18 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
19 require_once
'./Modules/TestQuestionPool/interfaces/interface.ilObjQuestionScoringAdjustable.php';
20 require_once
'./Modules/TestQuestionPool/interfaces/interface.ilObjAnswerScoringAdjustable.php';
21 require_once
'./Modules/TestQuestionPool/interfaces/interface.iQuestionCondition.php';
22 require_once
'./Modules/TestQuestionPool/classes/class.ilUserQuestionResult.php';
107 $this->matchingpairs = array();
109 $this->terms = array();
110 $this->definitions = array();
120 if (strlen($this->title)
123 && count($this->matchingpairs)
140 $ilDB = $DIC[
'ilDB'];
153 $ilDB = $DIC[
'ilDB'];
156 "DELETE FROM qpl_a_mterm WHERE question_fi = %s",
158 array( $this->
getId() )
163 "DELETE FROM qpl_a_mdef WHERE question_fi = %s",
165 array( $this->
getId() )
170 foreach ($this->terms as $key => $term) {
171 $next_id =
$ilDB->nextId(
'qpl_a_mterm');
172 $ilDB->insert(
'qpl_a_mterm', array(
173 'term_id' => array(
'integer', $next_id),
174 'question_fi' => array(
'integer', $this->
getId()),
175 'picture' => array(
'text', $term->picture),
176 'term' => array(
'text', $term->text),
177 'ident' => array(
'integer', $term->identifier)
179 $termids[$term->identifier] = $next_id;
182 $definitionids = array();
184 foreach ($this->definitions as $key => $definition) {
185 $next_id =
$ilDB->nextId(
'qpl_a_mdef');
186 $ilDB->insert(
'qpl_a_mdef', array(
187 'def_id' => array(
'integer', $next_id),
188 'question_fi' => array(
'integer', $this->
getId()),
189 'picture' => array(
'text', $definition->picture),
190 'definition' => array(
'text', $definition->text),
191 'ident' => array(
'integer', $definition->identifier)
193 $definitionids[$definition->identifier] = $next_id;
197 "DELETE FROM qpl_a_matching WHERE question_fi = %s",
199 array( $this->
getId() )
203 $next_id =
$ilDB->nextId(
'qpl_a_matching');
205 "INSERT INTO qpl_a_matching (answer_id, question_fi, points, term_fi, definition_fi) VALUES (%s, %s, %s, %s, %s)",
206 array(
'integer',
'integer',
'float',
'integer',
'integer' ),
211 $termids[$pair->term->identifier],
212 $definitionids[$pair->definition->identifier]
223 $ilDB = $DIC[
'ilDB'];
230 array( $this->
getId() )
234 'question_fi' => array(
'integer', $this->
getId()),
235 'shuffle' => array(
'text', $this->shuffle),
236 'matching_type' => array(
'text', $this->matching_type),
251 $ilDB = $DIC[
'ilDB'];
254 SELECT qpl_questions.*, 255 {$this->getAdditionalTableName()}.* 257 LEFT JOIN {$this->getAdditionalTableName()} 258 ON {$this->getAdditionalTableName()}.question_fi = qpl_questions.question_id 259 WHERE qpl_questions.question_id = %s 270 $this->
setId($question_id);
279 include_once(
"./Services/RTE/classes/class.ilRTE.php");
284 $this->
setEstimatedWorkingTime(substr($data[
"working_time"], 0, 2), substr($data[
"working_time"], 3, 2), substr($data[
"working_time"], 6, 2));
300 "SELECT * FROM qpl_a_mterm WHERE question_fi = %s ORDER BY term_id ASC",
304 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php";
305 $this->terms = array();
309 array_push($this->terms, $term);
310 $termids[
$data[
'term_id']] = $term;
314 $definitionids = array();
316 "SELECT * FROM qpl_a_mdef WHERE question_fi = %s ORDER BY def_id ASC",
320 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingDefinition.php";
321 $this->definitions = array();
325 array_push($this->definitions, $definition);
326 $definitionids[
$data[
'def_id']] = $definition;
330 $this->matchingpairs = array();
332 "SELECT * FROM qpl_a_matching WHERE question_fi = %s ORDER BY answer_id",
336 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php";
339 array_push($this->matchingpairs,
new assAnswerMatchingPair($termids[
$data[
'term_fi']], $definitionids[$data[
'definition_fi']], $data[
'points']));
342 parent::loadFromDb($question_id);
351 if ($this->
id <= 0) {
356 $this_id = $this->
getId();
360 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
364 if ((
int) $testObjId > 0) {
365 $clone->setObjId($testObjId);
384 $clone->copyPageOfQuestion($this_id);
386 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
388 $clone->duplicateImages($this_id, $thisObjId, $clone->getId(), $testObjId);
390 $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
400 if ($this->
id <= 0) {
406 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
409 $source_questionpool_id = $this->
getObjId();
410 $clone->setObjId($target_questionpool_id);
420 $clone->copyImages(
$original_id, $source_questionpool_id);
422 $clone->onCopy($source_questionpool_id,
$original_id, $clone->getObjId(), $clone->getId());
429 if ($this->
id <= 0) {
434 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
437 $sourceParentId = $this->
getObjId();
443 $clone->setObjId($targetParentId);
445 if ($targetQuestionTitle) {
446 $clone->setTitle($targetQuestionTitle);
451 $clone->copyPageOfQuestion($sourceQuestionId);
453 $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
455 $clone->copyImages($sourceQuestionId, $sourceParentId);
457 $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
465 $ilLog = $DIC[
'ilLog'];
467 $imagepath_original = str_replace(
"/$this->id/images",
"/$question_id/images", $imagepath);
469 if ((
int) $objectId > 0) {
470 $imagepath_original = str_replace(
"/$this->obj_id/",
"/$objectId/", $imagepath_original);
473 foreach ($this->terms as $term) {
474 if (strlen($term->picture)) {
476 if (!file_exists($imagepath)) {
479 if (!@copy($imagepath_original .
$filename, $imagepath . $filename)) {
480 $ilLog->write(
"matching question image could not be duplicated: $imagepath_original$filename");
482 if (@file_exists($imagepath_original . $this->
getThumbPrefix() . $filename)) {
484 $ilLog->write(
"matching question image thumbnail could not be duplicated: $imagepath_original" . $this->
getThumbPrefix() . $filename);
489 foreach ($this->definitions as $definition) {
490 if (strlen($definition->picture)) {
492 if (!file_exists($imagepath)) {
495 if (!@copy($imagepath_original .
$filename, $imagepath . $filename)) {
496 $ilLog->write(
"matching question image could not be duplicated: $imagepath_original$filename");
498 if (@file_exists($imagepath_original . $this->
getThumbPrefix() . $filename)) {
500 $ilLog->write(
"matching question image thumbnail could not be duplicated: $imagepath_original" . $this->
getThumbPrefix() . $filename);
507 public function copyImages($question_id, $source_questionpool)
510 $ilLog = $DIC[
'ilLog'];
513 $imagepath_original = str_replace(
"/$this->id/images",
"/$question_id/images", $imagepath);
514 $imagepath_original = str_replace(
"/$this->obj_id/",
"/$source_questionpool/", $imagepath_original);
515 foreach ($this->terms as $term) {
516 if (strlen($term->picture)) {
517 if (!file_exists($imagepath)) {
521 if (!@copy($imagepath_original .
$filename, $imagepath . $filename)) {
522 $ilLog->write(
"matching question image could not be copied: $imagepath_original$filename");
525 $ilLog->write(
"matching question image thumbnail could not be copied: $imagepath_original" . $this->
getThumbPrefix() . $filename);
529 foreach ($this->definitions as $definition) {
530 if (strlen($definition->picture)) {
532 if (!file_exists($imagepath)) {
537 copy($imagepath_original . $filename, $imagepath . $filename);
539 $ilLog->write(
"matching question image could not be copied: $imagepath_original$filename");
545 $ilLog->write(
"matching question image thumbnail could not be copied: $imagepath_original" . $this->
getThumbPrefix() . $filename);
563 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php";
564 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php";
565 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingDefinition.php";
566 if (is_null($term)) {
569 if (is_null($definition)) {
573 if ($position < count($this->matchingpairs)) {
574 $part1 = array_slice($this->matchingpairs, 0, $position);
575 $part2 = array_slice($this->matchingpairs, $position);
576 $this->matchingpairs = array_merge($part1, array($pair), $part2);
578 array_push($this->matchingpairs, $pair);
595 require_once
'./Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
596 require_once
'./Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
597 require_once
'./Modules/TestQuestionPool/classes/class.assAnswerMatchingDefinition.php';
598 if (is_null($term)) {
601 if (is_null($definition)) {
605 array_push($this->matchingpairs, $pair);
613 foreach ($this->terms as $term) {
614 if ($term->identifier == $a_identifier) {
626 foreach ($this->definitions as $definition) {
627 if ($definition->identifier == $a_identifier) {
647 if (count($this->matchingpairs) < 1) {
650 if (
$index >= count($this->matchingpairs)) {
653 return $this->matchingpairs[
$index];
668 if (count($this->matchingpairs) < 1) {
671 if (
$index >= count($this->matchingpairs)) {
674 unset($this->matchingpairs[
$index]);
675 $this->matchingpairs = array_values($this->matchingpairs);
684 $this->matchingpairs = array();
695 return count($this->matchingpairs);
728 return count($this->terms);
739 return count($this->definitions);
750 array_push($this->terms, $term);
761 array_push($this->definitions, $definition);
772 if (is_null($term)) {
773 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php";
776 if ($position < count($this->terms)) {
777 $part1 = array_slice($this->terms, 0, $position);
778 $part2 = array_slice($this->terms, $position);
779 $this->terms = array_merge($part1, array($term), $part2);
781 array_push($this->terms, $term);
793 if (is_null($definition)) {
794 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingDefinition.php";
797 if ($position < count($this->definitions)) {
798 $part1 = array_slice($this->definitions, 0, $position);
799 $part2 = array_slice($this->definitions, $position);
800 $this->definitions = array_merge($part1, array($definition), $part2);
802 array_push($this->definitions, $definition);
812 $this->terms = array();
821 $this->definitions = array();
832 unset($this->terms[$position]);
833 $this->terms = array_values($this->terms);
844 unset($this->definitions[$position]);
845 $this->definitions = array_values($this->definitions);
857 $this->terms[
$index] = $term;
872 if ($returndetails) {
873 throw new ilTestException(
'return details not implemented for ' . __METHOD__);
877 $ilDB = $DIC[
'ilDB'];
879 $found_values = array();
880 if (is_null(
$pass)) {
885 if (strcmp(
$data[
"value1"],
"") != 0) {
886 if (!isset($found_values[
$data[
'value2']])) {
887 $found_values[$data[
'value2']] = array();
890 $found_values[$data[
'value2']][] = $data[
'value1'];
926 $matchingPairs = array();
928 foreach ($this->matchingpairs as $pair) {
929 if ($pair->points <= 0) {
933 $matchingPairs[] = $pair;
936 return $matchingPairs;
941 $matchingPairsByDefinition = array();
943 foreach ($this->matchingpairs as $pair) {
944 if ($pair->points <= 0) {
948 $defId = $pair->definition->identifier;
950 if (!isset($matchingPairsByDefinition[$defId])) {
951 $matchingPairsByDefinition[$defId] = $pair;
952 } elseif ($pair->points > $matchingPairsByDefinition[$defId]->points) {
953 $matchingPairsByDefinition[$defId] = $pair;
957 return $matchingPairsByDefinition;
966 $indexedValues = array();
968 foreach ($valuePairs as $valuePair) {
969 if (!isset($indexedValues[$valuePair[
'value2']])) {
970 $indexedValues[$valuePair[
'value2']] = array();
973 $indexedValues[$valuePair[
'value2']][] = $valuePair[
'value1'];
976 return $indexedValues;
990 if (preg_match(
"/.*\\.(\\w+)$/",
$filename, $matches)) {
991 $extension = $matches[1];
993 return md5(
$filename) .
"." . $extension;
998 $term = $this->terms[
$index];
999 if (is_object($term)) {
1001 $term->picture = null;
1007 $definition = $this->definitions[
$index];
1008 if (is_object($definition)) {
1010 $definition->picture = null;
1037 public function setImageFile($image_tempfilename, $image_filename, $previous_filename =
'')
1040 if (strlen($image_tempfilename)) {
1041 $image_filename = str_replace(
" ",
"_", $image_filename);
1043 if (!file_exists($imagepath)) {
1046 $savename = $image_filename;
1054 if (
$result && (strcmp($image_filename, $previous_filename) != 0) && (strlen($previous_filename))) {
1065 $matchings = array();
1068 if (isset($postData[$definition->identifier])) {
1069 foreach ($this->
getTerms() as $term) {
1070 if (isset($postData[$definition->identifier][$term->identifier])) {
1071 if (!is_array($postData[$definition->identifier])) {
1072 $postData[$definition->identifier] = array();
1075 $matchings[$definition->identifier][] = $term->identifier;
1090 $handledTerms = array();
1092 foreach ($submittedMatchings as $definition =>
$terms) {
1099 if (isset($handledTerms[$term])) {
1104 $handledTerms[$term] = $term;
1122 $ilDB = $DIC[
'ilDB'];
1127 $matchingsExist =
false;
1129 if ($submittedMatchingsValid) {
1130 if (is_null(
$pass)) {
1131 include_once
"./Modules/Test/classes/class.ilObjTest.php";
1135 $this->
getProcessLocker()->executeUserSolutionUpdateLockOperation(
function () use (&$matchingsExist, $submittedMatchings, $active_id,
$pass, $authorized) {
1138 foreach ($submittedMatchings as $definition =>
$terms) {
1141 $matchingsExist =
true;
1146 $saveWorkingDataResult =
true;
1148 $saveWorkingDataResult =
false;
1151 include_once(
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
1153 if ($matchingsExist) {
1160 return $saveWorkingDataResult;
1174 mt_srand((
double) microtime() * 1000000);
1175 $random_number = mt_rand(1, 100000);
1179 foreach ($this->matchingpairs as $key => $pair) {
1180 if (($pair->term->identifier == $random_number) || ($pair->definition->identifier == $random_number)) {
1186 return $random_number;
1217 return "assMatchingQuestion";
1227 return "qpl_qst_matching";
1237 return array(
"qpl_a_matching",
"qpl_a_mterm");
1246 return parent::getRTETextWithMediaObjects();
1262 parent::setExportDetailsXLS($worksheet, $startrow, $active_id,
$pass);
1268 foreach ($solutions as $solution) {
1269 $matches_written =
false;
1271 if (!$matches_written) {
1272 $worksheet->setCell($startrow +
$i, 1, $this->lng->txt(
"matches"));
1274 $matches_written =
true;
1275 if ($pair->definition->identifier == $solution[
"value2"]) {
1276 if (strlen($pair->definition->text)) {
1277 $worksheet->setCell($startrow +
$i, 0, $pair->definition->text);
1279 $worksheet->setCell($startrow +
$i, 0, $pair->definition->picture);
1282 if ($pair->term->identifier == $solution[
"value1"]) {
1283 if (strlen($pair->term->text)) {
1284 $worksheet->setCell($startrow +
$i, 2, $pair->term->text);
1286 $worksheet->setCell($startrow +
$i, 2, $pair->term->picture);
1293 return $startrow +
$i + 1;
1323 $this->thumb_geometry = ($a_geometry < 1) ? 100 : $a_geometry;
1331 foreach ($this->terms as $term) {
1332 if (strlen($term->picture)) {
1336 foreach ($this->definitions as $definition) {
1337 if (strlen($definition->picture)) {
1355 switch (strtoupper($path_info[
'extension'])) {
1386 'onenotcorrect' => $this->
formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(),
false)),
1387 'allcorrect' => $this->
formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(),
true))
1390 require_once
'Services/Randomization/classes/class.ilArrayElementShuffler.php';
1399 "id" => (
int) $this->getId() . $term->identifier
1416 "id" => (
int) $this->getId() . $def->identifier
1422 $matchings = array();
1425 if ($pair->points <= 0) {
1430 $pid = $pair->definition->identifier;
1432 $pid .=
'::' . $pair->term->identifier;
1435 if (!isset($matchings[$pid]) || $matchings[$pid][
"points"] < $pair->points) {
1436 $matchings[$pid] = array(
1437 "term_id" => (
int) $this->
getId() . $pair->term->identifier,
1438 "def_id" => (
int) $this->getId() . $pair->definition->identifier,
1439 "points" => (int) $pair->points
1444 $result[
'matchingPairs'] = array_values($matchings);
1447 $result[
'mobs'] =
$mobs;
1451 $lng->loadLanguageModule(
'assessment');
1452 $result[
'reset_button_label'] =
$lng->txt(
"reset_terms");
1454 return json_encode($result);
1484 foreach ($found_values as $definition =>
$terms) {
1485 foreach (
$terms as $term) {
1486 foreach ($this->matchingpairs as $pair) {
1487 if ($pair->definition->identifier == $definition && $pair->term->identifier == $term) {
1506 require_once
"./Modules/TestQuestionPool/classes/class.ilOperatorsExpressionMapping.php";
1535 $ilDB = $DIC[
'ilDB'];
1539 "SELECT ident FROM qpl_a_mdef WHERE question_fi = %s ORDER BY def_id",
1541 array($this->
getId())
1551 "SELECT ident FROM qpl_a_mterm WHERE question_fi = %s ORDER BY term_id",
1553 array($this->
getId())
1562 $maxStep = $this->lookupMaxStep($active_id,
$pass);
1564 if ($maxStep !== null) {
1566 "SELECT value1, value2 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s AND step = %s",
1567 array(
"integer",
"integer",
"integer",
"integer"),
1568 array($active_id,
$pass, $this->
getId(), $maxStep)
1572 "SELECT value1, value2 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s",
1573 array(
"integer",
"integer",
"integer"),
1579 if ($row[
"value1"] > 0) {
1614 parent::afterSyncWithOriginal($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId);
1616 $origImagePath = $this->
buildImagePath($origQuestionId, $origParentObjId);
1617 $dupImagePath = $this->
buildImagePath($dupQuestionId, $dupParentObjId);
1620 if (is_dir($dupImagePath)) {
getThumbGeometry()
Get the thumbnail geometry.
Class for matching question terms.
supportsJavascriptOutput()
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static logAction($logtext="", $active_id="", $question_id="")
Logs an action into the Test&Assessment log.
getId()
Gets the id of the assQuestion object.
duplicate($for_test=true, $title="", $author="", $owner="", $testObjId=null)
Duplicates an assMatchingQuestion.
static isFileAvailable($file)
getMaximumPoints()
Calculates and Returns the maximum points, a learner can reach answering the question.
static getInstance($identifier)
static _getOriginalId($question_id)
Returns the original id of a question.
formatSAQuestion($a_q)
Format self assessment question.
const PercentageResultExpression
calculateReachedPoints($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
Returns the points, a learner has reached answering the question.
Class for matching question pairs.
Class iQuestionCondition.
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
getPositiveScoredMatchingPairs()
getTermCount()
Returns the number of terms.
const MATCHING_MODE_N_ON_N
copyObject($target_questionpool_id, $title="")
Copies an assMatchingQuestion.
generateThumbForFile($path, $file)
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
deleteMatchingPair($index=0)
Deletes a matching pair with a given index.
Abstract basic class which is to be extended by the concrete assessment question type classes...
afterSyncWithOriginal($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId)
{}
getDefinitionCount()
Returns the number of definitions.
const MATCHING_MODE_1_ON_1
getQuestionType()
Returns the question type of the question.
setExportDetailsXLS($worksheet, $startrow, $active_id, $pass)
{}
getSolutionValues($active_id, $pass=null, $authorized=true)
Loads solutions of a given user from the database an returns it.
addTerm($term)
Adds a term.
setId($id=-1)
Sets the id of the assQuestion object.
flushMatchingPairs()
Deletes all matching pairs.
setImageFile($image_tempfilename, $image_filename, $previous_filename='')
Sets the image file and uploads the image to the object's image directory.
getEncryptedFilename($filename)
Returns the encrypted save filename of a matching picture Images are saved with an encrypted filename...
flushTerms()
Deletes all terms.
deleteImagefile($filename)
Deletes an imagefile from the system if the file is deleted manually.
getSolutionMaxPass($active_id)
Returns the maximum pass a users question solution.
const MT_TERMS_DEFINITIONS
fetchIndexedValuesFromValuePairs(array $valuePairs)
createNewOriginalFromThisDuplicate($targetParentId, $targetQuestionTitle="")
setEstimatedWorkingTime($hour=0, $min=0, $sec=0)
Sets the estimated working time of a question from given hour, minute and second. ...
getRTETextWithMediaObjects()
Collects all text in the question which could contain media objects which were created with the Rich ...
getAdditionalTableName()
Returns the name of the additional question data table in the database.
getUserQuestionResult($active_id, $pass)
Get the user solution for a question by active_id and the test pass.
setNrOfTries($a_nr_of_tries)
deleteTerm($position)
Deletes a term.
setAdditionalContentEditingMode($additinalContentEditingMode)
setter for additional content editing mode for this question
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
rebuildThumbnails()
Rebuild the thumbnail images with a new thumbnail size.
getObjId()
Get the object id of the container object.
calculateReachedPointsForSolution($found_values)
getDefinitions()
Returns the definitions of the matching question.
loadFromDb($question_id)
Loads a assMatchingQuestion object from a database.
getMatchingPair($index=0)
Returns a matching pair with a given index.
Base Exception for all Exceptions relating to Modules/Test.
setMatchingMode($matchingMode)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setParticipantsSolution($participantSolution)
duplicateImages($question_id, $objectId=null)
static _getLogLanguage()
retrieve the log language for assessment logging
fetchSubmittedMatchingsFromPost()
getTermWithIdentifier($a_identifier)
Returns a term with a given identifier.
getAvailableAnswerOptions($index=null)
If index is null, the function returns an array with all anwser options Else it returns the specific ...
insertMatchingPair($position, $term=null, $definition=null, $points=0.0)
Inserts a matching pair for an matching choice question.
setAuthor($author="")
Sets the authors name of the assQuestion object.
removeDefinitionImage($index)
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
Class ilUserQuestionResult.
insertDefinition($position, $definition=null)
Inserts a definition.
saveCurrentSolution($active_id, $pass, $value1, $value2, $authorized=true, $tstamp=null)
setTerm($term, $index)
Sets a specific term.
getMatchingPairCount()
Returns the number of matching pairs.
const NumericResultExpression
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
getExpressionTypes()
Get all available expression types for a specific question.
getMostPositiveScoredUniqueTermMatchingPairs()
setShuffle($shuffle=true)
Sets the shuffle flag.
getOperators($expression)
Get all available operations for a specific question.
Interface ilObjAnswerScoringAdjustable.
checkSubmittedMatchings($submittedMatchings)
const MatchingResultExpression
getQuestion()
Gets the question string of the question object.
static convertImage( $a_from, $a_to, $a_target_format="", $a_geometry="", $a_background_color="")
convert image
saveWorkingData($active_id, $pass=null, $authorized=true)
Saves the learners input of the question to the database.
addDefinition($definition)
Adds a definition.
getMaximumScoringMatchingPairs()
flushDefinitions()
Deletes all definitions.
insertTerm($position, $term=null)
Inserts a term.
saveAnswerSpecificDataToDb()
Saves the answer specific records into a question types answer table.
static getOperatorsByExpression($expression)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
__construct( $title="", $comment="", $author="", $owner=-1, $question="", $matching_type=MT_TERMS_DEFINITIONS)
assMatchingQuestion constructor
toJSON()
Returns a JSON representation of the question TODO.
setPoints($a_points)
Sets the maximum available points for the question.
saveQuestionDataToDb($original_id="")
deleteDefinition($position)
Deletes a definition.
getTerms()
Returns the terms of the matching question.
getDefinitionWithIdentifier($a_identifier)
Returns a definition with a given identifier.
setQuestion($question="")
Sets the question string of the question object.
Interface ilObjQuestionScoringAdjustable.
removeCurrentSolution($active_id, $pass, $authorized=true)
__construct(Container $dic, ilPlugin $plugin)
setThumbGeometry($a_geometry)
Set the thumbnail geometry.
buildImagePath($questionId, $parentObjectId)
setOriginalId($original_id)
getCurrentSolutionResultSet($active_id, $pass, $authorized=true)
Get a restulset for the current user solution for a this question by active_id and pass...
Class for matching question definitions.
setLifecycle(ilAssQuestionLifecycle $lifecycle)
addMatchingPair($term=null, $definition=null, $points=0.0)
Adds an matching pair for an matching choice question.
getAnswerTableName()
Returns the name of the answer table in the database.
getTitle()
Gets the title string of the assQuestion object.
saveToDb($original_id="")
Saves a assMatchingQuestion object to a database.
& getMatchingPairs()
Returns the matchingpairs array.
copyImages($question_id, $source_questionpool)
setTitle($title="")
Sets the title string of the assQuestion object.
setObjId($obj_id=0)
Set the object id of the container object.
savePreviewData(ilAssQuestionPreviewSession $previewSession)
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
setComment($comment="")
Sets the comment string of the assQuestion object.
setShuffler(ilArrayElementShuffler $shuffler)
isComplete()
Returns true, if a matching question is complete for use.
static getDraftInstance()
getThumbSize()
Get the thumbnail geometry.
setOwner($owner="")
Sets the creator/owner ID of the assQuestion object.
const EmptyAnswerExpression