Permalink
Browse files

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

  • Loading branch information...
1 parent 94e4101 commit 63f3e269ca9a415ce5038cc4f6d3e261caea9b7c @mudrd8mz mudrd8mz committed Nov 12, 2009
Showing with 6 additions and 0 deletions.
  1. +6 −0 mod/workshop/lib.php
View
@@ -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;

0 comments on commit 63f3e26

Please sign in to comment.