"View all submissions" produces error code: dmlwriteexception

"View all submissions" produces error code: dmlwriteexception

by M Horn -
Number of replies: 0

Hi All

Background: A group-assignment link was created on 14 August 2017 and students submitted to the link (only one member per group needed to submit the group's assignment).

One student was not added to his group and he realised this when the grades were made available. We then added him to his group, so that he can share the grade and see the feedback files.

However, after adding him to the group, we now receive this error when clicking on "View all submissions" on the assignment link: Error writing to database

Debug info

The debug info shows the following:

Debug info: The statement has been terminated.
INSERT INTO mdl_assign_submission (assignment,userid,groupid,timecreated,timemodified,attemptnumber,latest,status) OUTPUT inserted.id VALUES (?,?,?,?,?,?,?,?)
[array (
0 => '1360',
1 => 0,
2 => '1286',
3 => 1506587180,
4 => 1506587180,
5 => NULL,
6 => 0,
7 => 'new',
)]
Error code: dmlwriteexception
The issue lies with the userid of this student. I can see that it is related to Group 4 (id=1286) where we added the new student into, but for some reason the userid of the student does not pull through (I also assume the issues lies with the newly added user and not any of the other group-members already in Group 4 as we haven't had this issue when the lecturer grades the assignments)

What we've tried so far:

1. Removed the user from the group and tried to access the submissions again: This still fails with the same error message, but then the groupid is also missing (2 => 0)

2. Log in as the user (by using "login as" from their profile): The student can see the assignment, see his grade, view the group-assignment uploaded for his group, view the feedback-file loaded for this group etc.

3. Added the user to the cohort sync and removed his "manual" enrollment


What we have not tried:

1. Unenrolling the student completely and enrolling him again (I'm cautious of this as I don't want him to loose any grades, submissions, feedback etc. so this is last resort)


Our current Moodle version is Moodle 3.1.5 (Build: 20170313)


Any suggestions would be welcomed!

Average of ratings: -