ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
assOrderingQuestionGUI Class Reference

Ordering question GUI representation. More...

+ Inheritance diagram for assOrderingQuestionGUI:
+ Collaboration diagram for assOrderingQuestionGUI:

Public Member Functions

 __construct ($id=-1)
 assOrderingQuestionGUI constructor More...
 
 setClearAnswersOnWritingPostDataEnabled ($clearAnswersOnWritingPostDataEnabled)
 
 isClearAnswersOnWritingPostDataEnabled ()
 
 changeToPictures ()
 
 changeToText ()
 
 orderNestedTerms ()
 
 orderNestedPictures ()
 
 removeElementImage ()
 
 uploadElementImage ()
 
 writeQuestionSpecificPostData (ilPropertyFormGUI $form)
 Extracts the question specific values from $_POST and applies them to the data object. More...
 
 writeAnswerSpecificPostData (ilPropertyFormGUI $form)
 Extracts the answer specific values from $_POST and applies them to the data object. More...
 
 populateAnswerSpecificFormPart (ilPropertyFormGUI $form)
 Adds the answer specific form parts to a question property form gui. More...
 
 populateQuestionSpecificFormPart (\ilPropertyFormGUI $form)
 
 editQuestion ($checkonly=false)
 Creates an output of the edit form for the question. More...
 
 getSolutionOutput ( $active_id, $pass=null, $graphicalOutput=false, $result_output=false, $show_question_only=true, $show_feedback=false, $forceCorrectSolution=false, $show_manual_scoring=false, $show_question_text=true)
 Get the question solution output. More...
 
 getPreview ($show_question_only=false, $showInlineFeedback=false)
 
 getTestOutput ($activeId, $pass, $isPostponed=false, $userSolutionPost=false, $inlineFeedback=false)
 
 setQuestionTabs ()
 Sets the ILIAS tabs for this question type. More...
 
 getSpecificFeedbackOutput ($active_id, $pass)
 Returns the answer specific feedback for the question. More...
 
 getAfterParticipationSuppressionAnswerPostVars ()
 Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment. More...
 
 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...
 
 aggregateAnswers ($relevant_answers_chosen, $answers_defined_on_question)
 
 renderAggregateView ($aggregate)
 
- Public Member Functions inherited from assQuestionGUI
 __construct ()
 assQuestionGUI constructor More...
 
 executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 
 getType ()
 needed for page editor compliance More...
 
 getPresentationContext ()
 
 setPresentationContext ($presentationContext)
 
 isTestPresentationContext ()
 
 isPreviousSolutionPrefilled ()
 
 setPreviousSolutionPrefilled ($previousSolutionPrefilled)
 
 getRenderPurpose ()
 
 setRenderPurpose ($renderPurpose)
 
 isRenderPurposePrintPdf ()
 
 isRenderPurposePreview ()
 
 isRenderPurposeInputValue ()
 
 isRenderPurposePlayback ()
 
 isRenderPurposeDemoplay ()
 
 renderPurposeSupportsFormHtml ()
 
 getEditContext ()
 
 setEditContext ($editContext)
 
 isAuthoringEditContext ()
 
 isAdjustmentEditContext ()
 
 setAdjustmentEditContext ()
 
 getNavigationGUI ()
 
 setNavigationGUI ($navigationGUI)
 
 setTaxonomyIds ($taxonomyIds)
 
 getTaxonomyIds ()
 
 setTargetGui ($linkTargetGui)
 
 setTargetGuiClass ($targetGuiClass)
 
 getTargetGuiClass ()
 
 setQuestionHeaderBlockBuilder ($questionHeaderBlockBuilder)
 
 getQuestionHeaderBlockBuilder ()
 
 setQuestionActionCmd ($questionActionCmd)
 
 getQuestionActionCmd ()
 
createQuestionGUI ($question_type, $question_id=-1)
 Creates a question gui representation. More...
 
 populateJavascriptFilesRequiredForWorkForm (ilTemplate $tpl)
 
 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...
 
 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...
 
 getGenericFeedbackOutputForCorrectSolution ()
 
 getGenericFeedbackOutputForIncorrectSolution ()
 
 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 ()
 
 addTab_SuggestedSolution (ilTabsGUI $tabs, $classname)
 
 getEditQuestionTabCommands ()
 
 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 ()
 
 getPreview ($show_question_only=false, $showInlineFeedback=false)
 
 outQuestionForTest ( $formaction, $active_id, $pass, $is_question_postponed=false, $user_post_solutions=false, $show_specific_inline_feedback=false)
 
 magicAfterTestOutput ()
 
 getTestOutput ( $active_id, $pass, $is_question_postponed, $user_post_solutions, $show_specific_inline_feedback)
 
 getFormEncodingType ()
 
 setPreviewSession ($previewSession)
 
 getPreviewSession ()
 
 showHints ()
 
- Public Member Functions inherited from ilGuiQuestionScoringAdjustable
 populateQuestionSpecificFormPart (ilPropertyFormGUI $form)
 Adds the question specific forms parts to a question property form gui. More...
 
 writeQuestionSpecificPostData (ilPropertyFormGUI $form)
 Extracts the question specific values from $_POST and applies them to the data object. More...
 
 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...
 
 populateAnswerSpecificFormPart (ilPropertyFormGUI $form)
 Adds the answer specific form parts to a question property form gui. More...
 
 writeAnswerSpecificPostData (ilPropertyFormGUI $form)
 Extracts the answer specific values from $_POST and applies them to the data object. More...
 
 getAfterParticipationSuppressionAnswerPostVars ()
 Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment. More...
 

Data Fields

 $object
 
 $old_ordering_depth = array()
 
 $leveled_ordering = array()
 
