ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
assFileUploadGUI Class Reference

The assFileUploadGUI class encapsulates the GUI representation for file upload questions. More...

+ Inheritance diagram for assFileUploadGUI:
+ Collaboration diagram for assFileUploadGUI:

Public Member Functions

 __construct ($id=-1)
 assFileUploadGUI constructor More...
 
 writePostData ($always=false)
 Evaluates a posted edit form and writes the form data in the question object. More...
 
 writeQuestionSpecificPostData ($always=false)
 
 editQuestion ($checkonly=FALSE)
 Creates an output of the edit form for the question. More...
 
 populateQuestionSpecificFormPart (ilPropertyFormGUI $form)
 
 determineMaxFilesize ()
 
 outQuestionForTest ($formaction, $active_id, $pass=NULL, $is_postponed=FALSE, $use_post_solutions=FALSE, $show_feedback=FALSE)
 
 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. More...
 
 getPreview ($show_question_only=FALSE)
 
 getTestOutput ($active_id, $pass=NULL, $is_postponed=FALSE, $use_post_solutions=FALSE, $show_feedback=FALSE)
 
 setQuestionTabs ()
 Sets the ILIAS tabs for this question type. More...
 
 getSpecificFeedbackOutput ($active_id, $pass)
 
 getAfterParticipationSuppressionQuestionPostVars ()
 Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment. More...
 
 getAggregatedAnswersView ($relevant_answers)
 Returns an html string containing a question specific representation of the answers so far given in the test for use in the right column in the scoring adjustment user interface. More...
 
- Public Member Functions inherited from assQuestionGUI
 __construct ()
 assQuestionGUI constructor More...
 
executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 
 getType ()
 needed for page editor compliance More...
 
 setTaxonomyIds ($taxonomyIds)
 
 getTaxonomyIds ()
 
 setTargetGui (ilTestPlayerAbstractGUI $linkTargetGui)
 
 setTargetGuiClass ($targetGuiClass)
 
 getTargetGuiClass ()
 
 writePostData ()
 Evaluates a posted edit form and writes the form data in the question object. More...
 
 assessment ()
 output assessment More...
 
_getQuestionGUI ($question_type, $question_id=-1)
 Creates a question gui representation and returns the alias to the question gui note: please do not use $this inside this method to allow static calls. More...
 
 _getGUIClassNameForId ($a_q_id)
 
 _getClassNameForQType ($q_type)
 
createQuestionGUI ($question_type, $question_id=-1)
 Creates a question gui representation. More...
 
 getQuestionTemplate ()
 get question template More...
 
 getILIASPage ($html="")
 Returns the ILIAS Page around a question. More...
 
 outQuestionPage ($a_temp_var, $a_postponed=false, $active_id="", $html="")
 output question page More...
 
 cancel ()
 cancel action More...
 
 originalSyncForm ($return_to="", $return_to_feedback='')
 
 sync ()
 
 cancelSync ()
 
 saveEdit ()
 save question More...
 
 save ()
 save question More...
 
 saveReturn ()
 save question More...
 
 apply ()
 apply changes More...
 
 getContextPath ($cont_obj, $a_endnode_id, $a_startnode_id=1)
 get context path in content object tree More...
 
 setSequenceNumber ($nr)
 
 getSequenceNumber ()
 
 setQuestionCount ($a_question_count)
 
 getQuestionCount ()
 
 getErrorMessage ()
 
 setErrorMessage ($errormessage)
 
 addErrorMessage ($errormessage)
 
 outAdditionalOutput ()
 
 getQuestionType ()
 Returns the question type string. More...
 
 getAsValueAttribute ($a_value)
 Returns a HTML value attribute. More...
 
 addNewIdListener (&$a_object, $a_method, $a_parameters="")
 Add a listener that is notified with the new question ID, when a new question is saved. More...
 
 callNewIdListeners ($a_new_id)
 Call the new id listeners. More...
 
 addQuestionFormCommandButtons ($form)
 Add the command buttons of a question properties form. More...
 
 addBasicQuestionFormProperties ($form)
 Add basic question form properties: assessment: title, author, description, question, working time. More...
 
 getSelfAssessmentTags ()
 Get tags allowed in question tags in self assessment mode. More...
 
 getAnswerFeedbackOutput ($active_id, $pass)
 Returns the answer generic feedback depending on the results of the question. More...
 
 getGenericFeedbackOutput ($active_id, $pass)
 Returns the answer specific feedback for the question. More...
 
 getSpecificFeedbackOutput ($active_id, $pass)
 Returns the answer specific feedback for the question. More...
 
 outQuestionType ()
 
 showSuggestedSolution ()
 
 suggestedsolution ()
 Allows to add suggested solutions for questions. More...
 
 outSolutionExplorer ()
 
 saveSuggestedSolution ()
 
 cancelExplorer ()
 
 outPageSelector ()
 
 outChapterSelector ()
 
 outGlossarySelector ()
 
 linkChilds ()
 
 addPG ()
 
 addST ()
 
 addGIT ()
 
 isSaveCommand ()
 
 setQuestionTabs ()
 
 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)
 
 isAutosaveable ()
 
 showHints ()
 

