-
Bug
-
Resolution: Fixed
-
Critical
-
1.9.7
-
None
-
Debian Lenny Stable
PHP 5.2.11-0.dotdeb.1 with Suhosin-Patch 0.9.7 (cli) (built: Sep 19 2009 23:21:37)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
Server version: Apache/2.2.9 (Debian)
Server built: Mar 28 2010 19:04:04
mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (x86_64) using readline 5.2
Linux version 2.6.26-2-amd64 (Debian 2.6.26-21lenny4) (dannf@debian.org) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Tue Mar 9 22:29:32 UTC 2010
Debian Lenny Stable PHP 5.2.11-0.dotdeb.1 with Suhosin-Patch 0.9.7 (cli) (built: Sep 19 2009 23:21:37) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies Server version: Apache/2.2.9 (Debian) Server built: Mar 28 2010 19:04:04 mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (x86_64) using readline 5.2 Linux version 2.6.26-2-amd64 (Debian 2.6.26-21lenny4) ( dannf@debian.org ) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Tue Mar 9 22:29:32 UTC 2010
-
MySQL
-
MOODLE_19_STABLE
-
MOODLE_19_STABLE
I've noticed a bug where if you set an ID in the Common Module settings portion of an advanced file upload assignment's settings page, the ID of the corresponding gradebook item gets overwritten with a number when a student submits an assignment.
For example, say you made an advanced upload assignment and set the ID number field to "asdf". If you go to the gradebook (categories and Items - simple view) and click edit on the grade item for the assignment, you can see that the ID will be "asdf" as expected. Next, you then log in as a student and submit a file for marking on the assignment. Then, log back in as a teacher and go back to the gradebook (categories and items - simple view). if you click edit on the assignment grade item now, you will see that the ID field has been replaced by a number. This also affects XML exports from the gradebook too, as the grade items for the affected assignment will have the wrong ID in the xml export. Interestingly, if you open the assignment's settings page and save it again, the ID in the gradebook will be reset to the correct value.
I did some digging and found that the new ID number that was showing up in the gradebook comes from the mdl_course_modules table. Instead of the grade item having mdl_course_modules.idnumber (which holds the value that you entered on the assignment settings page), it has mdl_course_modules.id (which is the auto-generated course module id number).
Looking through the code, I found in mod/assignment/lib.php at line 74,in the assignment class constructor, you have:
$this->assignment->cmidnumber = $this->cm->id; // compatibility with modedit assignment obj
$this->assignment->courseid = $this->course->id; // compatibility with modedit assignment obj
The fix that I have tried so far is to change this to:
$this->assignment->cmidnumber = $this->cm->idnumber; // compatibility with modedit assignment obj
$this->assignment->courseid = $this->course->id; // compatibility with modedit assignment obj
This corrects the problem, but I haven't tested it thoroughly as of yet.
- has been marked as being related by
-
CONTRIB-2073 Gradebook call using incorrect idnumber
-
- Closed
-
-
MDL-24110 Undefined property: object::$idnumber in /Applications/MAMP/htdocs/moodle19/mod/assignment/lib.php on line 74
-
- Closed
-