- Data Fields inherited from assQuestionGUI
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 SESSION_PREVIEW_DATA_BASE_INDEX = 'ilAssQuestionPreviewAnswers'
 
 $object
 
 $tpl
 
 $lng
 
 $error
 
 $errormessage
 
 $sequence_no
 sequence number in test More...
 
 $question_count
 question count in test More...
 
const PRESENTATION_CONTEXT_TEST = 'pContextTest'
 
const PRESENTATION_CONTEXT_RESULTS = 'pContextResults'
 
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'
 

Protected Member Functions

 writePostData ($forceSaving=false)
 {Evaluates a posted edit form and writes the form data in the question object.
Returns
integer A positive value, if one of the required fields wasn't set, else 0
} More...
 
 buildEditForm ()
 
 isInteractivePresentation ()
 
 persistAuthoringForm ($form)
 
- Protected Member Functions inherited from assQuestionGUI
 writePostData ($always=false)
 Evaluates a posted edit form and writes the form data in the question object. More...
 
 renderEditForm ($form)
 
 getUseUnchangedAnswerCheckboxHtml ()
 
 getPreviousSolutionProvidedMessage ()
 
 getPreviousSolutionConfirmationCheckboxHtml ()
 
 saveTaxonomyAssignments ()
 
 populateTaxonomyFormSection (ilPropertyFormGUI $form)
 
 getBasicEditQuestionTabCommands ()
 
 getAdditionalEditQuestionCommands ()
 
 addTab_QuestionFeedback (ilTabsGUI $tabs)
 adds the feedback tab to ilTabsGUI More...
 
 addTab_QuestionHints (ilTabsGUI $tabs)
 adds the hints tab to ilTabsGUI More...
 
 addTab_QuestionPreview (ilTabsGUI $tabsGUI)
 
 hasCorrectSolution ($activeId, $passIndex)
 
 writeQuestionGenericPostData ()
 
 completeTestOutputFormAction ($formAction, $active_id, $pass)
 
 addBackTab (ilTabsGUI $ilTabs)
 
 buildBasicEditFormObject ()
 
 buildEditForm ()
 

Private Member Functions

 getOldLeveledOrdering ()
 

Private Attributes

 $clearAnswersOnWritingPostDataEnabled
 

Additional Inherited Members

- Static Public Member Functions inherited from assQuestionGUI
static _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...
 
static _getGUIClassNameForId ($a_q_id)
 
static _getClassNameForQType ($q_type)
 
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...
 
- Protected Attributes inherited from assQuestionGUI
 $editForm
 

Detailed Description

Ordering question GUI representation.

The assOrderingQuestionGUI class encapsulates the GUI representation for ordering 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$

@ilCtrl_Calls assOrderingQuestionGUI: ilFormPropertyDispatchGUI

Definition at line 23 of file class.assOrderingQuestionGUI.php.

Constructor & Destructor Documentation

◆ __construct()

assOrderingQuestionGUI::__construct (   $id = -1)

assOrderingQuestionGUI constructor

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

Parameters
integer$idThe database id of a ordering question object
Returns
assOrderingQuestionGUI

Definition at line 47 of file class.assOrderingQuestionGUI.php.

48 {
49 parent::__construct();
50 include_once "./Modules/TestQuestionPool/classes/class.assOrderingQuestion.php";
51 $this->object = new assOrderingQuestion();
52 if ($id >= 0) {
53 $this->object->loadFromDb($id);
54 }
55 $this->clearAnswersOnWritingPostDataEnabled = false;
56 }
Class for ordering questions.
if(!array_key_exists('StateId', $_REQUEST)) $id

References $id.

Member Function Documentation

◆ aggregateAnswers()

assOrderingQuestionGUI::aggregateAnswers (   $relevant_answers_chosen,
  $answers_defined_on_question 
)

Definition at line 777 of file class.assOrderingQuestionGUI.php.

778 {
779 $passdata = array(); // Regroup answers into units of passes.
780 foreach ($relevant_answers_chosen as $answer_chosen) {
781 $passdata[$answer_chosen['active_fi'] . '-' . $answer_chosen['pass']][$answer_chosen['value2']] = $answer_chosen['value1'];
782 }
783
784 $variants = array(); // Determine unique variants.
785 foreach ($passdata as $key => $data) {
786 $hash = md5(implode('-', $data));
787 $value_set = false;
788 foreach ($variants as $vkey => $variant) {
789 if ($variant['hash'] == $hash) {
790 $variant['count']++;
791 $value_set = true;
792 }
793 }
794 if (!$value_set) {
795 $variants[$key]['hash'] = $hash;
796 $variants[$key]['count'] = 1;
797 }
798 }
799
800 $aggregate = array(); // Render aggregate from variant.
801 foreach ($variants as $key => $variant_entry) {
802 $variant = $passdata[$key];
803
804 foreach ($variant as $variant_key => $variant_line) {
805 $i = 0;
806 $aggregated_info_for_answer['count'] = $variant_entry['count'];
807 foreach ($answers_defined_on_question as $element) {
808 $i++;
809
810 if ($this->object->isImageOrderingType()) {
811 $element->setImageThumbnailPrefix($this->object->getThumbPrefix());
812 $element->setImagePathWeb($this->object->getImagePathWeb());
813 $element->setImagePathFs($this->object->getImagePath());
814
815 $src = $element->getPresentationImageUrl();
816 $alt = $element->getContent();
817 $content = "<img src='{$src}' alt='{$alt}' title='{$alt}'/>";
818 } else {
819 $content = $element->getContent();
820 }
821
822 $aggregated_info_for_answer[$i . ' - ' . $content]
823 = $passdata[$key][$i];
824 }
825 }
826 $aggregate[] = $aggregated_info_for_answer;
827 }
828 return $aggregate;
829 }
$key
Definition: croninfo.php:18
$i
Definition: disco.tpl.php:19

References $data, $i, and $key.

Referenced by getAggregatedAnswersView().

+ Here is the caller graph for this function:

◆ buildEditForm()

