ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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
 writePostData ($always=false)
 Evaluates a posted edit form and writes the form data in the question object.
 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.
 uploadterms ()
 removeimageterms ()
 uploaddefinitions ()
 removeimagedefinitions ()
 addterms ()
 removeterms ()
 adddefinitions ()
 removedefinitions ()
 addpairs ()
 removepairs ()
 editQuestion ($checkonly=FALSE)
 populateAnswerSpecificFormPart (\ilPropertyFormGUI $form)
 populateQuestionSpecificFormPart (\ilPropertyFormGUI $form)
 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.
 getPreview ($show_question_only=FALSE, $showInlineFeedback=false)
 getTestOutput ($active_id, $pass=NULL, $is_postponed=FALSE, $user_post_solution=FALSE)
 checkInput ()
 check input fields
 setQuestionTabs ()
 Sets the ILIAS tabs for this question type.
 getSpecificFeedbackOutput ($active_id, $pass)
 Returns the answer specific feedback for the question.
 getAfterParticipationSuppressionAnswerPostVars ()
 Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment.
 getAfterParticipationSuppressionQuestionPostVars ()
 Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment.
 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.
- Public Member Functions inherited from assQuestionGUI
 __construct ()
 assQuestionGUI constructor
executeCommand ()
 execute command
 getCommand ($cmd)
 getType ()
 needed for page editor compliance
 setTaxonomyIds ($taxonomyIds)
 getTaxonomyIds ()
 setTargetGui ($linkTargetGui)
 setTargetGuiClass ($targetGuiClass)
 getTargetGuiClass ()
 setQuestionHeaderBlockBuilder ($questionHeaderBlockBuilder)
 setQuestionActionCmd ($questionActionCmd)
 getQuestionActionCmd ()
_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.
 _getGUIClassNameForId ($a_q_id)
 _getClassNameForQType ($q_type)
createQuestionGUI ($question_type, $question_id=-1)
 Creates a question gui representation.
 getQuestionTemplate ()
 get question template
 getILIASPage ($html="")
 Returns the ILIAS Page around a question.
 outQuestionPage ($a_temp_var, $a_postponed=false, $active_id="", $html="")
 output question page
 cancel ()
 cancel action
 originalSyncForm ($return_to="", $return_to_feedback= '')
 sync ()
 cancelSync ()
 saveEdit ()
 save question
 save ()
 save question
 saveReturn ()
 save question
 apply ()
 apply changes
 getContextPath ($cont_obj, $a_endnode_id, $a_startnode_id=1)
 get context path in content object tree
 setSequenceNumber ($nr)
 getSequenceNumber ()
 setQuestionCount ($a_question_count)
 getQuestionCount ()
 getErrorMessage ()
 setErrorMessage ($errormessage)
 addErrorMessage ($errormessage)
 outAdditionalOutput ()
 getQuestionType ()
 Returns the question type string.
 getAsValueAttribute ($a_value)
 Returns a HTML value attribute.
 addNewIdListener (&$a_object, $a_method, $a_parameters="")
 Add a listener that is notified with the new question ID, when a new question is saved.
 callNewIdListeners ($a_new_id)
 Call the new id listeners.
 addQuestionFormCommandButtons ($form)
 Add the command buttons of a question properties form.
 addBasicQuestionFormProperties ($form)
 Add basic question form properties: assessment: title, author, description, question, working time.
 getSelfAssessmentTags ()
 Get tags allowed in question tags in self assessment mode.
 getAnswerFeedbackOutput ($active_id, $pass)
 Returns the answer generic feedback depending on the results of the question.
 getGenericFeedbackOutput ($active_id, $pass)
 Returns the answer specific feedback for the question.
 getGenericFeedbackOutputForCorrectSolution ()
 getGenericFeedbackOutputForIncorrectSolution ()
 outQuestionType ()
 showSuggestedSolution ()
 suggestedsolution ()
 Allows to add suggested solutions for questions.
 outSolutionExplorer ()
 saveSuggestedSolution ()
 cancelExplorer ()
 outPageSelector ()
 outChapterSelector ()
 outGlossarySelector ()
 linkChilds ()
 addPG ()
 addST ()
 addGIT ()
 isSaveCommand ()
 addTab_SuggestedSolution (ilTabsGUI $tabs, $classname)
 getEditQuestionTabCommands ()
 isAutosaveable ()
 outQuestionForTest ($formaction, $active_id, $pass=NULL, $is_question_postponed=FALSE, $user_post_solutions=FALSE, $show_specific_inline_feedback=FALSE)
 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.
- Public Member Functions inherited from ilGuiAnswerScoringAdjustable
 populateAnswerSpecificFormPart (ilPropertyFormGUI $form)
 Adds the answer specific form parts to a question property form gui.

Private Member Functions

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

Additional Inherited Members

