Permalink
Browse files

MDL-33697: Merge the 2 assignment notification types

This is the best solution until Moodle supports capabilities on module message providers.

Unfortunately we already changed the mod_assignment language string so I can't put an AMOS
command to copy the new string.
  • Loading branch information...
1 parent 414ce30 commit f750cf712c22427eb7bbf25761b459053af84b38 Damyon Wiese committed Jun 14, 2012
Showing with 6 additions and 10 deletions.
  1. +1 −4 mod/assign/db/messages.php
  2. +1 −2 mod/assign/lang/en/assign.php
  3. +3 −3 mod/assign/locallib.php
  4. +1 −1 mod/assign/version.php
@@ -25,10 +25,7 @@
$messageproviders = array (
// Ordinary assignment submissions
- 'assign_student_notification' => array(
- ),
- 'assign_grader_notification' => array(
- 'capability' => 'mod/assign:grade'
+ 'assign_notification' => array(
)
);
@@ -150,8 +150,7 @@
$string['locksubmissions'] = 'Lock submissions';
$string['manageassignfeedbackplugins'] = 'Manage assignment feedback plugins';
$string['manageassignsubmissionplugins'] = 'Manage assignment submission plugins';
-$string['messageprovider:assign_student_notification'] = 'Assignment student notifications';
-$string['messageprovider:assign_grader_notification'] = 'Assignment grader notifications';
+$string['messageprovider:assign_notification'] = 'Assignment notifications';
$string['modulename'] = 'Assignment';
$string['modulename_help'] = 'The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback.
View
@@ -1181,7 +1181,7 @@ static function cron() {
// need to send this to the student
$messagetype = 'feedbackavailable';
- $eventtype = 'assign_student_notification';
+ $eventtype = 'assign_notification';
$updatetime = $submission->lastmodified;
$modulename = get_string('modulename', 'assign');
self::send_assignment_notification($grader, $user, $messagetype, $eventtype, $updatetime, $mod, $contextmodule, $course, $modulename, $submission->name);
@@ -2449,7 +2449,7 @@ private function notify_student_submission_receipt(stdClass $submission) {
return;
}
$user = $DB->get_record('user', array('id'=>$submission->userid), '*', MUST_EXIST);
- $this->send_notification($user, $user, 'submissionreceipt', 'assign_student_notification', $submission->timemodified);
+ $this->send_notification($user, $user, 'submissionreceipt', 'assign_notification', $submission->timemodified);
}
/**
@@ -2471,7 +2471,7 @@ private function notify_graders(stdClass $submission) {
$user = $DB->get_record('user', array('id'=>$submission->userid), '*', MUST_EXIST);
if ($teachers = $this->get_graders($user->id)) {
foreach ($teachers as $teacher) {
- $this->send_notification($user, $teacher, 'gradersubmissionupdated', 'assign_grader_notification', $submission->timemodified);
+ $this->send_notification($user, $teacher, 'gradersubmissionupdated', 'assign_notification', $submission->timemodified);
}
}
}
View
@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();
$module->component = 'mod_assign'; // Full name of the plugin (used for diagnostics)
-$module->version = 2012061100; // The current module version (Date: YYYYMMDDXX)
+$module->version = 2012061400; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2012050300; // Requires this Moodle version
$module->cron = 60;

0 comments on commit f750cf7

Please sign in to comment.