assOrderingQuestionGUI::buildEditForm ( )
protected
Returns
ilAssOrderingQuestionAuthoringFormGUI

Reimplemented from assQuestionGUI.

Definition at line 389 of file class.assOrderingQuestionGUI.php.

390 {
391 require_once 'Modules/TestQuestionPool/classes/forms/class.ilAssOrderingQuestionAuthoringFormGUI.php';
393 $this->editForm = $form;
394
395 $form->setFormAction($this->ctrl->getFormAction($this));
396 $form->setTitle($this->outQuestionType());
397 $form->setMultipart(($this->object->getOrderingType() == OQ_PICTURES) ? true : false);
398 $form->setTableWidth("100%");
399 $form->setId("ordering");
400 // title, author, description, question, working time (assessment mode)
404
406
407 $form->addSpecificOrderingQuestionCommandButtons($this->object);
408 $form->addGenericAssessmentQuestionCommandButtons($this->object);
409
410 return $form;
411 }
populateAnswerSpecificFormPart(ilPropertyFormGUI $form)
Adds the answer specific form parts to a question property form gui.
populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
populateTaxonomyFormSection(ilPropertyFormGUI $form)
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question,...
const OQ_PICTURES
Ordering question constants.
if(isset($_POST['submit'])) $form

References $form, assQuestionGUI\addBasicQuestionFormProperties(), OQ_PICTURES, assQuestionGUI\outQuestionType(), populateAnswerSpecificFormPart(), populateQuestionSpecificFormPart(), and assQuestionGUI\populateTaxonomyFormSection().

Referenced by changeToPictures(), changeToText(), editQuestion(), orderNestedPictures(), orderNestedTerms(), removeElementImage(), uploadElementImage(), and writePostData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeToPictures()

assOrderingQuestionGUI::changeToPictures ( )

Definition at line 74 of file class.assOrderingQuestionGUI.php.

75 {
76 if ($this->object->getOrderingType() != OQ_NESTED_PICTURES && $this->object->getOrderingType() != OQ_PICTURES) {
78 }
79
80 $form = $this->buildEditForm();
81 $form->setValuesByPost();
83
84 $this->object->setOrderingType(OQ_PICTURES);
85 $this->object->saveToDb();
86
87 $form->ensureReprintableFormStructure($this->object);
88 $this->renderEditForm($form);
89 }
setClearAnswersOnWritingPostDataEnabled($clearAnswersOnWritingPostDataEnabled)
const OQ_NESTED_PICTURES

References $form, buildEditForm(), OQ_NESTED_PICTURES, OQ_PICTURES, persistAuthoringForm(), assQuestionGUI\renderEditForm(), and setClearAnswersOnWritingPostDataEnabled().

+ Here is the call graph for this function:

◆ changeToText()

assOrderingQuestionGUI::changeToText ( )

Definition at line 91 of file class.assOrderingQuestionGUI.php.

92 {
93 if ($this->object->getOrderingType() != OQ_NESTED_TERMS && $this->object->getOrderingType() != OQ_TERMS) {
95 }
96
97 $form = $this->buildEditForm();
98 $form->setValuesByPost();
100
101 $this->object->setOrderingType(OQ_TERMS);
102 $this->object->saveToDb();
103
104 $form->ensureReprintableFormStructure($this->object);
105 $this->renderEditForm($form);
106 }
const OQ_TERMS
const OQ_NESTED_TERMS

References $form, buildEditForm(), OQ_NESTED_TERMS, OQ_TERMS, persistAuthoringForm(), assQuestionGUI\renderEditForm(), and setClearAnswersOnWritingPostDataEnabled().

+ Here is the call graph for this function:

◆ editQuestion()

assOrderingQuestionGUI::editQuestion (   $checkonly = false)

Creates an output of the edit form for the question.

Definition at line 381 of file class.assOrderingQuestionGUI.php.

382 {
383 $this->renderEditForm($this->buildEditForm());
384 }

References buildEditForm(), and assQuestionGUI\renderEditForm().

+ Here is the call graph for this function:

◆ getAfterParticipationSuppressionAnswerPostVars()

assOrderingQuestionGUI::getAfterParticipationSuppressionAnswerPostVars ( )

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 ilGuiAnswerScoringAdjustable.

Definition at line 740 of file class.assOrderingQuestionGUI.php.

741 {
742 return array();
743 }

◆ getAfterParticipationSuppressionQuestionPostVars()

assOrderingQuestionGUI::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 754 of file class.assOrderingQuestionGUI.php.

755 {
756 return array();
757 }

◆ getAggregatedAnswersView()

assOrderingQuestionGUI::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

Implements ilGuiQuestionScoringAdjustable.

Definition at line 767 of file class.assOrderingQuestionGUI.php.

768 {
769 $aggView = $this->aggregateAnswers(
770 $relevant_answers,
771 $this->object->getOrderingElementList()
772 );
773
774 return $this->renderAggregateView($aggView)->get();
775 }
aggregateAnswers($relevant_answers_chosen, $answers_defined_on_question)

References aggregateAnswers(), and renderAggregateView().

+ Here is the call graph for this function:

◆ getOldLeveledOrdering()

assOrderingQuestionGUI::getOldLeveledOrdering ( )
private

Definition at line 716 of file class.assOrderingQuestionGUI.php.

717 {
718 global $ilDB;
719
720 $res = $ilDB->queryF(
721 'SELECT depth FROM qpl_a_ordering WHERE question_fi = %s ORDER BY solution_key ASC',
722 array('integer'),
723 array($this->object->getId())
724 );
725 while ($row = $ilDB->fetchAssoc($res)) {
726 $this->old_ordering_depth[] = $row['depth'];
727 }
729 }
foreach($_POST as $key=> $value) $res
global $ilDB

References $ilDB, $old_ordering_depth, $res, and $row.

◆ getPreview()

