Reset a single user's dashboard *without* accessing the dashboard? page?

Reset a single user's dashboard *without* accessing the dashboard? page?

by Mike Kelly -
Number of replies: 2

Hi all,

So I've run into a situation where a single user's dashboard page will not load. I'm not sure what's up (aside from the fact that it looks like they might've given their account info to a 3rd party / cheat service). When the student logs in, Moodle (3.5) redirects to the /my url, and does nothing until PHP times out. The nginx error logs fill with a flood of messages similar to these:

PHP message: PHP Notice: Undefined property: stdClass::$path in /data/shares/moodle/lib/grade/grade_category.php on line 2131
PHP message: PHP Notice: Undefined property: stdClass::$id in /data/shares/moodle/lib/grade/grade_category.php on line 2131
PHP message: PHP Notice: Undefined property: stdClass::$id in /data/shares/moodle/lib/grade/grade_category.php on line 2133
PHP message: PHP Warning: Creating default object from empty value in /data/shares/moodle/lib/grade/grade_category.php on line 2097
PHP message: PHP Notice: Undefined property: stdClass::$path in /data/shares/moodle/lib/grade/grade_category.php on line 2131
PHP message: PHP Notice: Undefined property: stdClass::$id in /data/shares/moodle/lib/grade/grade_category.php on line 2131

I've made a copy of the DB for later analysis, but right now I'd like to know if there's a straightforward way as an admin to reset a single user's dashboard without being able to access the dashboard itself (since it won't load). I don't want to reset the dashboards of all users in the system.

Thanks!

Average of ratings: -
In reply to Mike Kelly

Re: Reset a single user's dashboard *without* accessing the dashboard? page?

by Mike Kelly -
(and to be fair I can't pin those notices down to this problem, although their rate of appearance in the log definitely increases when I try and load the /my url)
In reply to Mike Kelly

Re: Reset a single user's dashboard *without* accessing the dashboard? page?

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
SELECT * FROM `mdl_my_pages` WHERE `userid` = 2 ORDER BY `userid` ASC

(changing the userid to that of the student)

If the dashboard is customised, there will be two entries: private=1 is the customised one (and should have a much higher id than the original (private=0). Deleting that row should return the dashboard to default but if you then get access, I would reinforce the default status by clicking on the “Reset dashboard to default” button at the top of the actual dashboard.
Average of ratings: Useful (5)