In mdl_assign_submission userid=0, attemptnumber=0

In mdl_assign_submission userid=0, attemptnumber=0

by Howard Miller -
Number of replies: 3
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I have around 4,500 rows in my mdl_assign_submission table where userid=0 (and attemptnumber=0). Is this legitimate or is something wrong?

To take a step back, this seems to manifest itself as lost submissions in some assignments. 

Any thoughts about what's going on much appreciated. 

Average of ratings: -
In reply to Howard Miller

Re: In mdl_assign_submission userid=0, attemptnumber=0

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I looked at my table and I have a few (7 total but probably a smaller site?).  Most of them say new under status but a few actually say submitted which is strange.  Not sure if that helps you at all!

In reply to Howard Miller

Re: In mdl_assign_submission userid=0, attemptnumber=0

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I think you have definitely had something go wrong. Before retiring I tended to run a new version of Moodle each school year so I have a number of archived databases to look through. It is common to see 0 for nearly all attemptnumber entries except when you I allowed someone another attempt, in which case it contains a 1, 2, or higher. Highest I saw was 4. In the same row it may show a 'status' of draft, reopened, or submitted.

My last completed year shows 2,534 rows in the mdl_assign_submission table. I do NOT have any rows where the userid=0. Most rows shows a 0 in attemptnumber, with 261 rows showing 1 or more attempts. Those numbers are about the same for the four years I checked.

Depending on the type of assignment, could it possibly be caused by having Moodle open so long without clicking on something, that their login has timed out, and yet they try to submit anyway?


In reply to Howard Miller

Re: In mdl_assign_submission userid=0, attemptnumber=0

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

Weird stuff in the database sometimes comes from backup and restore bugs. It that a possibility here?