'; $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 '
'; if ($objExercise->id != 0) { echo '' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).''; } else { if (!empty($_GET['lp_id']) || !empty($_POST['lp_id'])){ if (!empty($_POST['lp_id'])){ $lp_id = Security::remove_XSS($_POST['lp_id']);//TODO:this remains to be implemented after press the first post } else { $lp_id = Security::remove_XSS($_GET['lp_id']); } echo "".Display::return_icon('back.png', get_lang("BackTo").' '.get_lang("LearningPaths"),'',ICON_SIZE_MEDIUM).""; } else { echo '' . Display :: return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).''; } } echo '
'; if ($objExercise->feedback_type == 1) { Display::display_normal_message(get_lang('DirectFeedbackCantModifyTypeQuestion')); } if (api_get_setting('search_enabled')=='true' && !extension_loaded('xapian')) { Display::display_error_message(get_lang('SearchXapianModuleNotInstalled')); } if ($objExercise->id != 0 && $objExercise->edit_exercise_in_lp == false) { $form->freeze(); } $form->display(); } Display::display_footer();