ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
assFileUploadGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct (int $id=-1)
 assFileUploadGUI constructor More...
 
 writeQuestionSpecificPostData (ilPropertyFormGUI $form)
 Extracts the question specific values from the request and applies them to the data object. More...
 
 editQuestion (bool $checkonly=false, ?bool $is_save_cmd=null)
 
 populateQuestionSpecificFormPart (ilPropertyFormGUI $form)
 Adds the question specific forms parts to a question property form gui. More...
 
 getSolutionOutput (int $active_id, ?int $pass=null, bool $graphical_output=false, bool $result_output=false, bool $show_question_only=true, bool $show_feedback=false, bool $show_correct_solution=false, bool $show_manual_scoring=false, bool $show_question_text=true, bool $show_inline_feedback=true)
 
 getPreview (bool $show_question_only=false, bool $show_inline_feedback=false)
 
 getTestOutput (int $active_id, int $pass, bool $is_question_postponed=false, array|bool $user_post_solutions=false, bool $show_specific_inline_feedback=false)
 
 getSpecificFeedbackOutput (array $userSolution)
 
 getAfterParticipationSuppressionQuestionPostVars ()
 Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment. More...
 
 getFormEncodingType ()
 
 isAnswerFreuqencyStatisticSupported ()
 
 populateCorrectionsFormProperties (ilPropertyFormGUI $form)
 
 saveCorrectionsFormProperties (ilPropertyFormGUI $form)
 