assOrderingQuestionGUI::getPreview (   $show_question_only = false,
  $showInlineFeedback = false 
)

Reimplemented from assQuestionGUI.

Definition at line 505 of file class.assOrderingQuestionGUI.php.

506 {
507 if ($this->getPreviewSession() && $this->getPreviewSession()->hasParticipantSolution()) {
508 $solutionOrderingElementList = unserialize(
509 $this->getPreviewSession()->getParticipantsSolution()
510 );
511 } else {
512 $solutionOrderingElementList = $this->object->getShuffledOrderingElementList();
513 }
514
515 $answers = $this->object->buildNestedOrderingElementInputGui();
516 $answers->setNestingEnabled($this->object->isOrderingTypeNested());
518 $answers->setInteractionEnabled($this->isInteractivePresentation());
519 $answers->setElementList($solutionOrderingElementList);
520
521 $template = new ilTemplate("tpl.il_as_qpl_ordering_output.html", true, true, "Modules/TestQuestionPool");
522
523 $template->setCurrentBlock('nested_ordering_output');
524 $template->setVariable('NESTED_ORDERING', $answers->getHTML());
525 $template->parseCurrentBlock();
526
527 $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), true));
528
529 if ($show_question_only) {
530 return $template->get();
531 }
532
533 return $this->getILIASPage($template->get());
534
535 //$this->tpl->addJavascript("./Modules/TestQuestionPool/templates/default/ordering.js");
536 }
getILIASPage($html="")
Returns the ILIAS Page around a question.
special template class to simplify handling of ITX/PEAR
$template

References $template, ilAssNestedOrderingElementsInputGUI\CONTEXT_QUESTION_PREVIEW, assQuestionGUI\getILIASPage(), assQuestionGUI\getPreviewSession(), and isInteractivePresentation().

+ Here is the call graph for this function:

◆ getSolutionOutput()

assOrderingQuestionGUI::getSolutionOutput (   $active_id,
  $pass = null,
  $graphicalOutput = false,
  $result_output = false,
  $show_question_only = true,
  $show_feedback = false,
  $forceCorrectSolution = 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
bool$show_question_text
Returns
string The solution output of the question as HTML code

Reimplemented from assQuestionGUI.

Definition at line 428 of file class.assOrderingQuestionGUI.php.

438 {
439 $solutionOrderingList = $this->object->getOrderingElementListForSolutionOutput(
440 $forceCorrectSolution,
441 $active_id,
442 $pass
443 );
444
445 $answers_gui = $this->object->buildNestedOrderingElementInputGui();
446
447 if ($forceCorrectSolution) {
449 } else {
451 }
452
453 $answers_gui->setInteractionEnabled(false);
454
455 $answers_gui->setElementList($solutionOrderingList);
456
457 $answers_gui->setCorrectnessTrueElementList(
458 $solutionOrderingList->getParityTrueElementList($this->object->getOrderingElementList())
459 );
460
461 $solution_html = $answers_gui->getHTML();
462
463 $template = new ilTemplate("tpl.il_as_qpl_nested_ordering_output_solution.html", true, true, "Modules/TestQuestionPool");
464 $template->setVariable('SOLUTION_OUTPUT', $solution_html);
465 if ($show_question_text==true) {
466 $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), true));
467 }
468 $questionoutput = $template->get();
469
470 $solutiontemplate = new ilTemplate("tpl.il_as_tst_solution_output.html", true, true, "Modules/TestQuestionPool");
471 $solutiontemplate->setVariable("SOLUTION_OUTPUT", $questionoutput);
472
473 if ($show_feedback) {
474 $feedback = '';
475
476 if (!$this->isTestPresentationContext()) {
477 $fb = $this->getGenericFeedbackOutput($active_id, $pass);
478 $feedback .= strlen($fb) ? $fb : '';
479 }
480
481 $fb = $this->getSpecificFeedbackOutput($active_id, $pass);
482 $feedback .= strlen($fb) ? $fb : '';
483
484 if (strlen($feedback)) {
485 $cssClass = (
486 $this->hasCorrectSolution($active_id, $pass) ?
488 );
489
490 $solutiontemplate->setVariable("ILC_FB_CSS_CLASS", $cssClass);
491 $solutiontemplate->setVariable("FEEDBACK", $this->object->prepareTextareaOutput($feedback, true));
492 }
493 }
494
495 if ($show_question_only) {
496 return $solutiontemplate->get();
497 }
498
499 return $this->getILIASPage($solutiontemplate->get());
500
501 // is this template still in use? it is not used at this point any longer!
502 // $template = new ilTemplate("tpl.il_as_qpl_ordering_output_solution.html", TRUE, TRUE, "Modules/TestQuestionPool");
503 }
getSpecificFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
hasCorrectSolution($activeId, $passIndex)
getGenericFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.

References $pass, $template, ilAssNestedOrderingElementsInputGUI\CONTEXT_CORRECT_SOLUTION_PRESENTATION, ilAssNestedOrderingElementsInputGUI\CONTEXT_USER_SOLUTION_PRESENTATION, ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_CORRECT, ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_WRONG, assQuestionGUI\getGenericFeedbackOutput(), assQuestionGUI\getILIASPage(), getSpecificFeedbackOutput(), assQuestionGUI\hasCorrectSolution(), and assQuestionGUI\isTestPresentationContext().

+ Here is the call graph for this function:

◆ getSpecificFeedbackOutput()

assOrderingQuestionGUI::getSpecificFeedbackOutput (   $active_id,
  $pass 
)

Returns the answer specific feedback for the question.

This method should be overwritten by the actual question.

Todo:
Mark this method abstract!
Parameters
integer$active_idActive ID of the user
integer$passActive pass
Returns
string HTML Code with the answer specific feedback @access public

Reimplemented from assQuestionGUI.

Definition at line 672 of file class.assOrderingQuestionGUI.php.