- Static Public Member Functions inherited from assQuestionGUI
static getCommandsFromClassConstants ($guiClassName, $cmdConstantNameBegin= 'CMD_')
 extracts values of all constants of given class with given prefix as array can be used to get all possible commands in case of these commands are defined as constants
- 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
 $question_count
 question count in test
- Protected Member Functions inherited from assQuestionGUI
 writePostData ()
 Evaluates a posted edit form and writes the form data in the question object.
 saveTaxonomyAssignments ()
 populateTaxonomyFormSection (ilPropertyFormGUI $form)
 getBasicEditQuestionTabCommands ()
 getAdditionalEditQuestionCommands ()
 addTab_QuestionFeedback (ilTabsGUI $tabs)
 adds the feedback tab to ilTabsGUI
 addTab_QuestionHints (ilTabsGUI $tabs)
 adds the hints tab to ilTabsGUI
 addTab_QuestionPreview (ilTabsGUI $tabsGUI)
 writeQuestionGenericPostData ()
 getFormEncodingType ()
 addBackTab (ilTabsGUI $ilTabs)
 buildBasicEditFormObject ()

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:
class.assMatchingQuestionGUI.php 60702 2015-09-15 09:11:15Z gitmgr

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

Constructor & Destructor Documentation

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
Returns

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

References assQuestionGUI\__construct(), and assQuestionGUI\setErrorMessage().

{
include_once "./Modules/TestQuestionPool/classes/class.assMatchingQuestion.php";
$this->object = new assMatchingQuestion();
$this->setErrorMessage($this->lng->txt("msg_form_save_error"));
if ($id >= 0)
{
$this->object->loadFromDb($id);
}
}

+ Here is the call graph for this function:

Member Function Documentation

assMatchingQuestionGUI::adddefinitions ( )

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

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

{
$this->writePostData();
$position = key($_POST["cmd"]["adddefinitions"]);
$this->object->insertDefinition($position+1);
$this->editQuestion();
}

+ Here is the call graph for this function:

assMatchingQuestionGUI::addpairs ( )

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

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

{
$this->writePostData();
$position = key($_POST["cmd"]["addpairs"]);
$this->object->insertMatchingPair($position+1);
$this->editQuestion();
}

+ Here is the call graph for this function:

assMatchingQuestionGUI::addterms ( )

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

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

{
$this->writePostData();
$position = key($_POST["cmd"]["addterms"]);
$this->object->insertTerm($position+1);
$this->editQuestion();
}

+ Here is the call graph for this function:

assMatchingQuestionGUI::checkInput ( )

check input fields

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

References $_POST.

{
if ((!$_POST["title"]) or (!$_POST["author"]) or (!$_POST["question"]))
{
return false;
}
return true;
}
assMatchingQuestionGUI::editQuestion (   $checkonly = FALSE)

Definition at line 231 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().

{
$save = $this->isSaveCommand();
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->outQuestionType());
$form->setMultipart(true);
$form->setTableWidth("100%");
$form->setId("matching");
// title, author, description, question, working time (assessment mode)
$errors = false;
if ($save)
{
$form->setValuesByPost();
$errors = !$form->checkInput();
$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
if( !$errors && !$this->isValidTermAndDefinitionAmount($form) && !$this->object->getSelfAssessmentEditingMode() )
{
$errors = true;
$terms = $form->getItemByPostVar('terms');
$terms->setAlert($this->lng->txt("msg_number_of_terms_too_low"));
ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
}
if ($errors) $checkonly = false;
}
if (!$checkonly) $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
return $errors;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

{
return array();
}
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 1041 of file class.assMatchingQuestionGUI.php.

{
return array();
}
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 1054 of file class.assMatchingQuestionGUI.php.

{
return ''; //print_r($relevant_answers,true);
}
assMatchingQuestionGUI::getPreview (   $show_question_only = FALSE,
  $showInlineFeedback = false 
)

Reimplemented from assQuestionGUI.

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

References assQuestionGUI\getILIASPage(), ilUtil\getImagePath(), assQuestionGUI\getPreviewSession(), and ilUtil\getStyleSheetLocation().

