Last active
January 15, 2022 00:07
-
-
Save eyaler/fb1ff8579685ddfbc2d8f61146edd8b4 to your computer and use it in GitHub Desktop.
moodle_block_next_until_answered.html
This file contains 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
<script type="text/javascript"> | |
function onLoadHide() { // Hide the [Next page] button: | |
var d1 = document.getElementsByClassName("que description informationitem notyetanswered")[0]; | |
var d2 = document.getElementsByClassName("que description informationitem answersaved")[0]; | |
if (!d1 && !d2) document.getElementsByClassName("mod_quiz-next-nav btn btn-primary")[0].disabled = true; | |
} | |
function onAnswerShow() { // Show the [Next page] button: | |
document.getElementsByClassName("mod_quiz-next-nav btn btn-primary")[0].disabled = false; | |
} | |
window.onload = onLoadHide; | |
window.oninput = onAnswerShow; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment