Note: You are currently viewing documentation for Moodle 2.8. Up-to-date documentation for the latest stable version of Moodle may be available here: Quiz submission email notification.

Quiz submission email notification

From MoodleDocs
Revision as of 17:07, 26 June 2007 by Helen Foster (talk | contribs) (category edit)

Template:Quizzes Template:Moodle 1.9 When a student clicks 'Submit all and finish' to end a quiz attempt, you can configure Moodle to send email notifications. There are two types of notification: a confirmation to the student that their attempt has finished successfully, and a notification to the teacher(s) that someone has submitted an attempt. Emails are never sent for preview attempts.

How to turn on confirmation emails

To turn on confirmation emails for all students on all quizzes, edit the Student role and give it the capability mod/quiz:emailconfirmsubmission.

To turn on email confirmation for all students on one particular quiz, use the Roles override feature to give the Student role the mod/quiz:emailconfirmsubmission capability on that quiz. Similarly, you can override the role at the course level to turn on notification for all quizzes in that course.

How to turn on notification emails for teachers

To turn on confirmation emails for all teachers on all quizzes, edit the Teacher role and give it the capability mod/quiz:emailnotifysubmission.

To turn on email confirmation for all Teacher on one particular quiz, use the Roles override feature to give the Teacher role the mod/quiz:emailnotifysubmissionon capability on that quiz. Similarly, you can override the role at the course level to turn on notification for all quizzes in that course.

Note that if the quiz is set to separate groups, then teachers will only get a notification if either

  • the student is in the same group as the teacher, or
  • the teacher has moodle/site:accessallgroups.

How to configure the text of the emails

The subject and body of the emails are defined in the quiz.php language file. The strings are 'emailconfirmsubject', 'emailconfirmbody', 'emailnotifysubject' and 'emailnotifybody'. The $a string passed in when these language strings are loaded contains all the following information:

$a->coursename
The name of the course
$a->courseshortname
The shortname of the course
$a->quizname
The name of the quiz
$a->quizreporturl
The URL of the results overview for this quiz (.../mod/quiz/report.php?q=quizid)
$a->quizreportlink
The URL of the results overview URL and quiz name as a HTML link
$a->quizreviewurl
The URL of the review page for this attempt (.../mod/quiz/review.php?attempt=attemptid)
$a->quizreviewlink
The attempt review URL and quiz name as a HTML link
$a->quizurl
The URL of the main page of the quiz (.../mod/quiz/view.php?q=quizid)
$a->quizlink
The URL of the quiz and the quiz name as a HTML link
$a->attemptsubmissiontime
The time the attempt was submitted, formatted using userdate().
$a->timetaken
How long the quiz attempt lasted.
$a->studentname
The name of the person who submitted the quiz.
$a->studentidnumber
The idnumber of the person who submitted the quiz.
$a->studentusername
The username of the person who submitted the quiz.
$a->username
The name of the user the email is being sent to.
$a->useridnumber
The idnumber of the person who submitted the quiz.
$a->userusername
The username of the user the email is being sent to.