Email to teacher on quiz completion

Email to teacher on quiz completion

by Graham Miller -
Number of replies: 31
Hi again,

I was wondering if anyone had been able to make the quiz module email the results to a teacher once the student had completed the quiz?

TIA
Graham
Average of ratings: -
In reply to Graham Miller

Re: Email to teacher on quiz completion

by Just H -
Hi Graham

Yes, see this thread.

What version of Moodle are you running?

Harry
In reply to Just H

Re: Email to teacher on quiz completion

by Graham Miller -
Thanks Harry,

We are installing the recent (V1.8) copy for this project.

Do you have a version for this version?

Graham
In reply to Graham Miller

Re: Email to teacher on quiz completion

by Just H -
We do but hasn't had much testing (we're still running Moodle 1.6 and just set up 1.7 and 1.8 test sites as people where asking for this to be updated).

There's been a couple of people hit problems but we haven't been able to reproduce the issue here so as per all hacks, backup first and if possible test out on a test site.

Drop me an email (see my profile) and I'll send it to you.

Regards
Harry


In reply to Just H

Re: Email to teacher on quiz completion

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I am planning to do a proper implementation of this feature in Moodle 1.9 or 2.0. I have put a design document here: http://docs.moodle.org/en/Development:Email_notification_when_a_quiz_is_submitted

Please comment in this thread.

What would be really helpful is if you want this feature, could you give me an example of what you would want the email message to say. Thanks.
In reply to Tim Hunt

Re: Email to teacher on quiz completion

by Graham Miller -
Thanks Tim,

That development document is quite good. Has more than we need.

Below is a brief description of what we were thinking of doing followed by more comments on how this might fit with your design spec....