673 {
674 if (!$this->object->feedbackOBJ->specificAnswerFeedbackExists($this->object->getOrderingElementList())) {
675 return '';
676 }
677
678 $tpl = new ilTemplate('tpl.il_as_qpl_ordering_elem_fb.html', true, true, 'Modules/TestQuestionPool');
679
680 foreach ($this->object->getOrderingElementList() as $element) {
681 $feedback = $this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
682 $this->object->getId(),
683 $element->getPosition()
684 );
685
686 if ($this->object->isImageOrderingType()) {
687 $imgSrc = $this->object->getImagePathWeb() . $element->getContent();
688 $tpl->setCurrentBlock('image');
689 $tpl->setVariable('IMG_SRC', $imgSrc);
690 } else {
691 $tpl->setCurrentBlock('text');
692 }
693 $tpl->setVariable('CONTENT', $element->getContent());
694 $tpl->parseCurrentBlock();
695
696 $tpl->setCurrentBlock('element');
697 $tpl->setVariable('FEEDBACK', $feedback);
698 $tpl->parseCurrentBlock();
699 }
700
701 return $this->object->prepareTextareaOutput($tpl->get(), true);
702 }

References assQuestionGUI\$tpl.

Referenced by getSolutionOutput().

+ Here is the caller graph for this function:

◆ getTestOutput()

assOrderingQuestionGUI::getTestOutput (   $activeId,
  $pass,
  $isPostponed = false,
  $userSolutionPost = false,
  $inlineFeedback = false 
)

Reimplemented from assQuestionGUI.

Definition at line 539 of file class.assOrderingQuestionGUI.php.

541 {
542 // hey: prevPassSolutions - fixed variable type, makes phpstorm stop crying
543 $userSolutionPost = is_array($userSolutionPost) ? $userSolutionPost : array();
544 // hey.
545
546 $orderingGUI = $this->object->buildNestedOrderingElementInputGui();
547 $orderingGUI->setNestingEnabled($this->object->isOrderingTypeNested());
548
549 $solutionOrderingElementList = $this->object->getSolutionOrderingElementListForTestOutput(
550 $orderingGUI,
551 $userSolutionPost,
552 $activeId,
553 $pass
554 );
555
556 $template = new ilTemplate('tpl.il_as_qpl_ordering_output.html', true, true, 'Modules/TestQuestionPool');
557
559 $orderingGUI->setElementList($solutionOrderingElementList);
560
561 $template->setCurrentBlock('nested_ordering_output');
562 $template->setVariable('NESTED_ORDERING', $orderingGUI->getHTML());
563 $template->parseCurrentBlock();
564
565 $template->setVariable('QUESTIONTEXT', $this->object->prepareTextareaOutput($this->object->getQuestion(), true));
566
567 $pageoutput = $this->outQuestionPage('', $isPostponed, $activeId, $template->get());
568
569 return $pageoutput;
570 }
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="")
output question page

References $pass, $template, ilAssNestedOrderingElementsInputGUI\CONTEXT_USER_SOLUTION_SUBMISSION, and assQuestionGUI\outQuestionPage().

+ Here is the call graph for this function:

◆ isClearAnswersOnWritingPostDataEnabled()

assOrderingQuestionGUI::isClearAnswersOnWritingPostDataEnabled ( )
Returns
boolean

Definition at line 69 of file class.assOrderingQuestionGUI.php.

References $clearAnswersOnWritingPostDataEnabled.

Referenced by writeAnswerSpecificPostData().

+ Here is the caller graph for this function:

◆ isInteractivePresentation()

assOrderingQuestionGUI::isInteractivePresentation ( )
protected

Definition at line 572 of file class.assOrderingQuestionGUI.php.

573 {
574 if ($this->isRenderPurposePlayback()) {
575 return true;
576 }
577
578 if ($this->isRenderPurposeDemoplay()) {
579 return true;
580 }
581
582 return false;
583 }

References assQuestionGUI\isRenderPurposeDemoplay(), and assQuestionGUI\isRenderPurposePlayback().

Referenced by getPreview().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ orderNestedPictures()

assOrderingQuestionGUI::orderNestedPictures ( )

Definition at line 117 of file class.assOrderingQuestionGUI.php.

