ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
assMatchingQuestionGUI Class Reference

Matching question GUI representation. More...

+ Inheritance diagram for assMatchingQuestionGUI:
+ Collaboration diagram for assMatchingQuestionGUI:

Public Member Functions

 __construct ($id=-1)
 assMatchingQuestionGUI constructor More...
 
 writeAnswerSpecificPostData (ilPropertyFormGUI $form)
 Extracts the answer specific values from $_POST and applies them to the data object. More...
 
 writeQuestionSpecificPostData (ilPropertyFormGUI $form)
 Extracts the question specific values from $_POST and applies them to the data object. More...
 
 uploadterms ()
 
 removeimageterms ()
 
 uploaddefinitions ()
 
 removeimagedefinitions ()
 
 addterms ()
 
 removeterms ()
 
 adddefinitions ()
 
 removedefinitions ()
 
 addpairs ()
 
 removepairs ()
 
 editQuestion ($checkonly=false)
 
 populateAnswerSpecificFormPart (\ilPropertyFormGUI $form)
 
 populateQuestionSpecificFormPart (\ilPropertyFormGUI $form)
 
 supportsIntermediateSolutionOutput ()
 Question type specific support of intermediate solution output The function getSolutionOutput respects getUseIntermediateSolution() More...
 
 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, $showInlineFeedback=false)
 
 getPresentationJavascripts ()
 
 getTestOutput ($active_id, $pass, $is_postponed=false, $user_post_solution=false, $inlineFeedback=false)
 
 checkInput ()
 check input fields More...
 
 setQuestionTabs ()
 Sets the ILIAS tabs for this question type. More...
 
 getSpecificFeedbackOutput ($userSolution)
 
 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...
 
 getAnswersFrequency ($relevantAnswers, $questionIndex)
 
 getAnswerFrequencyTableGUI ($parentGui, $parentCmd, $relevantAnswers, $questionIndex)
 
 populateCorrectionsFormProperties (ilPropertyFormGUI $form)
 
 saveCorrectionsFormProperties (ilPropertyFormGUI $form)
 
- Public Member Functions inherited from assQuestionGUI
 __construct ()
 assQuestionGUI constructor More...
 
 hasInlineFeedback ()
 this method can be overwritten per question type More...
 
 addHeaderAction ()
 
 redrawHeaderAction ()
 
 getHeaderAction ()
 
 getNotesHTML ()
 
 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 (ilGlobalTemplateInterface $tpl)
 
 getPresentationJavascripts ()
 
 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="", $inlineFeedbackEnabled=false)
 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 ($userSolution)
 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)
 
 supportsIntermediateSolutionOutput ()
 Question type specific support of intermediate solution output The function getSolutionOutput respects getUseIntermediateSolution() More...
 
 hasIntermediateSolution ($activeId, $passIndex)
 Check if the question has an intermediate solution. More...
 
 setUseIntermediateSolution ($use)
 
 getUseIntermediateSolution ()
 Get if intermediate solution should be used for solution output. More...
 
 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 ()
 
 buildFocusAnchorHtml ()
 
 isAnswerFreuqencyStatisticSupported ()
 
 getSubQuestionsIndex ()
 
 getAnswersFrequency ($relevantAnswers, $questionIndex)
 
 getAnswerFrequencyTableGUI ($parentGui, $parentCmd, $relevantAnswers, $questionIndex)
 
 prepareReprintableCorrectionsForm (ilPropertyFormGUI $form)
 
 populateCorrectionsFormProperties (ilPropertyFormGUI $form)
 
 saveCorrectionsFormProperties (ilPropertyFormGUI $form)
 
- Public Member Functions inherited from ilGuiQuestionScoringAdjustable
 populateQuestionSpecificFormPart (ilPropertyFormGUI $form)
 Adds the question specific forms parts to a question property form gui. More...
 
- Public Member Functions inherited from ilGuiAnswerScoringAdjustable
 populateAnswerSpecificFormPart (ilPropertyFormGUI $form)
 Adds the answer specific form parts to a question property form gui. More...
 

Protected Member Functions

 writePostData ($always=false)
 {} More...
 
 getAnswerStatisticImageHtml ($picture)
 
 getAnswerStatisticMatchingElemHtml ($elem)
 
- 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

 isDefImgUploadCommand ()
 
 isTermImgUploadCommand ()
 
 isValidTermAndDefinitionAmount (ilPropertyFormGUI $form)
 for mode 1:1 terms count must not be less than definitions count for mode n:n this limitation is cancelled More...
 
 isCorrectMatching ($pair, $definition, $term)
 

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...
 
- 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 Attributes inherited from assQuestionGUI
 $editForm
 
 $use_intermediate_solution = false
 

Detailed Description

Matching question GUI representation.

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

assMatchingQuestionGUI: ilFormPropertyDispatchGUI

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

Constructor & Destructor Documentation

◆ __construct()

assMatchingQuestionGUI::__construct (   $id = -1)

assMatchingQuestionGUI constructor

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

Parameters
integer$idThe database id of a image map question object
integer$idThe database id of a image map question object
Returns

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

References ILIAS\GlobalScreen\Provider\__construct(), and assQuestionGUI\setErrorMessage().

36  {
38  include_once "./Modules/TestQuestionPool/classes/class.assMatchingQuestion.php";
39  $this->object = new assMatchingQuestion();
40  $this->setErrorMessage($this->lng->txt("msg_form_save_error"));
41  if ($id >= 0) {
42  $this->object->loadFromDb($id);
43  }
44  }
Class for matching questions.
setErrorMessage($errormessage)
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ adddefinitions()

assMatchingQuestionGUI::adddefinitions ( )

Definition at line 183 of file class.assMatchingQuestionGUI.php.

References $_POST, editQuestion(), and writePostData().

184  {
185  $this->writePostData();
186  $position = key($_POST["cmd"]["adddefinitions"]);
187  $this->object->insertDefinition($position + 1);
188  $this->editQuestion();
189  }
$_POST["username"]
+ Here is the call graph for this function:

◆ addpairs()

assMatchingQuestionGUI::addpairs ( )

Definition at line 199 of file class.assMatchingQuestionGUI.php.

References $_POST, editQuestion(), and writePostData().

200  {
201  $this->writePostData();
202  $position = key($_POST["cmd"]["addpairs"]);
203  $this->object->insertMatchingPair($position + 1);
204  $this->editQuestion();
205  }
$_POST["username"]
+ Here is the call graph for this function:

◆ addterms()

assMatchingQuestionGUI::addterms ( )

Definition at line 167 of file class.assMatchingQuestionGUI.php.

References $_POST, editQuestion(), and writePostData().

168  {
169  $this->writePostData();
170  $position = key($_POST["cmd"]["addterms"]);
171  $this->object->insertTerm($position + 1);
172  $this->editQuestion();
173  }
$_POST["username"]
+ Here is the call graph for this function:

◆ checkInput()

assMatchingQuestionGUI::checkInput ( )

check input fields

Definition at line 924 of file class.assMatchingQuestionGUI.php.

References $_POST.

925  {
926  if ((!$_POST["title"]) or (!$_POST["author"]) or (!$_POST["question"])) {
927  return false;
928  }
929  return true;
930  }
$_POST["username"]

