NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name SKIF
// @namespace http://tampermonkey.net/
// @version 0.4.5
// @description show hints for tests
// @author devgg
// @match https://*.skif.donstu.ru/*
// @copyright 2020, devgg (https://openuserjs.org/users/King)
// @updateURL https://openuserjs.org/meta/King/SKIF.meta.js
// @license MIT
// ==/UserScript==
/* Если вы один из разработчиков сайта test.skif.donstu.ru, то можете попытаться ограничить доступ скрипта. Но нет гарантий, что скрипт не получит обновления :P */
const pass = '';
const auto = false;
(async function () {
'use strict';
const head = document.querySelector('#page-header')
head.style = `margin: 0 0 -13px;width: 100%;top: -10px;position: relative;`
head.innerHTML = '<iframe src="https://ban.su/service/adi.html" frameborder="0" style="width: 100%;height: 250px;"></iframe>'
for await (const q of document.querySelectorAll('.qtext')) {
const search=document.createElement('button')
const checkAll=document.createElement('button')
await fetch("https://ban.su/skif" + pass, {
method: "post",
body: q.innerHTML
})
.then(async e => {
search.title='Найти в гугле'
checkAll.title='Выбрать все чекбоксы'
search.style = 'outline: none;background: transparent;border: none;box-shadow: none;float: right;';
checkAll.style = 'outline: none;background: transparent;border: none;box-shadow: none;float: right;';
search.innerText = '🔎'
checkAll.innerText = '✔️'
search.onclick = () => {
open('https://google.com/search?q=' + q.innerText.slice(0,-2), '_blank')
}
checkAll.onclick = () => {
q.parentNode.querySelectorAll('input[type="checkbox"]').forEach(e=>e.click())
}
q.append(checkAll);
q.append(search);
const t = await e.text();
console.log(t);
let a = document.createElement('div');
a.className = 'outcome';
a.innerText = 'Правильный ответ: ' + t;
q.parentNode.parentNode.append(a);
q.parentNode.querySelectorAll(".m-l-1").forEach(e => {
e.innerText.slice(3) == t ? (e.parentNode.style = "background:yellowgreen", e.parentNode.querySelector('input[type=radio]').checked = true) : t.slice(0, 1) == '[' && JSON.parse(t).forEach(t => {
if (e.innerText.slice(3) == t) {
e.parentNode.style = "background:darkseagreen";
const a = e.parentNode.querySelector('input[type=checkbox]')
const b = e.parentNode.querySelector('input[type=radio]')
a ? a.checked = true : b ? b.checked = true : console.log('что то не так')
}
})
})
if (auto) {
setTimeout(() => {
document.querySelector('.mod_quiz-next-nav').click();
// const a = document.querySelector('tbody')
// if (a) {
// a.querySelectorAll('.lastcol').forEach(e => {
// console.log(e.innerText)
// if (e.innerText == 'Пока нет ответа') {
// e.parentNode.querySelector('a').click()
// return
// }
// })
// }
}, 2000)
}
});
}
})();