118 {
119 $this->writePostData(true);
120 $this->object->setOrderingType(OQ_NESTED_PICTURES);
121 $this->object->saveToDb();
122
123 $this->renderEditForm($this->buildEditForm());
124 }
writePostData($forceSaving=false)
{Evaluates a posted edit form and writes the form data in the question object.integer A positive valu...

References buildEditForm(), OQ_NESTED_PICTURES, assQuestionGUI\renderEditForm(), and writePostData().

+ Here is the call graph for this function:

◆ orderNestedTerms()

assOrderingQuestionGUI::orderNestedTerms ( )

Definition at line 108 of file class.assOrderingQuestionGUI.php.

109 {
110 $this->writePostData(true);
111 $this->object->setOrderingType(OQ_NESTED_TERMS);
112 $this->object->saveToDb();
113
114 $this->renderEditForm($this->buildEditForm());
115 }

References buildEditForm(), OQ_NESTED_TERMS, assQuestionGUI\renderEditForm(), and writePostData().

+ Here is the call graph for this function:

◆ persistAuthoringForm()

assOrderingQuestionGUI::persistAuthoringForm (   $form)
protected
Parameters
$form
Exceptions
ilTestQuestionPoolException

Definition at line 708 of file class.assOrderingQuestionGUI.php.

709 {
714 }
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from $_POST and applies them to the data object.
writeAnswerSpecificPostData(ilPropertyFormGUI $form)
Extracts the answer specific values from $_POST and applies them to the data object.

References $form, assQuestionGUI\saveTaxonomyAssignments(), writeAnswerSpecificPostData(), assQuestionGUI\writeQuestionGenericPostData(), and writeQuestionSpecificPostData().

Referenced by changeToPictures(), changeToText(), and writePostData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateAnswerSpecificFormPart()

assOrderingQuestionGUI::populateAnswerSpecificFormPart ( ilPropertyFormGUI  $form)

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

Parameters
ilPropertyFormGUI$form
Returns
ilPropertyFormGUI

Implements ilGuiAnswerScoringAdjustable.

Definition at line 279 of file class.assOrderingQuestionGUI.php.

280 {
282 $header->setTitle($this->lng->txt('oq_header_ordering_elements'));
283 $form->addItem($header);
284
285 if ($this->isAdjustmentEditContext()) {
286 $orderingElementInput = $this->object->buildNestedOrderingElementInputGui();
287 } else {
288 $orderingElementInput = $this->object->buildOrderingElementInputGui();
289 }
290
291 $orderingElementInput->setStylingDisabled($this->isRenderPurposePrintPdf());
292 $this->object->initOrderingElementAuthoringProperties($orderingElementInput);
293
294 $orderingElementInput->setElementList($this->object->getOrderingElementList());
295
296 $form->addItem($orderingElementInput);
297
298 return $form;
299 }
This class represents a section header in a property form.

References $form, $header, assQuestionGUI\isAdjustmentEditContext(), and assQuestionGUI\isRenderPurposePrintPdf().

Referenced by buildEditForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateQuestionSpecificFormPart()

assOrderingQuestionGUI::populateQuestionSpecificFormPart ( \ilPropertyFormGUI  $form)

Definition at line 301 of file class.assOrderingQuestionGUI.php.

302 {
303 if (!$this->object->getSelfAssessmentEditingMode()) {
304 $element_height = new ilNumberInputGUI($this->lng->txt("element_height"), "element_height");
305 $element_height->setValue($this->object->getElementHeight());
306 $element_height->setRequired(false);
307 $element_height->setMaxLength(6);
308 $element_height->setMinValue(20);
309 $element_height->setSize(6);
310 $element_height->setInfo($this->lng->txt("element_height_info"));
311 $form->addItem($element_height);
312 }
313
314 if ($this->object->isImageOrderingType()) {
315 $geometry = new ilNumberInputGUI($this->lng->txt("thumb_geometry"), "thumb_geometry");
316 $geometry->setValue($this->object->getThumbGeometry());
317 $geometry->setRequired(true);
318 $geometry->setMaxLength(6);
319 $geometry->setMinValue(20);
320 $geometry->setSize(6);
321 $geometry->setInfo($this->lng->txt("thumb_geometry_info"));
322 $form->addItem($geometry);
323 }
324
325 // points
326 $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
327 $points->allowDecimals(true);
328 $points->setValue($this->object->getPoints());
329 $points->setRequired(true);
330 $points->setSize(3);
331 $points->setMinValue(0);
332 $points->setMinvalueShouldBeGreater(true);
333 $form->addItem($points);
334
335 return $form;
336 }
This class represents a number property in a property form.

References $form.

Referenced by buildEditForm().

+ Here is the caller graph for this function:

◆ removeElementImage()

assOrderingQuestionGUI::removeElementImage ( )

Definition at line 126 of file class.assOrderingQuestionGUI.php.

127 {
128 $orderingInput = $this->object->buildOrderingImagesInputGui();
129 $this->object->initOrderingElementAuthoringProperties($orderingInput);
130
131 $form = $this->buildEditForm();
132 $form->replaceFormItemByPostVar($orderingInput);
133 $form->setValuesByPost();
134
135 $replacementElemList = ilAssOrderingElementList::buildInstance(
136 $this->object->getId(),
137 array()
138 );
139
140 $storedElementList = $this->object->getOrderingElementList();
141
142 foreach ($orderingInput->getElementList($this->object->getId()) as $submittedElement) {
143 if ($submittedElement->isImageRemovalRequest()) {
144 if ($this->object->isImageFileStored($submittedElement->getContent())) {
145 $this->object->dropImageFile($submittedElement->getContent());
146 }
147
148 $submittedElement->setContent(null);
149 }
150
151 if ($storedElementList->elementExistByRandomIdentifier($submittedElement->getRandomIdentifier())) {
152 $storedElement = $storedElementList->getElementByRandomIdentifier(
153 $submittedElement->getRandomIdentifier()
154 );
155
156 $submittedElement->setSolutionIdentifier($storedElement->getSolutionIdentifier());
157 $submittedElement->setIndentation($storedElement->getIndentation());
158 }
159
160 $replacementElemList->addElement($submittedElement);
161 }
162
163 $replacementElemList->saveToDb();
164
165 $orderingInput->setElementList($replacementElemList);
166 $this->renderEditForm($form);
167 }
static buildInstance($questionId, $orderingElements=array())

References $form, buildEditForm(), ilAssOrderingElementList\buildInstance(), and assQuestionGUI\renderEditForm().

+ Here is the call graph for this function:

◆ renderAggregateView()

assOrderingQuestionGUI::renderAggregateView (   $aggregate)
Parameters
$aggregate
Returns
ilTemplate

Definition at line 836 of file class.assOrderingQuestionGUI.php.

837 {
838 $tpl = new ilTemplate('tpl.il_as_aggregated_answers_table.html', true, true, "Modules/TestQuestionPool");
839
840 foreach ($aggregate as $line_data) {
841 $tpl->setCurrentBlock('aggregaterow');
842 $count = array_shift($line_data);
843 $html = '<ul>';
844 foreach ($line_data as $key => $line) {
845 $html .= '<li>' . ++$line . '&nbsp;-&nbsp;' . $key . '</li>';
846 }
847 $html .= '</ul>';
848 $tpl->setVariable('COUNT', $count);
849 $tpl->setVariable('OPTION', $html);
850
851 $tpl->parseCurrentBlock();
852 }
853 return $tpl;
854 }
$html
Definition: example_001.php:87

References $html, $key, and assQuestionGUI\$tpl.

Referenced by getAggregatedAnswersView().

+ Here is the caller graph for this function:

◆ setClearAnswersOnWritingPostDataEnabled()

assOrderingQuestionGUI::setClearAnswersOnWritingPostDataEnabled (   $clearAnswersOnWritingPostDataEnabled)
Parameters
boolean$clearAnswersOnWritingPostDataEnabled

Definition at line 61 of file class.assOrderingQuestionGUI.php.

62 {
63 $this->clearAnswersOnWritingPostDataEnabled = $clearAnswersOnWritingPostDataEnabled;
64 }

References $clearAnswersOnWritingPostDataEnabled.

Referenced by changeToPictures(), and changeToText().

+ Here is the caller graph for this function:

◆ setQuestionTabs()

assOrderingQuestionGUI::setQuestionTabs ( )

Sets the ILIAS tabs for this question type.

@access public

Todo:
: MOVE THIS STEPS TO COMMON QUESTION CLASS assQuestionGUI

Reimplemented from assQuestionGUI.

Definition at line 592 of file class.assOrderingQuestionGUI.php.

593 {
594 global $rbacsystem, $ilTabs;
595
596 $ilTabs->clearTargets();
597
598 $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
599 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
600 $q_type = $this->object->getQuestionType();
601
602 if (strlen($q_type)) {
603 $classname = $q_type . "GUI";
604 $this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
605 $this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
606 }
607
608 if ($_GET["q_id"]) {
609 if ($rbacsystem->checkAccess('write', $_GET["ref_id"])) {
610 // edit page
611 $ilTabs->addTarget(
612 "edit_page",
613 $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
614 array("edit", "insert", "exec_pg"),
615 "",
616 "",
617 false
618 );
619 }
620
621 $this->addTab_QuestionPreview($ilTabs);
622 }
623
624 $force_active = false;
625 if ($rbacsystem->checkAccess('write', $_GET["ref_id"])) {
626 $url = "";
627 if ($classname) {
628 $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
629 }
630 $commands = $_POST["cmd"];
631 if (is_array($commands)) {
632 foreach ($commands as $key => $value) {
633 if (preg_match("/^delete_.*/", $key, $matches)) {
634 $force_active = true;
635 }
636 }
637 }
638 // edit question properties
639 $ilTabs->addTarget(
640 "edit_question",
641 $url,
642 array("orderNestedTerms","orderNestedPictures","editQuestion", "save", "saveEdit", "addanswers", "removeanswers", "changeToPictures", "uploadElementImage", "changeToText", "upanswers", "downanswers", "originalSyncForm"),
643 $classname,
644 "",
645 $force_active
646 );
647 }
648
649 // add tab for question feedback within common class assQuestionGUI
650 $this->addTab_QuestionFeedback($ilTabs);
651
652 // add tab for question hint within common class assQuestionGUI
653 $this->addTab_QuestionHints($ilTabs);
654
655 // add tab for question's suggested solution within common class assQuestionGUI
656 $this->addTab_SuggestedSolution($ilTabs, $classname);
657
658 // Assessment of questions sub menu entry
659 if ($_GET["q_id"]) {
660 $ilTabs->addTarget(
661 "statistics",
662 $this->ctrl->getLinkTargetByClass($classname, "assessment"),
663 array("assessment"),
664 $classname,
665 ""
666 );
667 }
668
669 $this->addBackTab($ilTabs);
670 }
$_GET["client_id"]
$_POST["username"]
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
addBackTab(ilTabsGUI $ilTabs)
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
addTab_QuestionPreview(ilTabsGUI $tabsGUI)
$url

References $_GET, $_POST, $key, $url, assQuestionGUI\addBackTab(), assQuestionGUI\addTab_QuestionFeedback(), assQuestionGUI\addTab_QuestionHints(), assQuestionGUI\addTab_QuestionPreview(), and assQuestionGUI\addTab_SuggestedSolution().

+ Here is the call graph for this function:

◆ uploadElementImage()

assOrderingQuestionGUI::uploadElementImage ( )

Definition at line 169 of file class.assOrderingQuestionGUI.php.

170 {
171 $orderingInput = $this->object->buildOrderingImagesInputGui();
172 $this->object->initOrderingElementAuthoringProperties($orderingInput);
173
174 $form = $this->buildEditForm();
175 $form->replaceFormItemByPostVar($orderingInput);
176 $form->setValuesByPost();
177
178 if (!$orderingInput->checkInput()) {
179 ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
180 }
181
183 $this->object->getOrderingElementList()->saveToDb();
184 $orderingInput->setElementList($this->object->getOrderingElementList());
185
186 $this->renderEditForm($form);
187 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $form, buildEditForm(), assQuestionGUI\renderEditForm(), ilUtil\sendFailure(), and writeAnswerSpecificPostData().

+ Here is the call graph for this function:

◆ writeAnswerSpecificPostData()

assOrderingQuestionGUI::writeAnswerSpecificPostData ( ilPropertyFormGUI  $form)

Extracts the answer specific values from $_POST and applies them to the data object.

Parameters
bool$alwaysIf true, a check for form validity is omitted.
Returns
void

Implements ilGuiAnswerScoringAdjustable.

Definition at line 197 of file class.assOrderingQuestionGUI.php.

198 {
200 throw new ilTestQuestionPoolException('form submit request missing the form submit!?');
201 }
202
203 #$submittedElementList = $this->object->fetchSolutionListFromFormSubmissionData($_POST);
204 $submittedElementList = $this->object->fetchSolutionListFromSubmittedForm($form);
205
206 $replacementElementList = new ilAssOrderingElementList();
207 $replacementElementList->setQuestionId($this->object->getId());
208
209 $currentElementList = $this->object->getOrderingElementList();
210
211 foreach ($submittedElementList as $submittedElement) {
212 if ($this->object->hasOrderingTypeUploadSupport()) {
213 if ($submittedElement->isImageUploadAvailable()) {
214 $suffix = strtolower(array_pop(explode(".", $submittedElement->getUploadImageName())));
215 if (in_array($suffix, array("jpg", "jpeg", "png", "gif"))) {
216 $submittedElement->setUploadImageName($this->object->buildHashedImageFilename(
217 $submittedElement->getUploadImageName(),
218 true
219 ));
220
221 $wasImageFileStored = $this->object->storeImageFile(
222 $submittedElement->getUploadImageFile(),
223 $submittedElement->getUploadImageName()
224 );
225
226 if ($wasImageFileStored) {
227 if ($this->object->isImageFileStored($submittedElement->getContent())) {
228 $this->object->dropImageFile($submittedElement->getContent());
229 }
230
231 $submittedElement->setContent($submittedElement->getUploadImageName());
232 }
233 }
234 }
235 }
236
237 if ($currentElementList->elementExistByRandomIdentifier($submittedElement->getRandomIdentifier())) {
238 $storedElement = $currentElementList->getElementByRandomIdentifier(
239 $submittedElement->getRandomIdentifier()
240 );
241
242 $submittedElement->setSolutionIdentifier($storedElement->getSolutionIdentifier());
243
244 if ($this->isAdjustmentEditContext() || $this->object->isOrderingTypeNested()) {
245 $submittedElement->setContent($storedElement->getContent());
246 }
247
248 if (!$this->object->isOrderingTypeNested()) {
249 $submittedElement->setIndentation($storedElement->getIndentation());
250 }
251
252 if ($this->object->isImageReplaced($submittedElement, $storedElement)) {
253 $this->object->dropImageFile($storedElement->getContent());
254 }
255 }
256
257 $replacementElementList->addElement($submittedElement);
258 }
259
260 if ($this->object->isImageOrderingType()) {
261 $this->object->handleThumbnailCreation($replacementElementList);
262 }
263
265 $replacementElementList->clearElementContents();
266 }
267
268 if ($this->object->hasOrderingTypeUploadSupport()) {
269 $obsoleteElementList = $currentElementList->getDifferenceElementList($replacementElementList);
270
271 foreach ($obsoleteElementList as $obsoleteElement) {
272 $this->object->dropImageFile($obsoleteElement->getContent());
273 }
274 }
275
276 $this->object->setOrderingElementList($replacementElementList);
277 }