- Public Member Functions inherited from assQuestionGUI
 editQuestion (bool $checkonly=false, ?bool $is_save_cmd=null)
 
 getSpecificFeedbackOutput (array $userSolution)
 Returns the answer specific feedback for the question. More...
 
 getSolutionOutput (int $active_id, ?int $pass=null, bool $graphical_output=false, bool $result_output=false, bool $show_question_only=true, bool $show_feedback=false, bool $show_correct_solution=false, bool $show_manual_scoring=false, bool $show_question_text=true, bool $show_inline_feedback=true)
 
 getPreview (bool $show_question_only=false, bool $show_inline_feedback=false)
 
 getTestOutput (int $active_id, int $pass, bool $is_question_postponed=false, array|bool $user_post_solutions=false, bool $show_specific_inline_feedback=false)
 
 renderSolutionOutput (mixed $user_solutions, int $active_id, ?int $pass, bool $graphical_output=false, bool $result_output=false, bool $show_question_only=true, bool $show_feedback=false, bool $show_correct_solution=false, bool $show_manual_scoring=false, bool $show_question_text=true, bool $show_autosave_title=false, bool $show_inline_feedback=false,)
 
 getObject ()
 
 setObject (assQuestion $question)
 
 setCopyToExistingPoolOnSave (?int $pool_ref_id)
 
 getCopyToExistingPoolOnSave ()
 
 setCopyToNewPoolOnSave (?string $pool_title)
 
 getCopyToNewPoolOnSave ()
 
 setMoveAfterQuestionId (?int $question_id)
 
 getMoveAfterQuestionId ()
 
 hasInlineFeedback ()
 
 addHeaderAction ()
 
 redrawHeaderAction ()
 
 getHeaderAction ()
 
 getCommentsPanelHTML ()
 
 executeCommand ()
 
 getType ()
 needed for page editor compliance More...
 
 getPresentationContext ()
 
 setPresentationContext (string $presentationContext)
 
 isTestPresentationContext ()
 
 isPreviousSolutionPrefilled ()
 
 setPreviousSolutionPrefilled (bool $previousSolutionPrefilled)
 
 getRenderPurpose ()
 
 setRenderPurpose (string $renderPurpose)
 
 isRenderPurposePrintPdf ()
 
 isRenderPurposePreview ()
 
 isRenderPurposeInputValue ()
 
 isRenderPurposePlayback ()
 
 isRenderPurposeDemoplay ()
 
 renderPurposeSupportsFormHtml ()
 
 getEditContext ()
 
 setEditContext (string $editContext)
 
 isAuthoringEditContext ()
 
 isAdjustmentEditContext ()
 
 setAdjustmentEditContext ()
 
 getNavigationGUI ()
 
 setNavigationGUI (?ilTestQuestionNavigationGUI $navigationGUI)
 
 setTaxonomyIds (array $taxonomyIds)
 
 getTaxonomyIds ()
 
 setTargetGui ($linkTargetGui)
 
 setTargetGuiClass (string $targetGuiClass)
 
 getTargetGuiClass ()
 
 setQuestionHeaderBlockBuilder (\ilQuestionHeaderBlockBuilder $questionHeaderBlockBuilder)
 
 getQuestionHeaderBlockBuilder ()
 
 setQuestionActionCmd (string $questionActionCmd)
 
 getQuestionActionCmd ()
 
 assessment ()
 
 populateJavascriptFilesRequiredForWorkForm (ilGlobalTemplateInterface $tpl)
 
 getPresentationJavascripts ()
 
 getQuestionTemplate ()
 
 getILIASPage (string $html="")
 Returns the ILIAS Page around a question. More...
 
 outQuestionPage ($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
 
 syncQuestion ()
 
 saveReturn ()
 
 saveQuestion ()
 
 setAdditionalContentEditingModeFromPost ()
 
 getContextPath ($cont_obj, int $a_endnode_id, int $a_startnode_id=1)
 get context path in content object tree More...
 
 setSequenceNumber (int $nr)
 
 getSequenceNumber ()
 
 setQuestionCount (int $a_question_count)
 
 getQuestionCount ()
 
 getErrorMessage ()
 
 setErrorMessage (string $errormessage)
 
 addErrorMessage (string $errormessage)
 
 getQuestionType ()
 
 getAsValueAttribute (string $a_value)
 
 addQuestionFormCommandButtons (ilPropertyFormGUI $form)
 
 addBasicQuestionFormProperties (ilPropertyFormGUI $form)
 
 getGenericFeedbackOutput (int $active_id, ?int $pass)
 
 getGenericFeedbackOutputForCorrectSolution ()
 
 getGenericFeedbackOutputForIncorrectSolution ()
 
 outQuestionType ()
 
 saveSuggestedSolution ()
 
 cancelSuggestedSolution ()
 
 suggestedsolution (bool $save=false)
 
 outSolutionExplorer ()
 
 saveSuggestedSolutionType ()
 
 cancelExplorer ()
 
 outPageSelector ()
 
 outChapterSelector ()
 
 outGlossarySelector ()
 
 linkChilds ()
 
 addPG ()
 
 addST ()
 
 addGIT ()
 
 isSaveCommand ()
 
 setQuestionTabs ()
 
 addTab_SuggestedSolution (ilTabsGUI $tabs, string $classname)
 
 getEditQuestionTabCommands ()
 
 isAutosaveable ()
 
 outQuestionForTest (string $formaction, int $active_id, ?int $pass, bool $is_question_postponed=false, array|bool $user_post_solutions=false, bool $show_specific_inline_feedback=false)
 
 magicAfterTestOutput ()
 
 getFormEncodingType ()
 
 setPreviewSession (ilAssQuestionPreviewSession $preview_session)
 
 getPreviewSession ()
 
 showHints ()
 
 buildFocusAnchorHtml ()
 
 isAnswerFrequencyStatisticSupported ()
 
 getSubQuestionsIndex ()
 
 getAnswersFrequency ($relevantAnswers, $questionIndex)
 
 getAnswerFrequencyTableGUI ($parentGui, $parentCmd, $relevantAnswers, $questionIndex)
 
 prepareReprintableCorrectionsForm (ilPropertyFormGUI $form)
 
 populateCorrectionsFormProperties (ilPropertyFormGUI $form)
 
 saveCorrectionsFormProperties (ilPropertyFormGUI $form)
 
 isInLearningModuleContext ()
 
 setInLearningModuleContext (bool $flag)
 
 cmdNeedsExistingQuestion (string $cmd)
 
 setContextAllowsSyncToPool (bool $sync_allowed)
 
 needsSyncQuery ()
 
 getQuestionSyncModal (string $cmd, string $cmd_class='')
 
 getAutoSavedSolutionOutput (int $active_id, int $pass, bool $graphical_output=false, bool $result_output=false, bool $show_question_only=true, bool $show_feedback=false, bool $show_correct_solution=false, bool $show_manual_scoring=false, bool $show_question_text=true, bool $show_autosave_title=false, bool $show_inline_feedback=false)
 

Data Fields

const REUSE_FILES_LANGVAR = 'ass_file_upload_reuse_btn'
 
const REUSE_FILES_ACTION = 'reuse'
 
const DELETE_FILES_LANGVAR = 'delete'
 
const DELETE_FILES_ACTION = 'delete'
 
- Data Fields inherited from assQuestionGUI
const ALLOWED_PLAIN_TEXT_TAGS = "<em>, <strong>"
 sk - 12.05.2023: This const is also used in ilKprimChoiceWizardInputGUI. More...
 
const SESSION_PREVIEW_DATA_BASE_INDEX = 'ilAssQuestionPreviewAnswers'
 
const FORM_MODE_EDIT = 'edit'
 
const FORM_MODE_ADJUST = 'adjust'
 
const FORM_ENCODING_URLENCODE = 'application/x-www-form-urlencoded'
 
const FORM_ENCODING_MULTIPART = 'multipart/form-data'
 
const CORRECTNESS_NOT_OK = 0
 
const CORRECTNESS_MOSTLY_OK = 1
 
const CORRECTNESS_OK = 2
 
const RENDER_PURPOSE_PLAYBACK = 'renderPurposePlayback'
 
const RENDER_PURPOSE_DEMOPLAY = 'renderPurposeDemoplay'
 
const RENDER_PURPOSE_PREVIEW = 'renderPurposePreview'
 
const RENDER_PURPOSE_PRINT_PDF = 'renderPurposePrintPdf'
 
const RENDER_PURPOSE_INPUT_VALUE = 'renderPurposeInputValue'
 
const EDIT_CONTEXT_AUTHORING = 'authoring'
 
const EDIT_CONTEXT_ADJUSTMENT = 'adjustment'
 
const PRESENTATION_CONTEXT_TEST = 'pContextTest'
 
const PRESENTATION_CONTEXT_RESULTS = 'pContextResults'
 
const CMD_SYNC_QUESTION_AND_RETURN = 'syncQuestionReturn'
 

Protected Member Functions

 writePostData (bool $always=false)
 {} More...
 
 getTestPresentationFileTablePostVar ()
 
 getPreviousSolutionProvidedMessage ()
 
 getPreviousSolutionConfirmationCheckboxHtml ()
 
- Protected Member Functions inherited from assQuestionGUI
 hasSpecialQuestionCommands ()
 
 writePostData (bool $always=false)
 Evaluates a posted edit form and writes the form data in the question object. More...
 
 renderEditForm (ilPropertyFormGUI $form)
 
 getUseUnchangedAnswerCheckboxHtml ()
 
 getPreviousSolutionProvidedMessage ()
 
 getPreviousSolutionConfirmationCheckboxHtml ()
 
 setTestSpecificProperties ()
 
 addNumberOfTriesToFormIfNecessary (ilPropertyFormGUI $form)
 
 saveTaxonomyAssignments ()
 
 populateTaxonomyFormSection (ilPropertyFormGUI $form)
 
 genericFeedbackOutputBuilder (string $feedback_correct, string $feedback_incorrect, int $active_id, ?int $pass)
 
 getTypeOptions ()
 
 createSuggestedSolutionLinkingTo (string $type, string $target)
 
 setDefaultTabs (ilTabsGUI $tabs_gui)
 
 setQuestionSpecificTabs (ilTabsGUI $tabs_gui)
 
 getBasicEditQuestionTabCommands ()
 
 getAdditionalEditQuestionCommands ()
 
 addTab_QuestionFeedback (ilTabsGUI $tabs)
 
 addTab_QuestionHints (ilTabsGUI $tabs)
 
 addTab_Question (ilTabsGUI $tabs_gui)
 
 hasCorrectSolution ($activeId, $passIndex)
 
 writeQuestionGenericPostData ()
 
 completeTestOutputFormAction (string $form_action, int $active_id, int $pass)
 
 addBackTab (ilTabsGUI $tabs_gui)
 
 buildBasicEditFormObject ()
 
 escapeTemplatePlaceholders (string $text)
 
 buildEditForm ()
 
 generateCorrectnessIconsForCorrectness (int $correctness)
 
 getSuggestedSolutionsRepo ()
 
 cleanupAnswerText (array $answer_text, bool $is_rte)
 sk - 12.05.2023: This is one more of those that we need, but don't want. More...
 
 addSaveOnEnterOnLoadCode ()
 

Private Member Functions

 getCommandButtonLangVarAndAction ()
 

Private Attributes

const HANDLE_FILE_UPLOAD = 'handleFileUpload'
 

Additional Inherited Members

- Static Public Member Functions inherited from assQuestionGUI
static _getQuestionGUI (string $question_type='', int $question_id=-1)
 Creates a question gui representation and returns the alias to the question gui. More...
 
static getCommandsFromClassConstants (string $guiClassName, string $cmdConstantNameBegin='CMD_')
 
static prepareTextareaOutput (?string $txt_output, bool $prepare_for_latex_output=false, bool $omitNl2BrWhenTextArea=false)
 Prepares a string for a text area output where latex code may be in it If the text is HTML-free, CHR(13) will be converted to a line break. More...
 
- Protected Attributes inherited from assQuestionGUI
const HAS_SPECIAL_QUESTION_COMMANDS = false
 
const SUGGESTED_SOLUTION_COMMANDS_CANCEL = 'cancelSuggestedSolution'
 
const SUGGESTED_SOLUTION_COMMANDS_SAVE = 'saveSuggestedSolution'
 
const SUGGESTED_SOLUTION_COMMANDS_DEFAULT = 'suggestedsolution'
 
const QUESTION_SAVE_CMDS
 
const ADDITIONAL_CMDS_NEEDING_EXISTING_QST
 There are functions that need an existing question. More...
 
ilLogger $logger
 
GeneralQuestionPropertiesRepository $questionrepository
 
GUIService $notes_gui
 
ilCtrl $ctrl
 
assQuestion $object
 
ilGlobalPageTemplate $tpl
 
ilLanguage $lng
 
Refinery $refinery
 
 $error
 
string $errormessage
 
int $sequence_no
 sequence number in test More...
 
int $question_count
 question count in test More...
 
ilPropertyFormGUI $editForm = null
 
readonly ilTestLegacyFormsHelper $forms_helper
 
readonly RequestDataCollector $request_data_collector
 
bool $parent_type_is_lm = false
 
SuggestedSolutionsDatabaseRepository $suggestedsolution_repo = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 assFileUploadGUI: ilFormPropertyDispatchGUI

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

Constructor & Destructor Documentation

◆ __construct()

assFileUploadGUI::__construct ( int  $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 49 of file class.assFileUploadGUI.php.

References $id, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), and assQuestionGUI\setErrorMessage().

50  {
52 
53  $this->object = new assFileUpload();
54  $this->setErrorMessage($this->lng->txt('msg_form_save_error'));
55  if ($id >= 0) {
56  $this->object->loadFromDb($id);
57  }
58  }
Class for file upload questions.
setErrorMessage(string $errormessage)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ editQuestion()

assFileUploadGUI::editQuestion ( bool  $checkonly = false,
?bool  $is_save_cmd = null 
)

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

References assQuestionGUI\addBasicQuestionFormProperties(), assQuestionGUI\addQuestionFormCommandButtons(), ILIAS\Repository\ctrl(), assQuestionGUI\isSaveCommand(), assQuestionGUI\outQuestionType(), populateQuestionSpecificFormPart(), assQuestionGUI\populateTaxonomyFormSection(), and assQuestionGUI\renderEditForm().

Referenced by writePostData().

88  : bool {
89  $save = $is_save_cmd ?? $this->isSaveCommand();
90 
91  $form = new ilPropertyFormGUI();
92  $this->editForm = $form;
93 
94  $form->setFormAction($this->ctrl->getFormAction($this));
95  $form->setTitle($this->outQuestionType());
96  $form->setMultipart(false);
97  $form->setTableWidth("100%");
98  $form->setId("assfileupload");
99 
100  $this->addBasicQuestionFormProperties($form);
101  $this->populateQuestionSpecificFormPart($form);
102 
103  $this->populateTaxonomyFormSection($form);
104  $this->addQuestionFormCommandButtons($form);
105 
106  $errors = false;
107 
108  if ($save) {
109  $form->setValuesByPost();
110  $errors = !$form->checkInput();
111  $form->setValuesByPost(); // again, because checkInput now performs the whole stripSlashes handling and
112  // we need this if we don't want to have duplication of backslashes
113  if ($errors) {
114  $checkonly = false;
115  }
116  }
117 
118  if (!$checkonly) {
119  $this->renderEditForm($form);
120  }
121  return $errors;
122  }
addBasicQuestionFormProperties(ilPropertyFormGUI $form)
populateTaxonomyFormSection(ilPropertyFormGUI $form)
addQuestionFormCommandButtons(ilPropertyFormGUI $form)
populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
Adds the question specific forms parts to a question property form gui.
renderEditForm(ilPropertyFormGUI $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[]

Implements ilGuiQuestionScoringAdjustable.

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

379  : array
380  {
381  return [];
382  }

◆ getCommandButtonLangVarAndAction()

assFileUploadGUI::getCommandButtonLangVarAndAction ( )
private

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

References ILIAS\Repository\object().

Referenced by getPreview(), and getTestOutput().

356  : array
357  {
358  if ($this->object->getTestPresentationConfig()->isSolutionInitiallyPrefilled()) {
359  return [self::REUSE_FILES_LANGVAR, self::REUSE_FILES_ACTION];
360  }
361  return [self::DELETE_FILES_LANGVAR, self::DELETE_FILES_ACTION];
362  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFormEncodingType()

assFileUploadGUI::getFormEncodingType ( )

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

406  : string
407  {
408  return self::FORM_ENCODING_MULTIPART;
409  }

◆ getPreview()

assFileUploadGUI::getPreview ( bool  $show_question_only = false,
bool  $show_inline_feedback = false 
)

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

References assFileUpload\DELETE_FILES_TBL_POSTVAR, getCommandButtonLangVarAndAction(), assQuestionGUI\getILIASPage(), assQuestionGUI\getPreviewSession(), assQuestionGUI\getQuestionActionCmd(), ILIAS\Repository\lng(), null, ILIAS\Repository\object(), and ilLegacyFormElementsUtil\prepareTextareaOutput().

257  : string {
258  $template = new ilTemplate("tpl.il_as_qpl_fileupload_output.html", true, true, "components/ILIAS/TestQuestionPool");
259 
260  if (is_object($this->getPreviewSession())) {
261  $files = $this->object->getPreviewFileUploads($this->getPreviewSession());
262  $table_gui = new assFileUploadFileTableGUI(null, $this->getQuestionActionCmd(), 'ilAssQuestionPreview');
263  $table_gui->setTitle(
264  $this->lng->txt('already_delivered_files'),
265  'standard/icon_file.svg',
266  $this->lng->txt('already_delivered_files')
267  );
268  $table_gui->setData($files);
269  // hey: prevPassSolutions - support file reuse with table
270 
271  list($lang_var, $cmd) = $this->getCommandButtonLangVarAndAction();
272  $table_gui->initCommand(
273  $lang_var,
274  $cmd,
276  );
277  // hey.
278  $template->setCurrentBlock("files");
279  $template->setVariable('FILES', $table_gui->getHTML());
280  $template->parseCurrentBlock();
281  }
282 
283  if ($this->object->getAllowedExtensions() !== '') {
284  $template->setCurrentBlock("allowed_extensions");
285  $template->setVariable("TXT_ALLOWED_EXTENSIONS", ilLegacyFormElementsUtil::prepareTextareaOutput($this->lng->txt("allowedextensions") . ": " . $this->object->getAllowedExtensions()));
286  $template->parseCurrentBlock();
287  }
288  $template->setVariable("QUESTIONTEXT", $this->object->getQuestionForHTMLOutput());
289  $template->setVariable("CMD_UPLOAD", $this->getQuestionActionCmd());
290  $template->setVariable("TEXT_UPLOAD", ilLegacyFormElementsUtil::prepareTextareaOutput($this->lng->txt('upload')));
291  $template->setVariable("TXT_UPLOAD_FILE", ilLegacyFormElementsUtil::prepareTextareaOutput($this->lng->txt('file_add')));
292  $template->setVariable("TXT_MAX_SIZE", ilLegacyFormElementsUtil::prepareTextareaOutput($this->lng->txt('file_notice') . " " . $this->object->getMaxFilesizeAsString()));
293 
294  $questionoutput = $template->get();
295  if (!$show_question_only) {
296  // get page object output
297  $questionoutput = $this->getILIASPage($questionoutput);
298  }
299  return $questionoutput;
300  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getILIASPage(string $html="")
Returns the ILIAS Page around a question.
static prepareTextareaOutput(string $txt_output, bool $prepare_for_latex_output=false, bool $omitNl2BrWhenTextArea=false)
Prepares a string for a text area output where latex code may be in it If the text is HTML-free...
+ Here is the call graph for this function:

◆ getPreviousSolutionConfirmationCheckboxHtml()

assFileUploadGUI::getPreviousSolutionConfirmationCheckboxHtml ( )
protected

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

400  : string
401  {
402  return '';
403  }

◆ getPreviousSolutionProvidedMessage()

assFileUploadGUI::getPreviousSolutionProvidedMessage ( )
protected

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

References ILIAS\Repository\lng().

395  : string
396  {
397  return $this->lng->txt('use_previous_solution_advice_file_upload');
398  }
+ Here is the call graph for this function:

◆ getSolutionOutput()

assFileUploadGUI::getSolutionOutput ( int  $active_id,
?int  $pass = null,
bool  $graphical_output = false,
bool  $result_output = false,
bool  $show_question_only = true,
bool  $show_feedback = false,
bool  $show_correct_solution = false,
bool  $show_manual_scoring = false,
bool  $show_question_text = true,
bool  $show_inline_feedback = true 
)

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

References ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_CORRECT, ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_WRONG, assQuestionGUI\generateCorrectnessIconsForCorrectness(), assQuestionGUI\getGenericFeedbackOutput(), assQuestionGUI\getILIASPage(), assQuestionGUI\hasCorrectSolution(), assQuestionGUI\isTestPresentationContext(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilLegacyFormElementsUtil\prepareTextareaOutput().

175  : string {
176  // get the solution of the user for the active pass or from the last pass if allowed
177  $template = new ilTemplate("tpl.il_as_qpl_fileupload_output_solution.html", true, true, "components/ILIAS/TestQuestionPool");
178 
179  $solutionvalue = "";
180  if (($active_id > 0) && (!$show_correct_solution)) {
181  $solutions = $this->object->getSolutionValues($active_id, $pass);
182 
183  $files = ($show_manual_scoring) ? $this->object->getUploadedFilesForWeb($active_id, $pass) : $this->object->getUploadedFiles($active_id, $pass);
184  $table_gui = new assFileUploadFileTableGUI($this, 'gotoquestion');
185  $table_gui->setTitle(
186  $this->lng->txt('already_delivered_files'),
187  'standard/icon_file.svg',
188  $this->lng->txt('already_delivered_files')
189  );
190  $table_gui->setData($files);
191  $table_gui->setRowTemplate("tpl.il_as_qpl_fileupload_file_view_row.html", "components/ILIAS/TestQuestionPool");
192  $table_gui->setSelectAllCheckbox("");
193  $table_gui->disable('numinfo');
194  $template->setCurrentBlock("files");
195  $template->setVariable('FILES', $table_gui->getHTML());
196  $template->parseCurrentBlock();
197  }
198 
199  if ($this->object->getAllowedExtensions() === '') {
200  $template->setCurrentBlock("allowed_extensions");
201  $template->setVariable("TXT_ALLOWED_EXTENSIONS", ilLegacyFormElementsUtil::prepareTextareaOutput($this->lng->txt("allowedextensions") . ": " . $this->object->getAllowedExtensions()));
202  $template->parseCurrentBlock();
203  }
204  $template->setVariable("CMD_UPLOAD", self::HANDLE_FILE_UPLOAD);
205  $template->setVariable("TEXT_UPLOAD", ilLegacyFormElementsUtil::prepareTextareaOutput($this->lng->txt('upload')));
206  $template->setVariable("TXT_UPLOAD_FILE", ilLegacyFormElementsUtil::prepareTextareaOutput($this->lng->txt('file_add')));
207  $template->setVariable("TXT_MAX_SIZE", ilLegacyFormElementsUtil::prepareTextareaOutput($this->lng->txt('file_notice') . " " . $this->object->getMaxFilesizeAsString()));
208 
209  if (($active_id > 0) && (!$show_correct_solution)) {
210  $reached_points = $this->object->getReachedPoints($active_id, $pass);
211  if ($graphical_output) {
212  $correctness_icon = $this->generateCorrectnessIconsForCorrectness(self::CORRECTNESS_NOT_OK);
213  if ($reached_points == $this->object->getMaximumPoints()) {
214  $correctness_icon = $this->generateCorrectnessIconsForCorrectness(self::CORRECTNESS_OK);
215  } elseif ($reached_points > 0) {
216  $correctness_icon = $this->generateCorrectnessIconsForCorrectness(self::CORRECTNESS_MOSTLY_OK);
217  }
218  $template->setCurrentBlock("icon_ok");
219  $template->setVariable("ICON_OK", $correctness_icon);
220  $template->parseCurrentBlock();
221  }
222  } else {
223  $reached_points = $this->object->getPoints();
224  }
225 
226  if ($result_output) {
227  $resulttext = ($reached_points == 1) ? "(%s " . $this->lng->txt("point") . ")" : "(%s " . $this->lng->txt("points") . ")";
228  $template->setVariable("RESULT_OUTPUT", sprintf($resulttext, $reached_points));
229  }
230  if ($show_question_text == true) {
231  $template->setVariable("QUESTIONTEXT", $this->object->getQuestionForHTMLOutput());
232  }
233  $questionoutput = $template->get();
234  $solutiontemplate = new ilTemplate("tpl.il_as_tst_solution_output.html", true, true, "components/ILIAS/TestQuestionPool");
235  $feedback = ($show_feedback && !$this->isTestPresentationContext()) ? $this->getGenericFeedbackOutput((int) $active_id, $pass) : "";
236  if (strlen($feedback)) {
237  $cssClass = (
238  $this->hasCorrectSolution($active_id, $pass) ?
240  );
241 
242  $solutiontemplate->setVariable("ILC_FB_CSS_CLASS", $cssClass);
243  $solutiontemplate->setVariable("FEEDBACK", ilLegacyFormElementsUtil::prepareTextareaOutput($feedback, true));
244  }
245  $solutiontemplate->setVariable("SOLUTION_OUTPUT", $questionoutput);
246  $solutionoutput = $solutiontemplate->get();
247  if (!$show_question_only) {
248  // get page object output
249  $solutionoutput = $this->getILIASPage($solutionoutput);
250  }
251  return $solutionoutput;
252  }
hasCorrectSolution($activeId, $passIndex)
generateCorrectnessIconsForCorrectness(int $correctness)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getILIASPage(string $html="")
Returns the ILIAS Page around a question.
static prepareTextareaOutput(string $txt_output, bool $prepare_for_latex_output=false, bool $omitNl2BrWhenTextArea=false)
Prepares a string for a text area output where latex code may be in it If the text is HTML-free...
getGenericFeedbackOutput(int $active_id, ?int $pass)
+ Here is the call graph for this function:

◆ getSpecificFeedbackOutput()

assFileUploadGUI::getSpecificFeedbackOutput ( array  $userSolution)

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

References ilLegacyFormElementsUtil\prepareTextareaOutput().

364  : string
365  {
366  $output = "";
368  }
static prepareTextareaOutput(string $txt_output, bool $prepare_for_latex_output=false, bool $omitNl2BrWhenTextArea=false)
Prepares a string for a text area output where latex code may be in it If the text is HTML-free...
+ Here is the call graph for this function:

◆ getTestOutput()

assFileUploadGUI::getTestOutput ( int  $active_id,
int  $pass,
bool  $is_question_postponed = false,
array|bool  $user_post_solutions = false,
bool  $show_specific_inline_feedback = false 
)

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

References getCommandButtonLangVarAndAction(), assQuestionGUI\getILIASPage(), assQuestionGUI\getQuestionActionCmd(), getTestPresentationFileTablePostVar(), ILIAS\Repository\lng(), null, ILIAS\Repository\object(), assQuestionGUI\outQuestionPage(), and ilLegacyFormElementsUtil\prepareTextareaOutput().

308  : string {
309  // generate the question output
310  $template = new ilTemplate("tpl.il_as_qpl_fileupload_output.html", true, true, "components/ILIAS/TestQuestionPool");
311 
312  if ($active_id) {
313  $files = $this->object->getTestOutputSolutions($active_id, $pass);
314  // hey.
315  $table_gui = new assFileUploadFileTableGUI(null, $this->getQuestionActionCmd());
316  $table_gui->setTitle(
317  $this->lng->txt('already_delivered_files'),
318  'standard/icon_file.svg',
319  $this->lng->txt('already_delivered_files')
320  );
321  $table_gui->setData($files);
322 
323  list($lang_var, $cmd) = $this->getCommandButtonLangVarAndAction();
324  $table_gui->initCommand(
325  $lang_var,
326  $cmd,
328  );
329  // hey.
330  $template->setCurrentBlock("files");
331  $template->setVariable('FILES', $table_gui->getHTML());
332  $template->parseCurrentBlock();
333  }
334 
335  if ($this->object->getAllowedExtensions() !== '') {
336  $template->setCurrentBlock("allowed_extensions");
337  $template->setVariable("TXT_ALLOWED_EXTENSIONS", ilLegacyFormElementsUtil::prepareTextareaOutput($this->lng->txt("allowedextensions") . ": " . $this->object->getAllowedExtensions()));
338  $template->parseCurrentBlock();
339  }
340  $template->setVariable("QUESTIONTEXT", $this->object->getQuestionForHTMLOutput());
341  $template->setVariable("CMD_UPLOAD", self::HANDLE_FILE_UPLOAD);
342  $template->setVariable("TEXT_UPLOAD", ilLegacyFormElementsUtil::prepareTextareaOutput($this->lng->txt('upload')));
343  $template->setVariable("TXT_UPLOAD_FILE", ilLegacyFormElementsUtil::prepareTextareaOutput($this->lng->txt('file_add')));
344  $template->setVariable("TXT_MAX_SIZE", ilLegacyFormElementsUtil::prepareTextareaOutput($this->lng->txt('file_notice') . " " . $this->object->getMaxFilesizeAsString()));
345 
346  $questionoutput = $template->get();
347  //if (!$show_question_only) {
348  // get page object output
349  $questionoutput = $this->getILIASPage($questionoutput);
350  //}
351  $questionoutput = $template->get();
352  $pageoutput = $this->outQuestionPage("", $is_question_postponed, $active_id, $questionoutput);
353  return $pageoutput;
354  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getILIASPage(string $html="")
Returns the ILIAS Page around a question.
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
static prepareTextareaOutput(string $txt_output, bool $prepare_for_latex_output=false, bool $omitNl2BrWhenTextArea=false)
Prepares a string for a text area output where latex code may be in it If the text is HTML-free...
+ Here is the call graph for this function:

◆ getTestPresentationFileTablePostVar()

assFileUploadGUI::getTestPresentationFileTablePostVar ( )
protected

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

References assFileUpload\DELETE_FILES_TBL_POSTVAR, ILIAS\Repository\object(), and assFileUpload\REUSE_FILES_TBL_POSTVAR.

Referenced by getTestOutput().

384  : string
385  {
386  if ($this->object->getTestPresentationConfig()->isSolutionInitiallyPrefilled()) {
388  }
389 
391  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAnswerFreuqencyStatisticSupported()

assFileUploadGUI::isAnswerFreuqencyStatisticSupported ( )

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

411  : bool
412  {
413  return false;
414  }

◆ populateCorrectionsFormProperties()

assFileUploadGUI::populateCorrectionsFormProperties ( ilPropertyFormGUI  $form)

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

References ilPropertyFormGUI\addItem(), ilNumberInputGUI\allowDecimals(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

416  : void
417  {
418  // points
419  $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
420  $points->allowDecimals(true);
421  $points->setValue(
422  is_numeric($this->object->getPoints()) && $this->object->getPoints(
423  ) >= 0 ? $this->object->getPoints() : ''
424  );
425  $points->setRequired(true);
426  $points->setSize(3);
427  $points->setMinValue(0.0);
428  $points->setMinvalueShouldBeGreater(true);
429  $form->addItem($points);
430 
431  $subcompl = new ilCheckboxInputGUI($this->lng->txt(
432  'ass_completion_by_submission'
433  ), 'completion_by_submission');
434  $subcompl->setInfo($this->lng->txt('ass_completion_by_submission_info'));
435  $subcompl->setValue(1);
436  $subcompl->setChecked($this->object->isCompletionBySubmissionEnabled());
437  $form->addItem($subcompl);
438  }
allowDecimals(bool $a_value)
This class represents a number property in a property form.
+ Here is the call graph for this function:

◆ populateQuestionSpecificFormPart()

assFileUploadGUI::populateQuestionSpecificFormPart ( ilPropertyFormGUI  $form)

Adds the question specific forms parts to a question property form gui.

Implements ilGuiQuestionScoringAdjustable.

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

References ilPropertyFormGUI\addItem(), ilNumberInputGUI\allowDecimals(), ILIAS\Repository\lng(), null, and ILIAS\Repository\object().

Referenced by editQuestion().

125  {
126  $maxsize = new ilNumberInputGUI($this->lng->txt("maxsize"), "maxsize");
127  $maxsize->allowDecimals(false);
128  $maxsize->setValue($this->object->getMaxSize() > 0 ? (string) $this->object->getMaxSize() : null);
129  $maxsize->setInfo($this->lng->txt("maxsize_info"));
130  $maxsize->setSize(10);
131  $maxsize->setMinValue(0);
132  $maxsize->setMaxValue((float) $this->object->determineMaxFilesize());
133  $maxsize->setRequired(false);
134  $form->addItem($maxsize);
135 
136  $allowedextensions = new ilTextInputGUI($this->lng->txt("allowedextensions"), "allowedextensions");
137  $allowedextensions->setInfo($this->lng->txt("allowedextensions_info"));
138  $allowedextensions->setValue($this->object->getAllowedExtensions());
139  $allowedextensions->setRequired(false);
140  $form->addItem($allowedextensions);
141 
142  $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
143  $points->allowDecimals(true);
144  $points->setValue(
145  is_numeric($this->object->getPoints()) && $this->object->getPoints(
146  ) >= 0 ? $this->object->getPoints() : ''
147  );
148  $points->setRequired(true);
149  $points->setSize(3);
150  $points->setMinValue(0.0);
151  $points->setMinvalueShouldBeGreater(true);
152  $form->addItem($points);
153 
154  $subcompl = new ilCheckboxInputGUI($this->lng->txt(
155  'ass_completion_by_submission'
156  ), 'completion_by_submission');
157  $subcompl->setInfo($this->lng->txt('ass_completion_by_submission_info'));
158  $subcompl->setValue('1');
159  $subcompl->setChecked($this->object->isCompletionBySubmissionEnabled());
160  $form->addItem($subcompl);
161  return $form;
162  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
allowDecimals(bool $a_value)
This class represents a number property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveCorrectionsFormProperties()

assFileUploadGUI::saveCorrectionsFormProperties ( ilPropertyFormGUI  $form)
Parameters
ilPropertyFormGUI$form

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

References ilPropertyFormGUI\getInput().

443  : void
444  {
445  $this->object->setPoints((float) str_replace(',', '.', $form->getInput('points')));
446  $this->object->setCompletionBySubmission((bool) $form->getInput('completion_by_submission'));
447  }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
+ Here is the call graph for this function:

◆ writePostData()

assFileUploadGUI::writePostData ( bool  $always = false)
protected

{}

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

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

63  : int
64  {
65  if (!$always && $this->editQuestion(true)) {
66  return 1;
67  }
68 
71  $this->saveTaxonomyAssignments();
72  return 0;
73  }
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from the request and applies them to the data object...
editQuestion(bool $checkonly=false, ?bool $is_save_cmd=null)
+ Here is the call graph for this function:

◆ writeQuestionSpecificPostData()

assFileUploadGUI::writeQuestionSpecificPostData ( ilPropertyFormGUI  $form)

Extracts the question specific values from the request and applies them to the data object.

Implements ilGuiQuestionScoringAdjustable.

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

References null.

Referenced by writePostData().

75  : void
76  {
77  $this->object->setPoints($this->request_data_collector->float('points'));
78  $this->object->setMaxSize($this->request_data_collector->int('maxsize') ?? null);
79 
80  $this->object->setAllowedExtensions($this->request_data_collector->string('allowedextensions'));
81  $completion_by_submission = $this->request_data_collector->int('completion_by_submission');
82  $this->object->setCompletionBySubmission($completion_by_submission === 1);
83  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

Field Documentation

◆ DELETE_FILES_ACTION

const assFileUploadGUI::DELETE_FILES_ACTION = 'delete'

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

Referenced by assFileUpload\isFileDeletionAction().

◆ DELETE_FILES_LANGVAR

const assFileUploadGUI::DELETE_FILES_LANGVAR = 'delete'

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

◆ HANDLE_FILE_UPLOAD

const assFileUploadGUI::HANDLE_FILE_UPLOAD = 'handleFileUpload'
private

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

◆ REUSE_FILES_ACTION

const assFileUploadGUI::REUSE_FILES_ACTION = 'reuse'

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

◆ REUSE_FILES_LANGVAR

const assFileUploadGUI::REUSE_FILES_LANGVAR = 'ass_file_upload_reuse_btn'

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


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