◆ editQuestion()

assMatchingQuestionGUI::editQuestion (   $checkonly = false)

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

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

Referenced by adddefinitions(), addpairs(), addterms(), removedefinitions(), removeimagedefinitions(), removeimageterms(), removepairs(), removeterms(), uploaddefinitions(), uploadterms(), and writePostData().

216  {
217  $save = $this->isSaveCommand();
218  $this->getQuestionTemplate();
219 
220  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
221  $form = new ilPropertyFormGUI();
222  $this->editForm = $form;
223 
224  $form->setFormAction($this->ctrl->getFormAction($this));
225  $form->setTitle($this->outQuestionType());
226  $form->setMultipart(true);
227  $form->setTableWidth("100%");
228  $form->setId("matching");
229 
230 
231  // title, author, description, question, working time (assessment mode)
232  $this->addBasicQuestionFormProperties($form);
233  $this->populateQuestionSpecificFormPart($form);
234  $this->populateAnswerSpecificFormPart($form);
235  $this->populateTaxonomyFormSection($form);
236  $this->addQuestionFormCommandButtons($form);
237 
238  $errors = false;
239  if ($save) {
240  $form->setValuesByPost();
241  $errors = !$form->checkInput();
242  $form->setValuesByPost(); // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
243  if (!$errors && !$this->isValidTermAndDefinitionAmount($form) && !$this->object->getSelfAssessmentEditingMode()) {
244  $errors = true;
245  $terms = $form->getItemByPostVar('terms');
246  $terms->setAlert($this->lng->txt("msg_number_of_terms_too_low"));
247  ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
248  }
249  if ($errors) {
250  $checkonly = false;
251  }
252  }
253 
254  if (!$checkonly) {
255  $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
256  }
257  return $errors;
258  }
$errors
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question, working time.
This class represents a property form user interface.
isValidTermAndDefinitionAmount(ilPropertyFormGUI $form)
for mode 1:1 terms count must not be less than definitions count for mode n:n this limitation is canc...
getQuestionTemplate()
get question template
populateTaxonomyFormSection(ilPropertyFormGUI $form)
populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
populateAnswerSpecificFormPart(\ilPropertyFormGUI $form)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
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:

◆ getAfterParticipationSuppressionAnswerPostVars()

assMatchingQuestionGUI::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 1060 of file class.assMatchingQuestionGUI.php.

1061  {
1062  return array();
1063  }

◆ getAfterParticipationSuppressionQuestionPostVars()

assMatchingQuestionGUI::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 1074 of file class.assMatchingQuestionGUI.php.

1075  {
1076  return array();
1077  }

◆ getAggregatedAnswersView()

assMatchingQuestionGUI::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 1087 of file class.assMatchingQuestionGUI.php.

1088  {
1089  return ''; //print_r($relevant_answers,true);
1090  }

◆ getAnswerFrequencyTableGUI()

assMatchingQuestionGUI::getAnswerFrequencyTableGUI (   $parentGui,
  $parentCmd,
  $relevantAnswers,
  $questionIndex 
)
Parameters
$parentGui
$parentCmd
$relevantAnswers
$questionIndex
Returns
ilMatchingQuestionAnswerFreqStatTableGUI

Definition at line 1185 of file class.assMatchingQuestionGUI.php.

References getAnswersFrequency().

1186  {
1187  require_once 'Modules/TestQuestionPool/classes/tables/class.ilMatchingQuestionAnswerFreqStatTableGUI.php';
1188 
1189  $table = new ilMatchingQuestionAnswerFreqStatTableGUI($parentGui, $parentCmd, $this->object);
1190  $table->setQuestionIndex($questionIndex);
1191  $table->setData($this->getAnswersFrequency($relevantAnswers, $questionIndex));
1192  $table->initColumns();
1193 
1194  return $table;
1195  }
getAnswersFrequency($relevantAnswers, $questionIndex)
+ Here is the call graph for this function:

◆ getAnswersFrequency()

assMatchingQuestionGUI::getAnswersFrequency (   $relevantAnswers,
  $questionIndex 
)

Definition at line 1134 of file class.assMatchingQuestionGUI.php.

References getAnswerStatisticMatchingElemHtml().

Referenced by getAnswerFrequencyTableGUI().

