add_system_message(_("At least one of the parameters is empty."), 'error'); forward("course/assignments/{$course_id}/assignment/{$id}/edit"); } else if (empty($course_id)) { $Dippler->add_system_message(_("Course not found"), 'error'); forward('courses/my'); } else if (empty($id)) { $Dippler->add_system_message(_("Assignment not found"), 'error'); forward("course/assignments/{$course_id}"); } else { $assignment = new Assignment($id); $assignment->load(); $assignment->title = $title; $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); } if (!$assignment->save()) { $Dippler->add_system_message(_("Assignment could not be edited."), 'error'); forward("course/assignments/{$course_id}/assignment/{$id}/edit"); } $Dippler->add_system_message(_("Assignment edited.")); // Clear cache $Dippler->clearSessionInputValues(); forward("course/assignments/{$course_id}"); } forward('courses/my'); ?>