1. Create a quiz. Set the navigation method to "Sequential."
2. Add multiple pages of questions to the quiz.
3. As a student, take the quiz.
4. Verify that navigation is visible, but not interactive.
5. Verify that you cannot manually move back to earlier questions.
6. Verify that you can click on finish, then back out and return to where you were in the quiz.
7. Finish the quiz.
8. Create a quiz. Set the navigation method to "Free" (this is the default).
9. Add multiple pages of questions to the quiz.
10. As a student, take the quiz.
11. Verify that you may navigate freely using the navigation buttons.
12. Finish the quiz.

1. Create a quiz. Set the navigation method to "Sequential."
2. Add multiple pages of questions to the quiz.
3. As a student, take the quiz.
4. Verify that navigation is visible, but not interactive.
5. Verify that you cannot manually move back to earlier questions.
6. Verify that you can click on finish, then back out and return to where you were in the quiz.
7. Finish the quiz.
8. Create a quiz. Set the navigation method to "Free" (this is the default).
9. Add multiple pages of questions to the quiz.
10. As a student, take the quiz.
11. Verify that you may navigate freely using the navigation buttons.
12. Finish the quiz.

Description

It would be useful to add an option to the Quiz settings whereby the teacher would make navigation "free" or "sequential", i.e. only display on each quiz page a Next link to the next page, without any possibility for the student to go back or jump ahead.
I suggest to name this option NAVIGATION and to name the two options FREE and SEQUENTIAL.
See this discussion: http://moodle.org/mod/forum/discuss.php?d=78806
Joseph

Activity

Sensible option, but it would be a big change that I won't have time to work on in the foreseeable future. So this will only happen if some other developer comes along and does it. Anyone who does want to have a go at this, please discuss the details of your proposed implementation in the quiz forum first.

Tim Hunt
added a comment - 18/Sep/07 11:40 PM Sensible option, but it would be a big change that I won't have time to work on in the foreseeable future. So this will only happen if some other developer comes along and does it. Anyone who does want to have a go at this, please discuss the details of your proposed implementation in the quiz forum first.

I've written a patch against CVS tag MOODLE_199. Its sloppy and doesn't give the option between "free" and "sequential", it just converts all quizzes to sequential. It does work and gives an idea of how this could be done.

BTW, I'm the moodle maintainer for Gentoo and I've seen this request come from several different sources. It seems there are some accrediting agencies in the US which require this kind of examination. For example, see pg 49 of

Anthony G. Basile
added a comment - 01/Oct/10 12:13 AM I've written a patch against CVS tag MOODLE_199. Its sloppy and doesn't give the option between "free" and "sequential", it just converts all quizzes to sequential. It does work and gives an idea of how this could be done.
BTW, I'm the moodle maintainer for Gentoo and I've seen this request come from several different sources. It seems there are some accrediting agencies in the US which require this kind of examination. For example, see pg 49 of
http://www.cdrnet.org/PDFs/ADA%20CDR%20RD%20Handbook.pdf

