Skip to content

Instantly share code, notes, and snippets.

@eyaler
Last active January 15, 2022 00:07
Show Gist options
  • Save eyaler/fb1ff8579685ddfbc2d8f61146edd8b4 to your computer and use it in GitHub Desktop.
Save eyaler/fb1ff8579685ddfbc2d8f61146edd8b4 to your computer and use it in GitHub Desktop.
moodle_block_next_until_answered.html
<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