1135  {
1136  $answersByActiveAndPass = array();
1137 
1138  foreach ($relevantAnswers as $row) {
1139  $key = $row['active_fi'] . ':' . $row['pass'];
1140 
1141  if (!isset($answersByActiveAndPass[$key])) {
1142  $answersByActiveAndPass[$key] = array();
1143  }
1144 
1145  $answersByActiveAndPass[$key][$row['value1']] = $row['value2'];
1146  }
1147 
1148  $answers = array();
1149 
1150  foreach ($answersByActiveAndPass as $key => $matchingPairs) {
1151  foreach ($matchingPairs as $termId => $defId) {
1152  $hash = md5($termId . ':' . $defId);
1153 
1154  if (!isset($answers[$hash])) {
1155  $termHtml = $this->getAnswerStatisticMatchingElemHtml(
1156  $this->object->getTermWithIdentifier($termId)
1157  );
1158 
1159  $defHtml = $this->getAnswerStatisticMatchingElemHtml(
1160  $this->object->getDefinitionWithIdentifier($defId)
1161  );
1162 
1163  $answers[$hash] = array(
1164  'answer' => $termHtml . $defHtml,
1165  'term' => $termHtml,
1166  'definition' => $defHtml,
1167  'frequency' => 0
1168  );
1169  }
1170 
1171  $answers[$hash]['frequency']++;
1172  }
1173  }
1174 
1175  return $answers;
1176  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAnswerStatisticImageHtml()

assMatchingQuestionGUI::getAnswerStatisticImageHtml (   $picture)
protected

Definition at line 1113 of file class.assMatchingQuestionGUI.php.

Referenced by getAnswerStatisticMatchingElemHtml().

1114  {
1115  $thumbweb = $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $picture;
1116  return '<img src="' . $thumbweb . '" alt="' . $picture . '" title="' . $picture . '"/>';
1117  }
+ Here is the caller graph for this function:

◆ getAnswerStatisticMatchingElemHtml()

assMatchingQuestionGUI::getAnswerStatisticMatchingElemHtml (   $elem)
protected

Definition at line 1119 of file class.assMatchingQuestionGUI.php.

References getAnswerStatisticImageHtml().

Referenced by getAnswersFrequency().

1120  {
1121  $html = '';
1122 
1123  if (strlen($elem->text)) {
1124  $html .= $elem->text;
1125  }
1126 
1127  if (strlen($elem->picture)) {
1128  $html .= $this->getAnswerStatisticImageHtml($elem->picture);
1129  }
1130 
1131  return $html;
1132  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPresentationJavascripts()

assMatchingQuestionGUI::getPresentationJavascripts ( )

Definition at line 753 of file class.assMatchingQuestionGUI.php.

References $DIC.

754  {
755  global $DIC; /* @var ILIAS\DI\Container $DIC */
756 
757  $files = array();
758 
759  if ($DIC['ilBrowser']->isMobile() || $DIC['ilBrowser']->isIpad()) {
760  $files[] = './libs/bower/bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.min.js';
761  }
762 
763  $files[] = 'Modules/TestQuestionPool/js/ilMatchingQuestion.js';
764 
765  return $files;
766  }
$DIC
Definition: xapitoken.php:46

◆ getPreview()

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

Definition at line 595 of file class.assMatchingQuestionGUI.php.

References $DIC, assQuestionGUI\getILIASPage(), ilUtil\getImagePath(), assQuestionGUI\getPreviewSession(), ilUtil\getStyleSheetLocation(), iljQueryUtil\initjQuery(), and iljQueryUtil\initjQueryUI().

596  {
597  $solutions = is_object($this->getPreviewSession()) ? (array) $this->getPreviewSession()->getParticipantsSolution() : array();
598 
599  global $DIC; /* @var ILIAS\DI\Container $DIC */
600  if ($DIC['ilBrowser']->isMobile() || $DIC['ilBrowser']->isIpad()) {
601  require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
604  $this->tpl->addJavaScript('./libs/bower/bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.min.js');
605  }
606  $this->tpl->addJavaScript('Modules/TestQuestionPool/js/ilMatchingQuestion.js');
607  $this->tpl->addCss(ilUtil::getStyleSheetLocation('output', 'test_javascript.css', 'Modules/TestQuestionPool'));
608 
609  $template = new ilTemplate("tpl.il_as_qpl_matching_output.html", true, true, "Modules/TestQuestionPool");
610 
611  foreach ($solutions as $defId => $terms) {
612  foreach ($terms as $termId) {
613  $template->setCurrentBlock("matching_data");
614  $template->setVariable("DEFINITION_ID", $defId);
615  $template->setVariable("TERM_ID", $termId);
616  $template->parseCurrentBlock();
617  }
618  }
619 
620  // shuffle output
621  $terms = $this->object->getTerms();
622  $definitions = $this->object->getDefinitions();
623  switch ($this->object->getShuffle()) {
624  case 1:
625  $seed = $this->object->getShuffler()->getSeed();
626  $this->object->getShuffler()->setSeed($seed . '1');
627  $terms = $this->object->getShuffler()->shuffle($terms);
628  $this->object->getShuffler()->setSeed($seed . '2');
629  $definitions = $this->object->getShuffler()->shuffle($definitions);
630  $this->object->getShuffler()->setSeed($seed);
631  break;
632  case 2:
633  $terms = $this->object->getShuffler()->shuffle($terms);
634  break;
635  case 3:
636  $definitions = $this->object->getShuffler()->shuffle($definitions);
637  break;
638  }
639 
640  // create definitions
641  $counter = 0;
642  foreach ($definitions as $definition) {
643  if (strlen($definition->picture)) {
644  $template->setCurrentBlock("definition_picture");
645  $template->setVariable("DEFINITION_ID", $definition->identifier);
646  $template->setVariable("IMAGE_HREF", $this->object->getImagePathWeb() . $definition->picture);
647  $thumbweb = $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $definition->picture;
648  $thumb = $this->object->getImagePath() . $this->object->getThumbPrefix() . $definition->picture;
649  if (!@file_exists($thumb)) {
650  $this->object->rebuildThumbnails();
651  }
652  $template->setVariable("THUMBNAIL_HREF", $thumbweb);
653  $template->setVariable("THUMB_ALT", $this->lng->txt("image"));
654  $template->setVariable("THUMB_TITLE", $this->lng->txt("image"));
655  $template->setVariable("TEXT_DEFINITION", (strlen($definition->text)) ? $this->object->prepareTextareaOutput($definition->text, true, true) : '');
656  $template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
657  $template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.svg'));
658  $template->parseCurrentBlock();
659  } else {
660  $template->setCurrentBlock("definition_text");
661  $template->setVariable("DEFINITION", $this->object->prepareTextareaOutput($definition->text, true, true));
662  $template->parseCurrentBlock();
663  }
664 
665  $template->setCurrentBlock("droparea");
666  $template->setVariable("ID_DROPAREA", $definition->identifier);
667  $template->setVariable("QUESTION_ID", $this->object->getId());
668  $template->parseCurrentBlock();
669 
670  $template->setCurrentBlock("definition_data");
671  $template->setVariable("DEFINITION_ID", $definition->identifier);
672  $template->parseCurrentBlock();
673  }
674 
675  // create terms
676  $counter = 0;
677  foreach ($terms as $term) {
678  if (strlen($term->picture)) {
679  $template->setCurrentBlock("term_picture");
680  $template->setVariable("TERM_ID", $term->identifier);
681  $template->setVariable("IMAGE_HREF", $this->object->getImagePathWeb() . $term->picture);
682  $thumbweb = $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $term->picture;
683  $thumb = $this->object->getImagePath() . $this->object->getThumbPrefix() . $term->picture;
684  if (!@file_exists($thumb)) {
685  $this->object->rebuildThumbnails();
686  }
687  $template->setVariable("THUMBNAIL_HREF", $thumbweb);
688  $template->setVariable("THUMB_ALT", $this->lng->txt("image"));
689  $template->setVariable("THUMB_TITLE", $this->lng->txt("image"));
690  $template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
691  $template->setVariable("TEXT_TERM", (strlen($term->text)) ? $this->object->prepareTextareaOutput($term->text, true, true) : '');
692  $template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.svg'));
693  $template->parseCurrentBlock();
694  } else {
695  $template->setCurrentBlock("term_text");
696  $template->setVariable("TERM_TEXT", $this->object->prepareTextareaOutput($term->text, true, true));
697  $template->parseCurrentBlock();
698  }
699  $template->setCurrentBlock("draggable");
700  $template->setVariable("ID_DRAGGABLE", $term->identifier);
701  $template->parseCurrentBlock();
702 
703  $template->setCurrentBlock("term_data");
704  $template->setVariable("TERM_ID", $term->identifier);
705  $template->parseCurrentBlock();
706  }
707 
708  $template->setVariable('MATCHING_MODE', $this->object->getMatchingMode());
709 
710  $template->setVariable("RESET_BUTTON", $this->lng->txt("reset_terms"));
711 
712  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), true));
713 
714  $questionoutput = $template->get();
715 
716  if (!$show_question_only) {
717  // get page object output
718  $questionoutput = $this->getILIASPage($questionoutput);
719  }
720 
721  return $questionoutput;
722  }
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
getILIASPage($html="")
Returns the ILIAS Page around a question.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static initjQueryUI($a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components.txt for included components)
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ getSolutionOutput()

assMatchingQuestionGUI::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 431 of file class.assMatchingQuestionGUI.php.

References $i, $ok, $pass, ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_CORRECT, ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_WRONG, assQuestionGUI\getGenericFeedbackOutput(), assQuestionGUI\getILIASPage(), ilUtil\getImagePath(), getSpecificFeedbackOutput(), assQuestionGUI\getUseIntermediateSolution(), assQuestionGUI\hasCorrectSolution(), isCorrectMatching(), assQuestionGUI\isTestPresentationContext(), ilUtil\prepareFormOutput(), and ilWACSignedPath\signFile().