However, there are big changes in the quiz in Moodle 2.0 (especially the new navigation, which should make this a bit easier to implement) and there is more to come (http://docs.moodle.org/en/Development:Question_Engine_2) probably in 2.1 which should help even more (new Interactive question behaviour). So I am not interested in adding this feature to the standard Moodle release until then.

Tim Hunt
added a comment - 01/Oct/10 2:45 AM Yes, I know people want it, and it is a perfectly reasonable feature.
So, making and sharing a patch, even a sloppy one, is helpful.
However, there are big changes in the quiz in Moodle 2.0 (especially the new navigation, which should make this a bit easier to implement) and there is more to come ( http://docs.moodle.org/en/Development:Question_Engine_2 ) probably in 2.1 which should help even more (new Interactive question behaviour). So I am not interested in adding this feature to the standard Moodle release until then.

It looks as if the Interactive question behavior (as envisioned in http://docs.moodle.org/en/Development:Question_Engine_2:Overview#Interactive) would almost accomplish the sequential quiz goal, if feedback can be turned off, reviewing prevented, and the default for the number of attempts be set (at the quiz level) to 1... probably not particularly difficult (though I'd defer to programmers for a definitive assessment) to add a "sequential" setting (button or checkbox) to set all of those necessary parameters... We have numerous requests for this feature, frequently for pedagogical reasons... glad it's under consideration.

Steven Breiner
added a comment - 04/Jan/11 5:10 AM It looks as if the Interactive question behavior (as envisioned in http://docs.moodle.org/en/Development:Question_Engine_2:Overview#Interactive ) would almost accomplish the sequential quiz goal, if feedback can be turned off, reviewing prevented, and the default for the number of attempts be set (at the quiz level) to 1... probably not particularly difficult (though I'd defer to programmers for a definitive assessment) to add a "sequential" setting (button or checkbox) to set all of those necessary parameters... We have numerous requests for this feature, frequently for pedagogical reasons... glad it's under consideration.

Tim Hunt
added a comment - 10/Oct/11 4:40 AM Well, I still have not real interest in this idea.
But it should now be possible to implement this relatively cleanly, and so if someone wants to try, I am willing to offer advice, and to review the finished code, if there ever is some.

Ray Lawrence
added a comment - 09/Jan/12 12:35 AM I can see the attraction of this but IMO as it would blur the boundaries of Quiz/Lesson modules it would benefit from a more holistic review before it got anywhere near core.

@Ray, I do not see your point of "blurring the boundaries of Quiz/Lesson". The feature of preventing students from moving backwards when taking an online quiz is a standard (optional) feature of a number of online quizes (it used to be part of WebCT when we used it at our university years ago). It is a recurring request in the Quiz forum, and has gathered 14 votes in the tracker.

@Tim, I can understand your reluctancy in implemeting the feature but realistically there is very very little chance that someone other than yourself will ever implement it, so in the end it's really your decision whether it will be implemented or not.

Joseph Rézeau
added a comment - 09/Jan/12 1:40 AM @Ray, I do not see your point of "blurring the boundaries of Quiz/Lesson". The feature of preventing students from moving backwards when taking an online quiz is a standard (optional) feature of a number of online quizes (it used to be part of WebCT when we used it at our university years ago). It is a recurring request in the Quiz forum, and has gathered 14 votes in the tracker.
@Tim, I can understand your reluctancy in implemeting the feature but realistically there is very very little chance that someone other than yourself will ever implement it, so in the end it's really your decision whether it will be implemented or not.

Tim Hunt
added a comment - 09/Jan/12 2:38 AM @Ray, yes it does not holistic thought. Have you seen http://docs.moodle.org/dev/Goals_of_an_online_assessment_system#A_richer_model_for_which_questions_are_in_a_quiz - I think this falls under that heading.
@Joseph, I disagree. Other people do contribute to the quiz, sometimes quite significantly.

This option would be a good one for Quiz. IMO, I do not see an overlap with Lesson. Lesson's reporting features are not as robust as quiz. Lesson always randomizes the answers. Lesson was designed to be interactive based upon student choices. I have the need for an assessment, where we want to present questions in a specific order, where revisiting and reanswering a question is not possible. While we score answers, this is not about a student receiving a grade, it is more like outcomes. Not very social constructionist

Chris Collman
added a comment - 09/Jan/12 8:38 PM - edited This option would be a good one for Quiz. IMO, I do not see an overlap with Lesson. Lesson's reporting features are not as robust as quiz. Lesson always randomizes the answers. Lesson was designed to be interactive based upon student choices. I have the need for an assessment, where we want to present questions in a specific order, where revisiting and reanswering a question is not possible. While we score answers, this is not about a student receiving a grade, it is more like outcomes. Not very social constructionist
Has any brave soul tried a patch for 2.2? Best Chris

With a suggestion from Tim in the Quiz forum, here is a css solution to hide the quiz navigation block and the entire summary of attempt block, except for submit all and finish. By using existing quiz settings to force the quiz to display the quiz in question edit order, you can force the student to step through each question. The downside is that this "fix" does not force a student to answer every question.

I used the Afterburner theme and the hide visibility CSS code . Appearance >Themes >Afterburner and entered this in the CSS code area:

div#mod_quiz_navblock

{
visibility:hidden;}

table.quizsummaryofattempt

{
visibility:hidden;}

This basically displays the background color for the left side block or center area.
Chris

Chris Collman
added a comment - 13/Jan/12 10:33 PM With a suggestion from Tim in the Quiz forum, here is a css solution to hide the quiz navigation block and the entire summary of attempt block, except for submit all and finish. By using existing quiz settings to force the quiz to display the quiz in question edit order, you can force the student to step through each question. The downside is that this "fix" does not force a student to answer every question.
I used the Afterburner theme and the hide visibility CSS code . Appearance >Themes >Afterburner and entered this in the CSS code area:
div#mod_quiz_navblock
{
visibility:hidden;}
table.quizsummaryofattempt
{
visibility:hidden;}
This basically displays the background color for the left side block or center area.
Chris

Tim Hunt
added a comment - 13/Jan/12 10:53 PM Note that MDL-3054 is pretty-much a prerequisite for this, and Charles Fulton has now done a fix that should be included in Moodle 2.3. This is getting closer!

1. Have you tested the upgrade? You seem to be adding a NOT NULL column with no default. That should not work.

2. Rather than cryptic numerical constants, I would use strings 'free' or 'sequential' for this settings. Makes the data more self-documenting. Also, makes this one fewer thing to change if we ever decide to make this a type of plugin.

3. I think navigation method belongs next to 'questions per page', not grademethod. (both in the form and the db) - but you might disagree on this. If so, please explain.

4. I think ideally, logic like switch ($attemptobj->get_quiz_navmethod()) { would not be in the renderer, it should be $attemptobj->can_navigate_to($slot). Also, navmethod is OK for a DB column name, but the API should be $attemptobj->get_navigation_method()

5. I don't think you should just hide the navigation panel when the quiz is in sequential mode. It displays useful status information. I think it should be visible, but without links.

That is all for now. There will probably be more comments one you have fixed those. Thanks, Tim.

Tim Hunt
added a comment - 21/Jan/12 4:01 PM Oh, I started looking at the patch quickly:
1. Have you tested the upgrade? You seem to be adding a NOT NULL column with no default. That should not work.
2. Rather than cryptic numerical constants, I would use strings 'free' or 'sequential' for this settings. Makes the data more self-documenting. Also, makes this one fewer thing to change if we ever decide to make this a type of plugin.
3. I think navigation method belongs next to 'questions per page', not grademethod. (both in the form and the db) - but you might disagree on this. If so, please explain.
4. I think ideally, logic like switch ($attemptobj->get_quiz_navmethod()) { would not be in the renderer, it should be $attemptobj->can_navigate_to($slot). Also, navmethod is OK for a DB column name, but the API should be $attemptobj->get_navigation_method()
5. I don't think you should just hide the navigation panel when the quiz is in sequential mode. It displays useful status information. I think it should be visible, but without links.
That is all for now. There will probably be more comments one you have fixed those. Thanks, Tim.

By the way, if you want to pay me back, MDL-30484, MDL-26260 and MDL-30854 all need review by someone other than me before they can be submitted for integration. Feel free to pick one Now I must go and catch a bus to Cambridge.

Tim Hunt
added a comment - 21/Jan/12 4:03 PM By the way, if you want to pay me back, MDL-30484 , MDL-26260 and MDL-30854 all need review by someone other than me before they can be submitted for integration. Feel free to pick one Now I must go and catch a bus to Cambridge.

Geeez Louise, two wishes and Charles is working on both! Guess I better get the updates and do some testing this weekend on this or one of Tim's. And I see that Kooz is one of the top 10 best beer cities in the US, so I am not sure Pig's Ear will meet Charles' standards.

Chris Collman
added a comment - 01/Feb/12 7:29 PM Geeez Louise, two wishes and Charles is working on both! Guess I better get the updates and do some testing this weekend on this or one of Tim's. And I see that Kooz is one of the top 10 best beer cities in the US, so I am not sure Pig's Ear will meet Charles' standards.
My CSS solution, while it works is hardly ideal. Chris

1) Yes, and it worked fine. The upgrade code sets '1' (QUIZ_NAVMETHOD_FREE) as the default.
2) I thought QUIZ_NAVMETHOD_FREE and QUIZ_NAVMETHOD_SEQ were pretty self-explanatory and line with current practice, but I'm open to a better way of handling this.
3) Your suggestion makes sense to me.
4) Renamed as suggested. I've moved the logic to the new function, although I didn't see any need in the current implementation for passing $slot since all the matters is the quiz's configuration.
5) I'm about 90% of the way there--the boxes render in both methods now but aren't "active" when using sequential navigation.

Charles Fulton
added a comment - 04/Feb/12 4:31 AM Hi Tim,
Sorry, I'm only now getting back to this.
1) Yes, and it worked fine. The upgrade code sets '1' (QUIZ_NAVMETHOD_FREE) as the default.
2) I thought QUIZ_NAVMETHOD_FREE and QUIZ_NAVMETHOD_SEQ were pretty self-explanatory and line with current practice, but I'm open to a better way of handling this.
3) Your suggestion makes sense to me.
4) Renamed as suggested. I've moved the logic to the new function, although I didn't see any need in the current implementation for passing $slot since all the matters is the quiz's configuration.
5) I'm about 90% of the way there--the boxes render in both methods now but aren't "active" when using sequential navigation.
Rebased and amended.

