Displaying quiz name to students

Displaying quiz name to students

by Erin Milanese -
Number of replies: 2

Version: 3.9.1

We want students to see the actual question name rather than just the number "1," "2," etc in the quiz navigation block, because part of what they are being tested over in a particular course is their ability to prioritize based on question text.

Is there any way to do this? I found some old documentation for adjusting PHP code to display the question name when the number was moused over, but unclear if that is compatible with 3.9.

thanks for any suggestions!

Average of ratings: -
In reply to Erin Milanese

Re: Displaying quiz name to students

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

JavaScript workarounds can be useful because they are often straightforward to implement. On the other hand, their possibilities are also often limited.

In your case, a simple workaround exists as long as the name of the questions is predictable, i.e. there are no random questions.

If so, it's just a matter of inserting a little JavaScript code into an HTML block, for example this one to get the figure below:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
    $("section#mod_quiz_navblock a.qnbutton:eq(0)").after("Question about the color red<br><br>");
    $("section#mod_quiz_navblock a.qnbutton:eq(1)").after("Question about the color green<br><br>");
    $("section#mod_quiz_navblock a.qnbutton:eq(2)").after("Question about the color blue<br><br>");
});
</script>

ForumQuiz_20210726_2156.png


You can try the quiz here ↗.

Follow these instructions ↗ to place the JavaScript code in an HTML block.

Average of ratings: Useful (2)
In reply to Dominique Bauer

Re: Displaying quiz name to students

by Erin Milanese -
Thanks Dominique! This Moodle instance and course are configured with a lot of custom CSS so even getting the block added is a bit challenging but I will give this a try.