[3.8.3+] Adding quiz sections, showing multiple questions per section?

[3.8.3+] Adding quiz sections, showing multiple questions per section?

by tim st.clair -
Number of replies: 5
Picture of Plugin developers

I had read in a very old thread that a quiz could have sections. For me this is good since I want a quiz with the first set of 5 questions relating to one chapter of my content, and the next set of 11 questions relating to a different chapter, and a section with 7 questions, and so on. I'm currently using description question types, but it doesn't look great and it means I have questions in my banks that aren't questions.

I went ahead and built the quiz with all the questions.

I then clicked on the 'Add' button at the bottom and it gives me these options:

  • a new question
  • from question bank
  • a random question

There's no option to add a section.

I have discovered what I need to to to put section headings in arbitrary locations within the quiz, which is this:

  1. Click the repaginate quiz button
  2. Repaginate with 1 question per page.
  3. in the 'add' menu for the question BEFORE i want a section heading, click add. This now has the following drop-down
  • a new question
  • from a question bank
  • a random question
  • a new section heading
I enter the section heading as I want it, and do this for all locations throughout the quizI click the repaginate quiz button againI then select 'unlimited' questions and update. this collapses down the pages and leaves the sections I've defined.voilà I have sections in the right spots

But here's the rub. I wanted to show those 5 questions on the first section all together, since the questions all interrelate and I want the learners to see that. I wanted to show the 11 questions on the section section together. I have the quiz layout set to 'never, all questions on one page' but one there are sections it flat out ignores what you set here.

Is there a quiz plugin or behaviour or setting I can fiddle that will allow multiple questions on a section?

Average of ratings: -
In reply to tim st.clair

Re: [3.8.3+] Adding quiz sections, showing multiple questions per section?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You don't have to repaginate with one question per page. Page breaks can be anywhere, there should be little add/remove page-break icons between each question on the left. You can use those to get page-breaks exactly where you want. (Repaginate is only there to quickly re-layout a large quiz.)
In reply to Tim Hunt

Re: [3.8.3+] Adding quiz sections, showing multiple questions per section?

by tim st.clair -
Picture of Plugin developers
Ok, that's one thing then. The quiz still presents one question per page, even though the quiz's Layout setting is set to 'All questions on one page'. Once the quiz has more than one section it ignores that setting and just does one question per page. Why is that? Is there a way I can override the behaviour so that it shows all questions in a section?
In reply to tim st.clair

Re: [3.8.3+] Adding quiz sections, showing multiple questions per section?

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Tim St.Clair,

Does the following video answer your question?
Average of ratings:Useful (1)
In reply to Dominique Bauer

Re: [3.8.3+] Adding quiz sections, showing multiple questions per section?

by tim st.clair -
Picture of Plugin developers
I managed to remove all the pagination so that there was only the sections I had defined, and went into a new attempt. This showed one question per page, rather than the structure I had set. I then went back in to edit the questions and sure enough it had inserted pages between each question again. Removing these via the little arrows icon and saving and starting another attempt showed multiple pages again.

I have recreated the quiz as a new activity and added sections as I was building it this time, rather than retroactively applying them, and it has worked now and has kept the paging that I want. I have a feeling there's a particular set of steps I could follow to mess it up again but for now this works the way I want and I'm not going to lose sleep chasing possible ways to break it again.

Thanks for sharing the video!
In reply to tim st.clair

Re: [3.8.3+] Adding quiz sections, showing multiple questions per section?

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

There could well be a bug here. If you are able, please could you perform this test:

  1. Go to the Edit quiz page for the problem quiz.
  2. Click one of the add/remove page-break icons.
  3. Press F5 to reload the page.

This will confirm if the edit really worked on the server.

If not, it would be an added bonus if you could

  1. Set Debugging to Developer level.
  2. And/or open the network tab in your web browsers developer tools.
  3. Then click the icon again.

Can you see the Ajax request in the browser developer tools, if so, does it look like it worked?

Are there any errors logged in the PHP error log on the server.

(Don't worry if you can't do the extra debugging, but it might reveal what is going on.)