Is there a way to show the question's name in the nav block?

Is there a way to show the question's name in the nav block?

by Patricio Lopez -
Number of replies: 3

Hello

I need to show the Actual name and number of the question on the navigation block in a quiz.
Via CSS i can put the numbers vertically but i cant find a way to show the actual name of the question there.

All of this is because i need to use one question per page, and the title is required to be shown and also because the questions have a video and some html code to complement them.

Probably this requires a customization of some sort but i dont know what file needs to be edited.

Thanks in advance, I am using Moodle 3.1 also attaching a screenshot on how it should be (Interface is in spanish but you should get the idea).


Attachment nav_quiz_name.jpg
Average of ratings: -
In reply to Patricio Lopez

Re: Is there a way to show the question's name in the nav block?

by Frankie Kam -
Picture of Plugin developers

Hi Patricio

I haven't yet figured out how to do what you are asking.

However, this post may be slightly related to what you are trying do. What I managed to do was to add the state of the question, a line break, and the question description to display. This will happen when I hover my mouse cursor over a question square block inside the Quiz Navigation block.

Perhaps the code I used to enable the mouseover (hover) information might help a little bit. All the best.

Regards
Frankie Kam


In reply to Patricio Lopez

Re: Is there a way to show the question's name in the nav block?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The only way to do what you ask would involve editing the PHP code. The code is in mod/quiz/renderer.php. https://github.com/moodle/moodle/blob/master/mod/quiz/renderer.php#L353

However, it seems the question name is not passed to that function.

An alternative might be to use the new Section heading feature. Split the quiz into sections, and use the section heading as question name.

In reply to Tim Hunt

Re: Is there a way to show the question's name in the nav block?

by Patricio Lopez -

Thank you Tim i can see that what you suggest could be useful will give it a try. Regards