Additional Inherited Members

- Static Public Member Functions inherited from assQuestionGUI
static getCommandsFromClassConstants ($guiClassName, $cmdConstantNameBegin='CMD_')
 extracts values of all constants of given class with given prefix as array can be used to get all possible commands in case of these commands are defined as constants More...
 
- Data Fields inherited from assQuestionGUI
const FORM_MODE_EDIT = 'edit'
 
const FORM_MODE_ADJUST = 'adjust'
 
 $object
 
 $tpl
 
 $lng
 
 $error
 
 $errormessage
 
 $sequence_no
 sequence number in test More...
 
 $question_count
 question count in test More...
 
- Protected Member Functions inherited from assQuestionGUI
 saveTaxonomyAssignments ()
 
 populateTaxonomyFormSection (ilPropertyFormGUI $form)
 
 addTab_QuestionFeedback (ilTabsGUI $tabs)
 adds the feedback tab to ilTabsGUI More...
 
 addTab_QuestionHints (ilTabsGUI $tabs)
 adds the hints tab to ilTabsGUI More...
 
 writeQuestionGenericPostData ()
 

Detailed Description

The assFileUploadGUI class encapsulates the GUI representation for file upload questions.

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Björn Heyser bheys.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

assFileUploadGUI: ilObjQuestionPoolGUI

Definition at line 22 of file class.assFileUploadGUI.php.

Constructor & Destructor Documentation

◆ __construct()

assFileUploadGUI::__construct (   $id = -1)

assFileUploadGUI constructor

The constructor takes possible arguments an creates an instance of the assFileUploadGUI object.

Parameters
integer$idThe database id of a single choice question object

Definition at line 32 of file class.assFileUploadGUI.php.

References assQuestionGUI\setErrorMessage().

33  {
34  parent::__construct();
35  include_once "./Modules/TestQuestionPool/classes/class.assFileUpload.php";
36  $this->object = new assFileUpload();
37  $this->setErrorMessage($this->lng->txt("msg_form_save_error"));
38  if ($id >= 0)
39  {
40  $this->object->loadFromDb($id);
41  }
42  }
Class for file upload questions.
setErrorMessage($errormessage)
+ Here is the call graph for this function:

Member Function Documentation

◆ determineMaxFilesize()

assFileUploadGUI::determineMaxFilesize ( )
Returns
mixed

Definition at line 153 of file class.assFileUploadGUI.php.

Referenced by populateQuestionSpecificFormPart().

154  {
155  //mbecker: Quick fix for mantis bug 8595: Change size file
156  $upload_max_filesize = get_cfg_var( "upload_max_filesize" );
157  // get the value for the maximal post data from the php.ini (if available)
158  $post_max_size = get_cfg_var( "post_max_size" );
159 
160  //convert from short-string representation to "real" bytes
161  $multiplier_a = array( "K" => 1024, "M" => 1024 * 1024, "G" => 1024 * 1024 * 1024 );
162  $umf_parts = preg_split( "/(\d+)([K|G|M])/",
163  $upload_max_filesize,
164  -1,
165  PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY
166  );
167  $pms_parts = preg_split( "/(\d+)([K|G|M])/",
168  $post_max_size,
169  -1,
170  PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY
171  );
172 
173  if (count( $umf_parts ) == 2)
174  {
175  $upload_max_filesize = $umf_parts[0] * $multiplier_a[$umf_parts[1]];
176  }
177 
178  if (count( $pms_parts ) == 2)
179  {
180  $post_max_size = $pms_parts[0] * $multiplier_a[$pms_parts[1]];
181  }
182 
183  // use the smaller one as limit
184  $max_filesize = min( $upload_max_filesize, $post_max_size );
185 
186  if (!$max_filesize)
187  {
188  $max_filesize = max( $upload_max_filesize, $post_max_size );
189  return $max_filesize;
190  }
191  return $max_filesize;
192  }
+ Here is the caller graph for this function:

◆ editQuestion()

assFileUploadGUI::editQuestion (   $checkonly = FALSE)

Creates an output of the edit form for the question.

public

Definition at line 77 of file class.assFileUploadGUI.php.

References $errors, assQuestionGUI\addBasicQuestionFormProperties(), assQuestionGUI\addQuestionFormCommandButtons(), assQuestionGUI\getQuestionTemplate(), assQuestionGUI\isSaveCommand(), assQuestionGUI\outQuestionType(), populateQuestionSpecificFormPart(), and assQuestionGUI\populateTaxonomyFormSection().

Referenced by writePostData().

78  {
79  $save = $this->isSaveCommand();
80  $this->getQuestionTemplate();
81 
82  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
83  $form = new ilPropertyFormGUI();
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 
90  $this->addBasicQuestionFormProperties($form);
91  $this->populateQuestionSpecificFormPart( $form );
92 
93  $this->populateTaxonomyFormSection($form);
94  $this->addQuestionFormCommandButtons($form);
95 
96  $errors = false;
97 
98  if ($save)
99  {
100  $form->setValuesByPost();
101  $errors = !$form->checkInput();
102  $form->setValuesByPost(); // again, because checkInput now performs the whole stripSlashes handling and
103  // we need this if we don't want to have duplication of backslashes
104  if ($errors) $checkonly = false;
105  }
106 
107  if (!$checkonly) $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
108  return $errors;
109  }
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question, working time.
This class represents a property form user interface.
$errors
getQuestionTemplate()
get question template
populateTaxonomyFormSection(ilPropertyFormGUI $form)
populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
addQuestionFormCommandButtons($form)
Add the command buttons of a question properties form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAfterParticipationSuppressionQuestionPostVars()

assFileUploadGUI::getAfterParticipationSuppressionQuestionPostVars ( )

Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment.

The form elements will be shown disabled, so the users see the usual form but can only edit the settings, which make sense in the given context.

E.g. array('cloze_type', 'image_filename')

Returns
string[]

Definition at line 506 of file class.assFileUploadGUI.php.

507  {
508  return array();
509  }

◆ getAggregatedAnswersView()

assFileUploadGUI::getAggregatedAnswersView (   $relevant_answers)

Returns an html string containing a question specific representation of the answers so far given in the test for use in the right column in the scoring adjustment user interface.

Parameters
array$relevant_answers
Returns
string

Definition at line 519 of file class.assFileUploadGUI.php.

520  {
521  // Empty implementation here since a feasible way to aggregate answer is not known.
522  return ''; //print_r($relevant_answers,true);
523  }

◆ getPreview()

assFileUploadGUI::getPreview (   $show_question_only = FALSE)

Definition at line 317 of file class.assFileUploadGUI.php.

References assQuestionGUI\getILIASPage().

318  {
319  $template = new ilTemplate("tpl.il_as_qpl_fileupload_output.html",TRUE, TRUE, "Modules/TestQuestionPool");
320  if (strlen($this->object->getAllowedExtensions()))
321  {
322  $template->setCurrentBlock("allowed_extensions");
323  $template->setVariable("TXT_ALLOWED_EXTENSIONS", $this->object->prepareTextareaOutput($this->lng->txt("allowedextensions") . ": " . $this->object->getAllowedExtensions()));
324  $template->parseCurrentBlock();
325  }
326  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->question, TRUE));
327  $template->setVariable("TEXT_UPLOAD", $this->object->prepareTextareaOutput($this->lng->txt('upload')));
328  $template->setVariable("TXT_UPLOAD_FILE", $this->object->prepareTextareaOutput($this->lng->txt('file_add')));
329  $template->setVariable("TXT_MAX_SIZE", $this->object->prepareTextareaOutput($this->lng->txt('file_notice') . " " . $this->object->getMaxFilesizeAsString()));
330 
331  $questionoutput = $template->get();
332  if (!$show_question_only)
333  {
334  // get page object output
335  $questionoutput = $this->getILIASPage($questionoutput);
336  }
337  return $questionoutput;
338  }
getILIASPage($html="")
Returns the ILIAS Page around a question.
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:

