ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.assFileUploadGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once './Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
5 require_once './Modules/Test/classes/inc.AssessmentConstants.php';
6 require_once './Modules/TestQuestionPool/interfaces/interface.ilGuiQuestionScoringAdjustable.php';
7 
23 {
24  const REUSE_FILES_TBL_POSTVAR = 'reusefiles';
25  const DELETE_FILES_TBL_POSTVAR = 'deletefiles';
26 
35  public function __construct($id = -1)
36  {
37  parent::__construct();
38  include_once "./Modules/TestQuestionPool/classes/class.assFileUpload.php";
39  $this->object = new assFileUpload();
40  $this->setErrorMessage($this->lng->txt("msg_form_save_error"));
41  if ($id >= 0) {
42  $this->object->loadFromDb($id);
43  }
44  }
45 
49  protected function writePostData($always = false)
50  {
51  $hasErrors = (!$always) ? $this->editQuestion(true) : false;
52  if (!$hasErrors) {
53  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
56  $this->saveTaxonomyAssignments();
57  return 0;
58  }
59  return 1;
60  }
61 
63  {
64  $this->object->setPoints($_POST["points"]);
65  $this->object->setMaxSize($_POST["maxsize"]);
66  $this->object->setAllowedExtensions($_POST["allowedextensions"]);
67  $this->object->setCompletionBySubmission($_POST['completion_by_submission'] == 1 ? true : false);
68  }
69 
75  public function editQuestion($checkonly = false)
76  {
77  $save = $this->isSaveCommand();
78  $this->getQuestionTemplate();
79 
80  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
81  $form = new ilPropertyFormGUI();
82  $this->editForm = $form;
83 
84  $form->setFormAction($this->ctrl->getFormAction($this));
85  $form->setTitle($this->outQuestionType());
86  $form->setMultipart(false);
87  $form->setTableWidth("100%");
88  $form->setId("assfileupload");
89 
92 
95 
96  $errors = false;
97 
98  if ($save) {
99  $form->setValuesByPost();
100  $errors = !$form->checkInput();
101  $form->setValuesByPost(); // again, because checkInput now performs the whole stripSlashes handling and
102  // we need this if we don't want to have duplication of backslashes
103  if ($errors) {
104  $checkonly = false;
105  }
106  }
107 
108  if (!$checkonly) {
109  $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
110  }
111  return $errors;
112  }
113 
115  {
116  // maxsize
117  $maxsize = new ilNumberInputGUI($this->lng->txt("maxsize"), "maxsize");
118  $maxsize->setValue($this->object->getMaxSize());
119  $maxsize->setInfo($this->lng->txt("maxsize_info"));
120  $maxsize->setSize(10);
121  $maxsize->setMinValue(0);
122  $maxsize->setMaxValue($this->determineMaxFilesize());
123  $maxsize->setRequired(false);
124  $form->addItem($maxsize);
125 
126  // allowedextensions
127  $allowedextensions = new ilTextInputGUI($this->lng->txt("allowedextensions"), "allowedextensions");
128  $allowedextensions->setInfo($this->lng->txt("allowedextensions_info"));
129  $allowedextensions->setValue($this->object->getAllowedExtensions());
130  $allowedextensions->setRequired(false);
131  $form->addItem($allowedextensions);
132 
133  // points
134  $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
135  $points->allowDecimals(true);
136  $points->setValue(
137  is_numeric($this->object->getPoints()) && $this->object->getPoints(
138  ) >= 0 ? $this->object->getPoints() : ''
139  );
140  $points->setRequired(true);
141  $points->setSize(3);
142  $points->setMinValue(0.0);
143  $points->setMinvalueShouldBeGreater(false);
144  $form->addItem($points);
145 
146  $subcompl = new ilCheckboxInputGUI($this->lng->txt(
147  'ass_completion_by_submission'
148  ), 'completion_by_submission');
149  $subcompl->setInfo($this->lng->txt('ass_completion_by_submission_info'));
150  $subcompl->setValue(1);
151  $subcompl->setChecked($this->object->isCompletionBySubmissionEnabled());
152  $form->addItem($subcompl);
153  return $form;
154  }
155 
159  public function determineMaxFilesize()
160  {
161  //mbecker: Quick fix for mantis bug 8595: Change size file
162  $upload_max_filesize = get_cfg_var("upload_max_filesize");
163  // get the value for the maximal post data from the php.ini (if available)
164  $post_max_size = get_cfg_var("post_max_size");
165 
166  //convert from short-string representation to "real" bytes
167  $multiplier_a = array( "K" => 1024, "M" => 1024 * 1024, "G" => 1024 * 1024 * 1024 );
168  $umf_parts = preg_split(
169  "/(\d+)([K|G|M])/",
170  $upload_max_filesize,
171  -1,
172  PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY
173  );
174  $pms_parts = preg_split(
175  "/(\d+)([K|G|M])/",
176  $post_max_size,
177  -1,
178  PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY
179  );
180 
181  if (count($umf_parts) == 2) {
182  $upload_max_filesize = $umf_parts[0] * $multiplier_a[$umf_parts[1]];
183  }
184 
185  if (count($pms_parts) == 2) {
186  $post_max_size = $pms_parts[0] * $multiplier_a[$pms_parts[1]];
187  }
188 
189  // use the smaller one as limit
190  $max_filesize = min($upload_max_filesize, $post_max_size);
191 
192  if (!$max_filesize) {
193  $max_filesize = max($upload_max_filesize, $post_max_size);
194  return $max_filesize;
195  }
196  return $max_filesize;
197  }
198 
212  public function getSolutionOutput(
213  $active_id,
214  $pass = null,
215  $graphicalOutput = false,
216  $result_output = false,
217  $show_question_only = true,
218  $show_feedback = false,
219  $show_correct_solution = false,
220  $show_manual_scoring = false,
221  $show_question_text = true
222  ) {
223  // get the solution of the user for the active pass or from the last pass if allowed
224  $template = new ilTemplate("tpl.il_as_qpl_fileupload_output_solution.html", true, true, "Modules/TestQuestionPool");
225 
226  $solutionvalue = "";
227  if (($active_id > 0) && (!$show_correct_solution)) {
228  $solutions = &$this->object->getSolutionValues($active_id, $pass);
229  include_once "./Modules/Test/classes/class.ilObjTest.php";
230  if (!ilObjTest::_getUsePreviousAnswers($active_id, true)) {
231  if (is_null($pass)) {
232  $pass = ilObjTest::_getPass($active_id);
233  }
234  }
235  $solutions = &$this->object->getSolutionValues($active_id, $pass);
236 
237  $files = ($show_manual_scoring) ? $this->object->getUploadedFilesForWeb($active_id, $pass) : $this->object->getUploadedFiles($active_id, $pass);
238  include_once "./Modules/TestQuestionPool/classes/tables/class.assFileUploadFileTableGUI.php";
239  $table_gui = new assFileUploadFileTableGUI($this->getTargetGuiClass(), 'gotoquestion');
240  $table_gui->setTitle($this->lng->txt('already_delivered_files'), 'icon_file.svg', $this->lng->txt('already_delivered_files'));
241  $table_gui->setData($files);
242  // hey: prevPassSolutions - table refactored
243  #$table_gui->initCommand(
244  #$this->buildFileTableDeleteButtonInstance(), assFileUploadGUI::DELETE_FILES_TBL_POSTVAR
245  #);
246  // hey.
247  $table_gui->setRowTemplate("tpl.il_as_qpl_fileupload_file_view_row.html", "Modules/TestQuestionPool");
248  $table_gui->setSelectAllCheckbox("");
249  // hey: prevPassSolutions - table refactored
250  #$table_gui->clearCommandButtons();
251  #$table_gui->disable('select_all');
252  // hey.
253  $table_gui->disable('numinfo');
254  $template->setCurrentBlock("files");
255  $template->setVariable('FILES', $table_gui->getHTML());
256  $template->parseCurrentBlock();
257  }
258 
259  if (strlen($this->object->getAllowedExtensions())) {
260  $template->setCurrentBlock("allowed_extensions");
261  $template->setVariable("TXT_ALLOWED_EXTENSIONS", $this->object->prepareTextareaOutput($this->lng->txt("allowedextensions") . ": " . $this->object->getAllowedExtensions()));
262  $template->parseCurrentBlock();
263  }
264  $template->setVariable("CMD_UPLOAD", $this->getQuestionActionCmd());
265  $template->setVariable("TEXT_UPLOAD", $this->object->prepareTextareaOutput($this->lng->txt('upload')));
266  $template->setVariable("TXT_UPLOAD_FILE", $this->object->prepareTextareaOutput($this->lng->txt('file_add')));
267  $template->setVariable("TXT_MAX_SIZE", $this->object->prepareTextareaOutput($this->lng->txt('file_notice') . " " . $this->object->getMaxFilesizeAsString()));
268 
269  if (($active_id > 0) && (!$show_correct_solution)) {
270  $reached_points = $this->object->getReachedPoints($active_id, $pass);
271  if ($graphicalOutput) {
272  // output of ok/not ok icons for user entered solutions
273  if ($reached_points == $this->object->getMaximumPoints()) {
274  $template->setCurrentBlock("icon_ok");
275  $template->setVariable("ICON_OK", ilUtil::getImagePath("icon_ok.svg"));
276  $template->setVariable("TEXT_OK", $this->lng->txt("answer_is_right"));
277  $template->parseCurrentBlock();
278  } else {
279  $template->setCurrentBlock("icon_ok");
280  if ($reached_points > 0) {
281  $template->setVariable("ICON_NOT_OK", ilUtil::getImagePath("icon_mostly_ok.svg"));
282  $template->setVariable("TEXT_NOT_OK", $this->lng->txt("answer_is_not_correct_but_positive"));
283  } else {
284  $template->setVariable("ICON_NOT_OK", ilUtil::getImagePath("icon_not_ok.svg"));
285  $template->setVariable("TEXT_NOT_OK", $this->lng->txt("answer_is_wrong"));
286  }
287  $template->parseCurrentBlock();
288  }
289  }
290  } else {
291  $reached_points = $this->object->getPoints();
292  }
293 
294  if ($result_output) {
295  $resulttext = ($reached_points == 1) ? "(%s " . $this->lng->txt("point") . ")" : "(%s " . $this->lng->txt("points") . ")";
296  $template->setVariable("RESULT_OUTPUT", sprintf($resulttext, $reached_points));
297  }
298  if ($show_question_text == true) {
299  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), true));
300  }
301  $questionoutput = $template->get();
302  $solutiontemplate = new ilTemplate("tpl.il_as_tst_solution_output.html", true, true, "Modules/TestQuestionPool");
303  $feedback = ($show_feedback && !$this->isTestPresentationContext()) ? $this->getAnswerFeedbackOutput($active_id, $pass) : "";
304  if (strlen($feedback)) {
305  $cssClass = (
306  $this->hasCorrectSolution($active_id, $pass) ?
308  );
309 
310  $solutiontemplate->setVariable("ILC_FB_CSS_CLASS", $cssClass);
311  $solutiontemplate->setVariable("FEEDBACK", $this->object->prepareTextareaOutput($feedback, true));
312  }
313  $solutiontemplate->setVariable("SOLUTION_OUTPUT", $questionoutput);
314  $solutionoutput = $solutiontemplate->get();
315  if (!$show_question_only) {
316  // get page object output
317  $solutionoutput = $this->getILIASPage($solutionoutput);
318  }
319  return $solutionoutput;
320  }
321 
322  public function getPreview($show_question_only = false, $showInlineFeedback = false)
323  {
324  $template = new ilTemplate("tpl.il_as_qpl_fileupload_output.html", true, true, "Modules/TestQuestionPool");
325 
326  if (is_object($this->getPreviewSession())) {
327  $files = $this->object->getPreviewFileUploads($this->getPreviewSession());
328  include_once "./Modules/TestQuestionPool/classes/tables/class.assFileUploadFileTableGUI.php";
329  $table_gui = new assFileUploadFileTableGUI(null, $this->getQuestionActionCmd(), 'ilAssQuestionPreview');
330  $table_gui->setTitle($this->lng->txt('already_delivered_files'), 'icon_file.svg', $this->lng->txt('already_delivered_files'));
331  $table_gui->setData($files);
332  // hey: prevPassSolutions - support file reuse with table
333  $table_gui->initCommand(
336  );
337  // hey.
338  $template->setCurrentBlock("files");
339  $template->setVariable('FILES', $table_gui->getHTML());
340  $template->parseCurrentBlock();
341  }
342 
343  if (strlen($this->object->getAllowedExtensions())) {
344  $template->setCurrentBlock("allowed_extensions");
345  $template->setVariable("TXT_ALLOWED_EXTENSIONS", $this->object->prepareTextareaOutput($this->lng->txt("allowedextensions") . ": " . $this->object->getAllowedExtensions()));
346  $template->parseCurrentBlock();
347  }
348  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->question, true));
349  $template->setVariable("CMD_UPLOAD", $this->getQuestionActionCmd());
350  $template->setVariable("TEXT_UPLOAD", $this->object->prepareTextareaOutput($this->lng->txt('upload')));
351  $template->setVariable("TXT_UPLOAD_FILE", $this->object->prepareTextareaOutput($this->lng->txt('file_add')));
352  $template->setVariable("TXT_MAX_SIZE", $this->object->prepareTextareaOutput($this->lng->txt('file_notice') . " " . $this->object->getMaxFilesizeAsString()));
353 
354  $questionoutput = $template->get();
355  if (!$show_question_only) {
356  // get page object output
357  $questionoutput = $this->getILIASPage($questionoutput);
358  }
359  return $questionoutput;
360  }
361 
362  // hey: prevPassSolutions - pass will be always available from now on
363  public function getTestOutput($active_id, $pass, $is_postponed = false, $use_post_solutions = false, $show_feedback = false)
364  // hey.
365  {
366  // generate the question output
367  $template = new ilTemplate("tpl.il_as_qpl_fileupload_output.html", true, true, "Modules/TestQuestionPool");
368 
369  if ($active_id) {
370  // hey: prevPassSolutions - obsolete due to central check
371  #$solutions = NULL;
372  #include_once "./Modules/Test/classes/class.ilObjTest.php";
373  #if (!ilObjTest::_getUsePreviousAnswers($active_id, true))
374  #{
375  # if (is_null($pass)) $pass = ilObjTest::_getPass($active_id);
376  #}
377  $files = $this->object->getTestOutputSolutions($active_id, $pass);
378  // hey.
379  include_once "./Modules/TestQuestionPool/classes/tables/class.assFileUploadFileTableGUI.php";
380  $table_gui = new assFileUploadFileTableGUI(null, $this->getQuestionActionCmd());
381  $table_gui->setTitle($this->lng->txt('already_delivered_files'), 'icon_file.svg', $this->lng->txt('already_delivered_files'));
382  $table_gui->setData($files);
383  // hey: prevPassSolutions - support file reuse with table
384  $table_gui->initCommand(
387  );
388  // hey.
389  $template->setCurrentBlock("files");
390  $template->setVariable('FILES', $table_gui->getHTML());
391  $template->parseCurrentBlock();
392  }
393 
394  if (strlen($this->object->getAllowedExtensions())) {
395  $template->setCurrentBlock("allowed_extensions");
396  $template->setVariable("TXT_ALLOWED_EXTENSIONS", $this->object->prepareTextareaOutput($this->lng->txt("allowedextensions") . ": " . $this->object->getAllowedExtensions()));
397  $template->parseCurrentBlock();
398  }
399  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->question, true));
400  $template->setVariable("CMD_UPLOAD", $this->getQuestionActionCmd());
401  $template->setVariable("TEXT_UPLOAD", $this->object->prepareTextareaOutput($this->lng->txt('upload')));
402  $template->setVariable("TXT_UPLOAD_FILE", $this->object->prepareTextareaOutput($this->lng->txt('file_add')));
403  $template->setVariable("TXT_MAX_SIZE", $this->object->prepareTextareaOutput($this->lng->txt('file_notice') . " " . $this->object->getMaxFilesizeAsString()));
404 
405  $questionoutput = $template->get();
406  if (!$show_question_only) {
407  // get page object output
408  $questionoutput = $this->getILIASPage($questionoutput);
409  }
410  $questionoutput = $template->get();
411  $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput);
412  return $pageoutput;
413  }
414 
422  public function setQuestionTabs()
423  {
424  global $DIC;
425  $rbacsystem = $DIC['rbacsystem'];
426  $ilTabs = $DIC['ilTabs'];
427 
428  $ilTabs->clearTargets();
429 
430  $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
431  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
432  $q_type = $this->object->getQuestionType();
433 
434  if (strlen($q_type)) {
435  $classname = $q_type . "GUI";
436  $this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
437  $this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
438  }
439 
440  if ($_GET["q_id"]) {
441  if ($rbacsystem->checkAccess('write', $_GET["ref_id"])) {
442  // edit page
443  $ilTabs->addTarget(
444  "edit_page",
445  $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
446  array("edit", "insert", "exec_pg"),
447  "",
448  "",
449  $force_active
450  );
451  }
452 
453  $this->addTab_QuestionPreview($ilTabs);
454  }
455 
456  $force_active = false;
457  if ($rbacsystem->checkAccess('write', $_GET["ref_id"])) {
458  $url = "";
459  if ($classname) {
460  $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
461  }
462  // edit question properties
463  $ilTabs->addTarget(
464  "edit_question",
465  $url,
466  array("editQuestion", "save", "cancel", "saveEdit"),
467  $classname,
468  ""
469  );
470  }
471 
472  // add tab for question feedback within common class assQuestionGUI
473  $this->addTab_QuestionFeedback($ilTabs);
474 
475  // add tab for question hint within common class assQuestionGUI
476  $this->addTab_QuestionHints($ilTabs);
477 
478  // add tab for question's suggested solution within common class assQuestionGUI
479  $this->addTab_SuggestedSolution($ilTabs, $classname);
480 
481  // Assessment of questions sub menu entry
482  if ($_GET["q_id"]) {
483  $ilTabs->addTarget(
484  "statistics",
485  $this->ctrl->getLinkTargetByClass($classname, "assessment"),
486  array("assessment"),
487  $classname,
488  ""
489  );
490  }
491 
492  if (($_GET["calling_test"] > 0) || ($_GET["test_ref_id"] > 0)) {
493  $ref_id = $_GET["calling_test"];
494  if (strlen($ref_id) == 0) {
495  $ref_id = $_GET["test_ref_id"];
496  }
497 
498  global $___test_express_mode;
499 
500  if (!$_GET['test_express_mode'] && !$___test_express_mode) {
501  $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), "ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
502  } else {
504  $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), $link);
505  }
506  } else {
507  $ilTabs->setBackTarget($this->lng->txt("qpl"), $this->ctrl->getLinkTargetByClass("ilobjquestionpoolgui", "questions"));
508  }
509  }
510 
511  public function getSpecificFeedbackOutput($userSolution)
512  {
513  $output = "";
514  return $this->object->prepareTextareaOutput($output, true);
515  }
516 
527  {
528  return array();
529  }
530 
539  public function getAggregatedAnswersView($relevant_answers)
540  {
541  // Empty implementation here since a feasible way to aggregate answer is not known.
542  return ''; //print_r($relevant_answers,true);
543  }
544 
545  // hey: prevPassSolutions - shown files needs to be chosen so upload can replace or complete fileset
550  {
551  require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssFileUploadFileTableDeleteButton.php';
553  }
554 
559  {
560  require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssFileUploadFileTableReuseButton.php';
562  }
563 
568  {
569  if ($this->object->getTestPresentationConfig()->isSolutionInitiallyPrefilled()) {
570  return $this->buildFileTableReuseButtonInstance();
571  }
572 
573  return $this->buildFileTableDeleteButtonInstance();
574  }
575 
577  {
578  if ($this->object->getTestPresentationConfig()->isSolutionInitiallyPrefilled()) {
580  }
581 
583  }
584  // hey.
585 
586  // hey: prevPassSolutions - overwrite common prevPassSolution-Checkbox
588  {
589  return $this->lng->txt('use_previous_solution_advice_file_upload');
590  }
591 
593  {
594  return '';
595  }
596  // hey.
597 
598  public function getFormEncodingType()
599  {
600  return self::FORM_ENCODING_MULTIPART;
601  }
602 
604  {
605  return false;
606  }
607 
609  {
610  // points
611  $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
612  $points->allowDecimals(true);
613  $points->setValue(
614  is_numeric($this->object->getPoints()) && $this->object->getPoints(
615  ) >= 0 ? $this->object->getPoints() : ''
616  );
617  $points->setRequired(true);
618  $points->setSize(3);
619  $points->setMinValue(0.0);
620  $points->setMinvalueShouldBeGreater(false);
621  $form->addItem($points);
622 
623  $subcompl = new ilCheckboxInputGUI($this->lng->txt(
624  'ass_completion_by_submission'
625  ), 'completion_by_submission');
626  $subcompl->setInfo($this->lng->txt('ass_completion_by_submission_info'));
627  $subcompl->setValue(1);
628  $subcompl->setChecked($this->object->isCompletionBySubmissionEnabled());
629  $form->addItem($subcompl);
630  }
631 
636  {
637  $this->object->setPoints((float) $form->getInput('points'));
638  $this->object->setCompletionBySubmission((bool) $form->getInput('completion_by_submission'));
639  }
640 }
hasCorrectSolution($activeId, $passIndex)
addTab_QuestionPreview(ilTabsGUI $tabsGUI)
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question, working time.
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
$files
Definition: metarefresh.php:49
setValue($a_value)
Set Value.
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
$template
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
editQuestion($checkonly=false)
Creates an output of the edit form for the question.
getTestOutput($active_id, $pass, $is_postponed=false, $use_post_solutions=false, $show_feedback=false)
getSpecificFeedbackOutput($userSolution)
if(!array_key_exists('StateId', $_REQUEST)) $id
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
getQuestionTemplate()
get question template
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from $_POST and applies them to the data object.
Class for file upload questions.
populateTaxonomyFormSection(ilPropertyFormGUI $form)
allowDecimals($a_value)
Toggle Decimals.
setInfo($a_info)
Set Information Text.
getAggregatedAnswersView($relevant_answers)
Returns an html string containing a question specific representation of the answers so far given in t...
saveCorrectionsFormProperties(ilPropertyFormGUI $form)
writePostData($always=false)
{}
static getReturnToPageLink($q_id=null)
if(isset($_POST['submit'])) $form
setQuestionTabs()
Sets the ILIAS tabs for this question type.
getILIASPage($html="")
Returns the ILIAS Page around a question.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
This class represents a number property in a property form.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
populateCorrectionsFormProperties(ilPropertyFormGUI $form)
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
Basic GUI class for assessment questions.
populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
Adds the question specific forms parts to a question property form gui.
setErrorMessage($errormessage)
The assFileUploadGUI class encapsulates the GUI representation for file upload questions.
getAnswerFeedbackOutput($active_id, $pass)
Returns the answer generic feedback depending on the results of the question.
getPreview($show_question_only=false, $showInlineFeedback=false)
$errors
Definition: index.php:6
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
output question page
__construct($id=-1)
assFileUploadGUI constructor
$url
Interface ilGuiQuestionScoringAdjustable.
static _getUsePreviousAnswers($active_id, $user_active_user_setting=false)
Returns if the previous results should be hidden for a learner.
getSolutionOutput( $active_id, $pass=null, $graphicalOutput=false, $result_output=false, $show_question_only=true, $show_feedback=false, $show_correct_solution=false, $show_manual_scoring=false, $show_question_text=true)
Get the question solution output.
getAfterParticipationSuppressionQuestionPostVars()
Returns a list of postvars which will be suppressed in the form output when used in scoring adjustmen...
$_POST["username"]
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
addQuestionFormCommandButtons($form)
Add the command buttons of a question properties form.