"exercice.php","name" => get_lang('Exercices')); // Tool name $nameTools=get_lang('AddQuestionToExercise'); // The form $form = new FormValidator('add_question','post',api_get_self().'?'.api_get_cidreq()); // form title $form->addElement('header','',get_lang('AddQuestionToExercise')); // the question types (normal form element) /* foreach (Question::$questionTypes as $key=>$value) { $question_types[] = get_lang($value[1]); } $form->addElement('select', 'question_type', get_lang('QuestionType'), $question_types); */ // the question types (jquery form element) $form->addElement('hidden', 'question_type_hidden', get_lang('QuestionType'), array('id'=>'question_type_hidden')); $form->addElement('static','',' '); $form->addElement('static','select_question_type', get_lang('QuestionType'),'
'); //session id $session_id = api_get_session_id(); // the exercices $tbl_exercices = Database :: get_course_table(TABLE_QUIZ_TEST); $sql = "SELECT id,title,type,description, results_disabled FROM $tbl_exercices WHERE active<>'-1' AND session_id=".$session_id." ORDER BY title ASC"; $result = Database::query($sql); $exercises['-'] = '-'.get_lang('SelectExercice').'-'; while ($row = Database :: fetch_array($result)) { $exercises[$row['id']] = $row['title']; } $form->addElement('select', 'exercice', get_lang('Exercice'), $exercises); // generate default content $form->addElement('checkbox', 'is_content', get_lang('DefaultContent'), null, array('checked' => true)); // the submit button $form->addElement('style_submit_button', 'SubmitCreateQuestion', get_lang('CreateQuestion'), 'class="add"'); // setting the rules // $form->addRule('question_type', '