Header repeating on the top of each page of a quiz

Header repeating on the top of each page of a quiz

by Paul Smith -
Number of replies: 11

Dear All,

Is it possible to have a header, with some paragraphs, repeating on the top of each page (with multiple questions) of a quiz?

Thanks in advance,

Paul

Average of ratings: -
In reply to Paul Smith

Re: Header repeating on the top of each page of a quiz

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Would using a description questiion type at the top of each page help?
In reply to Mary Cooch

Re: Header repeating on the top of each page of a quiz

by Paul Smith -
Thanks, Mary. The problem is that I would like to have the questions randomly ordered. Is it possible to force the description question to be at the top of each page and the other questions randomly ordered?
In reply to Paul Smith

Re: Header repeating on the top of each page of a quiz

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
I don't think so - but I hope someone will disagree..
In reply to Mary Cooch

Re: Header repeating on the top of each page of a quiz

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

Hello Paul and Mary,

Edit the quiz and "Add... a new section heading" on each page. Select "Shuffle" on each page. Add a Description question on each page.

Add the following code in Site administration / Appearance / Additional HTML / Within HEAD (also works in When BODY is opened and Before BODY is closed):

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
  if ($(document).find("title").text() == "Name of your quiz") {
    $(".description").prependTo($(".description").parent());
  }
});
</script>

This code will bring up the Description question at the top of every page. Note that if you have other Description questions on a page, they will also be moved up (is that a problem for you?).

Replace "Name of your quiz" with the actual name of your quiz. If you want to apply this to all the quizzes on your site, remove the 'if' statement.

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

Re: Header repeating on the top of each page of a quiz

by Paul Smith -
Thanks, Dominique. I am using the Moodle of my university, and what you suggest appears to require administration privileges regarding the Moodle of my university -- and I suspect I do not have such a privileges.
In reply to Paul Smith

Re: Header repeating on the top of each page of a quiz

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

Hello Paul,

In this case, simply put the code in the HTML of the question text for each Description question. You don't need the 'if', just put:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $(".description").prependTo($(".description").parent());
});
</script>
Average of ratings: Useful (1)
In reply to Dominique Bauer

Re: Header repeating on the top of each page of a quiz

by Paul Smith -
Thanks, Dominique and AL Rachels.

Dominique: Is not your solution only shuffle the questions per page? I would like all questions shuffled wholly and not only per page.
In reply to Paul Smith

Re: Header repeating on the top of each page of a quiz

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

Paul,

Moodle only shuffles questions from the same section. If you want to shuffle all the quiz questions wholly, they must be displayed on the same page.

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

Re: Header repeating on the top of each page of a quiz

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Another method. Let's say I have a question bank of 30 questions in a category named subject1, and I want to give a quiz comprised of 10 questions, five to a page.

Create another question category named subject1b and rename the first category, subject1a. Move half or your questions from subject1a over to subject1b. (easy to do) Create your quiz with two pages adding a description question first thing on each page. Also on each page, add 5 random questions with one instance getting questions from subject1a and the other from subject1b. Also set the quiz to shuffle.

Splitting the category into two could be further broken down as easy questions, slightly harder, tough questions, or any other sorting criteria you care to use, but the main idea is to help ensure you do not get a duplicate question between the two, or more pages if you need to go for extra categories and pages.

I used to do this all the time when teaching computer applications. For instance, when covering spreadsheets, I would have question categories for toolbuttons, simple formulas, spreadsheet vocabulary, name for parts of the program seen on screen, etc. Same procedure for all the other applications I taught. This actually saved me some work since so many toolbuttons are actually the same from program to program, I did not need to make but one "Common toolbuttons" category.
Average of ratings: Useful (1)