Last active
January 5, 2025 16:49
-
-
Save ve3xone/a35373dbc9d1fc8d1c904434ea6f54df to your computer and use it in GitHub Desktop.
[Для курса СУБД Pangolin] [bootcamp-sberid.pcbltools.ru] Данный скрипт позволяет вам решить задания не решая их как то, воооть (работает только на задачи где нужно вводить данные для span тоесть запросы для БД), чтоб сработало зажимаете ctrl+shift+i и откроется devtools браузера и открываете консоль и вставляете мой скрипт туда и готово.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Проверяем что гавна не нужного нет чтоб не отправить fakeotvet | |
| const choicesDiv = document.querySelector('div.widget-test-player__choices'); | |
| const fullAnswerDiv = document.querySelector('div.FULLANSWER[data-testid="MFE_DES.WIDGETS.PLAYER"]'); | |
| const inputField = document.querySelector('input[data-testid="Editor"]'); | |
| // Получаем все элементы span с классом "gap bg-white" | |
| const spans = document.querySelectorAll('span.gap.bg-white'); | |
| // Проходим по каждому элементу и вставляем содержимое data-value | |
| spans.forEach(span => { | |
| const value = span.getAttribute('data-value'); | |
| if (value) { | |
| span.textContent = value; // Вставляем значение внутрь span | |
| // Создаем и отправляем событие input | |
| const inputEvent = new Event('input', { | |
| bubbles: true, | |
| cancelable: true, | |
| }); | |
| span.dispatchEvent(inputEvent); | |
| // Если нужно, создаем и отправляем событие change | |
| const changeEvent = new Event('change', { | |
| bubbles: true, | |
| cancelable: true, | |
| }); | |
| span.dispatchEvent(changeEvent); | |
| } | |
| }); | |
| if (!choicesDiv && !fullAnswerDiv && !inputField){ | |
| // Находим кнопку | |
| const button = document.querySelector('button[data-qa="SHARED.components.Task.saveStudentAnswerButton"]'); | |
| // Проверяем, существует ли кнопка | |
| if (button) { | |
| // Удаляем атрибут disabled | |
| button.removeAttribute('disabled'); | |
| // Удаляем класс Mui-disabled | |
| button.classList.remove('Mui-disabled'); | |
| // Заменяем класс chAkIl на kTiSml | |
| button.classList.replace('chAkIl', 'kTiSml'); | |
| // Устанавливаем tabindex на 0 | |
| button.setAttribute('tabindex', '0'); | |
| // Нажимаем на кнопку | |
| button.click(); | |
| } | |
| } else { | |
| console.log('Нашел не выполнемые задание не выполняю! хихи хаха вооооотть') | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment