Quiz Summary Page Hiding: Difference between revisions
(15 intermediate revisions by the same user not shown) | |||
Line 18: | Line 18: | ||
---- | ---- | ||
As a way not see the summary page is to ask the confirmation on the last quiz page. | As a way not see the summary page is to ask the confirmation on the last quiz page. It could be "Submit and finish" button instead of "Next" on the last page of the quiz | ||
[[File: | [[File:3н.PNG]] | ||
Pushing | Pushing this button user finishes his attempt and goes to review page. | ||
[[File: | [[File:4н.jpg]] | ||
Another way to avoid the summary page is to add a submit and finish button to every page of the quiz. The student doesn`t need to click next button to the last page and can finish quiz anywhere. | |||
[[File:13.PNG]] | |||
== Turning off the summary page == | == Turning off the summary page == | ||
Line 35: | Line 39: | ||
'''Quiz administration -> Edit settings:''' | '''Quiz administration -> Edit settings:''' | ||
Add | Add a new point to Layout menu of quiz. It can be an advanced option and seen only after clicking "Show more". | ||
[[File:11a.PNG]] | |||
New option will contain information block. | |||
[[File: | |||
[[File:12.PNG]] | |||
'''Quiz administration -> Edit quiz:''' | '''Quiz administration -> Edit quiz:''' | ||
Line 52: | Line 61: | ||
---- | ---- | ||
The main problem of this task we need save anywhere the flag about the summary page showing. I`ve got some | The main problem of this task we need save anywhere the flag about the summary page showing. I`ve got some idea how to save this information: | ||
'''Change table structure by adding a new column to mdl_quiz table''' | '''Change table structure by adding a new column to mdl_quiz table''' | ||
Line 59: | Line 68: | ||
[[File:7.PNG ]] | [[File:7.PNG ]] | ||
== Implementation == | == Implementation == |
Latest revision as of 12:20, 8 October 2015
Summary page in Moodle quiz
At the end of every quiz user sees a summary page asking to confirm quiz finishing.
Pushing the "Submit all and finish" user gets another submit request.
Only after this user can finish and go to review page.
Finishing quiz without summary page
As a way not see the summary page is to ask the confirmation on the last quiz page. It could be "Submit and finish" button instead of "Next" on the last page of the quiz
Pushing this button user finishes his attempt and goes to review page.
Another way to avoid the summary page is to add a submit and finish button to every page of the quiz. The student doesn`t need to click next button to the last page and can finish quiz anywhere.
Turning off the summary page
We should have an additional option to omit the summary page.
There are some variants to place this option:
Quiz administration -> Edit settings:
Add a new point to Layout menu of quiz. It can be an advanced option and seen only after clicking "Show more".
New option will contain information block.
Quiz administration -> Edit quiz:
Add a new special summary page with a checkbox.
Add a new special summary page with a add-option on the page. And spedial close-button for disabling.
Storing the flag in the database
The main problem of this task we need save anywhere the flag about the summary page showing. I`ve got some idea how to save this information:
Change table structure by adding a new column to mdl_quiz table
The most obvious way to add a new column to the quiz information table mdl_quiz.This table was created for storing options and it`s common to add such things. But this table has already many columns and we need to take into account our new column in backup and restore procedures.
Implementation
The last page of the quiz redirects us to the summary page. Now it should be checked if summery page should be shawn.
We can create this fork next way:
next button sends a form with different properties of current and next page (look moodle\mod\quiz\renderer.php - attempt_form function). Inside this function we can check the hide-flag from database and send additional value by form. Another script (moodle\mod\quiz\process_attempt.php) catches this form and checks different given properties. The properties are:
// Get submitted parameters. $attemptid = required_param('attempt', PARAM_INT); $thispage = optional_param('thispage', 0, PARAM_INT); $nextpage = optional_param('nextpage', 0, PARAM_INT); $next = optional_param('next', false, PARAM_BOOL); $finishattempt = optional_param('finishattempt', false, PARAM_BOOL); $timeup = optional_param('timeup', 0, PARAM_BOOL); // True if form was submitted by timer. $scrollpos = optional_param('scrollpos', null , PARAM_RAW); // Here we can catch our hide-flag
And then in the place:
if ($page == -1) { $nexturl = $attemptobj->summary_url(); }
we can add checking hide-flag and if we need hide the summary page set the $finishattempt variable as true.
If we need show the confirm window before redirecting to preview page we can use
$button->add_action(new confirm_action(get_string('confirmclose', 'quiz'), null, get_string('submitallandfinish', 'quiz')));
for the "next" button on the last attempt page.