{
$solutions = is_object($this->getPreviewSession()) ? (array)$this->getPreviewSession()->getParticipantsSolution() : array();
$this->tpl->addJavaScript('Modules/TestQuestionPool/js/jquery-ui-1-10-3-fixed.js');
$this->tpl->addJavaScript('Modules/TestQuestionPool/js/ilMatchingQuestion.js');
$this->tpl->addCss(ilUtil::getStyleSheetLocation('output', 'test_javascript.css', 'Modules/TestQuestionPool'));
$template = new ilTemplate("tpl.il_as_qpl_matching_output.html", TRUE, TRUE, "Modules/TestQuestionPool");
foreach($solutions as $defId => $terms)
{
foreach($terms as $termId)
{
$template->setCurrentBlock("matching_data");
$template->setVariable("DEFINITION_ID", $defId);
$template->setVariable("TERM_ID", $termId);
$template->parseCurrentBlock();
}
}
// shuffle output
$terms = $this->object->getTerms();
$definitions = $this->object->getDefinitions();
switch ($this->object->getShuffle())
{
case 1:
$terms = $this->object->pcArrayShuffle($terms);
$definitions = $this->object->pcArrayShuffle($definitions);
break;
case 2:
$terms = $this->object->pcArrayShuffle($terms);
break;
case 3:
$definitions = $this->object->pcArrayShuffle($definitions);
break;
}
// create definitions
$counter = 0;
foreach ($definitions as $definition)
{
if (strlen($definition->picture))
{
$template->setCurrentBlock("definition_picture");
$template->setVariable("DEFINITION_ID", $definition->identifier);
$template->setVariable("IMAGE_HREF", $this->object->getImagePathWeb() . $definition->picture);
$thumbweb = $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $definition->picture;
$thumb = $this->object->getImagePath() . $this->object->getThumbPrefix() . $definition->picture;
if (!@file_exists($thumb)) $this->object->rebuildThumbnails();
$template->setVariable("THUMBNAIL_HREF", $thumbweb);
$template->setVariable("THUMB_ALT", $this->lng->txt("image"));
$template->setVariable("THUMB_TITLE", $this->lng->txt("image"));
$template->setVariable("TEXT_DEFINITION", (strlen($definition->text)) ? $this->object->prepareTextareaOutput($definition->text, TRUE) : '');
$template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
$template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.svg'));
$template->parseCurrentBlock();
}
else
{
$template->setCurrentBlock("definition_text");
$template->setVariable("DEFINITION", $this->object->prepareTextareaOutput($definition->text, TRUE));
$template->parseCurrentBlock();
}
$template->setCurrentBlock("droparea");
$template->setVariable("ID_DROPAREA", $definition->identifier);
$template->setVariable("QUESTION_ID", $this->object->getId());
$template->parseCurrentBlock();
$template->setCurrentBlock("definition_data");
$template->setVariable("DEFINITION_ID", $definition->identifier);
$template->parseCurrentBlock();
}
// create terms
$counter = 0;
foreach ($terms as $term)
{
if (strlen($term->picture))
{
$template->setCurrentBlock("term_picture");
$template->setVariable("TERM_ID", $term->identifier);
$template->setVariable("IMAGE_HREF", $this->object->getImagePathWeb() . $term->picture);
$thumbweb = $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $term->picture;
$thumb = $this->object->getImagePath() . $this->object->getThumbPrefix() . $term->picture;
if (!@file_exists($thumb)) $this->object->rebuildThumbnails();
$template->setVariable("THUMBNAIL_HREF", $thumbweb);
$template->setVariable("THUMB_ALT", $this->lng->txt("image"));
$template->setVariable("THUMB_TITLE", $this->lng->txt("image"));
$template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
$template->setVariable("TEXT_TERM", (strlen($term->text)) ? $this->object->prepareTextareaOutput($term->text, TRUE) : '');
$template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.svg'));
$template->parseCurrentBlock();
}
else
{
$template->setCurrentBlock("term_text");
$template->setVariable("TERM_TEXT", $this->object->prepareTextareaOutput($term->text, TRUE));
$template->parseCurrentBlock();
}
$template->setCurrentBlock("draggable");
$template->setVariable("ID_DRAGGABLE", $term->identifier);
$template->parseCurrentBlock();
$template->setCurrentBlock("term_data");
$template->setVariable("TERM_ID", $term->identifier);
$template->parseCurrentBlock();
}
$template->setVariable('MATCHING_MODE', $this->object->getMatchingMode());
$template->setVariable("RESET_BUTTON", $this->lng->txt("reset_terms"));
$template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE));
$questionoutput = $template->get();
if (!$show_question_only)
{
// get page object output
$questionoutput = $this->getILIASPage($questionoutput);
}
return $questionoutput;
}

+ Here is the call graph for this function:

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

Reimplemented from assQuestionGUI.

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

References $ok, $pass, assQuestionGUI\getGenericFeedbackOutput(), assQuestionGUI\getILIASPage(), ilUtil\getImagePath(), getSpecificFeedbackOutput(), isCorrectMatching(), and ilUtil\prepareFormOutput().