◆ getSolutionOutput()

assFileUploadGUI::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.

Parameters
integer$active_idThe active user id
integer$passThe test pass
boolean$graphicalOutputShow visual feedback for right/wrong answers
boolean$result_outputShow the reached points for parts of the question
boolean$show_question_onlyShow the question without the ILIAS content around
boolean$show_feedbackShow the question feedback
boolean$show_correct_solutionShow the correct solution instead of the user solution
boolean$show_manual_scoringShow specific information for the manual scoring output
Returns
The solution output of the question as HTML code

Definition at line 215 of file class.assFileUploadGUI.php.

References $pass, ilObjTest\_getPass(), ilObjTest\_getUsePreviousAnswers(), assQuestionGUI\getAnswerFeedbackOutput(), and ilUtil\getImagePath().

226  {
227  // get the solution of the user for the active pass or from the last pass if allowed
228  $template = new ilTemplate("tpl.il_as_qpl_fileupload_output_solution.html", TRUE, TRUE, "Modules/TestQuestionPool");
229 
230  $solutionvalue = "";
231  if (($active_id > 0) && (!$show_correct_solution))
232  {
233  $solutions =& $this->object->getSolutionValues($active_id, $pass);
234  include_once "./Modules/Test/classes/class.ilObjTest.php";
235  if (!ilObjTest::_getUsePreviousAnswers($active_id, true))
236  {
237  if (is_null($pass)) $pass = ilObjTest::_getPass($active_id);
238  }
239  $solutions =& $this->object->getSolutionValues($active_id, $pass);
240 
241  $files = ($show_manual_scoring) ? $this->object->getUploadedFilesForWeb($active_id, $pass) : $this->object->getUploadedFiles($active_id, $pass);
242  if (count($files))
243  {
244  include_once "./Modules/TestQuestionPool/classes/tables/class.assFileUploadFileTableGUI.php";
245  $table_gui = new assFileUploadFileTableGUI("iltestoutputgui", 'gotoquestion');
246  $table_gui->setTitle($this->lng->txt('already_delivered_files'), 'icon_file.png', $this->lng->txt('already_delivered_files'));
247  $table_gui->setData($files);
248  $table_gui->setRowTemplate("tpl.il_as_qpl_fileupload_file_view_row.html", "Modules/TestQuestionPool");
249  $table_gui->setSelectAllCheckbox("");
250  $table_gui->clearCommandButtons();
251  $table_gui->disable('select_all');
252  $table_gui->disable('numinfo');
253  $template->setCurrentBlock("files");
254  $template->setVariable('FILES', $table_gui->getHTML());
255  $template->parseCurrentBlock();
256  }
257  }
258 
259  if (($active_id > 0) && (!$show_correct_solution))
260  {
261  $reached_points = $this->object->getReachedPoints($active_id, $pass);
262  if ($graphicalOutput)
263  {
264  // output of ok/not ok icons for user entered solutions
265  if ($reached_points == $this->object->getMaximumPoints())
266  {
267  $template->setCurrentBlock("icon_ok");
268  $template->setVariable("ICON_OK", ilUtil::getImagePath("icon_ok.png"));
269  $template->setVariable("TEXT_OK", $this->lng->txt("answer_is_right"));
270  $template->parseCurrentBlock();
271  }
272  else
273  {
274  $template->setCurrentBlock("icon_ok");
275  if ($reached_points > 0)
276  {
277  $template->setVariable("ICON_NOT_OK", ilUtil::getImagePath("icon_mostly_ok.png"));
278  $template->setVariable("TEXT_NOT_OK", $this->lng->txt("answer_is_not_correct_but_positive"));
279  }
280  else
281  {
282  $template->setVariable("ICON_NOT_OK", ilUtil::getImagePath("icon_not_ok.png"));
283  $template->setVariable("TEXT_NOT_OK", $this->lng->txt("answer_is_wrong"));
284  }
285  $template->parseCurrentBlock();
286  }
287  }
288  }
289  else
290  {
291  $reached_points = $this->object->getPoints();
292  }
293 
294  if ($result_output)
295  {
296  $resulttext = ($reached_points == 1) ? "(%s " . $this->lng->txt("point") . ")" : "(%s " . $this->lng->txt("points") . ")";
297  $template->setVariable("RESULT_OUTPUT", sprintf($resulttext, $reached_points));
298  }
299  if ($show_question_text==true)
300  {
301  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE));
302  }
303  $questionoutput = $template->get();
304  $solutiontemplate = new ilTemplate("tpl.il_as_tst_solution_output.html",TRUE, TRUE, "Modules/TestQuestionPool");
305  $feedback = ($show_feedback) ? $this->getAnswerFeedbackOutput($active_id, $pass) : "";
306  if (strlen($feedback)) $solutiontemplate->setVariable("FEEDBACK", $feedback);
307  $solutiontemplate->setVariable("SOLUTION_OUTPUT", $questionoutput);
308  $solutionoutput = $solutiontemplate->get();
309  if (!$show_question_only)
310  {
311  // get page object output
312  $solutionoutput = '<div class="ilc_question_Standard">'.$solutionoutput."</div>";
313  }
314  return $solutionoutput;
315  }
_getPass($active_id)
Retrieves the actual pass of a given user for a given test.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
_getUsePreviousAnswers($active_id, $user_active_user_setting=false)
Returns if the previous results should be hidden for a learner.
getAnswerFeedbackOutput($active_id, $pass)
Returns the answer generic feedback depending on the results of the question.
+ Here is the call graph for this function:

◆ getSpecificFeedbackOutput()

assFileUploadGUI::getSpecificFeedbackOutput (   $active_id,
  $pass 
)

Definition at line 491 of file class.assFileUploadGUI.php.

492  {
493  $output = "";
494  return $this->object->prepareTextareaOutput($output, TRUE);
495  }

◆ getTestOutput()

assFileUploadGUI::getTestOutput (   $active_id,
  $pass = NULL,
  $is_postponed = FALSE,
  $use_post_solutions = FALSE,
  $show_feedback = FALSE 
)

Definition at line 340 of file class.assFileUploadGUI.php.

References $pass, ilObjTest\_getPass(), ilObjTest\_getUsePreviousAnswers(), assQuestionGUI\getILIASPage(), and assQuestionGUI\outQuestionPage().

Referenced by outQuestionForTest().

341  {
342  // generate the question output
343  $template = new ilTemplate("tpl.il_as_qpl_fileupload_output.html",TRUE, TRUE, "Modules/TestQuestionPool");
344 
345  if ($active_id)
346  {
347  $solutions = NULL;
348  include_once "./Modules/Test/classes/class.ilObjTest.php";
349  if (!ilObjTest::_getUsePreviousAnswers($active_id, true))
350  {
351  if (is_null($pass)) $pass = ilObjTest::_getPass($active_id);
352  }
353  $solutions =& $this->object->getSolutionValues($active_id, $pass);
354 
355  $files = $this->object->getUploadedFiles($active_id, $pass);
356  if (count($files))
357  {
358  include_once "./Modules/TestQuestionPool/classes/tables/class.assFileUploadFileTableGUI.php";
359  $table_gui = new assFileUploadFileTableGUI(null , 'handleQuestionAction');
360  $table_gui->setTitle($this->lng->txt('already_delivered_files'), 'icon_file.png', $this->lng->txt('already_delivered_files'));
361  $table_gui->setData($files);
362  $template->setCurrentBlock("files");
363  $template->setVariable('FILES', $table_gui->getHTML());
364  $template->parseCurrentBlock();
365  }
366  }
367 
368  if (strlen($this->object->getAllowedExtensions()))
369  {
370  $template->setCurrentBlock("allowed_extensions");
371  $template->setVariable("TXT_ALLOWED_EXTENSIONS", $this->object->prepareTextareaOutput($this->lng->txt("allowedextensions") . ": " . $this->object->getAllowedExtensions()));
372  $template->parseCurrentBlock();
373  }
374  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->question, TRUE));
375  $template->setVariable("CMD_UPLOAD", 'handleQuestionAction');
376  $template->setVariable("TEXT_UPLOAD", $this->object->prepareTextareaOutput($this->lng->txt('upload')));
377  $template->setVariable("TXT_UPLOAD_FILE", $this->object->prepareTextareaOutput($this->lng->txt('file_add')));
378  $template->setVariable("TXT_MAX_SIZE", $this->object->prepareTextareaOutput($this->lng->txt('file_notice') . " " . $this->object->getMaxFilesizeAsString()));
379 
380  $questionoutput = $template->get();
381  if (!$show_question_only)
382  {
383  // get page object output
384  $questionoutput = $this->getILIASPage($questionoutput);
385  }
386  $questionoutput = $template->get();
387  $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput);
388  return $pageoutput;
389  }
_getPass($active_id)
Retrieves the actual pass of a given user for a given test.
getILIASPage($html="")
Returns the ILIAS Page around a question.
special template class to simplify handling of ITX/PEAR
_getUsePreviousAnswers($active_id, $user_active_user_setting=false)
Returns if the previous results should be hidden for a learner.
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="")
output question page
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outQuestionForTest()