Our suggestions and wish list:
a. email all teachers assigned to the course.
b. Email format choices:
  1. short sentence and hyperlink to review page
    (http://example.org/moodle/mod/quiz/review.php?attempt=99)
  2. full html email copy of review page.
c. have global and course defaults for email on / off and preferred format.
d. override defaults on a per quiz basis.
e. set subject and short sentence per global, course, quiz.
f. allow some templating in subject and short sentence for including:
  1. student name
  2. student login name
g. perhaps some way of forcing html or plain text formatted emails on a teacher preference basis

Issues in relation to design spec:
Basically, our thoughts do not fit at all with your design spec. But I think that is a good thing. You approach looks very good to me. And I would rather adjust our thoughts than plough on regardless big grin.
Your "Controlling who gets emailed" section provides much better control over who gets emailed than my point (a). Obviously using the role and permission system is the way to go.
The "Configuring the text of the emails" section points out the issue of revealing the score to the student. On further review of the code, I also notice that there are a couple of slight variations of conditions that stop the display of the review to the student and thus the full text of the (empty) review would not be of any use to the teacher. We were thinking of emailing near the end of the review.php file, but this would be easily avoided by the setting of student review settings of the quiz itself.

So I will post again with the text we would like to see and some discussion on where the code to do the various things would sit within the moodle and quiz module structures.

Thanks
Graham

In reply to Tim Hunt

Re: Email information on quiz completion

by Graham Miller -
The type of information we require to be emailed to the nominated teacher(s) are as follows:

- Student name (and possibly login).
- Time taken to do the quiz.
- Date/time of completion.
- Raw score.
- Grade.
- Questions Info:
- Number.
- Correct / Incorrect.
- Answer chosen.

With this available in a templated message we'd be happy.

Graham


In reply to Tim Hunt

Re: Email to teacher on quiz completion

by Graham Miller -
Hi Tim,

As I have a client who is prepared to pay for the email facility, and we need to produce a result of some kind within the next two weeks, it would make sense for me to use the approach you have outlined in the development wiki and pass the code back to you for consideration. I have allocated some 16 man hours to the job.

Are you able to work with me while we achieve the result? Do you want us to do a simple implementation of your goal and alpha test it? Your spec will certainly achieve the result we want.

I am an experienced commercial PHP analyst/programmer of some 8 years and am very comfortable with your code (that I have looked at).

Do you have any code written yet? Or a more detailed spec including source files that would need changing?

Can you point me to the right places in the code to achieve the role and capability behaviour you describe?

I would also need direction a bit on the event handler, but only to get me started probably. As it seems this feature is in V1.9, then perhaps it would be best for me to write it as an external function in the quiz module (launched at the same place an event handler would be called) so it can be handled in much the same manner as the event handler approach and also not stop the quiz from being submitted.

If you can narrow my learning curve a bit, we could have working code very soon.

Cheers
Graham

In reply to Graham Miller

Re: Email to teacher on quiz completion

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Thanks for volunteering the try implementing this. If you are not familiar with Moodle coding, you will find that Moodle has a lot of its own conventions and ways of doing things, that are not necessarily the same as other PHP programs. Some of this is documented starting here: http://docs.moodle.org/en/Developer_documentation. In particular, you should read the coding guidelines, but the documentation is not necessarily complete, nor easy for a newcomer to find their way around.

Your profile says you are in Kenilworth, but given the times of your forum posts, I am guessing that you are not in Kenilworth, Warwickshire, UK. Therefore, there will be time-zone problems working together. Anyway, if we are ever online at the same time, you are welcome to bug me via skype chat to ask for programming help in real time - providing you have made a reasonable attempt to work things out on your own first.

If think that it is too hard to try to get scores, review page content, responses, etc. in the email at the first attempt. Let us first get it working sending plain text emails, containing links to the review page and the other simple sorts of information that I list on the wiki page. Once we have something that works, then we can think about something more sophisticated.

On the wiki page, I have made some brief notes about how and where to implement the functionality. I hope this is enough to get you started. Once you have some code, I will review it, and then when it is done, check it in to all the relevant places.

By the way, my estimate was about the same as yours - I guessed 2 days. (But that was assuming I would do it, and I know all the relevant Moodle APIs, but that did include the 1/2 day I have now spent specifying it.)
In reply to Tim Hunt

Re: Email to teacher on quiz completion

by king marsh -

I am not sure if this can make you work much easiser.

I am currently looking at an external quiz tool QuizCreator for similar feature.
It has a native functionality for you to send quiz results, including items of question, points, correct answer, student response, passiong points, total points, student points, and ect to teacher via e-mail automatically or manually.

With SCORM/AICC compliance, quiz created by this tool can be uploaded to Moodle and sending quiz results to teacher works on Moodle.

In reply to Tim Hunt

Odp: Re: Email to teacher on quiz completion

by Adam kowalski -
Is it possible to select date of sending notification e-mail?
In reply to Just H

Re: Email to teacher on quiz completion

by Bruno Rota Sargi -
Hi Harry

I'm having problems at the time to install the hack to the latest version of Moodle 1.9.

I followed all the steps, but when I create a new quiz every page is blank.

I realized I must have some problem with the file modedit.php because when I tried to let the file modedit.php old and tried to create a new quiz, it worked, but when I try to access the quiz set up the following error message:

Sorry, but you do not currently have the permissions to do that (access tab question edit 1)

What might be happening?

Graciously

Bruno Rota Sargi
In reply to Graham Miller

Re: Email to teacher on quiz completion

by Antonius Dilly -
Does anyone know? Why does my email_quiz_notification module not work in my moodle? In my case, admin (or teacher) had no email notification when students submitted the quiz attempts. I'm running Moodle 1.8. Thx u.
In reply to Antonius Dilly

Re: Email to teacher on quiz completion

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Do you see the bit in the message above that says this was implemented for Moodle 1.9.
In reply to Tim Hunt

Re: Email to teacher on quiz completion

by venkat sadineni -

Hello all,

Can any one explain in detail how to install this plugin on moodle 1.8

Regards,

Venkat

In reply to venkat sadineni

Re: Email to teacher on quiz completion

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It's not a plugin, it is a change to the quiz code. The corresponding issue in the issue tracker is MDL-648. If you go to the Version Control tab there, you can find out exactly what code changes were made by clicking on the +x -y links.
In reply to Tim Hunt

Re: Email to teacher on quiz completion

by Chris Bucin -
Hi
I tried to update the quiz module using the update quiz.zip from http://tracker.moodle.org/browse/MDL-648
However I think I must have done something wrong because not only did the quiz not update, I now get MySQL errors and the manual authentication options no longer display properly. If I add one user to a course everything is fine, however if I try to add multiple people, only the first person gets enrolled and the script hangs. I've just had to do the entire intake by hand and it's very time consuming to do like this as you can imagine.

I also have the same problems when uploading a list of users. If I try to enrol users on a course, only the first user gets enrolled (in fact only the first user is created), but if no enrolment is required, all users get created without any problems.
I backed up the original files before overwriting them with the contents of the above zip file, but I believe in running these modified versions of the script, some changes to the databases have been made. By replacing the original versions back in place, I still have the same issues.
If anyone has any suggestions of how to fix these annoying problems, please let me know. I'm really scratching my head over this one.
Many thanks,

Chris Bucin

In reply to Chris Bucin

Re: Email to teacher on quiz completion

by Just H -
Hi Chris

not only did the quiz not update

Can you check the database and see if the new fields where added . . . oooops, forget that. Sorry, misread the post, thought you had applied our hack but you're talking about the official one.

One thing that may help someone help you resolve your current issue is the version of Moodle you are running. Not being familiar with the official hack I'm not too sure if it's been backported.

Good luck.
H


In reply to Chris Bucin

Re: Email to teacher on quiz completion

by Graham Miller -
Sorry to say Chris, but that quiz.zip file was a first draft of a solution. It did not work properly, was not acceptable to Tim, and was totally rewritten to generate the quiz-648-0.1.patch file that does work OK against 1.8.2 of Moodle. That patch, though, lacks some small refinements that made it into the 1.9 release.

Which version of moodle did you have originally?

I have a patched 1.8.2 release running in a production environment with no hitches with all functionality except the group thing. If you want the latest patch against 1.8.2 then let me know and I will post it here.

As for the sql errors and list of users issue, I am not sure what would be doing that. The only thing that quiz.zip file may have done is bump up the moodle and quiz version numbers and that gets recorded in the database. I am not sure how to wind them back even after restoring all the files. I hope someone else can help you with that.

Another idea may be upgrading to 1.9 but that could be risky on a production system with existing history etc. Personally, I certainly would not do that unless you have tested you system on that release.

Graham
In reply to Chris Bucin

Re: Email to teacher on quiz completion

by Mike Allen -

I really want to use this email facility, but am having problems. I'm using 1.8.2+ on Windows. I have downloaded the latest files - latest date 22/11/2007 and the quiz_notification.php dated 25/06/2007.

All the tables have set up correctly and the quiz settings look correct. However when I run the quiz_notification.php nothing happens. It thinks about it for about 3-4 minutes and then returns a blank screen. I have set up our email server route and passwords, without success.

Does anybody have any ideas please.

Many thanks,

Mike

In reply to Mike Allen

Re: Email to teacher on quiz completion

by Erin Bennett -
Any news on the progress of the email notification? I'm looking at a similar idea, but we need to check all activities, not just quizzeses so we will prbably just run a cron job to check for newly completed modules.
Any suggestions welcome smile
In reply to Erin Bennett

Re: Email to teacher on quiz completion

by Graham Miller -
The full details of how the email to teacher on quiz completion was implemented in moodle 1.9 can be found here

http://moodle.org/mod/forum/post.php?reply=390501

I think this should give you access to all the info we have.

Cheers
Graham
In reply to Graham Miller

Re: Email to teacher on quiz completion

by Sasha Roman -
I have Moodle 1.7 installed and just beginning my Moodle "career", plz forgive my many ignorances.

I have downloaded Harry Smith's Quiz_email_notification module 1.7, followed the readme-file-instructions for uploading ( I think), and set up the cron with my webhost.
But I am still missing some vital bit -- cuz I can't find the settings anywhere in my Admin side, or any new part in the MySql database (god help us if I have to tinker around in there :| ). It appears as though I haven't done the first thing.

I can't begin any testing, cuz I can't find the new module parts.

Has anyone got an idea what I'm doing wrong?

TIA,
Sasha
In reply to Sasha Roman

Re: Email to teacher on quiz completion

by Just H -
Hi Sasha

If you've uploaded everything correctly, when you set up a new quiz (or edit an old one) you should see where to set up the email near the bottom of the quiz settings.

Re the database, did you go to admin after installing? (this should trigger the database changes).

Regards
H
In reply to Graham Miller

Re: Email to teacher on quiz completion

by N Hansen -
What it would be really helpful to have is for there to be a way for a teacher to indicate that they have finished reviewing a student's quiz, and then an email would be sent out to the student to let them know. Even with automatically graded questions, a teacher always has the opportunity to add remarks to the student's work and now there is no way for the student to know if the teacher has done that yet or not.
In reply to N Hansen

Re: Email to teacher on quiz completion

by venkat sadineni -

Hi,

Can I send a mail on completion of the Quiz to the Mail ID which is a Custom Field in user Profile,

What is the code I have to edit,

hope some one help on this,

Regards,

Venkat

In reply to venkat sadineni

Re: Email to teacher on quiz completion

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
As far as I know, them email sending function in Moodle just sends to the main email address in the user profile, so sending to some other address would require more work.

Which version of Moodle are you using?
In reply to Tim Hunt

Re: Email to teacher on quiz completion

by venkat sadineni -

For this, A plugin called  'Quiz EMail Notification'  available on the website,

But this plugin seems having bugs,

I am using moodle 1.8.2

Regards,

Venkat

In reply to Graham Miller

Re: Email to teacher on quiz completion

by Marcy Wrege -
I read all of these replies, but am very confused on how to do this. I want the teacher to be notified when a student has taken a test. Can someone help me out with this? I am very new to Moodle, and the page called, "Development: Email notification when a quiz is submitted" from Moodledocs is confusing to me.