{
// generate the question output
include_once "./Services/UICore/classes/class.ilTemplate.php";
$template = new ilTemplate("tpl.il_as_qpl_matching_output_solution.html", TRUE, TRUE, "Modules/TestQuestionPool");
$solutiontemplate = new ilTemplate("tpl.il_as_tst_solution_output.html",TRUE, TRUE, "Modules/TestQuestionPool");
$solutions = array();
if (($active_id > 0) && (!$show_correct_solution))
{
include_once "./Modules/Test/classes/class.ilObjTest.php";
$solutions =& $this->object->getSolutionValues($active_id, $pass);
$solution_script .= "";
}
else
{
foreach ($this->object->getMaximumScoringMatchingPairs() as $pair)
{
$solutions[] = array(
"value1" => $pair->term->identifier,
"value2" => $pair->definition->identifier,
'points' => $pair->points
);
}
}
$i = 0;
foreach ($solutions as $solution)
{
$definition = $this->object->getDefinitionWithIdentifier($solution['value2']);
$term = $this->object->getTermWithIdentifier($solution['value1']);
$points = $solution['points'];
if (is_object($definition))
{
if (strlen($definition->picture))
{
if( strlen($definition->text) )
{
$template->setCurrentBlock('definition_image_text');
$template->setVariable("TEXT_DEFINITION", ilUtil::prepareFormOutput($definition->text));
$template->parseCurrentBlock();
}
$template->setCurrentBlock('definition_image');
$template->setVariable('ANSWER_IMAGE_URL', $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $definition->picture);
$template->setVariable('ANSWER_IMAGE_ALT', (strlen($definition->text)) ? ilUtil::prepareFormOutput($definition->text) : ilUtil::prepareFormOutput($definition->picture));
$template->setVariable('ANSWER_IMAGE_TITLE', (strlen($definition->text)) ? ilUtil::prepareFormOutput($definition->text) : ilUtil::prepareFormOutput($definition->picture));
$template->setVariable('URL_PREVIEW', $this->object->getImagePathWeb() . $definition->picture);
$template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
$template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.svg'));
$template->parseCurrentBlock();
}
else
{
$template->setCurrentBlock('definition_text');
$template->setVariable("DEFINITION", $this->object->prepareTextareaOutput($definition->text, TRUE));
$template->parseCurrentBlock();
}
}
if (is_object($term))
{
if (strlen($term->picture))
{
if( strlen($term->text) )
{
$template->setCurrentBlock('term_image_text');
$template->setVariable("TEXT_TERM", ilUtil::prepareFormOutput($term->text));
$template->parseCurrentBlock();
}
$template->setCurrentBlock('term_image');
$template->setVariable('ANSWER_IMAGE_URL', $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $term->picture);
$template->setVariable('ANSWER_IMAGE_ALT', (strlen($term->text)) ? ilUtil::prepareFormOutput($term->text) : ilUtil::prepareFormOutput($term->picture));
$template->setVariable('ANSWER_IMAGE_TITLE', (strlen($term->text)) ? ilUtil::prepareFormOutput($term->text) : ilUtil::prepareFormOutput($term->picture));
$template->setVariable('URL_PREVIEW', $this->object->getImagePathWeb() . $term->picture);
$template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
$template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.svg'));
$template->parseCurrentBlock();
}
else
{
$template->setCurrentBlock('term_text');
$template->setVariable("TERM", $this->object->prepareTextareaOutput($term->text, TRUE));
$template->parseCurrentBlock();
}
$i++;
}
if (($active_id > 0) && (!$show_correct_solution))
{
if ($graphicalOutput)
{
// output of ok/not ok icons for user entered solutions
$ok = false;
foreach ($this->object->getMatchingPairs() as $pair)
{
if( $this->isCorrectMatching($pair, $definition, $term) )
{
$ok = true;
}
}
if ($ok)
{
$template->setCurrentBlock("icon_ok");
$template->setVariable("ICON_OK", ilUtil::getImagePath("icon_ok.svg"));
$template->setVariable("TEXT_OK", $this->lng->txt("answer_is_right"));
$template->parseCurrentBlock();
}
else
{
$template->setCurrentBlock("icon_ok");
$template->setVariable("ICON_NOT_OK", ilUtil::getImagePath("icon_not_ok.svg"));
$template->setVariable("TEXT_NOT_OK", $this->lng->txt("answer_is_wrong"));
$template->parseCurrentBlock();
}
}
}
if ($result_output)
{
$resulttext = ($points == 1) ? "(%s " . $this->lng->txt("point") . ")" : "(%s " . $this->lng->txt("points") . ")";
$template->setCurrentBlock("result_output");
$template->setVariable("RESULT_OUTPUT", sprintf($resulttext, $points));
$template->parseCurrentBlock();
}
$template->setCurrentBlock("row");
$template->setVariable("TEXT_MATCHES", $this->lng->txt("matches"));
$template->parseCurrentBlock();
}
$questiontext = $this->object->getQuestion();
if ($show_question_text==true)
{
$template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
}
$questionoutput = $template->get();
$feedback = '';
if($show_feedback)
{
$fb = $this->getGenericFeedbackOutput($active_id, $pass);
$feedback .= strlen($fb) ? $fb : '';
$fb = $this->getSpecificFeedbackOutput($active_id, $pass);
$feedback .= strlen($fb) ? $fb : '';
}
if (strlen($feedback)) $solutiontemplate->setVariable("FEEDBACK", $this->object->prepareTextareaOutput($feedback, true));
$solutiontemplate->setVariable("SOLUTION_OUTPUT", $questionoutput);
$solutionoutput = $solutiontemplate->get();
if (!$show_question_only)
{
// get page object output
$solutionoutput = $this->getILIASPage($solutionoutput);
}
return $solutionoutput;
}

