id; if (isset($exerciseId) && !empty($exerciseId)) { $TBL_LP_ITEM = Database::get_course_table(TABLE_LP_ITEM); $sql="SELECT max_score FROM $TBL_LP_ITEM WHERE item_type = '".TOOL_QUIZ."' AND path ='".Database::escape_string($exerciseId)."'"; $result = Database::query($sql); if (Database::num_rows($result) > 0) { Display::display_warning_message(get_lang('EditingScoreCauseProblemsToExercisesInLP')); } } } else { $objQuestion = Question :: getInstance($_REQUEST['answerType']); $action = api_get_self()."?".api_get_cidreq()."&modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion; } if(is_object($objQuestion)) { /********************* * FORM STYLES *********************/ // if you have a better way to improve the display, please inform me e.marguin@elixir-interactive.com $styles = ' '; echo $styles; /********************* * INIT FORM *********************/ $form = new FormValidator('question_admin_form','post',$action); /********************* * FORM CREATION *********************/ if(isset($_GET['editQuestion'])) { $class="save"; $text=get_lang('ModifyQuestion'); } else { $class="add"; $text=get_lang('AddQuestionToExercise'); } $types_information = $objQuestion->get_types_information(); $form_title_extra = get_lang($types_information[$_REQUEST['answerType']][1]); // form title $form->addElement('header', '', $text.': '.$form_title_extra); // question form elements $objQuestion -> createForm ($form,array('Height'=>150)); // answer form elements $objQuestion -> createAnswersForm ($form); // submit button is implemented in every question type //$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"'); //$renderer = $form->defaultRenderer(); //$renderer->setElementTemplate('