Skip to content

Commit

Permalink
MDL-31414: Separate settings to control notifications for submissions…
Browse files Browse the repository at this point in the history
…, late submissions and submission receipts

This adds separate controls for the sending of notifications from the mod_assign.

The separate notifications are: student submission receipt (for students), feedback available (for students)
and submission updated (for graders). The grader notifications can be enabled for all submissions or just late ones.

Added code to reset the message providers on upgrade (only applies for a 2.3 dev version)
  • Loading branch information
Damyon Wiese committed May 17, 2012
1 parent 71d7bc3 commit 6648261
Show file tree
Hide file tree
Showing 10 changed files with 272 additions and 72 deletions.
1 change: 1 addition & 0 deletions mod/assign/backup/moodle2/backup_assign_stepslib.php
Expand Up @@ -51,6 +51,7 @@ protected function define_structure() {
'preventlatesubmissions',
'submissiondrafts',
'sendnotifications',
'sendlatenotifications',
'duedate',
'allowsubmissionsfromdate',
'grade',
Expand Down
5 changes: 3 additions & 2 deletions mod/assign/db/install.xml
Expand Up @@ -15,8 +15,9 @@
<FIELD NAME="nosubmissions" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="This field is a cache for is_any_submission_plugin_enabled() which allows Moodle pages to distinguish offline assignment types without loading the assignment class." PREVIOUS="alwaysshowdescription" NEXT="preventlatesubmissions"/>
<FIELD NAME="preventlatesubmissions" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="If true, submissions will not be accepted past the due date." PREVIOUS="nosubmissions" NEXT="submissiondrafts"/>
<FIELD NAME="submissiondrafts" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="If true, assignment submissions will be considered drafts until the student clicks on the submit assignmnet button." PREVIOUS="preventlatesubmissions" NEXT="sendnotifications"/>
<FIELD NAME="sendnotifications" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Allows the disabling of email notifications in the assign module." PREVIOUS="submissiondrafts" NEXT="duedate"/>
<FIELD NAME="duedate" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The due date for the assignment. Displayed to students." PREVIOUS="sendnotifications" NEXT="allowsubmissionsfromdate"/>
<FIELD NAME="sendnotifications" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Allows the disabling of email notifications in the assign module." PREVIOUS="submissiondrafts" NEXT="sendlatenotifications"/>
<FIELD NAME="sendlatenotifications" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Allows separate enabling of notifications for late assignment submissions." PREVIOUS="sendnotifications" NEXT="duedate"/>
<FIELD NAME="duedate" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The due date for the assignment. Displayed to students." PREVIOUS="sendlatenotifications" NEXT="allowsubmissionsfromdate"/>
<FIELD NAME="allowsubmissionsfromdate" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="If set, submissions will only be accepted after this date." PREVIOUS="duedate" NEXT="grade"/>
<FIELD NAME="grade" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The maximum grade for this assignment. Can be negative to indicate the use of a scale." PREVIOUS="allowsubmissionsfromdate" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The time the settings for this assign module instance were last modified." PREVIOUS="grade"/>
Expand Down
8 changes: 6 additions & 2 deletions mod/assign/db/messages.php
Expand Up @@ -24,8 +24,12 @@

$messageproviders = array (

// Ordinary assignment submissions
'assign_updates' => array (
/// Ordinary assignment submissions
'assign_student_notification' => array (
'capability' => 'mod/assign:submit'
),
'assign_grader_notification' => array (
'capability' => 'mod/assign:grade'
)

);
3 changes: 3 additions & 0 deletions mod/assign/db/upgrade.php
Expand Up @@ -28,6 +28,9 @@
* @return bool
*/
function xmldb_assign_upgrade($oldversion) {
if ($oldversion < 2012051700) {
message_update_providers('mod_assign');
}
return true;
}

Expand Down
37 changes: 32 additions & 5 deletions mod/assign/lang/en/assign.php
Expand Up @@ -90,21 +90,32 @@
$string['duedatevalidation'] = 'Due date must be after the allow submissions from date.';
$string['editsubmission'] = 'Edit my submission';
$string['editaction'] = 'Actions...';
$string['emailgradermail'] = '{$a->username} has updated their assignment submission
$string['gradersubmissionupdatedtext'] = '{$a->username} has updated their assignment submission
for \'{$a->assignment}\' at {$a->timeupdated}
It is available here:
{$a->url}';
$string['emailgradermailhtml'] = '{$a->username} has updated their assignment submission
$string['gradersubmissionupdatedhtml'] = '{$a->username} has updated their assignment submission
for <i>\'{$a->assignment}\' at {$a->timeupdated}</i><br /><br />
It is <a href="{$a->url}">available on the web site</a>.';
$string['gradersubmissionupdatedsmall'] = '{$a->username} has updated their submission for assignment {$a->assignment}.';
$string['enabled'] = 'Enabled';
$string['errornosubmissions'] = 'There are no submissions to download';
$string['feedbackcomments'] = 'Feedback comments';
$string['feedback'] = 'Feedback';
$string['feedbackavailabletext'] = '{$a->username} has posted some feedback on your
assignment submission for \'{$a->assignment}\'
You can see it appended to your assignment submission:
{$a->url}';
$string['feedbackavailablehtml'] = '{$a->username} has posted some feedback on your
assignment submission for \'<i>{$a->assignment}</i>\'<br /><br />
You can see it appended to your <a href="{$a->url}">assignment submission</a>.';
$string['feedbackavailablesmall'] = '{$a->username} has given feedback for assignment {$a->assignment}';
$string['feedbackplugins'] = 'Feedback plugins';
$string['feedbackpluginforgradebook'] = 'Feedback plugin that will push comments to the gradebook';
$string['feedbackpluginforgradebook_help'] = 'Only one assignment feedback plugin can push feedback into the gradebook.';
$string['feedbackplugin'] = 'Feedback plugin';
$string['feedbacksettings'] = 'Feedback settings';
$string['filesubmissions'] = 'File submissions';
Expand Down Expand Up @@ -137,7 +148,8 @@
$string['locksubmissions'] = 'Lock submissions';
$string['manageassignfeedbackplugins'] = 'Manage assignment feedback plugins';
$string['manageassignsubmissionplugins'] = 'Manage assignment submission plugins';
$string['messageprovider:assign_updates'] = 'Assignment notifications';
$string['messageprovider:assign_student_notification'] = 'Assignment student notifications';
$string['messageprovider:assign_grader_notification'] = 'Assignment grader notifications';
$string['modulename'] = 'Assignment';
$string['modulename_help'] = 'Assignments enable the teacher to specify a task either on or offline which can then be graded.';
$string['modulenameplural'] = 'Assignments';
Expand All @@ -153,6 +165,7 @@
$string['notsubmittedyet'] = 'Not submitted yet';
$string['notifications'] = 'Notifications';
$string['nousersselected'] = 'No users selected';
$string['notification'] = 'Notification';
$string['numberofdraftsubmissions'] = 'Drafts';
$string['numberofparticipants'] = 'Participants';
$string['numberofsubmittedassignments'] = 'Submitted';
Expand All @@ -174,16 +187,30 @@
$string['reviewed'] = 'Reviewed';
$string['savechanges'] = 'Save changes';
$string['savenext'] = 'Save and show next';
$string['sendnotifications'] = 'Send notifications to graders';
$string['sendnotifications'] = 'Notify graders about submissions';
$string['sendnotifications_help'] = 'If enabled, graders (usually teachers) receive a message whenever a student submits an assignment, early, on time and late. Message methods are configurable.';
$string['selectlink'] = 'Select...';
$string['sendlatenotifications'] = 'Notify graders about late submissions';
$string['sendlatenotifications_help'] = 'If enabled, graders (usually teachers) receive a message whenever a student submits an assignment late. Message methods are configurable.';
$string['sendsubmissionreceipts'] = 'Send submission receipt to students';
$string['sendsubmissionreceipts_help'] = 'This switch will enable submission receipts for students. Students will receive a notification every time they successfully submit an assignment';
$string['settings'] = 'Assignment settings';
$string['showrecentsubmissions'] = 'Show recent submissions';
$string['submissiondrafts'] = 'Require students click submit button';
$string['submissiondrafts_help'] = 'If enabled, students will have to click a Submit button to declare their submission as final. This allows students to keep a draft version of the submission on the system.';
$string['submissionnotready'] = 'This assignment is not ready to submit:';
$string['submissionplugins'] = 'Submission plugins';
$string['submissionreceipts'] = 'Send submission receipts';
$string['submissionreceipttext'] = 'You have submitted an
assignment submission for \'{$a->assignment}\'
You can see the status of your assignment submission:
{$a->url}';
$string['submissionreceipthtml'] = 'You have submitted an
assignment submission for \'<i>{$a->assignment}</i>\'<br /><br />
You can the status of your <a href="{$a->url}">assignment submission</a>.';
$string['submissionreceiptsmall'] = 'You have submitted your assignment submission for {$a->assignment}';
$string['submissionslocked'] = 'This assignment is not accepting submissions';
$string['submissionslockedshort'] = 'Submission changes not allowed';
$string['submissions'] = 'Submissions';
Expand Down
3 changes: 2 additions & 1 deletion mod/assign/lib.php
Expand Up @@ -674,7 +674,8 @@ function assign_cron() {
global $CFG;

require_once($CFG->dirroot . '/mod/assign/locallib.php');
//assignment::cron();
assign::cron();

$plugins = get_plugin_list('assignsubmission');

foreach ($plugins as $name => $plugin) {
Expand Down

0 comments on commit 6648261

Please sign in to comment.