add_system_message(_("At least one of the parameters is empty."), 'error'); forward("course/assignments/{$course_id}/group/add"); } else if (empty($course_id)) { $Dippler->add_system_message(_("Course not found"), 'error'); forward('courses/my'); } else { $assignment = new Assignment(); $assignment->title = $title; $assignment->course = $course_id; $assignment->subtype = "group"; $assignment->start = date_into_timestamp($start); $assignment->deadline = date_into_timestamp($deadline); if (isset($target_group) && !empty($target_group)) { if (!is_array($target_group)) $target_group = array($target_group); } else { $target_group = array(); } $assignment->target_group = $target_group; $assignment->description = $task; $assignment->maxpoints = $maxpoints; $assignment->course = $course_id; if (isset($tags)) { $assignment->tags = explode(",", $tags); } $assignment->outcomes = array(); foreach ($outcomes as $o_id) { $assignment->outcomes[$o_id] = new LearningOutcome($o_id); } $assignment_id = $assignment->create(); if (!$assignment_id) { $Dippler->add_system_message(_("Assignment could not be created."), 'error'); forward("course/assignments/{$course_id}/group/add"); } $Dippler->add_system_message(_("Assignment added.")); // Clear cache $Dippler->clearSessionInputValues(); forward("course/assignments/{$course_id}"); } forward('courses/my'); ?>