moving the class instantiation a bit earlier so that we can safely modify it

This commit is contained in:
skodak 2007-10-04 08:48:04 +00:00
parent 3e0e2436de
commit 6f0078e5a0

View File

@ -28,6 +28,8 @@ if ($mform->is_cancelled() || empty($CFG->enableoutcomes)) {
}
if ($item = get_record('grade_items', 'id', $id, 'courseid', $course->id)) {
$item = new grade_item($item, false);
// redirect if outcomeid present
if (empty($item->outcomeid)) {
$url = $CFG->wwwroot.'/grade/edit/tree/item.php?id='.$id.'&courseid='.$courseid;
@ -40,7 +42,6 @@ if ($item = get_record('grade_items', 'id', $id, 'courseid', $course->id)) {
} else {
$item->cmid = 0;
}
$item = new grade_item($item);
} else {
$item = new grade_item(array('courseid'=>$courseid, 'itemtype'=>'manual'));