19 declare(strict_types=1);
93 $matching_type = self::MT_TERMS_DEFINITIONS
98 $this->matchingpairs = [];
101 $this->definitions = [];
102 $this->randomGroup = $DIC->refinery()->random();
117 if (strlen($this->title)
120 && count($this->matchingpairs)
141 $this->db->manipulateF(
142 "DELETE FROM qpl_a_mterm WHERE question_fi = %s",
148 $this->db->manipulateF(
149 "DELETE FROM qpl_a_mdef WHERE question_fi = %s",
156 foreach ($this->terms as $key => $term) {
157 $next_id = $this->db->nextId(
'qpl_a_mterm');
158 $this->db->insert(
'qpl_a_mterm', [
159 'term_id' => [
'integer', $next_id],
160 'question_fi' => [
'integer', $this->
getId()],
161 'picture' => [
'text', $term->getPicture()],
162 'term' => [
'text', $term->getText()],
163 'ident' => [
'integer', $term->getIdentifier()]
165 $termids[$term->getIdentifier()] = $next_id;
170 foreach ($this->definitions as $key => $definition) {
171 $next_id = $this->db->nextId(
'qpl_a_mdef');
172 $this->db->insert(
'qpl_a_mdef', [
173 'def_id' => [
'integer', $next_id],
174 'question_fi' => [
'integer', $this->
getId()],
175 'picture' => [
'text', $definition->getPicture()],
176 'definition' => [
'text', $definition->getText()],
177 'ident' => [
'integer', $definition->getIdentifier()]
179 $definitionids[$definition->getIdentifier()] = $next_id;
182 $this->db->manipulateF(
183 "DELETE FROM qpl_a_matching WHERE question_fi = %s",
189 $next_id = $this->db->nextId(
'qpl_a_matching');
190 $this->db->manipulateF(
191 "INSERT INTO qpl_a_matching (answer_id, question_fi, points, term_fi, definition_fi) VALUES (%s, %s, %s, %s, %s)",
192 [
'integer',
'integer',
'float',
'integer',
'integer' ],
197 $termids[$pair->getTerm()->getIdentifier()],
198 $definitionids[$pair->getDefinition()->getIdentifier()]
206 $this->db->manipulateF(
213 'question_fi' => [
'integer', $this->
getId()],
215 'matching_type' => [
'text', $this->matching_type],
230 SELECT qpl_questions.*, 231 {$this->getAdditionalTableName()}.* 233 LEFT JOIN {$this->getAdditionalTableName()} 234 ON {$this->getAdditionalTableName()}.question_fi = qpl_questions.question_id 235 WHERE qpl_questions.question_id = %s 238 $result = $this->db->queryF(
244 if ($result->numRows() == 1) {
245 $data = $this->db->fetchAssoc($result);
246 $this->
setId((
int) $question_id);
248 $this->
setTitle((
string) $data[
"title"]);
249 $this->
setComment((
string) $data[
"description"]);
253 $this->
setPoints((
float) $data[
"points"]);
254 $this->
setOwner((
int) $data[
"owner"]);
259 $this->
setMatchingMode($data[
'matching_mode'] ===
null ? self::MATCHING_MODE_1_ON_1 : $data[
'matching_mode']);
274 $result = $this->db->queryF(
275 "SELECT * FROM qpl_a_mterm WHERE question_fi = %s ORDER BY term_id ASC",
280 if ($result->numRows() > 0) {
281 while (
$data = $this->db->fetchAssoc($result)) {
283 $this->terms[] = $term;
284 $termids[$data[
'term_id']] = $term;
289 $result = $this->db->queryF(
290 "SELECT * FROM qpl_a_mdef WHERE question_fi = %s ORDER BY def_id ASC",
295 $this->definitions = [];
296 if ($result->numRows() > 0) {
297 while (
$data = $this->db->fetchAssoc($result)) {
299 array_push($this->definitions, $definition);
300 $definitionids[$data[
'def_id']] = $definition;
304 $this->matchingpairs = [];
305 $result = $this->db->queryF(
306 "SELECT * FROM qpl_a_matching WHERE question_fi = %s ORDER BY answer_id",
310 if ($result->numRows() > 0) {
311 while (
$data = $this->db->fetchAssoc($result)) {
313 $termids[
$data[
'term_fi']],
314 $definitionids[$data[
'definition_fi']],
315 (
float) $data[
'points']
317 array_push($this->matchingpairs, $pair);
320 parent::loadFromDb((
int) $question_id);
331 int $source_question_id,
332 int $source_parent_id,
333 int $target_question_id,
334 int $target_parent_id
336 $image_source_path = $this->
getImagePath($source_question_id, $source_parent_id);
337 $image_target_path = $this->
getImagePath($target_question_id, $target_parent_id);
339 if (!file_exists($image_target_path)) {
345 foreach ($this->terms as $term) {
346 if ($term->getPicture() ===
'') {
351 if (!file_exists($image_source_path .
$filename)
352 || !copy($image_source_path . $filename, $image_target_path . $filename)) {
353 $this->log->root()->warning(
'matching question image could not be copied: ' 354 . $image_source_path . $filename);
356 if (!file_exists($image_source_path . $this->
getThumbPrefix() . $filename)
361 $this->log->root()->warning(
'matching question image thumbnail could not be copied: ' 365 foreach ($this->definitions as $definition) {
366 if ($definition->getPicture() ===
'') {
371 if (!file_exists($image_source_path .
$filename)
372 || !copy($image_source_path . $filename, $image_target_path . $filename)) {
373 $this->log->root()->warning(
'matching question image could not be copied: ' 374 . $image_source_path . $filename);
377 if (!file_exists($image_source_path . $this->
getThumbPrefix() . $filename)
382 $this->log->root()->warning(
'matching question image thumbnail could not be copied: ' 402 if ($position < count($this->matchingpairs)) {
403 $part1 = array_slice($this->matchingpairs, 0, $position);
404 $part2 = array_slice($this->matchingpairs, $position);
405 $this->matchingpairs = array_merge($part1, [$pair], $part2);
407 array_push($this->matchingpairs, $pair);
425 array_push($this->matchingpairs, $pair);
433 foreach ($this->terms as $term) {
434 if ($term->getIdentifier() == $a_identifier) {
446 foreach ($this->definitions as $definition) {
447 if ($definition->getIdentifier() == $a_identifier) {
467 if (count($this->matchingpairs) < 1) {
470 if ($index >= count($this->matchingpairs)) {
473 return $this->matchingpairs[$index];
488 if (count($this->matchingpairs) < 1) {
491 if ($index >= count($this->matchingpairs)) {
494 unset($this->matchingpairs[$index]);
495 $this->matchingpairs = array_values($this->matchingpairs);
504 $this->matchingpairs = [];
512 $clone = clone $this;
513 $clone->matchingpairs = $pairs;
526 return count($this->matchingpairs);
559 return count($this->terms);
570 return count($this->definitions);
575 $this->terms[] = $term;
586 array_push($this->definitions, $definition);
597 if (is_null($term)) {
600 if ($position < count($this->terms)) {
601 $part1 = array_slice($this->terms, 0, $position);
602 $part2 = array_slice($this->terms, $position);
603 $this->terms = array_merge($part1, [$term], $part2);
605 array_push($this->terms, $term);
617 if (is_null($definition)) {
620 if ($position < count($this->definitions)) {
621 $part1 = array_slice($this->definitions, 0, $position);
622 $part2 = array_slice($this->definitions, $position);
623 $this->definitions = array_merge($part1, [$definition], $part2);
625 array_push($this->definitions, $definition);
644 $this->definitions = [];
655 unset($this->terms[$position]);
656 $this->terms = array_values($this->terms);
667 unset($this->definitions[$position]);
668 $this->definitions = array_values($this->definitions);
680 $this->terms[$index] = $term;
686 bool $authorized_solution =
true 689 if (is_null($pass)) {
693 while (
$data = $this->db->fetchAssoc($result)) {
694 if (
$data[
'value1'] ===
'') {
698 if (!isset($found_values[
$data[
'value2']])) {
699 $found_values[$data[
'value2']] = [];
702 $found_values[$data[
'value2']][] = $data[
'value1'];
739 foreach ($this->matchingpairs as $pair) {
740 if ($pair->getPoints() <= 0) {
744 $matchingPairs[] = $pair;
747 return $matchingPairs;
752 $matchingPairsByDefinition = [];
754 foreach ($this->matchingpairs as $pair) {
755 if ($pair->getPoints() <= 0) {
759 $defId = $pair->getDefinition()->getIdentifier();
761 if (!isset($matchingPairsByDefinition[$defId])) {
762 $matchingPairsByDefinition[$defId] = $pair;
763 } elseif ($pair->getPoints() > $matchingPairsByDefinition[$defId]->getPoints()) {
764 $matchingPairsByDefinition[$defId] = $pair;
768 return $matchingPairsByDefinition;
779 foreach ($valuePairs as $valuePair) {
780 if (!isset($indexedValues[$valuePair[
'value2']])) {
781 $indexedValues[$valuePair[
'value2']] = [];
784 $indexedValues[$valuePair[
'value2']][] = $valuePair[
'value1'];
787 return $indexedValues;
801 if (preg_match(
"/.*\\.(\\w+)$/",
$filename, $matches)) {
802 $extension = $matches[1];
804 return md5(
$filename) .
"." . $extension;
809 $term = $this->terms[$index] ??
null;
810 if (is_object($term)) {
812 $term = $term->withPicture(
'');
818 $definition = $this->definitions[$index] ??
null;
819 if (is_object($definition)) {
821 $definition = $definition->withPicture(
'');
845 string $image_tempfilename,
846 string $image_filename,
847 string $previous_filename =
'' 850 if ($image_tempfilename ===
'') {
854 $image_filename = str_replace(
' ',
'_', $image_filename);
856 if (!file_exists($imagepath)) {
863 $imagepath . $image_filename
870 $thumbpath = $imagepath . $this->
getThumbPrefix() . $image_filename;
872 $imagepath . $image_filename,
879 && $image_filename !== $previous_filename
880 && $previous_filename !==
'' 895 foreach ($submitted_matchings as $terms) {
896 if (count($terms) > 1) {
897 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"multiple_matching_values_selected"),
true);
901 foreach ($terms as $i => $term) {
902 if (isset($handledTerms[$term])) {
903 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"duplicate_matching_values_selected"),
true);
907 $handledTerms[$term] = $term;
917 bool $authorized =
true 919 if ($pass ===
null) {
923 $submitted_matchings = $this->questionpool_request->getMatchingPairs();
929 function () use ($submitted_matchings, $active_id, $pass, $authorized) {
931 foreach ($submitted_matchings as $definition => $terms) {
932 foreach ($terms as $i => $term) {
944 $submitted_matchings = $this->questionpool_request->getMatchingPairs();
953 mt_srand((
float) microtime() * 1000000);
954 $random_number = mt_rand(1, 100000);
958 foreach ($this->matchingpairs as $key => $pair) {
959 if (($pair->getTerm()->getIdentifier() == $random_number) || ($pair->getDefinition()->getIdentifier() == $random_number)) {
965 return $random_number;
980 return "assMatchingQuestion";
985 return "qpl_qst_matching";
990 return [
"qpl_a_matching",
"qpl_a_mterm"];
999 return parent::getRTETextWithMediaObjects();
1037 $this->thumb_geometry = ($a_geometry < 1) ? 100 : $a_geometry;
1046 foreach ($this->terms as $term) {
1047 if ($term->getPicture() !==
'') {
1048 $current_file_path = $this->
getImagePath() . $term->getPicture();
1049 if (!file_exists($current_file_path)) {
1050 $new_terms[] = $term;
1054 $new_file_path = $this->
getImagePath() . $new_file_name;
1055 rename($current_file_path, $new_file_path);
1056 $term = $term->withPicture($new_file_name);
1059 $new_terms[] = $term;
1061 $this->terms = $new_terms;
1063 $new_definitions = [];
1064 foreach ($this->definitions as $definition) {
1065 if ($definition->getPicture() !==
'') {
1066 $current_file_path = $this->
getImagePath() . $definition->getPicture();
1067 if (!file_exists($current_file_path)) {
1068 $new_definitions[] = $definition;
1072 $new_file_path = $this->
getImagePath() . $new_file_name;
1073 rename($current_file_path, $new_file_path);
1074 $definition = $definition->withPicture($new_file_name);
1077 $new_definitions[] = $definition;
1079 $this->definitions = $new_definitions;
1094 switch (strtoupper($path_info[
'extension'])) {
1116 $result[
'id'] = $this->
getId();
1122 $result[
'shuffle'] =
true;
1123 $result[
'feedback'] = [
1124 'onenotcorrect' => $this->
formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(),
false)),
1125 'allcorrect' => $this->
formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(),
true))
1134 "id" => $this->
getId() . $term->getIdentifier()
1137 $result[
'terms'] =
$terms;
1145 "id" => $this->
getId() . $def->getIdentifier()
1154 if ($pair->getPoints() <= 0) {
1159 $pid = $pair->getDefinition()->getIdentifier();
1161 $pid .=
'::' . $pair->getTerm()->getIdentifier();
1164 if (!isset($matchings[$pid]) || $matchings[$pid][
"points"] < $pair->getPoints()) {
1165 $matchings[$pid] = [
1166 "term_id" => $this->
getId() . $pair->getTerm()->getIdentifier(),
1167 "def_id" => $this->
getId() . $pair->getDefinition()->getIdentifier(),
1168 "points" => (
int) $pair->getPoints()
1173 $result[
'matchingPairs'] = array_values($matchings);
1176 $result[
'mobs'] = $mobs;
1178 $this->
lng->loadLanguageModule(
'assessment');
1179 $result[
'reset_button_label'] = $this->
lng->txt(
"reset_terms");
1181 return json_encode($result);
1197 if (!is_array($found_values)) {
1200 foreach ($found_values as $definition => $terms) {
1201 if (!is_array($terms)) {
1204 foreach ($terms as $term) {
1205 foreach ($this->matchingpairs as $pair) {
1206 if ($pair->getDefinition()->getIdentifier() == $definition
1207 && $pair->getTerm()->getIdentifier() == $term) {
1208 $points += $pair->getPoints();
1218 return ilOperatorsExpressionMapping::getOperatorsByExpression($expression);
1237 $data = $this->db->queryF(
1238 "SELECT ident FROM qpl_a_mdef WHERE question_fi = %s ORDER BY def_id",
1244 for ($index = 1; $index <= $this->db->numRows(
$data); ++$index) {
1245 $row = $this->db->fetchAssoc(
$data);
1246 $definitions[$row[
"ident"]] = $index;
1249 $data = $this->db->queryF(
1250 "SELECT ident FROM qpl_a_mterm WHERE question_fi = %s ORDER BY term_id",
1256 for ($index = 1; $index <= $this->db->numRows(
$data); ++$index) {
1257 $row = $this->db->fetchAssoc(
$data);
1258 $terms[$row[
"ident"]] = $index;
1264 $data = $this->db->queryF(
1265 "SELECT value1, value2 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s AND step = %s",
1266 [
"integer",
"integer",
"integer",
"integer"],
1267 [$active_id, $pass, $this->
getId(), $maxStep]
1270 $data = $this->db->queryF(
1271 "SELECT value1, value2 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s",
1272 [
"integer",
"integer",
"integer"],
1273 [$active_id, $pass, $this->
getId()]
1277 while ($row = $this->db->fetchAssoc(
$data)) {
1278 if ($row[
"value1"] > 0) {
1279 $result->addKeyValue($definitions[$row[
"value2"]], $terms[$row[
"value1"]]);
1286 $result->setReachedPercentage((
$points / $max_points) * 100);
1299 if ($index !==
null) {
1310 int $original_question_id,
1311 int $clone_question_id,
1312 int $original_parent_id,
1313 int $clone_parent_id
1315 parent::afterSyncWithOriginal($original_question_id, $clone_question_id, $original_parent_id, $clone_parent_id);
1317 $original_image_path = $this->question_files->buildImagePath($original_question_id, $original_parent_id);
1318 $clone_image_path = $this->question_files->buildImagePath($clone_question_id, $clone_parent_id);
1321 if (is_dir($clone_image_path)) {
1348 AdditionalInformationGenerator::KEY_QUESTION_TYPE => (string) $this->
getQuestionType(),
1351 AdditionalInformationGenerator::KEY_QUESTION_SHUFFLE_ANSWER_OPTIONS => $additional_info
1353 'qpl_qst_inp_matching_mode' => $this->
getMatchingMode() === self::MATCHING_MODE_1_ON_1 ?
'{{ qpl_qst_inp_matching_mode_one_on_one }}' :
'{{ qpl_qst_inp_matching_mode_all_on_all }}',
1354 AdditionalInformationGenerator::KEY_FEEDBACK => [
1355 AdditionalInformationGenerator::KEY_QUESTION_FEEDBACK_ON_INCOMPLETE => $this->
formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(),
false)),
1356 AdditionalInformationGenerator::KEY_QUESTION_FEEDBACK_ON_COMPLETE => $this->
formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(),
true))
1360 foreach ($this->
getTerms() as $term) {
1361 $result[AdditionalInformationGenerator::KEY_QUESTION_MATCHING_TERMS][] = $term->getText();
1365 $result[AdditionalInformationGenerator::KEY_QUESTION_MATCHING_DEFINITIONS][] = $this->
formatSAQuestion((
string) $definition->getText());
1369 $matching_pairs = [];
1372 $matching_pairs[$i++] = [
1373 AdditionalInformationGenerator::KEY_QUESTION_MATCHING_TERM => $pair->getTerm()->getText(),
1374 AdditionalInformationGenerator::KEY_QUESTION_MATCHING_DEFINITION => $this->
formatSAQuestion((
string) $pair->getDefinition()->getText()),
1375 AdditionalInformationGenerator::KEY_QUESTION_REACHABLE_POINTS => (
int) $pair->getPoints()
1379 $result[AdditionalInformationGenerator::KEY_QUESTION_CORRECT_ANSWER_OPTIONS] = $matching_pairs;
1385 array $solution_values
1393 $c[$v->getIdentifier()] = $v->getText() !==
'' 1399 $terms_by_identifier = array_reduce(
1405 $definitions_by_identifier = array_reduce(
1412 static fn(array $v):
string => $definitions_by_identifier[$v[
'value2']]
1413 .
':' . $terms_by_identifier[$v[
'value1']],
static _replaceMediaObjectImageSrc(string $a_text, int $a_direction=0, string $nic='')
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
getThumbGeometry()
Get the thumbnail geometry.
Class for matching question terms.
setNrOfTries(int $a_nr_of_tries)
addTerm(assAnswerMatchingTerm $term)
getMaximumPoints()
Calculates and Returns the maximum points, a learner can reach answering the question.
static getInstance($identifier)
insertTerm($position, ?assAnswerMatchingTerm $term=null)
Inserts a term.
const PercentageResultExpression
Class for matching question pairs.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
getMatchingPairs()
Returns the matchingpairs array.
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
getPositiveScoredMatchingPairs()
getTermCount()
Returns the number of terms.
const MATCHING_MODE_N_ON_N
calculateReachedPoints(int $active_id, ?int $pass=null, bool $authorized_solution=true)
generateThumbForFile($path, $file)
calculateReachedPointsForSolution(?array $found_values)
withMatchingPairs(array $pairs)
deleteMatchingPair($index=0)
Deletes a matching pair with a given index.
removeAllImageFiles(string $image_target_path)
getDefinitionCount()
Returns the number of definitions.
setShuffleMode(int $shuffle)
addMatchingPair(?assAnswerMatchingTerm $term=null, ?assAnswerMatchingDefinition $definition=null, $points=0.0)
Adds an matching pair for an matching choice question.
const MATCHING_MODE_1_ON_1
getQuestionType()
Returns the question type of the question.
flushMatchingPairs()
Deletes all matching pairs.
getEncryptedFilename($filename)
Returns the encrypted save filename of a matching picture Images are saved with an encrypted filename...
cloneImages(int $source_question_id, int $source_parent_id, int $target_question_id, int $target_parent_id)
flushTerms()
Deletes all terms.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
fetchIndexedValuesFromValuePairs(array $valuePairs)
getRTETextWithMediaObjects()
Collects all text in the question which could contain media objects which were created with the Rich ...
deleteTerm($position)
Deletes a term.
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
setComment(string $comment="")
setThumbGeometry(int $a_geometry)
Set the thumbnail geometry.
rebuildThumbnails()
Rebuild the thumbnail images with a new thumbnail size.
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.
Class for matching questions.
setParticipantsSolution($participantSolution)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct( $title="", $comment="", $author="", $owner=-1, $question="", $matching_type=self::MT_TERMS_DEFINITIONS)
assMatchingQuestion constructor
saveToDb(?int $original_id=null)
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.
saveCurrentSolution(int $active_id, int $pass, $value1, $value2, bool $authorized=true, $tstamp=0)
getOperators(string $expression)
Get all available operations for a specific question.
removeDefinitionImage($index)
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
const MT_TERMS_DEFINITIONS
buildHashedImageFilename(string $plain_image_filename, bool $unique=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTerm($term, $index)
Sets a specific term.
getMatchingPairCount()
Returns the number of matching pairs.
const NumericResultExpression
getExpressionTypes()
Get all available expression types for a specific question.
getMostPositiveScoredUniqueTermMatchingPairs()
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
setShuffle($shuffle=true)
cloneQuestionTypeSpecificProperties(\assQuestion $target)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const MatchingResultExpression
deleteImagefile(string $filename)
Deletes an imagefile from the system if the file is deleted manually.
addDefinition($definition)
Adds a definition.
getMaximumScoringMatchingPairs()
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
saveQuestionDataToDb(?int $original_id=null)
static convertImage(string $a_from, string $a_to, string $a_target_format="", string $a_geometry="", string $a_background_color="")
toLog(AdditionalInformationGenerator $additional_info)
flushDefinitions()
Deletes all definitions.
saveAnswerSpecificDataToDb()
Saves the answer specific records into a question types answer table.
createMatchingTerm(string $term='', string $picture='', int $identifier=0)
toJSON()
Returns a JSON representation of the question.
deleteDefinition($position)
Deletes a definition.
getUserQuestionResult(int $active_id, int $pass)
Get the user solution for a question by active_id and the test pass.
createMatchingPair(?assAnswerMatchingTerm $term=null, ?assAnswerMatchingDefinition $definition=null, float $points=0.0)
getSolutionMaxPass(int $active_id)
afterSyncWithOriginal(int $original_question_id, int $clone_question_id, int $original_parent_id, int $clone_parent_id)
{}
getTerms()
Returns the terms of the matching question.
solutionValuesToText(array $solution_values)
removeCurrentSolution(int $active_id, int $pass, bool $authorized=true)
getDefinitionWithIdentifier($a_identifier)
Returns a definition with a given identifier.
setMatchingMode(string $matching_mode)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
insertDefinition($position, ?assAnswerMatchingDefinition $definition=null)
Inserts a definition.
setOriginalId(?int $original_id)
setShuffler(Transformation $shuffler)
setTitle(string $title="")
createMatchingDefinition(string $term='', string $picture='', int $identifier=0)
Class for matching question definitions.
setLifecycle(ilAssQuestionLifecycle $lifecycle)
getCurrentSolutionResultSet(int $active_id, int $pass, bool $authorized=true)
getCorrectSolutionForTextOutput(int $active_id, int $pass)
setImageFile(string $image_tempfilename, string $image_filename, string $previous_filename='')
lookupMaxStep(int $active_id, int $pass)
setAuthor(string $author="")
savePreviewData(ilAssQuestionPreviewSession $previewSession)
solutionValuesToLog(AdditionalInformationGenerator $additional_info, array $solution_values)
setAdditionalContentEditingMode(?string $additionalContentEditingMode)
static getDraftInstance()
saveWorkingData(int $active_id, ?int $pass=null, bool $authorized=true)
checkSubmittedMatchings(array $submitted_matchings)
getThumbSize()
Get the thumbnail geometry.
setQuestion(string $question="")
const EmptyAnswerExpression