441  {
442  // generate the question output
443  include_once "./Services/UICore/classes/class.ilTemplate.php";
444  $template = new ilTemplate("tpl.il_as_qpl_matching_output_solution.html", true, true, "Modules/TestQuestionPool");
445  $solutiontemplate = new ilTemplate("tpl.il_as_tst_solution_output.html", true, true, "Modules/TestQuestionPool");
446 
447  $solutions = array();
448  if (($active_id > 0) && (!$show_correct_solution)) {
449  include_once "./Modules/Test/classes/class.ilObjTest.php";
450  $solutions = $this->object->getSolutionValues($active_id, $pass, !$this->getUseIntermediateSolution());
451  $solution_script .= "";
452  } else {
453  foreach ($this->object->getMaximumScoringMatchingPairs() as $pair) {
454  $solutions[] = array(
455  "value1" => $pair->term->identifier,
456  "value2" => $pair->definition->identifier,
457  'points' => $pair->points
458  );
459  }
460  }
461 
462  $i = 0;
463 
464  foreach ($solutions as $solution) {
465  $definition = $this->object->getDefinitionWithIdentifier($solution['value2']);
466  $term = $this->object->getTermWithIdentifier($solution['value1']);
467  $points = $solution['points'];
468 
469  if (is_object($definition)) {
470  if (strlen($definition->picture)) {
471  if (strlen($definition->text)) {
472  $template->setCurrentBlock('definition_image_text');
473  $template->setVariable("TEXT_DEFINITION", ilUtil::prepareFormOutput($definition->text));
474  $template->parseCurrentBlock();
475  }
476 
477  $answerImageSrc = ilWACSignedPath::signFile(
478  $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $definition->picture
479  );
480 
481  $template->setCurrentBlock('definition_image');
482  $template->setVariable('ANSWER_IMAGE_URL', $answerImageSrc);
483  $template->setVariable('ANSWER_IMAGE_ALT', (strlen($definition->text)) ? ilUtil::prepareFormOutput($definition->text) : ilUtil::prepareFormOutput($definition->picture));
484  $template->setVariable('ANSWER_IMAGE_TITLE', (strlen($definition->text)) ? ilUtil::prepareFormOutput($definition->text) : ilUtil::prepareFormOutput($definition->picture));
485  $template->setVariable('URL_PREVIEW', $this->object->getImagePathWeb() . $definition->picture);
486  $template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
487  $template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.svg'));
488  $template->parseCurrentBlock();
489  } else {
490  $template->setCurrentBlock('definition_text');
491  $template->setVariable("DEFINITION", $this->object->prepareTextareaOutput($definition->text, true));
492  $template->parseCurrentBlock();
493  }
494  }
495  if (is_object($term)) {
496  if (strlen($term->picture)) {
497  if (strlen($term->text)) {
498  $template->setCurrentBlock('term_image_text');
499  $template->setVariable("TEXT_TERM", ilUtil::prepareFormOutput($term->text));
500  $template->parseCurrentBlock();
501  }
502 
503  $answerImageSrc = ilWACSignedPath::signFile(
504  $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $term->picture
505  );
506 
507  $template->setCurrentBlock('term_image');
508  $template->setVariable('ANSWER_IMAGE_URL', $answerImageSrc);
509  $template->setVariable('ANSWER_IMAGE_ALT', (strlen($term->text)) ? ilUtil::prepareFormOutput($term->text) : ilUtil::prepareFormOutput($term->picture));
510  $template->setVariable('ANSWER_IMAGE_TITLE', (strlen($term->text)) ? ilUtil::prepareFormOutput($term->text) : ilUtil::prepareFormOutput($term->picture));
511  $template->setVariable('URL_PREVIEW', $this->object->getImagePathWeb() . $term->picture);
512  $template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
513  $template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.svg'));
514  $template->parseCurrentBlock();
515  } else {
516  $template->setCurrentBlock('term_text');
517  $template->setVariable("TERM", $this->object->prepareTextareaOutput($term->text, true));
518  $template->parseCurrentBlock();
519  }
520  $i++;
521  }
522  if (($active_id > 0) && (!$show_correct_solution)) {
523  if ($graphicalOutput) {
524  // output of ok/not ok icons for user entered solutions
525  $ok = false;
526  foreach ($this->object->getMatchingPairs() as $pair) {
527  if ($this->isCorrectMatching($pair, $definition, $term)) {
528  $ok = true;
529  }
530  }
531 
532  if ($ok) {
533  $template->setCurrentBlock("icon_ok");
534  $template->setVariable("ICON_OK", ilUtil::getImagePath("icon_ok.svg"));
535  $template->setVariable("TEXT_OK", $this->lng->txt("answer_is_right"));
536  $template->parseCurrentBlock();
537  } else {
538  $template->setCurrentBlock("icon_ok");
539  $template->setVariable("ICON_NOT_OK", ilUtil::getImagePath("icon_not_ok.svg"));
540  $template->setVariable("TEXT_NOT_OK", $this->lng->txt("answer_is_wrong"));
541  $template->parseCurrentBlock();
542  }
543  }
544  }
545 
546  if ($result_output) {
547  $resulttext = ($points == 1) ? "(%s " . $this->lng->txt("point") . ")" : "(%s " . $this->lng->txt("points") . ")";
548  $template->setCurrentBlock("result_output");
549  $template->setVariable("RESULT_OUTPUT", sprintf($resulttext, $points));
550  $template->parseCurrentBlock();
551  }
552 
553  $template->setCurrentBlock("row");
554  $template->setVariable("TEXT_MATCHES", $this->lng->txt("matches"));
555  $template->parseCurrentBlock();
556  }
557 
558  $questiontext = $this->object->getQuestion();
559  if ($show_question_text == true) {
560  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, true));
561  }
562 
563  $questionoutput = $template->get();
564 
565  $feedback = '';
566  if ($show_feedback) {
567  if (!$this->isTestPresentationContext()) {
568  $fb = $this->getGenericFeedbackOutput($active_id, $pass);
569  $feedback .= strlen($fb) ? $fb : '';
570  }
571 
572  $fb = $this->getSpecificFeedbackOutput(array());
573  $feedback .= strlen($fb) ? $fb : '';
574  }
575  if (strlen($feedback)) {
576  $cssClass = (
577  $this->hasCorrectSolution($active_id, $pass) ?
579  );
580 
581  $solutiontemplate->setVariable("ILC_FB_CSS_CLASS", $cssClass);
582  $solutiontemplate->setVariable("FEEDBACK", $this->object->prepareTextareaOutput($feedback, true));
583  }
584 
585  $solutiontemplate->setVariable("SOLUTION_OUTPUT", $questionoutput);
586 
587  $solutionoutput = $solutiontemplate->get();
588  if (!$show_question_only) {
589  // get page object output
590  $solutionoutput = $this->getILIASPage($solutionoutput);
591  }
592  return $solutionoutput;
593  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
hasCorrectSolution($activeId, $passIndex)
getUseIntermediateSolution()
Get if intermediate solution should be used for solution output.
getILIASPage($html="")
Returns the ILIAS Page around a question.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
isCorrectMatching($pair, $definition, $term)
static signFile($path_to_file)
getGenericFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
$i
Definition: metadata.php:24
+ Here is the call graph for this function:

◆ getSpecificFeedbackOutput()

assMatchingQuestionGUI::getSpecificFeedbackOutput (   $userSolution)

Definition at line 1014 of file class.assMatchingQuestionGUI.php.

