MDL-20827 workshop: set correct wtype on newly created instances

This commit is contained in:
David Mudrak
2009-11-12 20:09:07 +00:00
parent 94e4101a68
commit 63f3e269ca
+6
View File
@@ -109,6 +109,12 @@ function workshop_add_instance($workshop) {
return get_string('invaliddates', 'workshop');
}
// set the workshop's type
$wtype = 0; // 3 phases, no grading grades
if ($workshop->includeself or $workshop->ntassessments) $wtype = 1; // 3 phases with grading grades
if ($workshop->nsassessments) $wtype = 2; // 5 phases with grading grades
$workshop->wtype = $wtype;
if ($returnid = insert_record("workshop", $workshop)) {
$event = NULL;