Add a quiz deadline so late submissions are accepted

This forum post has been removed

Number of replies: 17
The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Add a quiz deadline so late submissions are accepted

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Looks like a good implementation of what you want. Some code review comments below.

I 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.
In reply to Tim Hunt

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Tim Hunt

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Add a quiz deadline so late submissions are accepted

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That is because you have a syntax error. You are missing :0 from the end of the line.

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.
In reply to Tim Hunt

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Tim Hunt

Re: Add a quiz deadline so late submissions are accepted

by John Boerger -
I would love this functionality. I've turned the patch over to our system admins, but from a practical application, this would work wonders for us, as we have deadlines when training must be completed.
In reply to John Boerger

ability to grant extensions to single students

by Andrea Spiering -
It would also be great to be able to grant extensions to individual students. So far, I can only do this by re-openig the quiz. For a quiz with multiple attempts allowed or for a student that "forgot" to take the quiz, this allows them to go in improve their grades. Any way to just open quizzes for one or two students without allowing everyone access?
In reply to Andrea Spiering

Re: ability to grant extensions to single students

by Ann Kretzschmar -
That would be very useful. I have a student who was off sick and missed the whole quiz. The only way he can take it is if I reopen it. Unless anyone knows anything different.....?
In reply to Ann Kretzschmar

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Add a quiz deadline so late submissions are accepted

by Cristina Berisso -

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

In reply to Deleted user

Re: Add a quiz deadline so late submissions are accepted

by James Ripps -

Does anyone know if this is compatible with moodle 2.0?

In reply to James Ripps

Re: Add a quiz deadline so late submissions are accepted

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Almost certainly not.

In reply to Tim Hunt

Re: Add a quiz deadline so late submissions are accepted

by James Ripps -

 What do we need to do to make it compatibile with 2.0? A complete re-write?

In reply to Deleted user

Re: Add a quiz deadline so late submissions are accepted

by Brandy Weaver -

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.).

 

In reply to Brandy Weaver

Re: Add a quiz deadline so late submissions are accepted

by Peter Halverson -

Did this capability/patch get implemented in Moodle 2.4 ?

I would love to use it!

Thanks,

Halverson