assFileUploadGUI::outQuestionForTest (   $formaction,
  $active_id,
  $pass = NULL,
  $is_postponed = FALSE,
  $use_post_solutions = FALSE,
  $show_feedback = FALSE 
)

Definition at line 194 of file class.assFileUploadGUI.php.

References $pass, and getTestOutput().

195  {
196  $test_output = $this->getTestOutput($active_id, $pass, $is_postponed, $use_post_solutions, $show_feedback);
197  $this->tpl->setVariable("QUESTION_OUTPUT", $test_output);
198  $this->tpl->setVariable("FORMACTION", $formaction);
199  $this->tpl->setVariable("ENCTYPE", 'enctype="multipart/form-data"');
200  }
getTestOutput($active_id, $pass=NULL, $is_postponed=FALSE, $use_post_solutions=FALSE, $show_feedback=FALSE)
+ Here is the call graph for this function:

◆ populateQuestionSpecificFormPart()

assFileUploadGUI::populateQuestionSpecificFormPart ( ilPropertyFormGUI  $form)

Definition at line 111 of file class.assFileUploadGUI.php.

References ilPropertyFormGUI\addItem(), determineMaxFilesize(), ilFormPropertyGUI\setInfo(), and ilNumberInputGUI\setValue().

Referenced by editQuestion().

112  {
113  // maxsize
114  $maxsize = new ilNumberInputGUI($this->lng->txt( "maxsize" ), "maxsize");
115  $maxsize->setValue( $this->object->getMaxSize() );
116  $maxsize->setInfo( $this->lng->txt( "maxsize_info" ) );
117  $maxsize->setSize( 10 );
118  $maxsize->setMinValue( 0 );
119  $maxsize->setMaxValue( $this->determineMaxFilesize() );
120  $maxsize->setRequired( FALSE );
121  $form->addItem( $maxsize );
122 
123  // allowedextensions
124  $allowedextensions = new ilTextInputGUI($this->lng->txt( "allowedextensions" ), "allowedextensions");
125  $allowedextensions->setInfo( $this->lng->txt( "allowedextensions_info" ) );
126  $allowedextensions->setValue( $this->object->getAllowedExtensions() );
127  $allowedextensions->setRequired( FALSE );
128  $form->addItem( $allowedextensions );
129 
130  // points
131  $points = new ilNumberInputGUI($this->lng->txt( "points" ), "points");
132  $points->setValue( is_numeric( $this->object->getPoints() ) && $this->object->getPoints(
133  ) >= 0 ? $this->object->getPoints() : ''
134  );
135  $points->setRequired( TRUE );
136  $points->setSize( 3 );
137  $points->setMinValue( 0.0 );
138  $points->setMinvalueShouldBeGreater( false );
139  $form->addItem( $points );
140 
141  $subcompl = new ilCheckboxInputGUI($this->lng->txt( 'ass_completion_by_submission'
142  ), 'completion_by_submission');
143  $subcompl->setInfo( $this->lng->txt( 'ass_completion_by_submission_info' ) );
144  $subcompl->setValue( 1 );
145  $subcompl->setChecked( $this->object->isCompletionBySubmissionEnabled() );
146  $form->addItem( $subcompl );
147  return $form;
148  }
setValue($a_value)
Set Value.
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
setInfo($a_info)
Set Information Text.
This class represents a number property in a property form.
This class represents a text property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setQuestionTabs()

assFileUploadGUI::setQuestionTabs ( )

Sets the ILIAS tabs for this question type.

public

Todo:
: MOVE THIS STEPS TO COMMON QUESTION CLASS assQuestionGUI

Definition at line 398 of file class.assFileUploadGUI.php.

