Now this setting type is available, it is a better UI.
This required a new setting class
admin_setting_configduration_with_advanced.
Also, I took the liberty of shortening the default auto-save delay to 1
minute, and re-wording the description of that setting, now that it can
be changed to any value.
The approach is that we have a new JavaScript function
M.mod_quiz.resource_toolbox.reorganise_edit_page which, after a ajax
action, fixes up everything like page breaks, page and question numbers,
that might now be wrong.
We call that function instead of reloading the page.
Also, there are a lot more Behat tests to verify this works correctly.
AMOS BEGIN
MOV [joinpages,mod_quiz],[removepagebreak,mod_quiz]
MOV [splitpages,mod_quiz],[addpagebreak,mod_quiz]
AMOS END
This commit is actually the joint work of Mahmoud Kassaei, Colin
Chambers and Tim Hunt from The Open University. We could only use one
persons name for the commit, and this time Colin gets the credit/blame.
The goal of this work was to increase usability, and also clean up
the page enough that it will be possible to add new features in future.
Display of mod/quiz/edit.php is now entirely generated by
mod_quiz\output\edit_renderer. This uses a helper class
mod_quiz\structure to provide details of the structure of the quiz, and
mod_quiz\repaginate to alter that structure. (Acutally, there are still
some modification methods on mod_quiz\structure. Expect that to be
cleaned up in future.)
The new code uses much more ajax, and there are new scripts
mod/quiz/edit_rest.php and mod/quiz/repaginate.php to handle this.
(Again, don't be surprised if those two scripts get merged in future.)
Also questionbank.ajax.php (which may, in future, be made more generic,
and moved into the core question bank code.)
Most of the new JavaScript code has intentionally copied the way things
are done when editing activities on the course page.
As a result of this, mod/quiz/editlib.php is now much shorter than it
was. (In future, expect the remaining code in here to move into
mod/quiz/classes.)
These strings have already been copied from mod_quiz to qtype_numerical but
in the qtype_numerical plugin code the translations from mod_quiz were used.
Even though the strings were already present we copy the translations.
AMOS BEGIN
CPY [invalidnumericanswer,mod_quiz],[invalidnumericanswer,qtype_numerical]
CPY [multiplier,mod_quiz],[qtype_numerical]
CPY [invalidnumerictolerance,mod_quiz],[qtype_numerical]
AMOS END
This patch adds completion options to Quiz similar to what is available in scorm.
One can have the quiz marked complete when either a passing grade is achieved or
all attempts are used up. This will allow a quiz to complete when the user "passes
or fails". (Where "fail" means "using up all attempts without passing".)
When the auto-save fails, we alert the user that they may have lost their
internet connection so that they don't do more work that they might just
lose.
At the top of the quiz reivew page, there is a table that summarises
infomration about the quiz attempt as a whole. For some question
behaviours, we would like to be able to add additional information to
that summary.
This commit introduces a generic method for the behaviour to provide
summary information about an entire question usage.
1. There is a new admin setting to control whether this feature is
enabled. The admin can set the auto-save frequency to 1, 2 or 5 minutes,
or disable it.
2. When autosave is enabled, there is code in the quiz that monitors the
main quiz form, and does an ajax save call at the given frequency when
changes are being made by the student.
3. The ajax saves go to a new script that calls the question engine to
do the work.
4. To avoid simultaneous autosave + submit and finish, the auto-save
system shuts down shortly before time expires in a timed quiz.
There were a number of lang strings in suboptimal places.
This commit fixes that, and also removed some unused strings.
AMOS BEGIN
MOV [addmorechoiceblanks,qtype_multichoice],[addmorechoiceblanks,question]
MOV [youmustenteramultiplierhere,qtype_calculated],[youmustenteramultiplierhere,qtype_numerical]
AMOS END
The summary page was not enforcing the end of the grace period. If the
user had the summary page open, then they coudl still stubmit after the
end of the grace period.
Also, the editing form was not validating that the quiz grace period was
greater than quiz|graceperiodmin in the quiz configuration, and that
should be checked, so I added it.
I fear that processattempt.php is becoming very spaghetti-like with all
the timing rules, it really needs to be refactored, but not 2 weeks
before the 2.3 release. (When refactoring, we really need unit tests for
this.)
Thanks to Mary Cooch & Martin Dougiamas who contributed to this
rewording.
AMOS BEGIN
REM These module help texts are going to be displayed more prominently in the Moodle interface
AMOS END