+ Here is the call graph for this function:

assMatchingQuestionGUI::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 public

Reimplemented from assQuestionGUI.

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

Referenced by getSolutionOutput().

{
$matches = array_values($this->object->getMaximumScoringMatchingPairs());
if( !$this->object->feedbackOBJ->specificAnswerFeedbackExists($matches) )
{
return '';
}
$feedback = '<table class="test_specific_feedback"><tbody>';
foreach ($matches as $idx => $ans)
{
$fb = $this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
$this->object->getId(), $idx
);
$feedback .= '<tr><td>"' . $ans->definition->text . '"&nbsp;' . $this->lng->txt("matches") . '&nbsp;"';
$feedback .= $ans->term->text . '"</td><td>';
$feedback .= $fb . '</td> </tr>';
}
$feedback .= '</tbody></table>';
return $this->object->prepareTextareaOutput($feedback, TRUE);
}

+ Here is the caller graph for this function:

assMatchingQuestionGUI::getTestOutput (   $active_id,
  $pass = NULL,
  $is_postponed = FALSE,
  $user_post_solution = FALSE 
)

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

References $pass, ilObjTest\_getPass(), ilObjTest\_getUsePreviousAnswers(), ilUtil\getImagePath(), ilUtil\getStyleSheetLocation(), assQuestionGUI\outQuestionPage(), and ilUtil\prepareFormOutput().

{
$this->tpl->addJavaScript('Modules/TestQuestionPool/js/jquery-ui-1-10-3-fixed.js');
$this->tpl->addJavaScript('Modules/TestQuestionPool/js/ilMatchingQuestion.js');
$this->tpl->addCss(ilUtil::getStyleSheetLocation('output', 'test_javascript.css', 'Modules/TestQuestionPool'));
$template = new ilTemplate("tpl.il_as_qpl_matching_output.html", true, true, "Modules/TestQuestionPool");
if ($active_id)
{
$solutions = NULL;
include_once "./Modules/Test/classes/class.ilObjTest.php";
if (!ilObjTest::_getUsePreviousAnswers($active_id, true))
{
if (is_null($pass)) $pass = ilObjTest::_getPass($active_id);
}
if (is_array($user_post_solution))
{
$solutions = array();
foreach ($user_post_solution['matching'][$this->object->getId()] as $definition => $term)
{
array_push($solutions, array("value1" => $term, "value2" => $definition));
}
}
else
{
$solutions =& $this->object->getSolutionValues($active_id, $pass);
}
$counter = 0;
foreach ($solutions as $idx => $solution_value)
{
if (($solution_value["value2"] > -1) && ($solution_value["value1"] > -1))
{
$template->setCurrentBlock("matching_data");
$template->setVariable("TERM_ID", $solution_value["value1"]);
$template->setVariable("DEFINITION_ID", $solution_value["value2"]);
$template->parseCurrentBlock();
}
$counter++;
}
}
$terms = $this->object->getTerms();
$definitions = $this->object->getDefinitions();
switch ($this->object->getShuffle())
{
case 1:
$terms = $this->object->pcArrayShuffle($terms);
if (count($solutions))
{
$definitions = $this->sortDefinitionsBySolution($solutions, $definitions);
}
else
{
$definitions = $this->object->pcArrayShuffle($definitions);
}
break;
case 2:
$terms = $this->object->pcArrayShuffle($terms);
break;
case 3:
if (count($solutions))
{
$definitions = $this->sortDefinitionsBySolution($solutions, $definitions);
}
else
{
$definitions = $this->object->pcArrayShuffle($definitions);
}
break;
}
// create definitions
$counter = 0;
foreach ($definitions as $definition)
{
if (strlen($definition->picture))
{
$template->setCurrentBlock("definition_picture");
$template->setVariable("DEFINITION_ID", $definition->identifier);
$template->setVariable("IMAGE_HREF", $this->object->getImagePathWeb() . $definition->picture);
$thumbweb = $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $definition->picture;
$thumb = $this->object->getImagePath() . $this->object->getThumbPrefix() . $definition->picture;
if (!@file_exists($thumb)) $this->object->rebuildThumbnails();
$template->setVariable("THUMBNAIL_HREF", $thumbweb);
$template->setVariable("THUMB_ALT", $this->lng->txt("image"));
$template->setVariable("THUMB_TITLE", $this->lng->txt("image"));
$template->setVariable("TEXT_DEFINITION", (strlen($definition->text)) ? ilUtil::prepareFormOutput($definition->text) : '');
$template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
$template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.svg'));
$template->parseCurrentBlock();
}
else
{
$template->setCurrentBlock("definition_text");
$template->setVariable("DEFINITION", $this->object->prepareTextareaOutput($definition->text, true));
$template->parseCurrentBlock();
}
$template->setCurrentBlock("droparea");
$template->setVariable("ID_DROPAREA", $definition->identifier);
$template->setVariable("QUESTION_ID", $this->object->getId());
$template->parseCurrentBlock();
$template->setCurrentBlock("definition_data");
$template->setVariable("DEFINITION_ID", $definition->identifier);
$template->parseCurrentBlock();
}
// create terms
$counter = 0;
foreach ($terms as $term)
{
if (strlen($term->picture))
{
$template->setCurrentBlock("term_picture");
$template->setVariable("TERM_ID", $term->identifier);
$template->setVariable("IMAGE_HREF", $this->object->getImagePathWeb() . $term->picture);
$thumbweb = $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $term->picture;
$thumb = $this->object->getImagePath() . $this->object->getThumbPrefix() . $term->picture;
if (!@file_exists($thumb)) $this->object->rebuildThumbnails();
$template->setVariable("THUMBNAIL_HREF", $thumbweb);
$template->setVariable("THUMB_ALT", $this->lng->txt("image"));
$template->setVariable("THUMB_TITLE", $this->lng->txt("image"));
$template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
$template->setVariable("TEXT_TERM", (strlen($term->text)) ? ilUtil::prepareFormOutput($term->text) : '');
$template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.svg'));
$template->parseCurrentBlock();
}
else
{
$template->setCurrentBlock("term_text");
$template->setVariable("TERM_TEXT", $this->object->prepareTextareaOutput($term->text, true));
$template->parseCurrentBlock();
}
$template->setCurrentBlock("draggable");
$template->setVariable("ID_DRAGGABLE", $term->identifier);
$template->parseCurrentBlock();
$template->setCurrentBlock('term_data');
$template->setVariable('TERM_ID', $term->identifier);
$template->parseCurrentBlock();
}
$template->setVariable('MATCHING_MODE', $this->object->getMatchingMode());
$template->setVariable("RESET_BUTTON", $this->lng->txt("reset_terms"));
$template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE));
return $this->outQuestionPage("", $is_postponed, $active_id, $template->get());
}

