Event triggered upon quiz grading?

Event triggered upon quiz grading?

by Mathieu Petit-Clair -
Number of replies: 3
Picture of Core developers Picture of Moodle HQ Picture of MoodleCloud team Picture of Plugin developers Picture of Testers

Hi Tim, Jean-Michel and everyone, 

This Moodle site of ours (2.7) needs to automatically submit grades to the school SIS. Since we are exclusively using quizzes (for now anyway), I was thinking to use an event listener and transfer the grade and comment upon trigger. 

I can see the question_manually_graded event, but that doesn't seem to be for the whole quiz (or is it?). I can also see a user_graded event (in /grade/report/grader/...), but I'm not sure it's actually triggered when a quiz is graded (I tested it and didn't get anything).

Reading through different issues (like MDL-44292) also had me confused about what could and can't be done with events and grades.

Would someone please enlighten me?

Thanks, 

Mathieu

Average of ratings: -
In reply to Mathieu Petit-Clair

Re: Event triggered upon quiz grading?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Well, you have found a key issue:

There is an event that happens on a question: teacher manually grades it. But, what makes that event interesting to the outside world is that that the question that was manually graded is part of a particular quiz event.

However, because we have good modular software design, the bit of the code which handles manual grading, and which might raise the event, does not know what this question is part of.

I raised this issue before: https://moodle.org/mod/forum/discuss.php?d=257934 . That lead to some discussion, but no agreed solution yet. Feel free to poke that discussion.

In reply to Tim Hunt

Re: Event triggered upon quiz grading?

by Mathieu Petit-Clair -
Picture of Core developers Picture of Moodle HQ Picture of MoodleCloud team Picture of Plugin developers Picture of Testers

Thanks Tim! Indeed, this would be a problem.

I'll change the procedure to search for all newly graded quiz (on cron run I suppose) instead of waiting for an event. With the new cron system in Moodle 2.7, it might actually look like it's synchronous.

In reply to Mathieu Petit-Clair

Re: Event triggered upon quiz grading?

by David Cruz -

Hello Mathieu, I'm new to Moodle and I'm also working on something like this.. Do you mind sharing how you got the new final grades on every cron cycle? Thanks!!