Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 include_once "./assessment/classes/class.assQuestionGUI.php";
00025 include_once "./assessment/classes/inc.AssessmentConstants.php";
00026
00038 class assQuestionTypeTemplateGUI extends assQuestionGUI
00039 {
00048 function assQuestionTypeTemplateGUI(
00049 $id = -1
00050 )
00051 {
00052 $this->assQuestionGUI();
00053
00054
00055
00056 include_once "./assessment/classes/class.assQuestionTypeTemplate.php";
00057 $this->object = new assQuestionTypeTemplate();
00058 if ($id >= 0)
00059 {
00060 $this->object->loadFromDb($id);
00061 }
00062 }
00063
00072 function getCommand($cmd)
00073 {
00074
00075 return $cmd;
00076 }
00077
00078
00087 function getQuestionType()
00088 {
00089 return "assQuestionTypeTemplate";
00090 }
00091
00099 function editQuestion()
00100 {
00101
00102
00103
00104
00105
00106
00107 $this->tpl->addBlockFile("QUESTION_DATA", "question_data", "tpl.il_as_qpl_mytype.html", TRUE);
00108
00109
00110
00111
00112
00113
00114
00115 }
00116
00124 function mycommandObject()
00125 {
00126
00127 }
00128
00141 function outQuestionForTest($formaction, $active_id, $pass = NULL, $is_postponed = FALSE, $use_post_solutions = FALSE)
00142 {
00143 $test_output = $this->getTestOutput($active_id, $pass, $is_postponed, $use_post_solutions);
00144 $this->tpl->setVariable("QUESTION_OUTPUT", $test_output);
00145 $this->tpl->setVariable("FORMACTION", $formaction);
00146 }
00147
00159 function getSolutionOutput($active_id, $pass = NULL, $graphicalOutput = FALSE, $result_output = FALSE)
00160 {
00161
00162
00163 return $questionoutput;
00164 }
00165
00174 function getPreview()
00175 {
00176
00177
00178 }
00179
00192 function getTestOutput($active_id, $pass = NULL, $is_postponed = FALSE, $use_post_solutions = FALSE)
00193 {
00194
00195
00196 }
00197
00205 function addSuggestedSolution()
00206 {
00207
00208
00209
00210
00211 $_SESSION["subquestion_index"] = 0;
00212 if ($_POST["cmd"]["addSuggestedSolution"])
00213 {
00214 if ($this->writePostData())
00215 {
00216 sendInfo($this->getErrorMessage());
00217 $this->editQuestion();
00218 return;
00219 }
00220 if (!$this->checkInput())
00221 {
00222 sendInfo($this->lng->txt("fill_out_all_required_fields_add_answer"));
00223 $this->editQuestion();
00224 return;
00225 }
00226 }
00227 $this->object->saveToDb();
00228 $_GET["q_id"] = $this->object->getId();
00229 $this->tpl->setVariable("HEADER", $this->object->getTitle());
00230 $this->getQuestionTemplate();
00231 parent::addSuggestedSolution();
00232 }
00233 }
00234 ?>