References $_POST, assQuestionGUI\isAdjustmentEditContext(), isClearAnswersOnWritingPostDataEnabled(), and assOrderingQuestion\ORDERING_ELEMENT_FORM_FIELD_POSTVAR.

Referenced by persistAuthoringForm(), and uploadElementImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writePostData()

assOrderingQuestionGUI::writePostData (   $forceSaving = false)
protected

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

Returns
integer A positive value, if one of the required fields wasn't set, else 0
}

Reimplemented from assQuestionGUI.

Definition at line 341 of file class.assOrderingQuestionGUI.php.

342 {
343 $savingAllowed = true; // assume saving allowed first
344
345 if (!$forceSaving) {
346 // this case seems to be a regular save call, so we consider
347 // the validation result for the decision of saving as well
348
349 // inits {this->editForm} and performs validation
350 $form = $this->buildEditForm();
351 $form->setValuesByPost(); // manipulation and distribution of values
352
353 if (!$form->checkInput()) { // manipulations regular style input propeties
354 $form->prepareValuesReprintable($this->object);
355 $this->renderEditForm($form);
356
357 // consequence of vaidation
358 $savingAllowed = false;
359 }
360 } elseif (!$this->isSaveCommand()) {
361 // this case handles form workflow actions like the mode/view switching requests,
362 // so saving must not be skipped, even for inputs invalid by business rules
363
364 $form = $this->buildEditForm();
365 $form->setValuesByPost(); // manipulation and distribution of values
366 $form->checkInput(); // manipulations regular style input propeties
367 }
368
369 if ($savingAllowed) {
371
372 return 0; // return 0 = all fine, was saved either forced or validated
373 }
374
375 return 1; // return 1 = something went wrong, no saving happened
376 }