Referenced by getSolutionOutput().

1015  {
1016  $matches = array_values($this->object->matchingpairs);
1017 
1018  if (!$this->object->feedbackOBJ->specificAnswerFeedbackExists()) {
1019  return '';
1020  }
1021 
1022  $feedback = '<table class="test_specific_feedback"><tbody>';
1023 
1024  foreach ($matches as $idx => $ans) {
1025  if (!isset($userSolution[$ans->definition->identifier])) {
1026  continue;
1027  }
1028 
1029  if (!is_array($userSolution[$ans->definition->identifier])) {
1030  continue;
1031  }
1032 
1033  if (!in_array($ans->term->identifier, $userSolution[$ans->definition->identifier])) {
1034  continue;
1035  }
1036 
1037  $fb = $this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
1038  $this->object->getId(),
1039  0,
1040  $idx
1041  );
1042  $feedback .= '<tr><td>"' . $ans->definition->text . '"&nbsp;' . $this->lng->txt("matches") . '&nbsp;"';
1043  $feedback .= $ans->term->text . '"</td><td>';
1044  $feedback .= $fb . '</td> </tr>';
1045  }
1046 
1047  $feedback .= '</tbody></table>';
1048  return $this->object->prepareTextareaOutput($feedback, true);
1049  }
+ Here is the caller graph for this function:

◆ getTestOutput()

assMatchingQuestionGUI::getTestOutput (   $active_id,
  $pass,
  $is_postponed = false,
  $user_post_solution = false,
  $inlineFeedback = false 
)

Definition at line 769 of file class.assMatchingQuestionGUI.php.

References $DIC, $pass, ilUtil\getImagePath(), ilUtil\getStyleSheetLocation(), iljQueryUtil\initjQuery(), iljQueryUtil\initjQueryUI(), and assQuestionGUI\outQuestionPage().

771  {
772  global $DIC; /* @var ILIAS\DI\Container $DIC */
773  if ($DIC['ilBrowser']->isMobile() || $DIC['ilBrowser']->isIpad()) {
774  require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
777  $this->tpl->addJavaScript('./libs/bower/bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.min.js');
778  }
779  $this->tpl->addJavaScript('Modules/TestQuestionPool/js/ilMatchingQuestion.js');
780  $this->tpl->addCss(ilUtil::getStyleSheetLocation('output', 'test_javascript.css', 'Modules/TestQuestionPool'));
781 
782  $template = new ilTemplate("tpl.il_as_qpl_matching_output.html", true, true, "Modules/TestQuestionPool");
783 
784  if ($active_id) {
785  // hey: prevPassSolutions - obsolete due to central check
786  #$solutions = NULL;
787  #include_once "./Modules/Test/classes/class.ilObjTest.php";
788  #if (!ilObjTest::_getUsePreviousAnswers($active_id, true))
789  #{
790  # if (is_null($pass)) $pass = ilObjTest::_getPass($active_id);
791  #}
792  // hey.
793  if (is_array($user_post_solution)) {
794  $solutions = array();
795  foreach ($user_post_solution['matching'][$this->object->getId()] as $definition => $term) {
796  array_push($solutions, array("value1" => $term, "value2" => $definition));
797  }
798  } else {
799  // hey: prevPassSolutions - obsolete due to central check
800  $solutions = $this->object->getTestOutputSolutions($active_id, $pass);
801  // hey.
802  }
803 
804  $counter = 0;
805  foreach ($solutions as $idx => $solution_value) {
806  if (($solution_value["value2"] > -1) && ($solution_value["value1"] > -1)) {
807  $template->setCurrentBlock("matching_data");
808  $template->setVariable("TERM_ID", $solution_value["value1"]);
809  $template->setVariable("DEFINITION_ID", $solution_value["value2"]);
810  $template->parseCurrentBlock();
811  }
812 
813  $counter++;
814  }
815  }
816 
817  $terms = $this->object->getTerms();
818  $definitions = $this->object->getDefinitions();
819  switch ($this->object->getShuffle()) {
820  case 1:
821  $seed = $this->object->getShuffler()->getSeed();
822  $this->object->getShuffler()->setSeed($seed . '1');
823  $terms = $this->object->getShuffler()->shuffle($terms);
824  if (count($solutions)) {
825  $definitions = $this->sortDefinitionsBySolution($solutions, $definitions);
826  } else {
827  $this->object->getShuffler()->setSeed($seed . '2');
828  $definitions = $this->object->getShuffler()->shuffle($definitions);
829  }
830  $this->object->getShuffler()->setSeed($seed);
831  break;
832  case 2:
833  $terms = $this->object->getShuffler()->shuffle($terms);
834  break;
835  case 3:
836  if (count($solutions)) {
837  $definitions = $this->sortDefinitionsBySolution($solutions, $definitions);
838  } else {
839  $definitions = $this->object->getShuffler()->shuffle($definitions);
840  }
841  break;
842  }
843 
844  // create definitions
845  $counter = 0;
846  foreach ($definitions as $definition) {
847  if (strlen($definition->picture)) {
848  $template->setCurrentBlock("definition_picture");
849  $template->setVariable("DEFINITION_ID", $definition->identifier);
850  $template->setVariable("IMAGE_HREF", $this->object->getImagePathWeb() . $definition->picture);
851  $thumbweb = $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $definition->picture;
852  $thumb = $this->object->getImagePath() . $this->object->getThumbPrefix() . $definition->picture;
853  if (!@file_exists($thumb)) {
854  $this->object->rebuildThumbnails();
855  }
856  $template->setVariable("THUMBNAIL_HREF", $thumbweb);
857  $template->setVariable("THUMB_ALT", $this->lng->txt("image"));
858  $template->setVariable("THUMB_TITLE", $this->lng->txt("image"));
859  $template->setVariable("TEXT_DEFINITION", (strlen($definition->text)) ? $this->object->prepareTextareaOutput($definition->text, true, true) : '');
860  $template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
861  $template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.svg'));
862  $template->parseCurrentBlock();
863  } else {
864  $template->setCurrentBlock("definition_text");
865  $template->setVariable("DEFINITION", $this->object->prepareTextareaOutput($definition->text, true, true));
866  $template->parseCurrentBlock();
867  }
868 
869  $template->setCurrentBlock("droparea");
870  $template->setVariable("ID_DROPAREA", $definition->identifier);
871  $template->setVariable("QUESTION_ID", $this->object->getId());
872  $template->parseCurrentBlock();
873 
874  $template->setCurrentBlock("definition_data");
875  $template->setVariable("DEFINITION_ID", $definition->identifier);
876  $template->parseCurrentBlock();
877  }
878 
879  // create terms
880  $counter = 0;
881  foreach ($terms as $term) {
882  if (strlen($term->picture)) {
883  $template->setCurrentBlock("term_picture");
884  $template->setVariable("TERM_ID", $term->identifier);
885  $template->setVariable("IMAGE_HREF", $this->object->getImagePathWeb() . $term->picture);
886  $thumbweb = $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $term->picture;
887  $thumb = $this->object->getImagePath() . $this->object->getThumbPrefix() . $term->picture;
888  if (!@file_exists($thumb)) {
889  $this->object->rebuildThumbnails();
890  }
891  $template->setVariable("THUMBNAIL_HREF", $thumbweb);
892  $template->setVariable("THUMB_ALT", $this->lng->txt("image"));
893  $template->setVariable("THUMB_TITLE", $this->lng->txt("image"));
894  $template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
895  $template->setVariable("TEXT_TERM", (strlen($term->text)) ? $this->object->prepareTextareaOutput($term->text, true, true) : '');
896  $template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.svg'));
897  $template->parseCurrentBlock();
898  } else {
899  $template->setCurrentBlock("term_text");
900  $template->setVariable("TERM_TEXT", $this->object->prepareTextareaOutput($term->text, true, true));
901  $template->parseCurrentBlock();
902  }
903  $template->setCurrentBlock("draggable");
904  $template->setVariable("ID_DRAGGABLE", $term->identifier);
905  $template->parseCurrentBlock();
906 
907  $template->setCurrentBlock('term_data');
908  $template->setVariable('TERM_ID', $term->identifier);
909  $template->parseCurrentBlock();
910  }
911 
912  $template->setVariable('MATCHING_MODE', $this->object->getMatchingMode());
913 
914  $template->setVariable("RESET_BUTTON", $this->lng->txt("reset_terms"));
915 
916  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), true));
917 
918  return $this->outQuestionPage("", $is_postponed, $active_id, $template->get());
919  }
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static initjQueryUI($a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components.txt for included components)
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
output question page
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ isCorrectMatching()

assMatchingQuestionGUI::isCorrectMatching (   $pair,
  $definition,
  $term 
)
private

Definition at line 1092 of file class.assMatchingQuestionGUI.php.

Referenced by getSolutionOutput().

1093  {
1094  if (!($pair->points > 0)) {
1095  return false;
1096  }
1097 
1098  if (!is_object($term)) {
1099  return false;
1100  }
1101 
1102  if ($pair->definition->identifier != $definition->identifier) {
1103  return false;
1104  }
1105 
1106  if ($pair->term->identifier != $term->identifier) {
1107  return false;
1108  }
1109 
1110  return true;
1111  }
+ Here is the caller graph for this function:

◆ isDefImgUploadCommand()

assMatchingQuestionGUI::isDefImgUploadCommand ( )
private

Definition at line 260 of file class.assMatchingQuestionGUI.php.

Referenced by populateAnswerSpecificFormPart().

261  {
262  return $this->ctrl->getCmd() == 'uploaddefinitions';
263  }
+ Here is the caller graph for this function:

◆ isTermImgUploadCommand()

assMatchingQuestionGUI::isTermImgUploadCommand ( )
private

Definition at line 265 of file class.assMatchingQuestionGUI.php.

Referenced by populateAnswerSpecificFormPart().

266  {
267  return $this->ctrl->getCmd() == 'uploadterms';
268  }
+ Here is the caller graph for this function:

◆ isValidTermAndDefinitionAmount()

assMatchingQuestionGUI::isValidTermAndDefinitionAmount ( ilPropertyFormGUI  $form)
private

for mode 1:1 terms count must not be less than definitions count for mode n:n this limitation is cancelled

Parameters
ilPropertyFormGUI$form
Returns
bool

Definition at line 277 of file class.assMatchingQuestionGUI.php.

References ilPropertyFormGUI\getItemByPostVar(), and assMatchingQuestion\MATCHING_MODE_N_ON_N.

Referenced by editQuestion().

