'; $htmlHeadXtra[] = ''; $htmlHeadXtra[] = ''; // to correct #4029 Random and number of attempt menu empty added window.onload=advanced_parameters; $htmlHeadXtra[] = ''; // INIT EXERCISE $objExercise = new Exercise(); $objExercise->setCategoriesGrouping(false); $course_id = api_get_course_int_id(); //INIT FORM if (isset($_GET['exerciseId'])) { $form = new FormValidator('exercise_admin', 'post', api_get_self().'?'.api_get_cidreq().'&exerciseId='.intval($_GET['exerciseId'])); $objExercise->read($_GET['exerciseId']); $form->addElement('hidden','edit','true'); } else { $form = new FormValidator('exercise_admin','post',api_get_self().'?'.api_get_cidreq()); $form->addElement('hidden','edit','false'); } $objExercise->createForm($form); // VALIDATE FORM if ($form->validate()) { $objExercise->processCreation($form); if ($form->getSubmitValue('edit') == 'true') { $message = 'ExerciseEdited'; } else { $message = 'ExerciseAdded'; } $exercise_id = $objExercise->id; Session::erase('objExercise'); header('Location:admin.php?message='.$message.'&exerciseId='.$exercise_id.'&'.api_get_cidreq()); exit; } else { // DISPLAY FORM if (isset($_SESSION['gradebook'])) { $gradebook= $_SESSION['gradebook']; } if (!empty($gradebook) && $gradebook=='view') { $interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'],'name' => get_lang('ToolGradebook')); } $nameTools = get_lang('ExerciseManagement'); $interbreadcrumb[] = array("url"=>'exercice.php', 'name'=> get_lang('Exercices')); $interbreadcrumb[] = array("url"=>"admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->name); Display::display_header($nameTools,get_lang('Exercise')); echo '