Assignment

 
 
Picture of Vicko Cesko
Duplicate Assignment after Assignment Upgrade
 

Hi Everyone,

We are currently running 2.4.4.

Recently, while still on 2.3.7 we upgraded all our assignments using the Assignment Upgrade Helper. One of our assignments failed to upgrade for some reason, I forget why now. From searching the forum here we found that upgrading to 2.4.4 would fix the issue and enable us to upgrade our assignment. 

2.4.4 did allow us to upgrade the assignment but it ended up creating a duplicate assignment upload link, each with its own view ID. It seems that one has all the old info in it (prior to assignment upgrade) and the other has all the new submissions. 

When we click on the View/Grade Submission link and then click on the grading icon (in the Grade column) for one of the students we get an error stating: Multiple records found, only one record expected.

Can anyone help us sort this out?

Thank you,

Vicko

 
Average of ratings:Useful (1)
Me!
Re: Duplicate Assignment after Assignment Upgrade
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

It may be that the first upgrade attempt left some bad data in the database. Do you have a backup of the assignment from before the upgrade? The first thing I would try is to restore the old assignment from a backup and attempt the upgrade again, if it works and all the data is there then delete the assignments from the previous upgrade attempts. 

 

 
Average of ratings: -
Picture of Vicko Cesko
Re: Duplicate Assignment after Assignment Upgrade
 

We don't have the backup of the assignment any longer. I cleaned up the backup files before noticing this issue a week or two after the upgrade. Even if we had the assignment backup, wouldn't we lose all the data that was submitted after the upgrade was done?

Is there a way to merge the two assignments together, maybe in the database?

 
Average of ratings: -
Picture of Vicko Cesko
Re: Duplicate Assignment after Assignment Upgrade
 

Update --

We tried to create a new assignment to replace both of the existing ones so that our students and instructors can at least have everything working from this point on.

Creating a new assignment created 2 copies of it. Trying to update the assignment and check settings throws that "multiple records found, one expected" error. Deleting those assignments errors out as well but the assignments do end up deleting as they're no longer there when the page is refreshed. Creating a new assignment anywhere in that course causes that error. Creating a new assignment in another course works fine. 

Thanks,

 
Average of ratings:Useful (1)
Picture of Vicko Cesko
Re: Duplicate Assignment after Assignment Upgrade
 

Correction:

The assignments can not be deleted even though it looked like it at first.

 
Average of ratings: -
Picture of Olumuyiwa Taiwo
Re: Duplicate Assignment after Assignment Upgrade
 

1. Turn on debugging

2. Attempt to delete the unwanted assignment

3. Post the resulting error message here

 
Average of ratings: -
Picture of Vicko Cesko
Re: Duplicate Assignment after Assignment Upgrade
 

This is what I get in a pop up window when I try to delete the assignment:

 

Error
Multiple records found, only one record expected.
URL: /
Debug info: SELECT cm.*, m.name, md.name AS modname FROM {course_modules} cm JOIN {modules} md ON md.id = cm.module JOIN {assign} m ON m.id = cm.instance WHERE m.id = :instance AND md.name = :modulename [array ( 'instance' => '182', 'modulename' => 'assign', )] Error code: multiplerecordsfound
Stack trace:
* line 1392 of /lib/dml/moodle_database.php: dml_multiple_records_exception thrown
* line 1551 of /lib/datalib.php: call to moodle_database->get_record_sql()
* line 50 of /mod/assign/lib.php: call to get_coursemodule_from_instance()
* line 208 of /course/rest.php: call to assign_delete_instance()

 
Average of ratings: -
Picture of Uniting College
Re: Duplicate Assignment after Assignment Upgrade
 

I'm not an sql expert but like to look under the hood at things occasionally it seems with the update you did the error has corrupted the 'assign' database table as this is where the error code appears in the above.

I see you posted a job add to get this fixed. Happy to have a look (I am a Moodle Admin) and if I can't fix it then no charge.

 
Average of ratings: -
Picture of sohail aslam
Re: Duplicate Assignment after Assignment Upgrade
 

Is there any possibility that there are 2 assignment plugins now ( old one and new/upgraded one).

Have you disabled the old plugin?

 

 
Average of ratings: -
Picture of Vicko Cesko
Re: Duplicate Assignment after Assignment Upgrade
 

The old assignment module has been disabled but not deleted.

 
Average of ratings: -