4require_once 
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
 
    5require_once 
'./Modules/Test/classes/inc.AssessmentConstants.php';
 
    6require_once 
'./Modules/TestQuestionPool/interfaces/interface.ilObjQuestionScoringAdjustable.php';
 
    7require_once 
'./Modules/TestQuestionPool/interfaces/interface.ilObjAnswerScoringAdjustable.php';
 
    8require_once 
'./Modules/TestQuestionPool/interfaces/interface.iQuestionCondition.php';
 
    9require_once 
'./Modules/TestQuestionPool/classes/class.ilUserQuestionResult.php';
 
   95                $this->matchingpairs = array();
 
   97                $this->terms = array();
 
   98                $this->definitions = array();
 
  108                if (strlen($this->title) 
 
  111                        && count($this->matchingpairs) 
 
  142                $ilDB->manipulateF( 
"DELETE FROM qpl_a_mterm WHERE question_fi = %s",
 
  144                                                        array( $this->
getId() )
 
  148                $ilDB->manipulateF( 
"DELETE FROM qpl_a_mdef WHERE question_fi = %s",
 
  150                                                        array( $this->
getId() )
 
  155                foreach ($this->terms as $key => $term)
 
  157                        $next_id = 
$ilDB->nextId( 
'qpl_a_mterm' );
 
  158                        $ilDB->insert(
'qpl_a_mterm', array(
 
  159                                'term_id' => array(
'integer', $next_id),
 
  160                                'question_fi' => array(
'integer', $this->
getId()),
 
  161                                'picture' => array(
'text', $term->picture),
 
  162                                'term' => array(
'text', $term->text),
 
  163                                'ident' => array(
'integer', $term->identifier)
 
  165                        $termids[$term->identifier] = $next_id;
 
  168                $definitionids = array();
 
  170                foreach ($this->definitions as $key => $definition)
 
  172                        $next_id = 
$ilDB->nextId( 
'qpl_a_mdef' );
 
  173                        $ilDB->insert(
'qpl_a_mdef', array(
 
  174                                'def_id' => array(
'integer', $next_id),
 
  175                                'question_fi' => array(
'integer', $this->
getId()),
 
  176                                'picture' => array(
'text', $definition->picture),
 
  177                                'definition' => array(
'text', $definition->text),
 
  178                                'ident' => array(
'integer', $definition->identifier)
 
  180                        $definitionids[$definition->identifier] = $next_id;
 
  183                $ilDB->manipulateF( 
"DELETE FROM qpl_a_matching WHERE question_fi = %s",
 
  185                                                        array( $this->
getId() )
 
  188                foreach ($matchingpairs as $key => $pair)
 
  190                        $next_id = 
$ilDB->nextId( 
'qpl_a_matching' );
 
  191                        $ilDB->manipulateF( 
"INSERT INTO qpl_a_matching (answer_id, question_fi, points, term_fi, definition_fi) VALUES (%s, %s, %s, %s, %s)",
 
  192                                                                array( 
'integer', 
'integer', 
'float', 
'integer', 
'integer' ),
 
  197                                                                        $termids[$pair->term->identifier],
 
  198                                                                        $definitionids[$pair->definition->identifier]
 
  214                        array( 
"integer" ), array( $this->
getId() )
 
  218                        'question_fi' => array(
'integer', $this->
getId()),
 
  219                        'shuffle' => array(
'text', $this->shuffle),
 
  220                        'matching_type' => array(
'text', $this->matching_type),
 
  237                        SELECT          qpl_questions.*, 
  238                                                {$this->getAdditionalTableName()}.* 
  240                        LEFT JOIN       {$this->getAdditionalTableName()} 
  241                        ON                      {$this->getAdditionalTableName()}.question_fi = qpl_questions.question_id 
  242                        WHERE           qpl_questions.question_id = %s 
  246                        $query, array(
'integer'), array($question_id)
 
  252                        $this->
setId($question_id);
 
  261                        include_once(
"./Services/RTE/classes/class.ilRTE.php");
 
  278                $result = 
$ilDB->queryF(
"SELECT * FROM qpl_a_mterm WHERE question_fi = %s ORDER BY term_id ASC",
 
  282                include_once 
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php";
 
  283                $this->terms = array();
 
  289                                array_push($this->terms, $term);
 
  290                                $termids[
$data[
'term_id']] = $term;
 
  294                $definitionids = array();
 
  295                $result = 
$ilDB->queryF(
"SELECT * FROM qpl_a_mdef WHERE question_fi = %s ORDER BY def_id ASC",
 
  299                include_once 
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingDefinition.php";
 
  300                $this->definitions = array();
 
  306                                array_push($this->definitions, $definition);
 
  307                                $definitionids[
$data[
'def_id']] = $definition;
 
  311                $this->matchingpairs = array();
 
  312                $result = 
$ilDB->queryF(
"SELECT * FROM qpl_a_matching WHERE question_fi = %s ORDER BY answer_id",
 
  316                include_once 
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php";
 
  324                parent::loadFromDb($question_id);
 
  339                $this_id = $this->
getId();
 
  343                include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
 
  347                if( (
int)$testObjId > 0 )
 
  349                        $clone->setObjId($testObjId);
 
  374                $clone->copyPageOfQuestion($this_id);
 
  376                $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
 
  378                $clone->duplicateImages($this_id, $thisObjId, $clone->getId(), $testObjId);
 
  380                $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
 
  397                include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
 
  400                $source_questionpool_id = $this->
getObjId();
 
  401                $clone->setObjId($target_questionpool_id);
 
  412                $clone->copyImages(
$original_id, $source_questionpool_id);
 
  414                $clone->onCopy($source_questionpool_id, 
$original_id, $clone->getObjId(), $clone->getId());
 
  427                include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
 
  430                $sourceParentId = $this->
getObjId();
 
  436                $clone->setObjId($targetParentId);
 
  438                if ($targetQuestionTitle)
 
  440                        $clone->setTitle($targetQuestionTitle);
 
  445                $clone->copyPageOfQuestion($sourceQuestionId);
 
  447                $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
 
  449                $clone->copyImages($sourceQuestionId, $sourceParentId);
 
  451                $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
 
  460                $imagepath_original = str_replace(
"/$this->id/images", 
"/$question_id/images", $imagepath);
 
  462                if( (
int)$objectId > 0 )
 
  464                        $imagepath_original = str_replace(
"/$this->obj_id/", 
"/$objectId/", $imagepath_original);
 
  467                foreach ($this->terms as $term)
 
  469                        if (strlen($term->picture))
 
  472                                if (!file_exists($imagepath))
 
  478                                        $ilLog->write(
"matching question image could not be duplicated: $imagepath_original$filename");
 
  480                                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)
 
  491                        if (strlen($definition->picture))
 
  494                                if (!file_exists($imagepath))
 
  500                                        $ilLog->write(
"matching question image could not be duplicated: $imagepath_original$filename");
 
  502                                if (@file_exists($imagepath_original . $this->
getThumbPrefix() . $filename))
 
  506                                                $ilLog->write(
"matching question image thumbnail could not be duplicated: $imagepath_original" . $this->
getThumbPrefix() . $filename);
 
  513        public function copyImages($question_id, $source_questionpool)
 
  518                $imagepath_original = str_replace(
"/$this->id/images", 
"/$question_id/images", $imagepath);
 
  519                $imagepath_original = str_replace(
"/$this->obj_id/", 
"/$source_questionpool/", $imagepath_original);
 
  520                foreach ($this->terms as $term)
 
  522                        if (strlen($term->picture))
 
  524                                if (!file_exists($imagepath))
 
  531                                        $ilLog->write(
"matching question image could not be copied: $imagepath_original$filename");
 
  535                                        $ilLog->write(
"matching question image thumbnail could not be copied: $imagepath_original" . $this->
getThumbPrefix() . $filename);
 
  539                foreach ($this->definitions as $definition)
 
  541                        if (strlen($definition->picture))
 
  544                                if (!file_exists($imagepath))
 
  555                                        $ilLog->write(
"matching question image could not be copied: $imagepath_original$filename");
 
  564                                        $ilLog->write(
"matching question image thumbnail could not be copied: $imagepath_original" . $this->
getThumbPrefix() . $filename);
 
  582                include_once 
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php";
 
  583                include_once 
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php";
 
  584                include_once 
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingDefinition.php";
 
  588                if ($position < count($this->matchingpairs))
 
  590                        $part1 = array_slice($this->matchingpairs, 0, $position);
 
  591                        $part2 = array_slice($this->matchingpairs, $position);
 
  592                        $this->matchingpairs = array_merge($part1, array($pair), $part2);
 
  596                        array_push($this->matchingpairs, $pair);
 
  613                require_once 
'./Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
 
  614                require_once 
'./Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
 
  615                require_once 
'./Modules/TestQuestionPool/classes/class.assAnswerMatchingDefinition.php';
 
  620                if (is_null($definition)) 
 
  625                array_push($this->matchingpairs, $pair);
 
  633                foreach ($this->terms as $term)
 
  635                        if ($term->identifier == $a_identifier) 
return $term;
 
  645                foreach ($this->definitions as $definition)
 
  647                        if ($definition->identifier == $a_identifier) 
return $definition;
 
  666                if (count($this->matchingpairs) < 1)
 
  670                if ($index >= count($this->matchingpairs))
 
  674                return $this->matchingpairs[$index];
 
  690                if (count($this->matchingpairs) < 1)
 
  694                if ($index >= count($this->matchingpairs))
 
  698                unset($this->matchingpairs[$index]);
 
  699                $this->matchingpairs = array_values($this->matchingpairs);
 
  708                $this->matchingpairs = array();
 
  719                return count($this->matchingpairs);
 
  752                return count($this->terms);
 
  763                return count($this->definitions);
 
  774                array_push($this->terms, $term);
 
  785                array_push($this->definitions, $definition);
 
  798                        include_once 
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php";
 
  801                if ($position < count($this->terms))
 
  803                        $part1 = array_slice($this->terms, 0, $position);
 
  804                        $part2 = array_slice($this->terms, $position);
 
  805                        $this->terms = array_merge($part1, array($term), $part2);
 
  809                        array_push($this->terms, $term);
 
  821                if (is_null($definition))
 
  823                        include_once 
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingDefinition.php";
 
  826                if ($position < count($this->definitions))
 
  828                        $part1 = array_slice($this->definitions, 0, $position);
 
  829                        $part2 = array_slice($this->definitions, $position);
 
  830                        $this->definitions = array_merge($part1, array($definition), $part2);
 
  834                        array_push($this->definitions, $definition);
 
  844                $this->terms = array();
 
  853                $this->definitions = array();
 
  864                unset($this->terms[$position]);
 
  865                $this->terms = array_values($this->terms);
 
  876                unset($this->definitions[$position]);
 
  877                $this->definitions = array_values($this->definitions);
 
  889                $this->terms[$index] = $term;
 
  906                        throw new ilTestException(
'return details not implemented for '.__METHOD__);
 
  911                $found_values = array();
 
  919                        if (strcmp(
$data[
"value1"], 
"") != 0)
 
  921                                if( !isset($found_values[
$data[
'value2']]) )
 
  923                                        $found_values[
$data[
'value2']] = array();
 
  926                                $found_values[
$data[
'value2']][] = 
$data[
'value1'];
 
  966                $matchingPairs = array();
 
  968                foreach( $this->matchingpairs as $pair )
 
  970                        if( $pair->points <= 0 )
 
  975                        $matchingPairs[] = $pair;
 
  978                return $matchingPairs;
 
  983                $matchingPairsByDefinition = array();
 
  985                foreach( $this->matchingpairs as $pair )
 
  987                        if( $pair->points <= 0 )
 
  992                        $defId = $pair->definition->identifier;
 
  994                        if( !isset($matchingPairsByDefinition[$defId]) )
 
  996                                $matchingPairsByDefinition[$defId] = $pair;
 
  998                        elseif( $pair->points > $matchingPairsByDefinition[$defId]->points )
 
 1000                                $matchingPairsByDefinition[$defId] = $pair;
 
 1004                return $matchingPairsByDefinition;
 
 1018                if (preg_match(
"/.*\\.(\\w+)$/", 
$filename, $matches))
 
 1020                        $extension = $matches[1];
 
 1022                return md5(
$filename) . 
"." . $extension;
 
 1027                $term = $this->terms[$index];
 
 1028                if (is_object($term))
 
 1031                        $term->picture = 
null;
 
 1037                $definition = $this->definitions[$index];
 
 1038                if (is_object($definition))
 
 1041                        $definition->picture = 
null;
 
 1068        function setImageFile($image_tempfilename, $image_filename, $previous_filename = 
'')
 
 1071                if (strlen($image_tempfilename))
 
 1073                        $image_filename = str_replace(
" ", 
"_", $image_filename);
 
 1075                        if (!file_exists($imagepath))
 
 1079                        $savename = $image_filename;
 
 1090                        if (
$result && (strcmp($image_filename, $previous_filename) != 0) && (strlen($previous_filename)))
 
 1102                $matchings = array();
 
 1106                        if( isset($postData[$definition->identifier]) )
 
 1108                                foreach( $this->
getTerms() as $term )
 
 1110                                        if( isset($postData[$definition->identifier][$term->identifier]) )
 
 1112                                                if( !is_array($postData[$definition->identifier]) )
 
 1114                                                        $postData[$definition->identifier] = array();
 
 1117                                                $matchings[$definition->identifier][] = $term->identifier;
 
 1133                $handledTerms = array();
 
 1135                foreach( $submittedMatchings as $definition => 
$terms )
 
 1143                        foreach( 
$terms as $i => $term )
 
 1145                                if( isset($handledTerms[$term]) )
 
 1151                                $handledTerms[$term] = $term;
 
 1173                $matchingsExist = 
false;
 
 1175                if ($submittedMatchingsValid)
 
 1179                                include_once 
"./Modules/Test/classes/class.ilObjTest.php";
 
 1187                        foreach( $submittedMatchings as $definition => 
$terms )
 
 1189                                foreach( 
$terms as $i => $term )
 
 1193                                        $matchingsExist = 
true;
 
 1199                        $saveWorkingDataResult = 
true;
 
 1203                        $saveWorkingDataResult = 
false;
 
 1206                include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
 
 1209                        if( $matchingsExist )
 
 1219                return $saveWorkingDataResult;
 
 1247                mt_srand((
double)microtime()*1000000);
 
 1248                $random_number = mt_rand(1, 100000);
 
 1253                        foreach ($this->matchingpairs as $key => $pair)
 
 1255                                if (($pair->term->identifier == $random_number) || ($pair->definition->identifier == $random_number))
 
 1262                return $random_number;
 
 1294                return "assMatchingQuestion";
 
 1304                return "qpl_qst_matching";
 
 1314                return array(
"qpl_a_matching", 
"qpl_a_mterm");
 
 1323                return parent::getRTETextWithMediaObjects();
 
 1348                include_once (
"./Services/Excel/classes/class.ilExcelUtils.php");
 
 1354                foreach ($solutions as $solution)
 
 1356                        $matches_written = FALSE;
 
 1360                                $matches_written = TRUE;
 
 1361                                if ($pair->definition->identifier == $solution[
"value2"])
 
 1363                                        if (strlen($pair->definition->text))
 
 1372                                if ($pair->term->identifier == $solution[
"value1"])
 
 1374                                        if (strlen($pair->term->text))
 
 1386                return $startrow + $i + 1;
 
 1416                $this->thumb_geometry = ($a_geometry < 1) ? 100 : $a_geometry;
 
 1424                foreach ($this->terms as $term)
 
 1428                foreach ($this->definitions as $definition)
 
 1447                        switch (strtoupper($path_info[
'extension']))
 
 1479                        'onenotcorrect' => $this->
formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), 
false)),
 
 1480                        'allcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), 
true))
 
 1484                foreach ($this->
getTerms() as $term)
 
 1488                                "id" =>(
int)$this->getId().$term->identifier
 
 1505                                "id" => (
int) $this->getId().$def->identifier
 
 1511                $matchings = array();
 
 1515                        if ($pair->points <= 0)
 
 1521                        $pid = $pair->definition->identifier;
 
 1524                                $pid .= 
'::'.$pair->term->identifier;
 
 1527                        if( !isset($matchings[$pid]) || $matchings[$pid][
"points"] < $pair->points )
 
 1529                                $matchings[$pid] = array(
 
 1530                                        "term_id" => (
int) $this->
getId().$pair->term->identifier,
 
 1531                                        "def_id" => (
int) $this->getId().$pair->definition->identifier,
 
 1532                                        "points" => (
int) $pair->points
 
 1537                $result[
'matchingPairs'] = array_values($matchings);
 
 1543                $lng->loadLanguageModule(
'assessment');
 
 1544                $result[
'reset_button_label'] = 
$lng->txt(
"reset_terms");
 
 1576                foreach($found_values as $definition => 
$terms)
 
 1580                                foreach($this->matchingpairs as $pair)
 
 1582                                        if($pair->definition->identifier == $definition && $pair->term->identifier == $term)
 
 1602                require_once 
"./Modules/TestQuestionPool/classes/class.ilOperatorsExpressionMapping.php";
 
 1634                        "SELECT morder FROM qpl_a_mdef WHERE question_fi = %s ORDER BY def_id",
 
 1636                        array($this->
getId())
 
 1640                for($index=1; $index <= 
$ilDB->numRows(
$data); ++$index)
 
 1647                        "SELECT ident FROM qpl_a_mterm WHERE question_fi = %s ORDER BY term_id",
 
 1649                        array($this->
getId())
 
 1653                for($index=1; $index <= 
$ilDB->numRows(
$data); ++$index)
 
 1659                $maxStep = $this->lookupMaxStep($active_id, 
$pass);
 
 1661                if( $maxStep !== 
null )
 
 1664                                "SELECT value1, value2 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s AND step = %s",
 
 1665                                array(
"integer", 
"integer", 
"integer",
"integer"),
 
 1666                                array($active_id, 
$pass, $this->
getId(), $maxStep)
 
 1672                                "SELECT value1, value2 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s",
 
 1673                                array(
"integer", 
"integer", 
"integer"),
 
 1680                        if(
$row[
"value1"] > 0)
 
 1719                parent::afterSyncWithOriginal($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId);
 
 1721                $origImagePath = $this->
buildImagePath($origQuestionId, $origParentObjId);
 
 1722                $dupImagePath  = $this->
buildImagePath($dupQuestionId, $dupParentObjId);
 
 1725                if(is_dir($dupImagePath))
 
Class for matching question definitions.
Class for matching question pairs.
Class for matching question terms.
Class for matching questions.
supportsJavascriptOutput()
Returns true if the question type supports JavaScript output.
setThumbGeometry($a_geometry)
Set the thumbnail geometry.
deleteDefinition($position)
Deletes a definition.
getEncryptedFilename($filename)
Returns the encrypted save filename of a matching picture Images are saved with an encrypted filename...
__construct( $title="", $comment="", $author="", $owner=-1, $question="", $matching_type=MT_TERMS_DEFINITIONS)
assMatchingQuestion constructor
removeDefinitionImage($index)
getMatchingPairCount()
Returns the number of matching pairs.
calculateReachedPointsForSolution($found_values)
addDefinition($definition)
Adds a definition.
getMaximumPoints()
Calculates and Returns the maximum points, a learner can reach answering the question.
savePreviewData(ilAssQuestionPreviewSession $previewSession)
Reworks the allready saved working data if neccessary.
copyObject($target_questionpool_id, $title="")
Copies an assMatchingQuestion.
getMostPositiveScoredUniqueTermMatchingPairs()
toJSON()
Returns a JSON representation of the question TODO.
getOperators($expression)
Get all available operations for a specific question.
getDefinitionCount()
Returns the number of definitions.
setExportDetailsXLS(&$worksheet, $startrow, $active_id, $pass, &$format_title, &$format_bold)
Creates an Excel worksheet for the detailed cumulated results of this question.
getDefinitions()
Returns the definitions of the matching question.
getMatchingPair($index=0)
Returns a matching pair with a given index.
createNewOriginalFromThisDuplicate($targetParentId, $targetQuestionTitle="")
duplicate($for_test=true, $title="", $author="", $owner="", $testObjId=null)
Duplicates an assMatchingQuestion.
getQuestionType()
Returns the question type of the question.
isComplete()
Returns true, if a matching question is complete for use.
insertDefinition($position, $definition=null)
Inserts a definition.
& getMatchingPairs()
Returns the matchingpairs array.
rebuildThumbnails()
Rebuild the thumbnail images with a new thumbnail size.
getPositiveScoredMatchingPairs()
duplicateImages($question_id, $objectId=null)
getTermCount()
Returns the number of terms.
getThumbGeometry()
Get the thumbnail geometry.
deleteTerm($position)
Deletes a term.
checkSubmittedMatchings($submittedMatchings)
getTerms()
Returns the terms of the matching question.
calculateReachedPoints($active_id, $pass=NULL, $authorizedSolution=true, $returndetails=FALSE)
Returns the points, a learner has reached answering the question.
addMatchingPair($term=null, $definition=null, $points=0.0)
Adds an matching pair for an matching choice question.
flushDefinitions()
Deletes all definitions.
loadFromDb($question_id)
Loads a assMatchingQuestion object from a database.
getAnswerTableName()
Returns the name of the answer table in the database.
getDefinitionWithIdentifier($a_identifier)
Returns a definition with a given identifier.
getAdditionalTableName()
Returns the name of the additional question data table in the database.
flushTerms()
Deletes all terms.
copyImages($question_id, $source_questionpool)
flushMatchingPairs()
Deletes all matching pairs.
saveToDb($original_id="")
Saves a assMatchingQuestion object to a database.
setMatchingMode($matchingMode)
getAvailableAnswerOptions($index=null)
If index is null, the function returns an array with all anwser options Else it returns the specific ...
setImageFile($image_tempfilename, $image_filename, $previous_filename='')
Sets the image file and uploads the image to the object's image directory.
setShuffle($shuffle=true)
Sets the shuffle flag.
getThumbSize()
Get the thumbnail geometry.
getTermWithIdentifier($a_identifier)
Returns a term with a given identifier.
setTerm($term, $index)
Sets a specific term.
getRTETextWithMediaObjects()
Collects all text in the question which could contain media objects which were created with the Rich ...
fetchSubmittedMatchingsFromPost()
addTerm($term)
Adds a term.
saveAnswerSpecificDataToDb()
Saves the answer specific records into a question types answer table.
afterSyncWithOriginal($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId)
{}
getExpressionTypes()
Get all available expression types for a specific question.
const MATCHING_MODE_1_ON_1
deleteImagefile($filename)
Deletes an imagefile from the system if the file is deleted manually.
getMaximumScoringMatchingPairs()
deleteMatchingPair($index=0)
Deletes a matching pair with a given index.
const MATCHING_MODE_N_ON_N
reworkWorkingData($active_id, $pass, $obligationsAnswered)
Reworks the allready saved working data if neccessary.
insertMatchingPair($position, $term=null, $definition=null, $points=0.0)
Inserts a matching pair for an matching choice question.
insertTerm($position, $term=null)
Inserts a term.
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
saveWorkingData($active_id, $pass=NULL, $authorized=true)
Saves the learners input of the question to the database.
generateThumbForFile($path, $file)
Abstract basic class which is to be extended by the concrete assessment question type classes.
getCurrentSolutionResultSet($active_id, $pass, $authorized=true)
Get a restulset for the current user solution for a this question by active_id and pass.
static _getOriginalId($question_id)
Returns the original id of a question.
formatSAQuestion($a_q)
Format self assessment question.
setId($id=-1)
Sets the id of the assQuestion object.
setOriginalId($original_id)
setObjId($obj_id=0)
Set the object id of the container object.
getSolutionMaxPass($active_id)
Returns the maximum pass a users question solution.
saveQuestionDataToDb($original_id="")
getId()
Gets the id of the assQuestion object.
getObjId()
Get the object id of the container object.
setTitle($title="")
Sets the title string of the assQuestion object.
setOwner($owner="")
Sets the creator/owner ID of the assQuestion object.
setEstimatedWorkingTime($hour=0, $min=0, $sec=0)
Sets the estimated working time of a question from given hour, minute and second.
buildImagePath($questionId, $parentObjectId)
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
setAuthor($author="")
Sets the authors name of the assQuestion object.
static isFileAvailable($file)
getSolutionValues($active_id, $pass=NULL, $authorized=true)
Loads solutions of a given user from the database an returns it.
logAction($logtext="", $active_id="", $question_id="")
Logs an action into the Test&Assessment log.
removeCurrentSolution($active_id, $pass, $authorized=true, $ignoredSolutionIds=array())
getTitle()
Gets the title string of the assQuestion object.
setPoints($a_points)
Sets the maximum available points for the question.
setComment($comment="")
Sets the comment string of the assQuestion object.
setNrOfTries($a_nr_of_tries)
getQuestion()
Gets the question string of the question object.
setAdditionalContentEditingMode($additinalContentEditingMode)
setter for additional content editing mode for this question
saveCurrentSolution($active_id, $pass, $value1, $value2, $authorized=true)
setQuestion($question="")
Sets the question string of the question object.
setParticipantsSolution($participantSolution)
_convert_text($a_text, $a_target="has been removed")
_getLogLanguage()
retrieve the log language for assessment logging
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
_getPass($active_id)
Retrieves the actual pass of a given user for a given test.
static getOperatorsByExpression($expression)
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...
Base Exception for all Exceptions relating to Modules/Test.
Class ilUserQuestionResult.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static convertImage($a_from, $a_to, $a_target_format="", $a_geometry="", $a_background_color="")
convert image
static makeDirParents($a_dir)
Create a new directory and all parent directories.
const MT_TERMS_DEFINITIONS
Class iQuestionCondition.
const PercentageResultExpression
const MatchingResultExpression
getUserQuestionResult($active_id, $pass)
Get the user solution for a question by active_id and the test pass.
const NumericResultExpression
const EmptyAnswerExpression
Interface ilObjAnswerScoringAdjustable.
Interface ilObjQuestionScoringAdjustable.