Regarding 2) I mean that instead of QUIZ_NAVMETHOD_FREE = 1 and QUIZ_NAVMETHOD_SEQ = 2 (or whatever it is) you should define QUIZ_NAVMETHOD_FREE = 'free' and QUIZ_NAVMETHOD_SEQ = 'sequential', and change the DB column to be VARCHAR(16).

Re 3) I think passing $slot in the can_navigate_to is likely to he helpful in future, even if we don't need it now.

6) Drat! I just spotted one more significant thing. All the other quiz settings allow the admin to set defaults, and whether the setting is advanced, in settings.php. We need the same functionality for this feature. (It should default to 'free', and being an advanced settings.)

Now I am getting down to really picky points:

7) get_question_url returns a moodle_url. Therefore, when we are returning nothing, I think we should return null, not false.

8) There has just been a big commit that gets rid of UNSIGNED in database definitions (yay!) so you will have to rebase and fix up install.xml and upgrade.php (after this week's integration is finished).

9) I wonder if we can make the language strings more self-explanatory. Something like

$string['navmethod'] = 'Navigation';

$string['navmethod_free'] = 'Questions can be answered in any order using the navigation';

$string['navmethod_sequential'] = 'Questions must be answered in strict sequence';

Hmm. I am not sure if that is actually clearer, or just verbose. I will leave this on to your judgement.

10) In mod/quiz/renderer.php there is a lot of duplicated code in the two branches of the if statement. Please refactor. This applies to both methods you changed. Also, I don't think you should remove the flag in the else branch.

11) In mod/quiz/attempt.php - is it really best to redirect when they try to access out-of-sequence, rather than displaying an error. What is the thinking here?

Once again, I am impressed what a small amount of code it is (relatively speaking) to implement these features. I think if we can get these last few tweaks sorted out, this can be integrated.

Hopefully next time you revise things, it will take me less than one month to review your changes. Sorry for the delay.

Tim Hunt
added a comment - 09/Mar/12 12:32 AM Re 3) I think passing $slot in the can_navigate_to is likely to he helpful in future, even if we don't need it now.
6) Drat! I just spotted one more significant thing. All the other quiz settings allow the admin to set defaults, and whether the setting is advanced, in settings.php. We need the same functionality for this feature. (It should default to 'free', and being an advanced settings.)
Now I am getting down to really picky points:
7) get_question_url returns a moodle_url. Therefore, when we are returning nothing, I think we should return null, not false.
8) There has just been a big commit that gets rid of UNSIGNED in database definitions (yay!) so you will have to rebase and fix up install.xml and upgrade.php (after this week's integration is finished).
9) I wonder if we can make the language strings more self-explanatory. Something like
$string['navmethod'] = 'Navigation';
$string['navmethod_free'] = 'Questions can be answered in any order using the navigation';
$string['navmethod_sequential'] = 'Questions must be answered in strict sequence';
Hmm. I am not sure if that is actually clearer, or just verbose. I will leave this on to your judgement.
10) In mod/quiz/renderer.php there is a lot of duplicated code in the two branches of the if statement. Please refactor. This applies to both methods you changed. Also, I don't think you should remove the flag in the else branch.
11) In mod/quiz/attempt.php - is it really best to redirect when they try to access out-of-sequence, rather than displaying an error. What is the thinking here?
Once again, I am impressed what a small amount of code it is (relatively speaking) to implement these features. I think if we can get these last few tweaks sorted out, this can be integrated.
Hopefully next time you revise things, it will take me less than one month to review your changes. Sorry for the delay.

Sorry, doing a bit more testing, and I just spotted two more significant issues:

12) There is a problem with the CSS. When you mouse over the navigation buttons, the still get underined as if they were links in sequential mode.

13) What about the Finish attempt... link. In sequential mode, that is very dangerous for students. You cannot get back from the summary page to the place where you where. Oh, you can actually, but you have to navigate back to the quiz info page, and then click the Continue attempt button, and then you get back to where you were. I think what should happen in this case is a link 'Continue from where I had got to' (or some better words than that) on the summary page. At any rate, the way it is now, we have a serious usability bug.

Tim Hunt
added a comment - 09/Mar/12 12:43 AM Sorry, doing a bit more testing, and I just spotted two more significant issues:
12) There is a problem with the CSS. When you mouse over the navigation buttons, the still get underined as if they were links in sequential mode.
13) What about the Finish attempt... link. In sequential mode, that is very dangerous for students. You cannot get back from the summary page to the place where you where. Oh, you can actually, but you have to navigate back to the quiz info page, and then click the Continue attempt button, and then you get back to where you were. I think what should happen in this case is a link 'Continue from where I had got to' (or some better words than that) on the summary page. At any rate, the way it is now, we have a serious usability bug.
I am afraid you will have to address those.

Helen Foster
added a comment - 09/Mar/12 4:57 AM Tim, I think your suggestions for making the language strings more self-explanatory are good. Perhaps they could be shortened a little as follows:
'Questions may be answered in any order'
'Questions must be answered in sequence'

6) Implemented.
7) Agreed and changed.
8) Yeah, I saw that one in the pipeline. Rebased and merged.
9) I'd rather leave these as-is. There's a help string after all.
10) I did what I could with those snippets.
11) My thinking was that (a) the redirect fits in with the logic introduced in MDL-3054 and (b) I don't like introducing error logic when it's not necessary. I'd rather keep the student in the quiz.
12) Rewritten to include nav method in the CSS; only "free" has the hover styling.
13) Button added.

Charles Fulton
added a comment - 10/Mar/12 1:34 AM @Tim:
6) Implemented.
7) Agreed and changed.
8) Yeah, I saw that one in the pipeline. Rebased and merged.
9) I'd rather leave these as-is. There's a help string after all.
10) I did what I could with those snippets.
11) My thinking was that (a) the redirect fits in with the logic introduced in MDL-3054 and (b) I don't like introducing error logic when it's not necessary. I'd rather keep the student in the quiz.
12) Rewritten to include nav method in the CSS; only "free" has the hover styling.
13) Button added.
Charles

Tim Hunt
added a comment - 10/Mar/12 3:10 AM So close, but
14) A lot of the blank lines are full of whitespace. That breaks the coding style rules.
15) You have $tag_contents and $tag_attributes, there should be no underscores in variable names.
16) https://github.com/mackensen/moodle/compare/master...MDL-11047#L9R584 is still missing $flag, isn't it?
One more amend?

Tim Hunt
added a comment - 10/Mar/12 3:20 AM Oh, sorry, and a more serious one:
17) You cannot do require_once($CFG->dirroot . '/mod/quiz/locallib.php'); in settings.php. That is a serious performance bug for anyone logged in as admin.

Tim Hunt
added a comment - 15/Mar/12 11:38 PM Just to confirm that the last version of your branch looks good to go, so if you can rebase it (This week's weekly build has just been released) then I will push it for integration.
The other thing we need are some testing instructions.
Thank you for sticking with this!

I have just tried the latest version of this new "sequential navigation" feature and it's working fine. Many thanks to Charles!

Just a minor terminology point: if a student "jumps" from page to the next without answering one question (or more) on that page, hovering over the unanswered questions in the navigation block shows the "Not yet answered" message which is inadequate since the "sequential" navigation mode will not allow the student to answer that question any longer.

A "Not answered" message would be more adequate than "Not yet answered".

Joseph Rézeau
added a comment - 16/Mar/12 6:25 PM - edited I have just tried the latest version of this new "sequential navigation" feature and it's working fine. Many thanks to Charles!
Just a minor terminology point: if a student "jumps" from page to the next without answering one question (or more) on that page, hovering over the unanswered questions in the navigation block shows the "Not yet answered" message which is inadequate since the "sequential" navigation mode will not allow the student to answer that question any longer.
A "Not answered" message would be more adequate than "Not yet answered".
Joseph

Sam Hemelryk
added a comment - 23/Mar/12 9:27 AM Congratulations are in order, you've made it, or at least your code has!
It's now part of Moodle and both the git and cvs repositories have been updated.
This issue is being marked as fixed and closed.
Thank you.

Charles Fulton
added a comment - 05/Jun/12 4:27 AM Evgeniy: there isn't and I don't there are any plans for one since it involves database changes. A manual backport might be possible but you'd also have to port MDL-3054 .

Evgeniy Voevodin
added a comment - 07/Jun/12 8:39 PM As far as I understand the module was tested on 2.2.x and 2.3, Could anyone please provide me with the package, or patch or whatever form this module is in?

Tim Hunt
added a comment - 07/Jun/12 9:44 PM Do you know how to use git? If so,
git log --grep MDL-3054
and
git log --grep MDL-11047
Will find the relevant patches. You will then need to work to combine the relevant ones into a patch that can be used on top of Moodle 2.2.
Or, you could just wait for the 2.3 release, and then upgrade.