add_system_message(_("At least one of the parameters is empty."), 'error'); forward("course/assignments/{$course_id}/assignment/{$assignment_id}/edit"); } else if (empty($assignment_id)) { $Dippler->add_system_message(_("Assignment not found."), 'error'); forward("course/assignments/{$course_id}"); } else if (empty($course_id)) { $Dippler->add_system_message(_("Course not found."), 'error'); forward('courses/my'); } else { $assignment = new Assignment($assignment_id); $assignment->load(); if ($assignment && $assignment->getType() == 'assignment') { if ($assignment->canEdit()) { $assignment->title = $title; //$assignment->assignment_type = "writing"; $assignment->start = date_into_timestamp($start); $assignment->deadline = date_into_timestamp($deadline); if ($hidden) { $assignment->hidden = "true"; } else { $assignment->hidden = "false"; } 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; if (isset($tags)) { $assignment->tags = explode(",", $tags); } if (!$assignment->save()) { $Dippler->add_system_message(_("Assignment could not be edited."), 'error'); forward("course/assignments/{$course_id}/assignment/{$assignment_id}/edit"); } } else { $Dippler->add_system_message(_("At least one of the parameters is empty."), 'error'); forward("course/assignments/{$course_id}/assignment/{$assignment_id}/edit"); } } else { $Dippler->add_system_message(_("Assignment could not be edited."), 'error'); } $Dippler->add_system_message(_("Assignment edited.")); // Clear cache $Dippler->clearSessionInputValues(); forward("course/assignments/{$course_id}/assignment/{$assignment_id}"); } forward('courses/my'); ?>