+ Here is the call graph for this function:

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

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

Referenced by getSolutionOutput().

{
if( !($pair->points > 0) )
{
return false;
}
if( !is_object($term) )
{
return false;
}
if( $pair->definition->identifier != $definition->identifier )
{
return false;
}
if( $pair->term->identifier != $term->identifier )
{
return false;
}
return true;
}

+ Here is the caller graph for this function:

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

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

Referenced by editQuestion().

{
$matchingMode = $form->getItemByPostVar('matching_mode')->getValue();
{
return true;
}
$numTerms = count($form->getItemByPostVar('terms')->getValues());
$numDefinitions = count($form->getItemByPostVar('definitions')->getValues());
if($numTerms >= $numDefinitions)
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assMatchingQuestionGUI::populateAnswerSpecificFormPart ( \ilPropertyFormGUI  $form)

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

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

Referenced by editQuestion().

{
// Definitions
include_once "./Modules/TestQuestionPool/classes/class.ilMatchingWizardInputGUI.php";
$definitions = new ilMatchingWizardInputGUI($this->lng->txt( "definitions" ), "definitions");
if ($this->object->getSelfAssessmentEditingMode())
{
$definitions->setHideImages( true );
}
$definitions->setRequired( true );
$definitions->setQuestionObject( $this->object );
$definitions->setTextName( $this->lng->txt( 'definition_text' ) );
$definitions->setImageName( $this->lng->txt( 'definition_image' ) );
include_once "./Modules/TestQuestionPool/classes/class.assAnswerMatchingDefinition.php";
if (!count( $this->object->getDefinitions() ))
{
$this->object->addDefinition( new assAnswerMatchingDefinition() );
}
$definitionvalues = $this->object->getDefinitions();
$definitions->setValues( $definitionvalues );
$definitions->checkInput();
$form->addItem( $definitions );
// Terms
include_once "./Modules/TestQuestionPool/classes/class.ilMatchingWizardInputGUI.php";
$terms = new ilMatchingWizardInputGUI($this->lng->txt( "terms" ), "terms");
if ($this->object->getSelfAssessmentEditingMode())
$terms->setHideImages( true );
$terms->setRequired( true );
$terms->setQuestionObject( $this->object );
$terms->setTextName( $this->lng->txt( 'term_text' ) );
$terms->setImageName( $this->lng->txt( 'term_image' ) );
include_once "./Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php";
if (!count( $this->object->getTerms() ))
$this->object->addTerm( new assAnswerMatchingTerm() );
$termvalues = $this->object->getTerms();
$terms->setValues( $termvalues );
$terms->checkInput();
$form->addItem( $terms );
// Matching Pairs
include_once "./Modules/TestQuestionPool/classes/class.ilMatchingPairWizardInputGUI.php";
$pairs = new ilMatchingPairWizardInputGUI($this->lng->txt( 'matching_pairs' ), 'pairs');
$pairs->setRequired( true );
$pairs->setTerms( $this->object->getTerms() );
$pairs->setDefinitions( $this->object->getDefinitions() );
include_once "./Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php";
if (count( $this->object->getMatchingPairs() ) == 0)
{
$this->object->addMatchingPair( new assAnswerMatchingPair($termvalues[0], $definitionvalues[0], 0) );
}
$pairs->setPairs( $this->object->getMatchingPairs() );
$form->addItem( $pairs );
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assMatchingQuestionGUI::populateQuestionSpecificFormPart ( \ilPropertyFormGUI  $form)

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

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

Referenced by editQuestion().

{
// Edit mode
$hidden = new ilHiddenInputGUI("matching_type");
$hidden->setValue($matchingtype);
$form->addItem($hidden);
if (!$this->object->getSelfAssessmentEditingMode())
{
// shuffle
$shuffle = new ilSelectInputGUI($this->lng->txt( "shuffle_answers" ), "shuffle");
$shuffle_options = array(
0 => $this->lng->txt( "no" ),
1 => $this->lng->txt( "matching_shuffle_terms_definitions" ),
2 => $this->lng->txt( "matching_shuffle_terms" ),
3 => $this->lng->txt( "matching_shuffle_definitions" )
);
$shuffle->setOptions( $shuffle_options );
$shuffle->setValue($this->object->getShuffle() != null ? $this->object->getShuffle() : 1);
$shuffle->setRequired( FALSE );
$form->addItem( $shuffle );
$geometry = new ilNumberInputGUI($this->lng->txt( "thumb_geometry" ), "thumb_geometry");
$geometry->setValue( $this->object->getThumbGeometry() );
$geometry->setRequired( true );
$geometry->setMaxLength( 6 );
$geometry->setMinValue( 20 );
$geometry->setSize( 6 );
$geometry->setInfo( $this->lng->txt( "thumb_geometry_info" ) );
$form->addItem( $geometry );
}
// Matching Mode
$mode = new ilRadioGroupInputGUI($this->lng->txt('qpl_qst_inp_matching_mode'), 'matching_mode');
$mode->setRequired(true);
$modeONEonONE = new ilRadioOption(
$this->lng->txt('qpl_qst_inp_matching_mode_one_on_one'), assMatchingQuestion::MATCHING_MODE_1_ON_1
);
$mode->addOption($modeONEonONE);
$modeALLonALL = new ilRadioOption(
$this->lng->txt('qpl_qst_inp_matching_mode_all_on_all'), assMatchingQuestion::MATCHING_MODE_N_ON_N
);
$mode->addOption($modeALLonALL);
$mode->setValue($this->object->getMatchingMode());
$form->addItem($mode);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assMatchingQuestionGUI::removedefinitions ( )

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

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

{
$this->writePostData();
$position = key($_POST["cmd"]["removedefinitions"]);
$this->object->deleteDefinition($position);
$this->editQuestion();
}

+ Here is the call graph for this function:

assMatchingQuestionGUI::removeimagedefinitions ( )

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

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

{
$this->writePostData(true);
$position = key($_POST['cmd']['removeimagedefinitions']);
$this->object->removeDefinitionImage($position);
$this->editQuestion();
}

+ Here is the call graph for this function:

assMatchingQuestionGUI::removeimageterms ( )

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

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

{
$this->writePostData(true);
$position = key($_POST['cmd']['removeimageterms']);
$this->object->removeTermImage($position);
$this->editQuestion();
}

+ Here is the call graph for this function:

assMatchingQuestionGUI::removepairs ( )

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

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

{
$this->writePostData();
$position = key($_POST["cmd"]["removepairs"]);
$this->object->deleteMatchingPair($position);
$this->editQuestion();
}

+ Here is the call graph for this function:

assMatchingQuestionGUI::removeterms ( )

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

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

{
$this->writePostData();
$position = key($_POST["cmd"]["removeterms"]);
$this->object->deleteTerm($position);
$this->editQuestion();
}

+ Here is the call graph for this function:

assMatchingQuestionGUI::setQuestionTabs ( )

Sets the ILIAS tabs for this question type.

public

Todo:
: MOVE THIS STEPS TO COMMON QUESTION CLASS assQuestionGUI

Reimplemented from assQuestionGUI.

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

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

{
global $rbacsystem, $ilTabs;
$ilTabs->clearTargets();
$this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$q_type = $this->object->getQuestionType();
if (strlen($q_type))
{
$classname = $q_type . "GUI";
$this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
$this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
}
if ($_GET["q_id"])
{
if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
{
// edit page
$ilTabs->addTarget("edit_page",
$this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
array("edit", "insert", "exec_pg"),
"", "", $force_active);
}
$this->addTab_QuestionPreview($ilTabs);
}
$force_active = false;
if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
{
$url = "";
if ($classname) $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
// edit question properties
$ilTabs->addTarget("edit_question",
$url,
array("editQuestion", "save", "saveEdit", "removeimageterms", "uploadterms", "removeimagedefinitions", "uploaddefinitions",
"addpairs", "removepairs", "addterms", "removeterms", "adddefinitions", "removedefinitions", "originalSyncForm"),
$classname, "", $force_active);
}
// add tab for question feedback within common class assQuestionGUI
$this->addTab_QuestionFeedback($ilTabs);
// add tab for question hint within common class assQuestionGUI
$this->addTab_QuestionHints($ilTabs);
// add tab for question's suggested solution within common class assQuestionGUI
$this->addTab_SuggestedSolution($ilTabs, $classname);
// Assessment of questions sub menu entry
if ($_GET["q_id"])
{
$ilTabs->addTarget("statistics",
$this->ctrl->getLinkTargetByClass($classname, "assessment"),
array("assessment"),
$classname, "");
}
$this->addBackTab($ilTabs);
}

+ Here is the call graph for this function:

assMatchingQuestionGUI::uploaddefinitions ( )

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

References editQuestion(), and assQuestionGUI\writePostData().

{
$this->writePostData(true);
$this->editQuestion();
}

+ Here is the call graph for this function:

assMatchingQuestionGUI::uploadterms ( )

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

References editQuestion(), and assQuestionGUI\writePostData().

{
$this->writePostData(true);
$this->editQuestion();
}

+ Here is the call graph for this function:

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

References $_POST, and $filename.

Referenced by writePostData().

{
// Delete all existing answers and create new answers from the form data
$this->object->flushMatchingPairs();
$this->object->flushTerms();
$this->object->flushDefinitions();
// add terms
require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
foreach ($_POST['terms']['answer'] as $index => $answer)
{
$filename = $_POST['terms']['imagename'][$index];
if (strlen( $_FILES['terms']['name']['image'][$index] ))
{
// upload the new file
$name = $_FILES['terms']['name']['image'][$index];
if ($this->object->setImageFile( $_FILES['terms']['tmp_name']['image'][$index],
$this->object->getEncryptedFilename( $name )
)
)
{
$filename = $this->object->getEncryptedFilename( $name );
}
else
{
$filename = "";
}
}
$this->object->addTerm( new assAnswerMatchingTerm($answer, $filename, $_POST['terms']['identifier'][$index])
);
}
// add definitions
require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingDefinition.php';
foreach ($_POST['definitions']['answer'] as $index => $answer)
{
$filename = $_POST['definitions']['imagename'][$index];
if (strlen( $_FILES['definitions']['name']['image'][$index] ))
{
// upload the new file
$name = $_FILES['definitions']['name']['image'][$index];
if ($this->object->setImageFile( $_FILES['definitions']['tmp_name']['image'][$index],
$this->object->getEncryptedFilename( $name )
)
)
{
$filename = $this->object->getEncryptedFilename( $name );
}
else
{
$filename = "";
}
}
$this->object->addDefinition(
new assAnswerMatchingDefinition($answer, $filename, $_POST['definitions']['identifier'][$index])
);
}
// add matching pairs
if (is_array( $_POST['pairs']['points'] ))
{
require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
foreach ($_POST['pairs']['points'] as $index => $points)
{
$term_id = $_POST['pairs']['term'][$index];
$definition_id = $_POST['pairs']['definition'][$index];
$this->object->addMatchingPair( $this->object->getTermWithIdentifier( $term_id ),
$this->object->getDefinitionWithIdentifier( $definition_id ),
$points
);
}
}
}

+ Here is the caller graph for this function:

assMatchingQuestionGUI::writePostData (   $always = false)

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

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

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

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

{
$hasErrors = (!$always) ? $this->editQuestion(true) : false;
if (!$hasErrors)
{
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
return 0;
}
return 1;
}

+ Here is the call graph for this function:

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

References $_POST.

Referenced by writePostData().

{
if (!$this->object->getSelfAssessmentEditingMode())
{
$this->object->setShuffle( $_POST["shuffle"] );
}
else
{
$this->object->setShuffle( 1 );
}
$this->object->setThumbGeometry( $_POST["thumb_geometry"] );
$this->object->setMatchingMode($_POST['matching_mode']);
}

+ Here is the caller graph for this function:


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