278  {
279  $matchingMode = $form->getItemByPostVar('matching_mode')->getValue();
280 
281  if ($matchingMode == assMatchingQuestion::MATCHING_MODE_N_ON_N) {
282  return true;
283  }
284 
285  $numTerms = count($form->getItemByPostVar('terms')->getValues());
286  $numDefinitions = count($form->getItemByPostVar('definitions')->getValues());
287 
288  if ($numTerms >= $numDefinitions) {
289  return true;
290  }
291 
292  return false;
293  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateAnswerSpecificFormPart()

assMatchingQuestionGUI::populateAnswerSpecificFormPart ( \ilPropertyFormGUI  $form)

Definition at line 295 of file class.assMatchingQuestionGUI.php.

References ilPropertyFormGUI\addItem(), isDefImgUploadCommand(), isTermImgUploadCommand(), ilMatchingWizardInputGUI\setHideImages(), and ilFormPropertyGUI\setRequired().

Referenced by editQuestion().

296  {
297  // Definitions
298  include_once "./Modules/TestQuestionPool/classes/class.ilMatchingWizardInputGUI.php";
299  $definitions = new ilMatchingWizardInputGUI($this->lng->txt("definitions"), "definitions");
300  if ($this->object->getSelfAssessmentEditingMode()) {
301  $definitions->setHideImages(true);
302  }
303 
304  $definitions->setRequired(true);
305  $definitions->setQuestionObject($this->object);
306  $definitions->setTextName($this->lng->txt('definition_text'));
307  $definitions->setImageName($this->lng->txt('definition_image'));
308  include_once "./Modules/TestQuestionPool/classes/class.assAnswerMatchingDefinition.php";
309  if (!count($this->object->getDefinitions())) {
310  $this->object->addDefinition(new assAnswerMatchingDefinition());
311  }
312  $definitionvalues = $this->object->getDefinitions();
313  $definitions->setValues($definitionvalues);
314  if ($this->isDefImgUploadCommand()) {
315  $definitions->checkInput();
316  }
317  $form->addItem($definitions);
318 
319  // Terms
320  include_once "./Modules/TestQuestionPool/classes/class.ilMatchingWizardInputGUI.php";
321  $terms = new ilMatchingWizardInputGUI($this->lng->txt("terms"), "terms");
322  if ($this->object->getSelfAssessmentEditingMode()) {
323  $terms->setHideImages(true);
324  }
325  $terms->setRequired(true);
326  $terms->setQuestionObject($this->object);
327  $terms->setTextName($this->lng->txt('term_text'));
328  $terms->setImageName($this->lng->txt('term_image'));
329  include_once "./Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php";
330  if (!count($this->object->getTerms())) {
331  $this->object->addTerm(new assAnswerMatchingTerm());
332  }
333  $termvalues = $this->object->getTerms();
334  $terms->setValues($termvalues);
335  if ($this->isTermImgUploadCommand()) {
336  $terms->checkInput();
337  }
338  $form->addItem($terms);
339 
340  // Matching Pairs
341  include_once "./Modules/TestQuestionPool/classes/class.ilMatchingPairWizardInputGUI.php";
342  $pairs = new ilMatchingPairWizardInputGUI($this->lng->txt('matching_pairs'), 'pairs');
343  $pairs->setRequired(true);
344  $pairs->setTerms($this->object->getTerms());
345  $pairs->setDefinitions($this->object->getDefinitions());
346  include_once "./Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php";
347  if (count($this->object->getMatchingPairs()) == 0) {
348  $this->object->addMatchingPair(new assAnswerMatchingPair($termvalues[0], $definitionvalues[0], 0));
349  }
350  $pairs->setPairs($this->object->getMatchingPairs());
351  $form->addItem($pairs);
352 
353  return $form;
354  }
Class for matching question terms.
Class for matching question pairs.
This class represents a single choice wizard property in a property form.
setHideImages($a_hide)
Set hide images.
Class for matching question definitions.
setRequired($a_required)
Set Required.
This class represents a key value pair wizard property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateCorrectionsFormProperties()

assMatchingQuestionGUI::populateCorrectionsFormProperties ( ilPropertyFormGUI  $form)

Definition at line 1197 of file class.assMatchingQuestionGUI.php.

References ilPropertyFormGUI\addItem(), and ilFormPropertyGUI\setRequired().

1198  {
1199  require_once 'Modules/TestQuestionPool/classes/forms/class.ilAssMatchingPairCorrectionsInputGUI.php';
1200  $pairs = new ilAssMatchingPairCorrectionsInputGUI($this->lng->txt('matching_pairs'), 'pairs');
1201  $pairs->setRequired(true);
1202  $pairs->setTerms($this->object->getTerms());
1203  $pairs->setDefinitions($this->object->getDefinitions());
1204  $pairs->setPairs($this->object->getMatchingPairs());
1205  $form->addItem($pairs);
1206  }
addItem($a_item)
Add Item (Property, SectionHeader).
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

◆ populateQuestionSpecificFormPart()

assMatchingQuestionGUI::populateQuestionSpecificFormPart ( \ilPropertyFormGUI  $form)

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

References ilPropertyFormGUI\addItem(), assMatchingQuestion\MATCHING_MODE_1_ON_1, assMatchingQuestion\MATCHING_MODE_N_ON_N, ilFormPropertyGUI\setRequired(), ilNumberInputGUI\setValue(), and ilRadioOption\setValue().

Referenced by editQuestion().

357  {
358  // Edit mode
359  $hidden = new ilHiddenInputGUI("matching_type");
360  $hidden->setValue($matchingtype);
361  $form->addItem($hidden);
362 
363  if (!$this->object->getSelfAssessmentEditingMode()) {
364  // shuffle
365  $shuffle = new ilSelectInputGUI($this->lng->txt("shuffle_answers"), "shuffle");
366  $shuffle_options = array(
367  0 => $this->lng->txt("no"),
368  1 => $this->lng->txt("matching_shuffle_terms_definitions"),
369  2 => $this->lng->txt("matching_shuffle_terms"),
370  3 => $this->lng->txt("matching_shuffle_definitions")
371  );
372  $shuffle->setOptions($shuffle_options);
373  $shuffle->setValue($this->object->getShuffle() != null ? $this->object->getShuffle() : 1);
374  $shuffle->setRequired(false);
375  $form->addItem($shuffle);
376 
377  $geometry = new ilNumberInputGUI($this->lng->txt("thumb_geometry"), "thumb_geometry");
378  $geometry->setValue($this->object->getThumbGeometry());
379  $geometry->setRequired(true);
380  $geometry->setMaxLength(6);
381  $geometry->setMinValue(20);
382  $geometry->setSize(6);
383  $geometry->setInfo($this->lng->txt("thumb_geometry_info"));
384  $form->addItem($geometry);
385  }
386 
387  // Matching Mode
388  $mode = new ilRadioGroupInputGUI($this->lng->txt('qpl_qst_inp_matching_mode'), 'matching_mode');
389  $mode->setRequired(true);
390 
391  $modeONEonONE = new ilRadioOption(
392  $this->lng->txt('qpl_qst_inp_matching_mode_one_on_one'),
394  );
395  $mode->addOption($modeONEonONE);
396 
397  $modeALLonALL = new ilRadioOption(
398  $this->lng->txt('qpl_qst_inp_matching_mode_all_on_all'),
400  );
401  $mode->addOption($modeALLonALL);
402 
403  $mode->setValue($this->object->getMatchingMode());
404 
405  $form->addItem($mode);
406  }
This class represents an option in a radio group.
setValue($a_value)
Set Value.
This class represents a hidden form property in a property form.
This class represents a property in a property form.
setValue($a_value)
Set Value.
This class represents a number property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removedefinitions()

assMatchingQuestionGUI::removedefinitions ( )

Definition at line 191 of file class.assMatchingQuestionGUI.php.

References $_POST, editQuestion(), and writePostData().

192  {
193  $this->writePostData();
194  $position = key($_POST["cmd"]["removedefinitions"]);
195  $this->object->deleteDefinition($position);
196  $this->editQuestion();
197  }
$_POST["username"]
+ Here is the call graph for this function:

◆ removeimagedefinitions()

assMatchingQuestionGUI::removeimagedefinitions ( )

Definition at line 159 of file class.assMatchingQuestionGUI.php.

References $_POST, editQuestion(), and writePostData().

160  {
161  $this->writePostData(true);
162  $position = key($_POST['cmd']['removeimagedefinitions']);
163  $this->object->removeDefinitionImage($position);
164  $this->editQuestion();
165  }
$_POST["username"]
+ Here is the call graph for this function:

◆ removeimageterms()

assMatchingQuestionGUI::removeimageterms ( )

Definition at line 145 of file class.assMatchingQuestionGUI.php.

References $_POST, editQuestion(), and writePostData().

146  {
147  $this->writePostData(true);
148  $position = key($_POST['cmd']['removeimageterms']);
149  $this->object->removeTermImage($position);
150  $this->editQuestion();
151  }
$_POST["username"]
+ Here is the call graph for this function:

◆ removepairs()

assMatchingQuestionGUI::removepairs ( )

Definition at line 207 of file class.assMatchingQuestionGUI.php.

References $_POST, editQuestion(), and writePostData().

208  {
209  $this->writePostData();
210  $position = key($_POST["cmd"]["removepairs"]);
211  $this->object->deleteMatchingPair($position);
212  $this->editQuestion();
213  }
$_POST["username"]
+ Here is the call graph for this function:

◆ removeterms()

assMatchingQuestionGUI::removeterms ( )

Definition at line 175 of file class.assMatchingQuestionGUI.php.

References $_POST, editQuestion(), and writePostData().

176  {
177  $this->writePostData();
178  $position = key($_POST["cmd"]["removeterms"]);
179  $this->object->deleteTerm($position);
180  $this->editQuestion();
181  }
$_POST["username"]
+ Here is the call graph for this function:

◆ saveCorrectionsFormProperties()

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

Definition at line 1211 of file class.assMatchingQuestionGUI.php.

References ilPropertyFormGUI\getItemByPostVar().

1212  {
1213  $pairs = $form->getItemByPostVar('pairs')->getPairs();
1214 
1215  foreach ($this->object->getMatchingPairs() as $idx => $matchingPair) {
1216  $matchingPair->points = (float) $pairs[$idx]->points;
1217  }
1218  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
+ Here is the call graph for this function:

◆ setQuestionTabs()

assMatchingQuestionGUI::setQuestionTabs ( )

Sets the ILIAS tabs for this question type.

public

Todo:
: MOVE THIS STEPS TO COMMON QUESTION CLASS assQuestionGUI

Definition at line 939 of file class.assMatchingQuestionGUI.php.

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

940  {
941  global $DIC;
942  $rbacsystem = $DIC['rbacsystem'];
943  $ilTabs = $DIC['ilTabs'];
944 
945  $ilTabs->clearTargets();
946 
947  $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
948  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
949  $q_type = $this->object->getQuestionType();
950 
951  if (strlen($q_type)) {
952  $classname = $q_type . "GUI";
953  $this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
954  $this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
955  }
956 
957  if ($_GET["q_id"]) {
958  if ($rbacsystem->checkAccess('write', $_GET["ref_id"])) {
959  // edit page
960  $ilTabs->addTarget(
961  "edit_page",
962  $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
963  array("edit", "insert", "exec_pg"),
964  "",
965  "",
966  $force_active
967  );
968  }
969 
970  $this->addTab_QuestionPreview($ilTabs);
971  }
972 
973  $force_active = false;
974  if ($rbacsystem->checkAccess('write', $_GET["ref_id"])) {
975  $url = "";
976  if ($classname) {
977  $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
978  }
979  // edit question properties
980  $ilTabs->addTarget(
981  "edit_question",
982  $url,
983  array("editQuestion", "save", "saveEdit", "removeimageterms", "uploadterms", "removeimagedefinitions", "uploaddefinitions",
984  "addpairs", "removepairs", "addterms", "removeterms", "adddefinitions", "removedefinitions", "originalSyncForm"),
985  $classname,
986  "",
987  $force_active
988  );
989  }
990 
991  // add tab for question feedback within common class assQuestionGUI
992  $this->addTab_QuestionFeedback($ilTabs);
993 
994  // add tab for question hint within common class assQuestionGUI
995  $this->addTab_QuestionHints($ilTabs);
996 
997  // add tab for question's suggested solution within common class assQuestionGUI
998  $this->addTab_SuggestedSolution($ilTabs, $classname);
999 
1000  // Assessment of questions sub menu entry
1001  if ($_GET["q_id"]) {
1002  $ilTabs->addTarget(
1003  "statistics",
1004  $this->ctrl->getLinkTargetByClass($classname, "assessment"),
1005  array("assessment"),
1006  $classname,
1007  ""
1008  );
1009  }
1010 
1011  $this->addBackTab($ilTabs);
1012  }
addTab_QuestionPreview(ilTabsGUI $tabsGUI)
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
$_GET["client_id"]
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
addBackTab(ilTabsGUI $ilTabs)
$DIC
Definition: xapitoken.php:46
$url
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
+ Here is the call graph for this function:

◆ supportsIntermediateSolutionOutput()

assMatchingQuestionGUI::supportsIntermediateSolutionOutput ( )

Question type specific support of intermediate solution output The function getSolutionOutput respects getUseIntermediateSolution()

Returns
bool

Definition at line 413 of file class.assMatchingQuestionGUI.php.

414  {
415  return true;
416  }

◆ uploaddefinitions()

assMatchingQuestionGUI::uploaddefinitions ( )

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

References editQuestion(), and writePostData().

154  {
155  $this->writePostData(true);
156  $this->editQuestion();
157  }
+ Here is the call graph for this function:

◆ uploadterms()

assMatchingQuestionGUI::uploadterms ( )

Definition at line 139 of file class.assMatchingQuestionGUI.php.

References editQuestion(), and writePostData().

140  {
141  $this->writePostData(true);
142  $this->editQuestion();
143  }
+ Here is the call graph for this function:

◆ writeAnswerSpecificPostData()

assMatchingQuestionGUI::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 63 of file class.assMatchingQuestionGUI.php.

References $_POST, $filename, $index, and $name.

Referenced by writePostData().

64  {
65  // Delete all existing answers and create new answers from the form data
66  $this->object->flushMatchingPairs();
67  $this->object->flushTerms();
68  $this->object->flushDefinitions();
69 
70  // add terms
71  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
72  foreach ($_POST['terms']['answer'] as $index => $answer) {
73  $filename = $_POST['terms']['imagename'][$index];
74  if (strlen($_FILES['terms']['name']['image'][$index])) {
75  // upload the new file
76  $name = $_FILES['terms']['name']['image'][$index];
77  if ($this->object->setImageFile(
78  $_FILES['terms']['tmp_name']['image'][$index],
79  $this->object->getEncryptedFilename($name)
80  )
81  ) {
82  $filename = $this->object->getEncryptedFilename($name);
83  } else {
84  $filename = "";
85  }
86  }
87  $this->object->addTerm(
88  new assAnswerMatchingTerm($answer, $filename, $_POST['terms']['identifier'][$index])
89  );
90  }
91  // add definitions
92  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingDefinition.php';
93  foreach ($_POST['definitions']['answer'] as $index => $answer) {
94  $filename = $_POST['definitions']['imagename'][$index];
95  if (strlen($_FILES['definitions']['name']['image'][$index])) {
96  // upload the new file
97  $name = $_FILES['definitions']['name']['image'][$index];
98  if ($this->object->setImageFile(
99  $_FILES['definitions']['tmp_name']['image'][$index],
100  $this->object->getEncryptedFilename($name)
101  )
102  ) {
103  $filename = $this->object->getEncryptedFilename($name);
104  } else {
105  $filename = "";
106  }
107  }
108  $this->object->addDefinition(
109  new assAnswerMatchingDefinition($answer, $filename, $_POST['definitions']['identifier'][$index])
110  );
111  }
112 
113  // add matching pairs
114  if (is_array($_POST['pairs']['points'])) {
115  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
116  foreach ($_POST['pairs']['points'] as $index => $points) {
117  $term_id = $_POST['pairs']['term'][$index];
118  $definition_id = $_POST['pairs']['definition'][$index];
119  $this->object->addMatchingPair(
120  $this->object->getTermWithIdentifier($term_id),
121  $this->object->getDefinitionWithIdentifier($definition_id),
122  $points
123  );
124  }
125  }
126  }
Class for matching question terms.
$index
Definition: metadata.php:128
if($format !==null) $name
Definition: metadata.php:230
$filename
Definition: buildRTE.php:89
Class for matching question definitions.
$_POST["username"]
+ Here is the caller graph for this function:

◆ writePostData()

assMatchingQuestionGUI::writePostData (   $always = false)
protected

{}

Definition at line 49 of file class.assMatchingQuestionGUI.php.

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

Referenced by adddefinitions(), addpairs(), addterms(), removedefinitions(), removeimagedefinitions(), removeimageterms(), removepairs(), removeterms(), uploaddefinitions(), and uploadterms().

50  {
51  $hasErrors = (!$always) ? $this->editQuestion(true) : false;
52  if (!$hasErrors) {
53  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
57  $this->saveTaxonomyAssignments();
58  return 0;
59  }
60  return 1;
61  }
This class represents a property form user interface.
writeAnswerSpecificPostData(ilPropertyFormGUI $form)
Extracts the answer specific values from $_POST and applies them to the data object.
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from $_POST and applies them to the data object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeQuestionSpecificPostData()

assMatchingQuestionGUI::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 128 of file class.assMatchingQuestionGUI.php.

References $_POST.

Referenced by writePostData().

129  {
130  if (!$this->object->getSelfAssessmentEditingMode()) {
131  $this->object->setShuffle($_POST["shuffle"]);
132  } else {
133  $this->object->setShuffle(1);
134  }
135  $this->object->setThumbGeometry($_POST["thumb_geometry"]);
136  $this->object->setMatchingMode($_POST['matching_mode']);
137  }
$_POST["username"]
+ Here is the caller graph for this function:

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