References $_GET, $ref_id, assQuestionGUI\addTab_QuestionFeedback(), assQuestionGUI\addTab_QuestionHints(), and ilTestExpressPage\getReturnToPageLink().

399  {
400  global $rbacsystem, $ilTabs;
401 
402  $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
403  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
404  $q_type = $this->object->getQuestionType();
405 
406  if (strlen($q_type))
407  {
408  $classname = $q_type . "GUI";
409  $this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
410  $this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
411  }
412 
413  if ($_GET["q_id"])
414  {
415  if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
416  {
417  // edit page
418  $ilTabs->addTarget("edit_page",
419  $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
420  array("edit", "insert", "exec_pg"),
421  "", "", $force_active);
422  }
423 
424  // edit page
425  $ilTabs->addTarget("preview",
426  $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "preview"),
427  array("preview"),
428  "ilAssQuestionPageGUI", "", $force_active);
429  }
430 
431  $force_active = false;
432  if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
433  {
434  $url = "";
435  if ($classname) $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
436  // edit question properties
437  $ilTabs->addTarget("edit_question",
438  $url,
439  array("editQuestion", "save", "cancel", "saveEdit"),
440  $classname, "");
441  }
442 
443  // add tab for question feedback within common class assQuestionGUI
444  $this->addTab_QuestionFeedback($ilTabs);
445 
446  // add tab for question hint within common class assQuestionGUI
447  $this->addTab_QuestionHints($ilTabs);
448 
449  if ($_GET["q_id"])
450  {
451  $ilTabs->addTarget("solution_hint",
452  $this->ctrl->getLinkTargetByClass($classname, "suggestedsolution"),
453  array("suggestedsolution", "saveSuggestedSolution", "outSolutionExplorer", "cancel",
454  "addSuggestedSolution","cancelExplorer", "linkChilds", "removeSuggestedSolution"
455  ),
456  $classname,
457  ""
458  );
459  }
460 
461  // Assessment of questions sub menu entry
462  if ($_GET["q_id"])
463  {
464  $ilTabs->addTarget("statistics",
465  $this->ctrl->getLinkTargetByClass($classname, "assessment"),
466  array("assessment"),
467  $classname, "");
468  }
469 
470  if (($_GET["calling_test"] > 0) || ($_GET["test_ref_id"] > 0))
471  {
472  $ref_id = $_GET["calling_test"];
473  if (strlen($ref_id) == 0) $ref_id = $_GET["test_ref_id"];
474 
475  global $___test_express_mode;
476 
477  if (!$_GET['test_express_mode'] && !$___test_express_mode) {
478  $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), "ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
479  }
480  else {
482  $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), $link);
483  }
484  }
485  else
486  {
487  $ilTabs->setBackTarget($this->lng->txt("qpl"), $this->ctrl->getLinkTargetByClass("ilobjquestionpoolgui", "questions"));
488  }
489  }
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
$_GET["client_id"]
static getReturnToPageLink($q_id=null)
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ writePostData()

assFileUploadGUI::writePostData (   $always = false)

Evaluates a posted edit form and writes the form data in the question object.

Parameters
bool$always
Returns
integer A positive value, if one of the required fields wasn't set, else 0

Definition at line 51 of file class.assFileUploadGUI.php.

References editQuestion(), assQuestionGUI\saveTaxonomyAssignments(), assQuestionGUI\writeQuestionGenericPostData(), and writeQuestionSpecificPostData().

52  {
53  $hasErrors = (!$always) ? $this->editQuestion(true) : false;
54  if (!$hasErrors)
55  {
58  $this->saveTaxonomyAssignments();
59  return 0;
60  }
61  return 1;
62  }
writeQuestionSpecificPostData($always=false)
editQuestion($checkonly=FALSE)
Creates an output of the edit form for the question.
+ Here is the call graph for this function:

◆ writeQuestionSpecificPostData()

assFileUploadGUI::writeQuestionSpecificPostData (   $always = false)

Definition at line 64 of file class.assFileUploadGUI.php.

References $_POST.

Referenced by writePostData().

65  {
66  $this->object->setPoints( $_POST["points"] );
67  $this->object->setMaxSize( $_POST["maxsize"] );
68  $this->object->setAllowedExtensions( $_POST["allowedextensions"] );
69  $this->object->setCompletionBySubmission( $_POST['completion_by_submission'] == 1 ? true : false );
70  }
$_POST['username']
Definition: cron.php:12
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: