Empty section heading in quiz - Bug or feature?

Empty section heading in quiz - Bug or feature?

Marie-Eve Lévesque གིས-
Number of replies: 4

Hi,

I would like to know if there is a reason why questions that are in a section with no name appear in the previous section in the quiz navigation and attempt summary page?

Here is an example. The quiz has 3 sections, but the 2nd has an empty heading :


The question 2 should be in this 2nd section, but in the quiz navigation and in the quiz attempt summary page it appears in the Section 1.


In my opinion, if the teacher decided to add a section there, there must be a reason... So why does this section disappears in the other pages? Maybe there are some usages that I don't know and that explain this decision?

If not, I think of two possible solutions :

  • Make the section name required
  • Show the section with "(No section name)" or something like that in quiz navigation and attempt review
Before opening a tracker I would like to better understand if it is really a bug, or a feature that I don't understand correctly?

I am asking all that because I am working on a Quiz Report "Marks per section" plugin so which questions are in which section is really important in this context!

Thanks,
Marie-Eve
དཔྱ་སྙོམས་ཀྱི་སྐུགས་ཚུ།:Useful (1)
In reply to Marie-Eve Lévesque

Re: Empty section heading in quiz - Bug or feature?

Tim Hunt གིས-
Core developers གི་པར Documentation writers གི་པར Particularly helpful Moodlers གི་པར Peer reviewers གི་པར Plugin developers གི་པར
It's not a bug. If you want a section heading, add one. It is only a few clicks.

(It is a bit odd we allow the section heading to be blank. I think the main reason for that is so that a one-section quiz does not have to have a section heading.)
In reply to Tim Hunt

Re: Empty section heading in quiz - Bug or feature?

Marie-Eve Lévesque གིས-

Yes, I agree that for a one section quiz it makes sense not to have a heading and leave it blank.

But I am looking for the best solution for quizzes with more than one section :

  1. Make the section name required (except if the quiz has only one section)
  2. Show the section with "(No section name)" or something like that in quiz navigation and attempt review (like in the image below)
My team and I will work to patch our Moodle with one of those solutions (or another if there are better ideas). We are willing to create a tracker and share the code if the solution suits everybody. But for that, we need to make sure that blank sections names in quizzes with more than one section is not something that is used for some particular usages we are unaware of.

Thanks!
Marie-Eve
In reply to Marie-Eve Lévesque

Re: Empty section heading in quiz - Bug or feature?

Dominique Bauer གིས-
Documentation writers གི་པར Particularly helpful Moodlers གི་པར Plugin developers གི་པར

Hello Marie-Eve,

You're right, Moodle seems to behave a little weird when you leave a section heading blank. When you edit the quiz, you see what really seems to be a section but what is in reality just a new page during the quiz and the review.

In my opinion, this a little bug. Teachers must therefore give a name to any new section, namely:

  • any name of their choice,
  • the default name "New heading", which works fine, or
  • a non-breaking space " " written as is, without quotes, to get a blank heading. i.e. an unnamed section.

I have added the following note to MoodleDocs ↗:

The heading of a section can have the default name "New heading" or any other name. However, it must not be empty, otherwise the section will behave like a new page, not a new section. To have a blank heading, use a non-breaking space, that is " " written as is without quotes.

In reply to Dominique Bauer

Re: Empty section heading in quiz - Bug or feature?

Marie-Eve Lévesque གིས-
Thanks for your answer Dominique! As it really seems to be a bug, I created a tracker for this : https://tracker.moodle.org/browse/MDL-71785