This forum post has been removed
Number of replies: 17I would be interested to see discussion about whether this is what everyone wants. Would we like this in the official Moodle release? (It would probably have to go into Moodle 2.0.) Or do other people have yet other requirements?
+ if (!isset($form->timedue)) {
+ $form->timeopen = "";
+ }
Looks wrong.
In mod/quiz/restorelib.php you need to deal with the case where someone may be restoring a backup made on another version of Moodle without your extra field. There is probably other code like that already - yes, look at the code for $quiz->delay1 and 2. You need to do an if statement to see if that data is present, and if not, use a default (0 in this case).
Localizability code like get_string('quizdue', 'quiz'), ': ', userdate($quiz->timedue) is wrong. (Yes, I know the other code there is like this). The reason is that not all languages use the same word-order or punctuation conventions. The right way is to define the string
$string['timeduex'] = 'Time due: $a';
and then do
get_string('quizdue', 'quiz', userdate($quiz->timedue));
Editing install.xml will ensure that the new database field is created when a fresh install of Moodle is done. It will not create the new field when people upgrade their quiz (or apply your patch).
You need to follow the instructions in Development:Installing_and_upgrading_plugin_database_tables. That is, you need to edit version.php and add some code to mod/quiz/db/upgrade.php. However, you need to be very careful doing this on a stable branch, or in a one-off patch. Leaving people to create the database column manually if they really want this may be safer.
This forum post has been removed
This forum post has been removed
The syntax of the 'ternary operator' is
$x = $y ? $a : $b;
which means
if ($y) {
$x = $a;
} else {
$x = $b;
}
By the way, when doing development, you should always have Debugging turned up to maximum, so you get the most helpful error messages.
This forum post has been removed
This forum post has been removed
This forum post has been removed
This forum post has been removed
Re: Add a quiz deadline so late submissions are accepted
Can anybody tell me if these zipped files for the late submissions patch by Douglas Segar work for the latest moodle 1.9 version? Has anyone used them recently? I noticed that the patch contains a "quiz.php" file in the "mod/quiz" subdirectory, while my existing moodle 1.9 contains a quiz.js instead... I am a php ignorant so I will appreciate any guidance with this.
I have not found any entry for this patch in the "Modules and Plugins" searching on "Douglas Segar" and "quiz deadline". Any other suggested keyword or link would be greatly appreciated.
Thank you so much
Cristina
Does anyone know if this is compatible with moodle 2.0?
Almost certainly not.
What do we need to do to make it compatibile with 2.0? A complete re-write?
Re: Add a quiz deadline so late submissions are accepted
I would very much like to see this implemented as part of Core 2.3 or later. We use quizzes as self-graded assignments, which would normally be accepted late. For now, we choose the close date as the end of the term, and post the submission deadline (for on-time) in the description.
However, we use Moodle integrated with our gradebook management system, which links our quizzes to the gradebook via the close date - which provides false "due dates" in our GMS and makes ordering assignments in the gradebook by due date useless.
Linking through a deadline (such as with assignment) would be so much more manageable, giving "quizzes" order (a deadline to be considered on-time, a firm due date on calendars and the gradebook) while still providing fleibility (acceptibility of late work, retakes for absences, etc.).
Re: Add a quiz deadline so late submissions are accepted
Did this capability/patch get implemented in Moodle 2.4 ?
I would love to use it!
Thanks,
Halverson