References $form, buildEditForm(), assQuestionGUI\isSaveCommand(), persistAuthoringForm(), and assQuestionGUI\renderEditForm().

Referenced by orderNestedPictures(), and orderNestedTerms().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeQuestionSpecificPostData()

assOrderingQuestionGUI::writeQuestionSpecificPostData ( ilPropertyFormGUI  $form)

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

Parameters
bool$alwaysIf true, a check for form validity is omitted.
Returns
void

Implements ilGuiQuestionScoringAdjustable.

Definition at line 189 of file class.assOrderingQuestionGUI.php.

190 {
191 $this->object->setThumbGeometry($_POST["thumb_geometry"]);
192 $this->object->setElementHeight($_POST["element_height"]);
193 //$this->object->setOrderingType( $_POST["ordering_type"] );
194 $this->object->setPoints($_POST["points"]);
195 }

References $_POST.

Referenced by persistAuthoringForm().

+ Here is the caller graph for this function:

Field Documentation

◆ $clearAnswersOnWritingPostDataEnabled

assOrderingQuestionGUI::$clearAnswersOnWritingPostDataEnabled
private

◆ $leveled_ordering

assOrderingQuestionGUI::$leveled_ordering = array()

Definition at line 31 of file class.assOrderingQuestionGUI.php.

◆ $object

assOrderingQuestionGUI::$object

Definition at line 28 of file class.assOrderingQuestionGUI.php.

◆ $old_ordering_depth

assOrderingQuestionGUI::$old_ordering_depth = array()

Definition at line 30 of file class.assOrderingQuestionGUI.php.

Referenced by getOldLeveledOrdering().


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