0

I'm trying to modify the email that a student receives when he finish a quiz. I want to add some information to the mail (like the feedbacks of each answer, the score ecc.) but, on moodle documentation, i read that there are only few information that i can add: (the $a strings): https://docs.moodle.org/20/en/Quiz_submission_email_notification

Do you know if there are more information that i can add? Or can you explain me how add manually those information, thanks.

Removed
  • 109
  • 3
  • 19

1 Answers1

1

The customisation can be done through the language module as I'm sure you've already worked out.

$a is just a variable carrier. In order to access full information you need to add a parameter like so: $a->ParameterToPass

The parameters available to pass are:

$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 user the email is being sent to.
$a->userusername
The username of the user the email is being sent to.

(Taken from https://docs.moodle.org/30/en/Quiz_submission_email_notification)

This is for Moodle 3.0 - for future reference, you can get a more accurate response if you let us know which Moodle version you're operating.

The reason you can't pass score/outcome as a parameter is because not all review modes on Moodle quizzes enable users to view score - especially if manual marking is enabled (e.g. in the presence of essay-type questions). Instead, you can pass a URL to the review. This ensures that if a review is not available, the user is informed when they click on the link, rather than having a blank statement in the email which may be confusing.

Tim
  • 797
  • 2
  • 10
  • 22
  • I'm using moodle 2.9 not the 3.0 but i met the same $a parameters. the decision of print the results of a quiz on the mail instead to url is not mine eheh. So it's impossible add the feedbacks of answers to the mail? If is it not possible i have to try with url... – Removed Dec 02 '15 at 13:24