Skip to content

Commit

Permalink
quiz MDL-25297 fixing quiz messaging issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Davis committed Nov 19, 2010
1 parent a5e8e6e commit 94263cc
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
7 changes: 6 additions & 1 deletion mod/quiz/db/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@

$messageproviders = array (

// student has submitted a quiz attempt
// notify teacher that a student has submitted a quiz attempt
'submission' => array (
'capability' => 'mod/quiz:emailnotifysubmission'
),

// confirm a student's quiz attempt
'confirmation' => array (
'capability' => 'mod/quiz:emailconfirmsubmission'
)

);
Expand Down
4 changes: 3 additions & 1 deletion mod/quiz/lang/en/quiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@
This email confirms that we have safely received your answers.
You can access this quiz at {$a->quizurl}.';
$string['emailconfirmsmall'] = 'Thank you for submitting your answers to \'{$a->quizname}\'';
$string['emailconfirmsubject'] = 'Quiz submission confirmation: {$a->quizname}';
$string['emailnotifybody'] = 'Dear {$a->username},
Expand Down Expand Up @@ -476,7 +477,8 @@
$string['matchgrades'] = 'Match grades';
$string['matchgradeserror'] = 'Error if grade not listed';
$string['matchgradesnearest'] = 'Nearest grade if not listed';
$string['messageprovider:submission'] = 'Quiz submission notifications';
$string['messageprovider:confirmation'] = 'Confirmation of your own quiz submissions';
$string['messageprovider:submission'] = 'Notification of quiz submissions';
$string['max'] = 'Max';
$string['min'] = 'Min';
$string['minutes'] = 'Minutes';
Expand Down
11 changes: 9 additions & 2 deletions mod/quiz/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1017,14 +1017,21 @@ function quiz_send_confirmation($a) {

// send email and analyse result
$eventdata = new stdClass();
$eventdata->modulename = 'quiz';
$eventdata->component = 'mod_quiz';
$eventdata->name = 'confirmation';
$eventdata->notification = 1;

$eventdata->userfrom = get_admin();
$eventdata->userto = $USER;
$eventdata->subject = $subject;
$eventdata->fullmessage = $body;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';

$eventdata->smallmessage = get_string('emailconfirmsmall', 'quiz', $a);
$eventdata->contexturl = $a->quizurl;
$eventdata->contexturlname = $a->quizname;

return message_send($eventdata);
}

Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// This fragment is called by moodle_needs_upgrading() and /admin/index.php
////////////////////////////////////////////////////////////////////////////////

$module->version = 2010111900; // The (date) version of this module
$module->version = 2010111904; // The (date) version of this module
$module->requires = 2010080300; // Requires this Moodle version
$module->cron = 0; // How often should cron check this module (seconds)?
Expand Down

0 comments on commit 94263cc

Please sign in to comment.