Admin name displayed in response history of a quiz

Admin name displayed in response history of a quiz

by François Lizotte -
Number of replies: 2
Picture of Particularly helpful Moodlers
Hello,

Anybody knows why my name (main admin on site) is displayed in the response history of a quiz attempt?


Thank you in advance,

EDIT

From the log:
30 May 2022, 12:01 PMFrançois LizotteIxxxn HxxaQuiz: Examen final - 35%QuizQuiz attempt submittedThe user with id '5128' has submitted the attempt with id '51919' for the quiz with course module id '30781'.cli

Obviously, the submission was not done by the student but by a cli task, but why would Moodle display the admin's name?
François
Average of ratings: Useful (1)
In reply to François Lizotte

Re: Admin name displayed in response history of a quiz

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The name is showing up because of this enhancement MDL-71030.

As you say, the log entry shows that this was done by the CLI task which automatically submits quiz attempt when the time expires. It is a (weird?) feature of the scheduled tasks system that any actions performed when the task runs get logged as if done by the main site admin.

So, one work-around is to create an additional user account (that no-one ever uses) called 'System task' or something, and make that the main site admin. Then that is the name that will appear in the logs, this bit of the quiz, etc.

Or, someone could propose a change to how scheduled tasks work, but that is not a quiz issue.
Average of ratings: Useful (3)
In reply to Tim Hunt

Re: Admin name displayed in response history of a quiz

by François Lizotte -
Picture of Particularly helpful Moodlers
Hi Tim,

Thanks a lot for this input. Now everything makes sense.