ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
assMatchingQuestion Class Reference

Class for matching questions. More...

+ Inheritance diagram for assMatchingQuestion:
+ Collaboration diagram for assMatchingQuestion:

Public Member Functions

 __construct ( $title="", $comment="", $author="", $owner=-1, $question="", $matching_type=MT_TERMS_DEFINITIONS)
 assMatchingQuestion constructor More...
 
 getShuffleMode ()
 
 setShuffleMode (int $shuffle)
 
 isComplete ()
 Returns true, if a matching question is complete for use. More...
 
 saveToDb ($original_id="")
 Saves a assMatchingQuestion object to a database. More...
 
 saveAnswerSpecificDataToDb ()
 Saves the answer specific records into a question types answer table. More...
 
 saveAdditionalQuestionDataToDb ()
 Saves a record to the question types additional data table. More...
 
 loadFromDb ($question_id)
 Loads a assMatchingQuestion object from a database. More...
 
 duplicate (bool $for_test=true, string $title="", string $author="", int $owner=-1, $testObjId=null)
 Duplicates an assMatchingQuestion. More...
 
 copyObject ($target_questionpool_id, $title="")
 Copies an assMatchingQuestion. More...
 
 createNewOriginalFromThisDuplicate ($targetParentId, $targetQuestionTitle="")
 
 duplicateImages ($question_id, $objectId=null)
 
 copyImages ($question_id, $source_questionpool)
 
 insertMatchingPair ($position, $term=null, $definition=null, $points=0.0)
 Inserts a matching pair for an matching choice question. More...
 
 addMatchingPair (assAnswerMatchingTerm $term=null, assAnswerMatchingDefinition $definition=null, $points=0.0)
 Adds an matching pair for an matching choice question. More...
 
 getTermWithIdentifier ($a_identifier)
 Returns a term with a given identifier. More...
 
 getDefinitionWithIdentifier ($a_identifier)
 Returns a definition with a given identifier. More...
 
 getMatchingPair ($index=0)
 Returns a matching pair with a given index. More...
 
 deleteMatchingPair ($index=0)
 Deletes a matching pair with a given index. More...
 
 flushMatchingPairs ()
 Deletes all matching pairs. More...
 
 withMatchingPairs (array $pairs)
 
 getMatchingPairCount ()
 Returns the number of matching pairs. More...
 
 getTerms ()
 Returns the terms of the matching question. More...
 
 getDefinitions ()
 Returns the definitions of the matching question. More...
 
 getTermCount ()
 Returns the number of terms. More...
 
 getDefinitionCount ()
 Returns the number of definitions. More...
 
 addTerm (assAnswerMatchingTerm $term)
 
 addDefinition ($definition)
 Adds a definition. More...
 
 insertTerm ($position, assAnswerMatchingTerm $term=null)
 Inserts a term. More...
 
 insertDefinition ($position, assAnswerMatchingDefinition $definition=null)
 Inserts a definition. More...
 
 flushTerms ()
 Deletes all terms. More...
 
 flushDefinitions ()
 Deletes all definitions. More...
 
 deleteTerm ($position)
 Deletes a term. More...
 
 deleteDefinition ($position)
 Deletes a definition. More...
 
 setTerm ($term, $index)
 Sets a specific term. More...
 
 calculateReachedPoints ($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
 Returns the points, a learner has reached answering the question. More...
 
 getMaximumPoints ()
 Calculates and Returns the maximum points, a learner can reach answering the question. More...
 
 getMaximumScoringMatchingPairs ()
 
 fetchIndexedValuesFromValuePairs (array $valuePairs)
 
 getEncryptedFilename ($filename)
 Returns the encrypted save filename of a matching picture Images are saved with an encrypted filename to prevent users from cheating by guessing the solution from the image filename. More...
 
 removeTermImage ($index)
 
 removeDefinitionImage ($index)
 
 deleteImagefile (string $filename)
 Deletes an imagefile from the system if the file is deleted manually. More...
 
 setImageFile ($image_tempfilename, $image_filename, $previous_filename='')
 Sets the image file and uploads the image to the object's image directory. More...
 
 saveWorkingData ($active_id, $pass=null, $authorized=true)
 Saves the learners input of the question to the database. More...
 
 getRandomId ()
 
 setShuffle ($shuffle=true)
 
 getQuestionType ()
 Returns the question type of the question. More...
 
 getAdditionalTableName ()
 
 getAnswerTableName ()
 
 getRTETextWithMediaObjects ()
 Collects all text in the question which could contain media objects which were created with the Rich Text Editor. More...
 
getMatchingPairs ()
 Returns the matchingpairs array. More...
 
 setExportDetailsXLSX (ilAssExcelFormatHelper $worksheet, int $startrow, int $col, int $active_id, int $pass)
 {} More...
 
 getThumbGeometry ()
 Get the thumbnail geometry. More...
 
 getThumbSize ()
 Get the thumbnail geometry. More...
 
 setThumbGeometry (int $a_geometry)
 Set the thumbnail geometry. More...
 
 rebuildThumbnails ()
 Rebuild the thumbnail images with a new thumbnail size. More...
 
 getThumbPrefix ()
 
 toJSON ()
 Returns a JSON representation of the question. More...
 
 setMatchingMode ($matchingMode)
 
 getMatchingMode ()
 
 getOperators ($expression)
 Get all available operations for a specific question. More...
 
 getExpressionTypes ()
 Get all available expression types for a specific question. More...
 
 getUserQuestionResult ($active_id, $pass)
 Get the user solution for a question by active_id and the test pass. More...
 
 getAvailableAnswerOptions ($index=null)
 If index is null, the function returns an array with all anwser options Else it returns the specific answer option. More...
 
- Public Member Functions inherited from assQuestion
 __construct (string $title="", string $comment="", string $author="", int $owner=-1, string $question="")
 assQuestion constructor More...
 
 getShuffler ()
 
 setShuffler (Transformation $shuffler)
 
 setProcessLocker (ilAssQuestionProcessLocker $processLocker)
 
 getProcessLocker ()
 
 fromXML ($item, int $questionpool_id, ?int $tst_id, &$tst_object, int &$question_counter, array $import_mapping, array &$solutionhints=[])
 Receives parameters from a QTI parser and creates a valid ILIAS question object. More...
 
 toXML (bool $a_include_header=true, bool $a_include_binary=true, bool $a_shuffle=false, bool $test_output=false, bool $force_image_references=false)
 Returns a QTI xml representation of the question. More...
 
 isComplete ()
 Returns true, if a question is complete for use. More...
 
 setTitle (string $title="")
 
 setId (int $id=-1)
 
 setTestId (int $id=-1)
 
 setComment (string $comment="")
 
 setShuffle (?bool $shuffle=true)
 
 setAuthor (string $author="")
 
 setOwner (int $owner=-1)
 
 getTitle ()
 
 getTitleForHTMLOutput ()
 
 getTitleFilenameCompliant ()
 
 getId ()
 
 getShuffle ()
 
 getTestId ()
 
 getComment ()
 
 getDescriptionForHTMLOutput ()
 
 getThumbSize ()
 
 setThumbSize (int $a_size)
 
 getMinimumThumbSize ()
 
 getMaximumThumbSize ()
 
 getAuthor ()
 
 getAuthorForHTMLOutput ()
 
 getOwner ()
 
 getObjId ()
 
 setObjId (int $obj_id=0)
 
 getLifecycle ()
 
 setLifecycle (ilAssQuestionLifecycle $lifecycle)
 
 setExternalId (?string $external_id)
 
 getExternalId ()
 
 getSuggestedSolutionOutput ()
 
 getSuggestedSolutions ()
 
 getReachedPoints (int $active_id, int $pass)
 
 getMaximumPoints ()
 
 getAdjustedReachedPoints (int $active_id, int $pass, bool $authorizedSolution=true)
 returns the reached points ... More...
 
 calculateResultsFromSolution (int $active_id, int $pass, bool $obligationsEnabled=false)
 Calculates the question results from a previously saved question solution. More...
 
 persistWorkingState (int $active_id, $pass, bool $obligationsEnabled=false, bool $authorized=true)
 persists the working state for current testactive and testpass More...
 
 persistPreviewState (ilAssQuestionPreviewSession $previewSession)
 persists the preview state for current user and question More...
 
 validateSolutionSubmit ()
 
 saveWorkingData (int $active_id, int $pass, bool $authorized=true)
 Saves the learners input of the question to the database. More...
 
 getSuggestedSolutionPath ()
 
 getImagePath ($question_id=null, $object_id=null)
 Returns the image path for web accessable images of a question. More...
 
 getSuggestedSolutionPathWeb ()
 
 getImagePathWeb ()
 Returns the web image path for web accessable images of a question. More...
 
 getTestOutputSolutions (int $activeId, int $pass)
 
 getUserSolutionPreferingIntermediate (int $active_id, $pass=null)
 
 getSolutionValues ($active_id, $pass=null, bool $authorized=true)
 Loads solutions of a given user from the database an returns it. More...
 
 getAdditionalTableName ()
 
 getAnswerTableName ()
 
 deleteAnswers (int $question_id)
 
 deleteAdditionalTableData (int $question_id)
 
 delete (int $question_id)
 
 getTotalAnswers ()
 
 copyXHTMLMediaObjectsOfQuestion (int $a_q_id)
 
 syncXHTMLMediaObjectsOfQuestion ()
 
 createPageObject ()
 
 copyPageOfQuestion (int $a_q_id)
 
 getPageOfQuestion ()
 
 setOriginalId (?int $original_id)
 
 getOriginalId ()
 
 fixSvgToPng (string $imageFilenameContainingString)
 
 fixUnavailableSkinImageSources (string $html)
 
 loadFromDb (int $question_id)
 
 createNewQuestion (bool $a_create_page=true)
 Creates a new question without an owner when a new question is created This assures that an ID is given to the question if a file upload or something else occurs. More...
 
 saveQuestionDataToDb (int $original_id=-1)
 
 saveToDb ()
 
 deleteSuggestedSolutions ()
 
 getSuggestedSolution (int $subquestion_index=0)
 
 resolveInternalLink (string $internal_link)
 
 resolveSuggestedSolutionLinks ()
 
 syncWithOriginal ()
 
 getPoints ()
 
 setPoints (float $points)
 
 getSolutionMaxPass (int $active_id)
 
 calculateReachedPoints ($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
 Returns the points, a learner has reached answering the question. More...
 
 deductHintPointsFromReachedPoints (ilAssQuestionPreviewSession $previewSession, $reachedPoints)
 
 calculateReachedPointsFromPreviewSession (ilAssQuestionPreviewSession $previewSession)
 
 isPreviewSolutionCorrect (ilAssQuestionPreviewSession $previewSession)
 
 adjustReachedPointsByScoringOptions ($points, $active_id, $pass=null)
 Adjust the given reached points by checks for all special scoring options in the test container. More...
 
 buildHashedImageFilename (string $plain_image_filename, bool $unique=false)
 
 getQuestion ()
 
 getQuestionForHTMLOutput ()
 
 setQuestion (string $question="")
 
 getQuestionType ()
 Returns the question type of the question. More...
 
 getQuestionTypeID ()
 
 syncHints ()
 
 cleanupMediaObjectUsage ()
 
 getInstances ()
 
 getActiveUserData (int $active_id)
 Returns the user id and the test id for a given active id. More...
 
 hasSpecificFeedback ()
 
 setExportDetailsXLSX (ilAssExcelFormatHelper $worksheet, int $startrow, int $col, int $active_id, int $pass)
 
 getNrOfTries ()
 
 setNrOfTries (int $a_nr_of_tries)
 
 setExportImagePath (string $path)
 
 formatSAQuestion ($a_q)
 
 setPreventRteUsage (bool $prevent_rte_usage)
 
 getPreventRteUsage ()
 
 migrateContentForLearningModule (ilAssSelfAssessmentMigrator $migrator)
 
 setSelfAssessmentEditingMode (bool $selfassessmenteditingmode)
 
 getSelfAssessmentEditingMode ()
 
 setDefaultNrOfTries (int $defaultnroftries)
 
 getDefaultNrOfTries ()
 
 syncSkillAssignments (int $srcParentId, int $srcQuestionId, int $trgParentId, int $trgQuestionId)
 
 ensureHintPageObjectExists ($pageObjectId)
 
 isAnswered (int $active_id, int $pass)
 
 getAdditionalContentEditingMode ()
 
 setAdditionalContentEditingMode (?string $additionalContentEditingMode)
 
 isAdditionalContentEditingModePageObject ()
 
 isValidAdditionalContentEditingMode (string $additionalContentEditingMode)
 
 getValidAdditionalContentEditingModes ()
 
 getHtmlUserSolutionPurifier ()
 
 getHtmlQuestionContentPurifier ()
 
 setLastChange ($lastChange)
 
 getLastChange ()
 
 removeIntermediateSolution (int $active_id, int $pass)
 
 removeCurrentSolution (int $active_id, int $pass, bool $authorized=true)
 
 saveCurrentSolution (int $active_id, int $pass, $value1, $value2, bool $authorized=true, $tstamp=0)
 
 updateCurrentSolution (int $solutionId, $value1, $value2, bool $authorized=true)
 
 updateCurrentSolutionsAuthorization (int $activeId, int $pass, bool $authorized, bool $keepTime=false)
 
 setStep ($step)
 
 getStep ()
 
 toJSON ()
 
 duplicate (bool $for_test=true, string $title="", string $author="", int $owner=-1, $testObjId=null)
 
 intermediateSolutionExists (int $active_id, int $pass)
 
 authorizedSolutionExists (int $active_id, ?int $pass)
 
 authorizedOrIntermediateSolutionExists (int $active_id, int $pass)
 
 lookupForExistingSolutions (int $activeId, int $pass)
 Lookup if an authorized or intermediate solution exists. More...
 
 isAddableAnswerOptionValue (int $qIndex, string $answerOptionValue)
 
 addAnswerOptionValue (int $qIndex, string $answerOptionValue, float $points)
 
 removeAllExistingSolutions ()
 
 removeExistingSolutions (int $activeId, int $pass)
 
 resetUsersAnswer (int $activeId, int $pass)
 
 removeResultRecord (int $activeId, int $pass)
 
 fetchValuePairsFromIndexedValues (array $indexedValues)
 
 fetchIndexedValuesFromValuePairs (array $valuePairs)
 
 areObligationsToBeConsidered ()
 
 setObligationsToBeConsidered (bool $obligationsToBeConsidered)
 
 updateTimestamp ()
 
 getTestPresentationConfig ()
 
- Public Member Functions inherited from assQuestionInterface
 validateSolutionSubmit ()
 

Data Fields

 $matchingpairs
 
 $matching_type
 
 $thumb_geometry = 100
 
 $element_height
 
const MATCHING_MODE_1_ON_1 = '1:1'
 
const MATCHING_MODE_N_ON_N = 'n:n'
 
- Data Fields inherited from assQuestion
const TRIM_PATTERN = '/^[\p{C}\p{Z}]+|[\p{C}\p{Z}]+$/u'
 
const ADDITIONAL_CONTENT_EDITING_MODE_RTE = 'default'
 
const ADDITIONAL_CONTENT_EDITING_MODE_IPE = 'pageobject'
 
ilAssQuestionFeedback $feedbackOBJ
 
bool $prevent_rte_usage = false
 
bool $selfassessmenteditingmode = false
 
int $defaultnroftries = 0
 
string $questionActionCmd = 'handleQuestionAction'
 
const KEY_VALUES_IMPLOSION_SEPARATOR = ':'
 
- Data Fields inherited from iQuestionCondition
const StringResultExpression = '~TEXT~'
 
const PercentageResultExpression = '%n%'
 
const NumericResultExpression = '#n#'
 
const MatchingResultExpression = ';n:m;'
 
const OrderingResultExpression = '$n,m,o,p$'
 
const NumberOfResultExpression = '+n+'
 
const ExclusiveResultExpression = '*n,m,o,p*'
 
const EmptyAnswerExpression = "?"
 

Protected Member Functions

 savePreviewData (ilAssQuestionPreviewSession $previewSession)
 
 generateThumbForFile ($path, $file)
 
 calculateReachedPointsForSolution ($found_values)
 
 afterSyncWithOriginal ($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId)
 {} More...
 
 createMatchingTerm (string $term='', string $picture='', int $identifier=0)
 
 createMatchingDefinition (string $term='', string $picture='', int $identifier=0)
 
 createMatchingPair (assAnswerMatchingTerm $term=null, assAnswerMatchingDefinition $definition=null, float $points=0.0)
 
- Protected Member Functions inherited from assQuestion
 getQuestionAction ()
 
 isNonEmptyItemListPostSubmission (string $postSubmissionFieldname)
 
 log (int $active_id, string $langVar)
 
 savePreviewData (ilAssQuestionPreviewSession $previewSession)
 
 deletePageOfQuestion (int $question_id)
 
 onDuplicate (int $originalParentId, int $originalQuestionId, int $duplicateParentId, int $duplicateQuestionId)
 
 beforeSyncWithOriginal (int $origQuestionId, int $dupQuestionId, int $origParentObjId, int $dupParentObjId)
 
 afterSyncWithOriginal (int $origQuestionId, int $dupQuestionId, int $origParentObjId, int $dupParentObjId)
 
 onCopy (int $sourceParentId, int $sourceQuestionId, int $targetParentId, int $targetQuestionId)
 
 duplicateComments (int $parent_source_id, int $source_id, int $parent_target_id, int $target_id)
 
 deleteComments ()
 
 getNotesManager ()
 
 getNotesDataService ()
 
 getNotesRepo ()
 
 syncSuggestedSolutions (int $target_question_id, int $target_obj_id)
 
 duplicateSuggestedSolutionFiles (int $parent_id, int $question_id)
 Duplicates the files of a suggested solution if the question is duplicated. More...
 
 syncSuggestedSolutionFiles (int $target_question_id, int $target_obj_id)
 
 copySuggestedSolutionFiles (int $source_questionpool_id, int $source_question_id)
 
 copySuggestedSolutions (int $target_question_id)
 
 ensureNonNegativePoints ($points)
 
 purifyAndPrepareTextAreaOutput (string $content)
 
 getRTETextWithMediaObjects ()
 
 getSelfAssessmentFormatter ()
 
 lmMigrateQuestionTypeGenericContent (ilAssSelfAssessmentMigrator $migrator)
 
 lmMigrateQuestionTypeSpecificContent (ilAssSelfAssessmentMigrator $migrator)
 
 duplicateQuestionHints (int $originalQuestionId, int $duplicateQuestionId)
 
 duplicateSkillAssignments (int $srcParentId, int $srcQuestionId, int $trgParentId, int $trgQuestionId)
 
 buildQuestionDataQuery ()
 
 getCurrentSolutionResultSet (int $active_id, int $pass, bool $authorized=true)
 
 removeSolutionRecordById (int $solutionId)
 
 getSolutionRecordById (int $solutionId)
 
 deleteDummySolutionRecord (int $activeId, int $passIndex)
 
 isDummySolutionRecord (array $solutionRecord)
 
 deleteSolutionRecordByValues (int $activeId, int $passIndex, bool $authorized, array $matchValues)
 
 duplicateIntermediateSolutionAuthorized (int $activeId, int $passIndex)
 
 forceExistingIntermediateSolution (int $activeId, int $passIndex, bool $considerDummyRecordCreation)
 
 lookupMaxStep (int $active_id, int $pass)
 
 buildTestPresentationConfig ()
 build basic test question configuration instance More...
 
 getSuggestedSolutionsRepo ()
 
 loadSuggestedSolutions ()
 

Protected Attributes

array $terms = []
 
 $definitions
 
 $matchingMode = self::MATCHING_MODE_1_ON_1
 
- Protected Attributes inherited from assQuestion
const HAS_SPECIFIC_FEEDBACK = true
 
ILIAS TestQuestionPool QuestionInfoService $questioninfo
 
ILIAS Test TestParticipantInfoService $testParticipantInfo
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ILIAS TestQuestionPool QuestionFilesService $questionFilesService
 
ILIAS DI LoggingServices $ilLog
 
int $id
 
string $title
 
string $comment
 
string $owner
 
string $author
 
int $thumb_size
 
string $question
 The question text. More...
 
float $points
 The maximum available points for the question. More...
 
bool $shuffle
 Indicates whether the answers will be shuffled or not. More...
 
int $test_id
 The database id of a test in which the question is contained. More...
 
int $obj_id = 0
 Object id of the container object. More...
 
 $ilias
 
ilGlobalPageTemplate $tpl
 
ilLanguage $lng
 
ilDBInterface $db
 
Container $dic
 
array $suggested_solutions
 
int $original_id = null
 
 $page
 
string $external_id = null
 
ilAssQuestionProcessLocker $processLocker
 
 $step
 
 $lastChange
 
Transformation $shuffler
 
ilTestQuestionConfig $testQuestionConfig
 
ilAssQuestionLifecycle $lifecycle
 
ilObjUser $current_user
 
SkillUsageService $skillUsageService
 
assQuestionSuggestedSolutionsDatabaseRepository $suggestedsolution_repo = null
 

Private Member Functions

 getPositiveScoredMatchingPairs ()
 
 getMostPositiveScoredUniqueTermMatchingPairs ()
 
 fetchSubmittedMatchingsFromPost ()
 
 checkSubmittedMatchings ($submittedMatchings)
 

Private Attributes

int $shufflemode = 0
 
RandomGroup $randomGroup
 

Additional Inherited Members

- Static Public Member Functions inherited from assQuestion
static setForcePassResultUpdateEnabled (bool $forcePassResultsUpdateEnabled)
 
static isForcePassResultUpdateEnabled ()
 
static _getSuggestedSolutionOutput (int $question_id)
 
static _getReachedPoints (int $active_id, int $question_id, int $pass)
 
static logAction (string $logtext, int $active_id, int $question_id)
 
static isFileAvailable (string $file)
 
static saveOriginalId (int $questionId, int $originalId)
 
static resetOriginalId (int $questionId)
 
static _getInternalLinkHref (string $target="")
 
static instantiateQuestion (int $question_id)
 
static _getSolutionMaxPass (int $question_id, int $active_id)
 Returns the maximum pass a users question solution. More...
 
static _isWriteable (int $question_id, int $user_id)
 
static _setReachedPoints (int $active_id, int $question_id, float $points, float $maxpoints, int $pass, bool $manualscoring, bool $obligationsEnabled, ?int $test_id=null)
 Sets the points, a learner has reached answering the question Additionally objective results are updated. More...
 
static _needsManualScoring (int $question_id)
 
static getFeedbackClassNameByQuestionType (string $questionType)
 
static instantiateQuestionGUI (int $a_question_id)
 
static _questionExistsInTest (int $question_id, int $test_id)
 
static lookupParentObjId (int $questionId)
 
static isObligationPossible (int $questionId)
 
static implodeKeyValues (array $keyValues)
 
static explodeKeyValues (string $keyValues)
 
static convertISO8601FormatH_i_s_ExtendedToSeconds (string $time)
 
static extendedTrim (string $value)
 Trim non-printable characters from the beginning and end of a string. More...
 
- Static Protected Member Functions inherited from assQuestion
static getNumExistingSolutionRecords (int $activeId, int $pass, int $questionId)
 
- Static Protected Attributes inherited from assQuestion
static $forcePassResultsUpdateEnabled = false
 
static $imageSourceFixReplaceMap
 

Detailed Description

Class for matching questions.

assMatchingQuestion is a class 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$

Definition at line 39 of file class.assMatchingQuestion.php.

Constructor & Destructor Documentation

◆ __construct()

assMatchingQuestion::__construct (   $title = "",
  $comment = "",
  $author = "",
  $owner = -1,
  $question = "",
  $matching_type = MT_TERMS_DEFINITIONS 
)

assMatchingQuestion constructor

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

Parameters
string$titleA title string to describe the question
string$commentA comment string to describe the question
string$authorA string containing the name of the questions author
integer$ownerA numerical ID to identify the owner/creator
string$questionThe question string of the matching question
int$matching_type

Definition at line 102 of file class.assMatchingQuestion.php.

References assQuestion\$author, assQuestion\$comment, $DIC, $matching_type, assQuestion\$owner, assQuestion\$question, assQuestion\$title, and ILIAS\MetaData\Repository\Validation\Data\__construct().

109  {
110  global $DIC;
111 
113  $this->matchingpairs = [];
114  $this->matching_type = $matching_type;
115  $this->terms = [];
116  $this->definitions = [];
117  $this->randomGroup = $DIC->refinery()->random();
118  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
string $question
The question text.
+ Here is the call graph for this function:

Member Function Documentation

◆ addDefinition()

assMatchingQuestion::addDefinition (   $definition)

Adds a definition.

Parameters
object$definitionThe definition
See also
$definitions

Definition at line 752 of file class.assMatchingQuestion.php.

752  : void
753  {
754  array_push($this->definitions, $definition);
755  }

◆ addMatchingPair()

assMatchingQuestion::addMatchingPair ( assAnswerMatchingTerm  $term = null,
assAnswerMatchingDefinition  $definition = null,
  $points = 0.0 
)

Adds an matching pair for an matching choice question.

The students have to fill in an order for the matching pair. The matching pair is an ASS_AnswerMatching object that will be created and assigned to the array $this->matchingpairs.

Parameters
assAnswerMatchingTerm | null$termA matching term
assAnswerMatchingDefinition | null$definitionA matching definition
float$pointsThe points for selecting the matching pair, incl. negative.
See also
$matchingpairs

Definition at line 590 of file class.assMatchingQuestion.php.

References assQuestion\$points, and createMatchingPair().

590  : void
591  {
592  $pair = $this->createMatchingPair($term, $definition, $points);
593  array_push($this->matchingpairs, $pair);
594  }
float $points
The maximum available points for the question.
createMatchingPair(assAnswerMatchingTerm $term=null, assAnswerMatchingDefinition $definition=null, float $points=0.0)
+ Here is the call graph for this function:

◆ addTerm()

assMatchingQuestion::addTerm ( assAnswerMatchingTerm  $term)

Definition at line 741 of file class.assMatchingQuestion.php.

741  : void
742  {
743  $this->terms[] = $term;
744  }

◆ afterSyncWithOriginal()

assMatchingQuestion::afterSyncWithOriginal (   $origQuestionId,
  $dupQuestionId,
  $origParentObjId,
  $dupParentObjId 
)
protected

{}

Definition at line 1586 of file class.assMatchingQuestion.php.

References ilFileUtils\delDir(), ilFileUtils\makeDirParents(), and ilFileUtils\rCopy().

1586  : void
1587  {
1588  parent::afterSyncWithOriginal($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId);
1589 
1590  $origImagePath = $this->questionFilesService->buildImagePath($origQuestionId, $origParentObjId);
1591  $dupImagePath = $this->questionFilesService->buildImagePath($dupQuestionId, $dupParentObjId);
1592 
1593  ilFileUtils::delDir($origImagePath);
1594  if (is_dir($dupImagePath)) {
1595  ilFileUtils::makeDirParents($origImagePath);
1596  ilFileUtils::rCopy($dupImagePath, $origImagePath);
1597  }
1598  }
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ calculateReachedPoints()

assMatchingQuestion::calculateReachedPoints (   $active_id,
  $pass = null,
  $authorizedSolution = true,
  $returndetails = false 
)

Returns the points, a learner has reached answering the question.

The points are calculated from the given answers.

public

Parameters
integer$active_id
integer$pass
boolean$returndetails(deprecated !!)
Returns
integer/array $points/$details (array $details is deprecated !!)

Definition at line 861 of file class.assMatchingQuestion.php.

References $data, assQuestion\$points, calculateReachedPointsForSolution(), assQuestion\getCurrentSolutionResultSet(), and assQuestion\getSolutionMaxPass().

Referenced by getUserQuestionResult().

861  : float
862  {
863  if ($returndetails) {
864  throw new ilTestException('return details not implemented for ' . __METHOD__);
865  }
866 
867  $found_values = [];
868  if (is_null($pass)) {
869  $pass = $this->getSolutionMaxPass($active_id);
870  }
871  $result = $this->getCurrentSolutionResultSet($active_id, (int) $pass, $authorizedSolution);
872  while ($data = $this->db->fetchAssoc($result)) {
873  if (strcmp($data["value1"], "") != 0) {
874  if (!isset($found_values[$data['value2']])) {
875  $found_values[$data['value2']] = [];
876  }
877 
878  $found_values[$data['value2']][] = $data['value1'];
879  }
880  }
881 
882  $points = $this->calculateReachedPointsForSolution($found_values);
883 
884  return $points;
885  }
calculateReachedPointsForSolution($found_values)
float $points
The maximum available points for the question.
Base Exception for all Exceptions relating to Modules/Test.
getSolutionMaxPass(int $active_id)
getCurrentSolutionResultSet(int $active_id, int $pass, bool $authorized=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculateReachedPointsForSolution()

assMatchingQuestion::calculateReachedPointsForSolution (   $found_values)
protected
Parameters
$found_values
Returns
float

Definition at line 1455 of file class.assMatchingQuestion.php.

References assQuestion\$points.

Referenced by calculateReachedPoints().

1455  : float
1456  {
1457  $points = 0;
1458  if (! is_array($found_values)) {
1459  return $points;
1460  }
1461  foreach ($found_values as $definition => $terms) {
1462  if (!is_array($terms)) {
1463  continue;
1464  }
1465  foreach ($terms as $term) {
1466  foreach ($this->matchingpairs as $pair) {
1467  if ($pair->getDefinition()->getIdentifier() == $definition && $pair->getTerm()->getIdentifier() == $term) {
1468  $points += $pair->getPoints();
1469  }
1470  }
1471  }
1472  }
1473  return $points;
1474  }
float $points
The maximum available points for the question.
+ Here is the caller graph for this function:

◆ checkSubmittedMatchings()

assMatchingQuestion::checkSubmittedMatchings (   $submittedMatchings)
private

Definition at line 1078 of file class.assMatchingQuestion.php.

References getMatchingMode(), and ILIAS\Repository\lng().

Referenced by savePreviewData(), and saveWorkingData().

1078  : bool
1079  {
1080  if ($this->getMatchingMode() == self::MATCHING_MODE_N_ON_N) {
1081  return true;
1082  }
1083 
1084  $handledTerms = [];
1085 
1086  foreach ($submittedMatchings as $definition => $terms) {
1087  if (count($terms) > 1) {
1088  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("multiple_matching_values_selected"), true);
1089  return false;
1090  }
1091 
1092  foreach ($terms as $i => $term) {
1093  if (isset($handledTerms[$term])) {
1094  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("duplicate_matching_values_selected"), true);
1095  return false;
1096  }
1097 
1098  $handledTerms[$term] = $term;
1099  }
1100  }
1101 
1102  return true;
1103  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyImages()

assMatchingQuestion::copyImages (   $question_id,
  $source_questionpool 
)

Definition at line 512 of file class.assMatchingQuestion.php.

References $DIC, $filename, assQuestion\$ilLog, assQuestion\getImagePath(), getThumbPrefix(), assQuestion\isFileAvailable(), and ilFileUtils\makeDirParents().

512  : void
513  {
514  global $DIC;
515  $ilLog = $DIC['ilLog'];
516 
517  $imagepath = $this->getImagePath();
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) {
521  if (strlen($term->getPicture())) {
522  if (!file_exists($imagepath)) {
523  ilFileUtils::makeDirParents($imagepath);
524  }
525  $filename = $term->getPicture();
526  if (!@copy($imagepath_original . $filename, $imagepath . $filename)) {
527  $ilLog->write("matching question image could not be copied: $imagepath_original$filename");
528  }
529  if (!@copy($imagepath_original . $this->getThumbPrefix() . $filename, $imagepath . $this->getThumbPrefix() . $filename)) {
530  $ilLog->write("matching question image thumbnail could not be copied: $imagepath_original" . $this->getThumbPrefix() . $filename);
531  }
532  }
533  }
534  foreach ($this->definitions as $definition) {
535  if (strlen($definition->getPicture())) {
536  $filename = $definition->getPicture();
537  if (!file_exists($imagepath)) {
538  ilFileUtils::makeDirParents($imagepath);
539  }
540 
541  if (assQuestion::isFileAvailable($imagepath_original . $filename)) {
542  copy($imagepath_original . $filename, $imagepath . $filename);
543  } else {
544  $ilLog->write("matching question image could not be copied: $imagepath_original$filename");
545  }
546 
547  if (assQuestion::isFileAvailable($imagepath_original . $this->getThumbPrefix() . $filename)) {
548  copy($imagepath_original . $this->getThumbPrefix() . $filename, $imagepath . $this->getThumbPrefix() . $filename);
549  } else {
550  $ilLog->write("matching question image thumbnail could not be copied: $imagepath_original" . $this->getThumbPrefix() . $filename);
551  }
552  }
553  }
554  }
static isFileAvailable(string $file)
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
global $DIC
Definition: feed.php:28
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
$filename
Definition: buildRTE.php:78
ILIAS DI LoggingServices $ilLog
+ Here is the call graph for this function:

◆ copyObject()

assMatchingQuestion::copyObject (   $target_questionpool_id,
  $title = "" 
)

Copies an assMatchingQuestion.

Definition at line 407 of file class.assMatchingQuestion.php.

References assQuestion\$original_id, assQuestion\$title, assQuestion\getId(), and assQuestion\getObjId().

407  : int
408  {
409  if ($this->getId() <= 0) {
410  throw new RuntimeException('The question has not been saved. It cannot be duplicated');
411  }
412  // duplicate the question in database
413  $clone = $this;
414 
415  $original_id = $this->questioninfo->getOriginalId($this->id);
416  $clone->id = -1;
417  $source_questionpool_id = $this->getObjId();
418  $clone->setObjId($target_questionpool_id);
419  if ($title) {
420  $clone->setTitle($title);
421  }
422  $clone->saveToDb();
423  // copy question page content
424  $clone->copyPageOfQuestion($original_id);
425  // copy XHTML media objects
426  $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
427  // duplicate the image
428  $clone->copyImages($original_id, $source_questionpool_id);
429 
430  $clone->onCopy($source_questionpool_id, $original_id, $clone->getObjId(), $clone->getId());
431 
432  return $clone->id;
433  }
+ Here is the call graph for this function:

◆ createMatchingDefinition()

assMatchingQuestion::createMatchingDefinition ( string  $term = '',
string  $picture = '',
int  $identifier = 0 
)
protected

Definition at line 1604 of file class.assMatchingQuestion.php.

Referenced by createMatchingPair(), insertDefinition(), and loadFromDb().

1605  {
1606  return new assAnswerMatchingDefinition($term, $picture, $identifier);
1607  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ createMatchingPair()

assMatchingQuestion::createMatchingPair ( assAnswerMatchingTerm  $term = null,
assAnswerMatchingDefinition  $definition = null,
float  $points = 0.0 
)
protected

Definition at line 1608 of file class.assMatchingQuestion.php.

References assQuestion\$points, createMatchingDefinition(), and createMatchingTerm().

Referenced by addMatchingPair(), insertMatchingPair(), and loadFromDb().

1613  $term = $term ?? $this->createMatchingTerm();
1614  $definition = $definition ?? $this->createMatchingDefinition();
1615  return new assAnswerMatchingPair($term, $definition, $points);
1616  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
float $points
The maximum available points for the question.
createMatchingTerm(string $term='', string $picture='', int $identifier=0)
createMatchingDefinition(string $term='', string $picture='', int $identifier=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createMatchingTerm()

assMatchingQuestion::createMatchingTerm ( string  $term = '',
string  $picture = '',
int  $identifier = 0 
)
protected

Definition at line 1600 of file class.assMatchingQuestion.php.

Referenced by createMatchingPair(), insertTerm(), and loadFromDb().

1601  {
1602  return new assAnswerMatchingTerm($term, $picture, $identifier);
1603  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ createNewOriginalFromThisDuplicate()

assMatchingQuestion::createNewOriginalFromThisDuplicate (   $targetParentId,
  $targetQuestionTitle = "" 
)

Definition at line 435 of file class.assMatchingQuestion.php.

References assQuestion\$id, assQuestion\getId(), and assQuestion\getObjId().

435  : int
436  {
437  if ($this->getId() <= 0) {
438  throw new RuntimeException('The question has not been saved. It cannot be duplicated');
439  }
440 
441  $sourceQuestionId = $this->id;
442  $sourceParentId = $this->getObjId();
443 
444  // duplicate the question in database
445  $clone = $this;
446  $clone->id = -1;
447 
448  $clone->setObjId($targetParentId);
449 
450  if ($targetQuestionTitle) {
451  $clone->setTitle($targetQuestionTitle);
452  }
453 
454  $clone->saveToDb();
455  // copy question page content
456  $clone->copyPageOfQuestion($sourceQuestionId);
457  // copy XHTML media objects
458  $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
459  // duplicate the image
460  $clone->copyImages($sourceQuestionId, $sourceParentId);
461 
462  $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
463 
464  return $clone->id;
465  }
+ Here is the call graph for this function:

◆ deleteDefinition()

assMatchingQuestion::deleteDefinition (   $position)

Deletes a definition.

Parameters
integer$positionThe position of the definition in the definition array
See also
$definitions

Definition at line 833 of file class.assMatchingQuestion.php.

833  : void
834  {
835  unset($this->definitions[$position]);
836  $this->definitions = array_values($this->definitions);
837  }

◆ deleteImagefile()

assMatchingQuestion::deleteImagefile ( string  $filename)

Deletes an imagefile from the system if the file is deleted manually.

Parameters
string$filenameImage file filename
Returns
boolean Success

Definition at line 1009 of file class.assMatchingQuestion.php.

References Vendor\Package\$e, $filename, assQuestion\getImagePath(), and getThumbPrefix().

Referenced by removeDefinitionImage(), removeTermImage(), and setImageFile().

1009  : bool
1010  {
1011  $deletename = $filename;
1012  try {
1013  $result = unlink($this->getImagePath() . $deletename)
1014  && unlink($this->getImagePath() . $this->getThumbPrefix() . $deletename);
1015  } catch (Throwable $e) {
1016  $result = false;
1017  }
1018  return $result;
1019  }
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
$filename
Definition: buildRTE.php:78
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteMatchingPair()

assMatchingQuestion::deleteMatchingPair (   $index = 0)

Deletes a matching pair with a given index.

The index of the first matching pair is 0, the index of the second matching pair is 1 and so on.

Parameters
integer$indexA nonnegative index of the n-th matching pair
See also
$matchingpairs

Definition at line 651 of file class.assMatchingQuestion.php.

651  : void
652  {
653  if ($index < 0) {
654  return;
655  }
656  if (count($this->matchingpairs) < 1) {
657  return;
658  }
659  if ($index >= count($this->matchingpairs)) {
660  return;
661  }
662  unset($this->matchingpairs[$index]);
663  $this->matchingpairs = array_values($this->matchingpairs);
664  }

◆ deleteTerm()

assMatchingQuestion::deleteTerm (   $position)

Deletes a term.

Parameters
string$term_idThe id of the term to delete
See also
$terms

Definition at line 821 of file class.assMatchingQuestion.php.

821  : void
822  {
823  unset($this->terms[$position]);
824  $this->terms = array_values($this->terms);
825  }

◆ duplicate()

assMatchingQuestion::duplicate ( bool  $for_test = true,
string  $title = "",
string  $author = "",
int  $owner = -1,
  $testObjId = null 
)

Duplicates an assMatchingQuestion.

Definition at line 358 of file class.assMatchingQuestion.php.

References assQuestion\$author, assQuestion\$original_id, assQuestion\$owner, assQuestion\$title, assQuestion\getId(), and assQuestion\getObjId().

358  : int
359  {
360  if ($this->id <= 0) {
361  // The question has not been saved. It cannot be duplicated
362  return -1;
363  }
364  // duplicate the question in database
365  $this_id = $this->getId();
366  $thisObjId = $this->getObjId();
367 
368  $clone = $this;
369 
370  $original_id = $this->questioninfo->getOriginalId($this->id);
371  $clone->id = -1;
372 
373  if ((int) $testObjId > 0) {
374  $clone->setObjId($testObjId);
375  }
376 
377  if ($title) {
378  $clone->setTitle($title);
379  }
380  if ($author) {
381  $clone->setAuthor($author);
382  }
383  if ($owner) {
384  $clone->setOwner((int) $owner);
385  }
386  if ($for_test) {
387  $clone->saveToDb($original_id);
388  } else {
389  $clone->saveToDb();
390  }
391 
392  // copy question page content
393  $clone->copyPageOfQuestion($this_id);
394  // copy XHTML media objects
395  $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
396  // duplicate the image
397  $clone->duplicateImages($this_id, $thisObjId, $clone->getId(), $testObjId);
398 
399  $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
400 
401  return $clone->id;
402  }
+ Here is the call graph for this function:

◆ duplicateImages()

assMatchingQuestion::duplicateImages (   $question_id,
  $objectId = null 
)

Definition at line 467 of file class.assMatchingQuestion.php.

References $DIC, $filename, assQuestion\$ilLog, assQuestion\getImagePath(), getThumbPrefix(), and ilFileUtils\makeDirParents().

467  : void
468  {
469  global $DIC;
470  $ilLog = $DIC['ilLog'];
471  $imagepath = $this->getImagePath();
472  $imagepath_original = str_replace("/$this->id/images", "/$question_id/images", $imagepath);
473 
474  if ((int) $objectId > 0) {
475  $imagepath_original = str_replace("/$this->obj_id/", "/$objectId/", $imagepath_original);
476  }
477 
478  foreach ($this->terms as $term) {
479  if (strlen($term->getPicture())) {
480  $filename = $term->getPicture();
481  if (!file_exists($imagepath)) {
482  ilFileUtils::makeDirParents($imagepath);
483  }
484  if (!@copy($imagepath_original . $filename, $imagepath . $filename)) {
485  $ilLog->write("matching question image could not be duplicated: $imagepath_original$filename");
486  }
487  if (@file_exists($imagepath_original . $this->getThumbPrefix() . $filename)) {
488  if (!@copy($imagepath_original . $this->getThumbPrefix() . $filename, $imagepath . $this->getThumbPrefix() . $filename)) {
489  $ilLog->write("matching question image thumbnail could not be duplicated: $imagepath_original" . $this->getThumbPrefix() . $filename);
490  }
491  }
492  }
493  }
494  foreach ($this->definitions as $definition) {
495  if (strlen($definition->getPicture())) {
496  $filename = $definition->getPicture();
497  if (!file_exists($imagepath)) {
498  ilFileUtils::makeDirParents($imagepath);
499  }
500  if (!@copy($imagepath_original . $filename, $imagepath . $filename)) {
501  $ilLog->write("matching question image could not be duplicated: $imagepath_original$filename");
502  }
503  if (@file_exists($imagepath_original . $this->getThumbPrefix() . $filename)) {
504  if (!@copy($imagepath_original . $this->getThumbPrefix() . $filename, $imagepath . $this->getThumbPrefix() . $filename)) {
505  $ilLog->write("matching question image thumbnail could not be duplicated: $imagepath_original" . $this->getThumbPrefix() . $filename);
506  }
507  }
508  }
509  }
510  }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
global $DIC
Definition: feed.php:28
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
$filename
Definition: buildRTE.php:78
ILIAS DI LoggingServices $ilLog
+ Here is the call graph for this function:

◆ fetchIndexedValuesFromValuePairs()

assMatchingQuestion::fetchIndexedValuesFromValuePairs ( array  $valuePairs)
Parameters
array$valuePairs
Returns
array $indexedValues

Definition at line 952 of file class.assMatchingQuestion.php.

952  : array
953  {
954  $indexedValues = [];
955 
956  foreach ($valuePairs as $valuePair) {
957  if (!isset($indexedValues[$valuePair['value2']])) {
958  $indexedValues[$valuePair['value2']] = [];
959  }
960 
961  $indexedValues[$valuePair['value2']][] = $valuePair['value1'];
962  }
963 
964  return $indexedValues;
965  }

◆ fetchSubmittedMatchingsFromPost()

assMatchingQuestion::fetchSubmittedMatchingsFromPost ( )
private

Definition at line 1053 of file class.assMatchingQuestion.php.

References $post, getDefinitions(), assQuestion\getId(), and getTerms().

Referenced by savePreviewData(), and saveWorkingData().

1053  : array
1054  {
1055  $request = $this->dic->testQuestionPool()->internal()->request();
1056  $post = $request->getParsedBody();
1057 
1058  $matchings = [];
1059  if (array_key_exists('matching', $post)) {
1060  $postData = $post['matching'][$this->getId()];
1061  foreach ($this->getDefinitions() as $definition) {
1062  if (isset($postData[$definition->getIdentifier()])) {
1063  foreach ($this->getTerms() as $term) {
1064  if (isset($postData[$definition->getIdentifier()][$term->getIdentifier()])) {
1065  if (!is_array($postData[$definition->getIdentifier()])) {
1066  $postData[$definition->getIdentifier()] = [];
1067  }
1068  $matchings[$definition->getIdentifier()][] = $term->getIdentifier();
1069  }
1070  }
1071  }
1072  }
1073  }
1074 
1075  return $matchings;
1076  }
getDefinitions()
Returns the definitions of the matching question.
getTerms()
Returns the terms of the matching question.
$post
Definition: ltitoken.php:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flushDefinitions()

assMatchingQuestion::flushDefinitions ( )

Deletes all definitions.

See also
$definitions

Definition at line 810 of file class.assMatchingQuestion.php.

810  : void
811  {
812  $this->definitions = [];
813  }

◆ flushMatchingPairs()

assMatchingQuestion::flushMatchingPairs ( )

Deletes all matching pairs.

See also
$matchingpairs

Definition at line 670 of file class.assMatchingQuestion.php.

670  : void
671  {
672  $this->matchingpairs = [];
673  }

◆ flushTerms()

assMatchingQuestion::flushTerms ( )

Deletes all terms.

See also
$terms

Definition at line 801 of file class.assMatchingQuestion.php.

801  : void
802  {
803  $this->terms = [];
804  }

◆ generateThumbForFile()

assMatchingQuestion::generateThumbForFile (   $path,
  $file 
)
protected

Definition at line 1344 of file class.assMatchingQuestion.php.

References $filename, $path, ilShellUtil\convertImage(), getThumbGeometry(), and getThumbPrefix().

Referenced by rebuildThumbnails().

1344  : void
1345  {
1346  $filename = $path . $file;
1347  if (file_exists($filename)) {
1348  $thumbpath = $path . $this->getThumbPrefix() . $file;
1349  $path_info = pathinfo($filename);
1350  $ext = "";
1351  switch (strtoupper($path_info['extension'])) {
1352  case 'PNG':
1353  $ext = 'PNG';
1354  break;
1355  case 'GIF':
1356  $ext = 'GIF';
1357  break;
1358  default:
1359  $ext = 'JPEG';
1360  break;
1361  }
1362  ilShellUtil::convertImage($filename, $thumbpath, $ext, (string) $this->getThumbGeometry());
1363  }
1364  }
getThumbGeometry()
Get the thumbnail geometry.
$path
Definition: ltiservices.php:32
static convertImage(string $a_from, string $a_to, string $a_target_format="", string $a_geometry="", string $a_background_color="")
$filename
Definition: buildRTE.php:78
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAdditionalTableName()

assMatchingQuestion::getAdditionalTableName ( )

Definition at line 1201 of file class.assMatchingQuestion.php.

Referenced by saveAdditionalQuestionDataToDb().

1201  : string
1202  {
1203  return "qpl_qst_matching";
1204  }
+ Here is the caller graph for this function:

◆ getAnswerTableName()

assMatchingQuestion::getAnswerTableName ( )

Definition at line 1206 of file class.assMatchingQuestion.php.

1206  : array
1207  {
1208  return ["qpl_a_matching", "qpl_a_mterm"];
1209  }

◆ getAvailableAnswerOptions()

assMatchingQuestion::getAvailableAnswerOptions (   $index = null)

If index is null, the function returns an array with all anwser options Else it returns the specific answer option.

Parameters
null | int$index

Implements iQuestionCondition.

Definition at line 1574 of file class.assMatchingQuestion.php.

References getMatchingPair(), and getMatchingPairs().

1575  {
1576  if ($index !== null) {
1577  return $this->getMatchingPair($index);
1578  } else {
1579  return $this->getMatchingPairs();
1580  }
1581  }
getMatchingPair($index=0)
Returns a matching pair with a given index.
& getMatchingPairs()
Returns the matchingpairs array.
+ Here is the call graph for this function:

◆ getDefinitionCount()

assMatchingQuestion::getDefinitionCount ( )

Returns the number of definitions.

Returns
integer The number of definitions
See also
$definitions

Definition at line 736 of file class.assMatchingQuestion.php.

736  : int
737  {
738  return count($this->definitions);
739  }

◆ getDefinitions()

assMatchingQuestion::getDefinitions ( )

Returns the definitions of the matching question.

Returns
array An array containing the definitions
See also
$terms

Definition at line 714 of file class.assMatchingQuestion.php.

References $definitions.

Referenced by fetchSubmittedMatchingsFromPost(), and toJSON().

714  : array
715  {
716  return $this->definitions;
717  }
+ Here is the caller graph for this function:

◆ getDefinitionWithIdentifier()

assMatchingQuestion::getDefinitionWithIdentifier (   $a_identifier)

Returns a definition with a given identifier.

Definition at line 612 of file class.assMatchingQuestion.php.

613  {
614  foreach ($this->definitions as $definition) {
615  if ($definition->getIdentifier() == $a_identifier) {
616  return $definition;
617  }
618  }
619  return null;
620  }

◆ getEncryptedFilename()

assMatchingQuestion::getEncryptedFilename (   $filename)

Returns the encrypted save filename of a matching picture Images are saved with an encrypted filename to prevent users from cheating by guessing the solution from the image filename.

Parameters
string$filenameOriginal filename
Returns
string Encrypted filename

Definition at line 975 of file class.assMatchingQuestion.php.

References $filename.

975  : string
976  {
977  $extension = "";
978  if (preg_match("/.*\\.(\\w+)$/", $filename, $matches)) {
979  $extension = $matches[1];
980  }
981  return md5($filename) . "." . $extension;
982  }
$filename
Definition: buildRTE.php:78

◆ getExpressionTypes()

◆ getMatchingMode()

assMatchingQuestion::getMatchingMode ( )

Definition at line 1446 of file class.assMatchingQuestion.php.

References $matchingMode.

Referenced by checkSubmittedMatchings(), getMaximumScoringMatchingPairs(), saveAdditionalQuestionDataToDb(), and toJSON().

1446  : string
1447  {
1448  return $this->matchingMode;
1449  }
+ Here is the caller graph for this function:

◆ getMatchingPair()

assMatchingQuestion::getMatchingPair (   $index = 0)

Returns a matching pair with a given index.

The index of the first matching pair is 0, the index of the second matching pair is 1 and so on.

Parameters
integer$indexA nonnegative index of the n-th matching pair
Returns
object ASS_AnswerMatching-Object
See also
$matchingpairs

Definition at line 630 of file class.assMatchingQuestion.php.

Referenced by getAvailableAnswerOptions().

630  : ?object
631  {
632  if ($index < 0) {
633  return null;
634  }
635  if (count($this->matchingpairs) < 1) {
636  return null;
637  }
638  if ($index >= count($this->matchingpairs)) {
639  return null;
640  }
641  return $this->matchingpairs[$index];
642  }
+ Here is the caller graph for this function:

◆ getMatchingPairCount()

assMatchingQuestion::getMatchingPairCount ( )

Returns the number of matching pairs.

Returns
integer The number of matching pairs of the matching question
See also
$matchingpairs

Definition at line 692 of file class.assMatchingQuestion.php.

692  : int
693  {
694  return count($this->matchingpairs);
695  }

◆ getMatchingPairs()

& assMatchingQuestion::getMatchingPairs ( )

Returns the matchingpairs array.

Definition at line 1223 of file class.assMatchingQuestion.php.

References $matchingpairs.

Referenced by getAvailableAnswerOptions(), saveAnswerSpecificDataToDb(), setExportDetailsXLSX(), and toJSON().

1223  : array
1224  {
1225  return $this->matchingpairs;
1226  }
+ Here is the caller graph for this function:

◆ getMaximumPoints()

assMatchingQuestion::getMaximumPoints ( )

Calculates and Returns the maximum points, a learner can reach answering the question.

Definition at line 890 of file class.assMatchingQuestion.php.

References assQuestion\$points, and getMaximumScoringMatchingPairs().

Referenced by getUserQuestionResult(), and isComplete().

890  : float
891  {
892  $points = 0;
893 
894  foreach ($this->getMaximumScoringMatchingPairs() as $pair) {
895  $points += $pair->getPoints();
896  }
897 
898  return $points;
899  }
float $points
The maximum available points for the question.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMaximumScoringMatchingPairs()

assMatchingQuestion::getMaximumScoringMatchingPairs ( )

Definition at line 901 of file class.assMatchingQuestion.php.

References getMatchingMode(), getMostPositiveScoredUniqueTermMatchingPairs(), and getPositiveScoredMatchingPairs().

Referenced by getMaximumPoints().

901  : array
902  {
903  if ($this->getMatchingMode() == self::MATCHING_MODE_N_ON_N) {
904  return $this->getPositiveScoredMatchingPairs();
905  } elseif ($this->getMatchingMode() == self::MATCHING_MODE_1_ON_1) {
907  }
908 
909  return [];
910  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMostPositiveScoredUniqueTermMatchingPairs()

assMatchingQuestion::getMostPositiveScoredUniqueTermMatchingPairs ( )
private

Definition at line 927 of file class.assMatchingQuestion.php.

Referenced by getMaximumScoringMatchingPairs().

927  : array
928  {
929  $matchingPairsByDefinition = [];
930 
931  foreach ($this->matchingpairs as $pair) {
932  if ($pair->getPoints() <= 0) {
933  continue;
934  }
935 
936  $defId = $pair->getDefinition()->getIdentifier();
937 
938  if (!isset($matchingPairsByDefinition[$defId])) {
939  $matchingPairsByDefinition[$defId] = $pair;
940  } elseif ($pair->getPoints() > $matchingPairsByDefinition[$defId]->getPoints()) {
941  $matchingPairsByDefinition[$defId] = $pair;
942  }
943  }
944 
945  return $matchingPairsByDefinition;
946  }
+ Here is the caller graph for this function:

◆ getOperators()

assMatchingQuestion::getOperators (   $expression)

Get all available operations for a specific question.

Parameters
$expression

Implements iQuestionCondition.

Definition at line 1484 of file class.assMatchingQuestion.php.

References ilOperatorsExpressionMapping\getOperatorsByExpression().

1484  : array
1485  {
1487  }
+ Here is the call graph for this function:

◆ getPositiveScoredMatchingPairs()

assMatchingQuestion::getPositiveScoredMatchingPairs ( )
private

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

Referenced by getMaximumScoringMatchingPairs().

912  : array
913  {
914  $matchingPairs = [];
915 
916  foreach ($this->matchingpairs as $pair) {
917  if ($pair->getPoints() <= 0) {
918  continue;
919  }
920 
921  $matchingPairs[] = $pair;
922  }
923 
924  return $matchingPairs;
925  }
+ Here is the caller graph for this function:

◆ getQuestionType()

assMatchingQuestion::getQuestionType ( )

Returns the question type of the question.

Returns
integer The question type of the question

Definition at line 1196 of file class.assMatchingQuestion.php.

Referenced by toJSON().

1196  : string
1197  {
1198  return "assMatchingQuestion";
1199  }
+ Here is the caller graph for this function:

◆ getRandomId()

assMatchingQuestion::getRandomId ( )

Definition at line 1169 of file class.assMatchingQuestion.php.

References ILIAS\LTI\ToolProvider\$key.

1169  : int
1170  {
1171  mt_srand((float) microtime() * 1000000);
1172  $random_number = mt_rand(1, 100000);
1173  $found = false;
1174  while ($found) {
1175  $found = false;
1176  foreach ($this->matchingpairs as $key => $pair) {
1177  if (($pair->getTerm()->getIdentifier() == $random_number) || ($pair->getDefinition()->getIdentifier() == $random_number)) {
1178  $found = true;
1179  $random_number++;
1180  }
1181  }
1182  }
1183  return $random_number;
1184  }
string $key
Consumer key/client ID value.
Definition: System.php:193

◆ getRTETextWithMediaObjects()

assMatchingQuestion::getRTETextWithMediaObjects ( )

Collects all text in the question which could contain media objects which were created with the Rich Text Editor.

Definition at line 1215 of file class.assMatchingQuestion.php.

1215  : string
1216  {
1217  return parent::getRTETextWithMediaObjects();
1218  }

◆ getShuffleMode()

assMatchingQuestion::getShuffleMode ( )

Definition at line 120 of file class.assMatchingQuestion.php.

References $shufflemode.

Referenced by saveAdditionalQuestionDataToDb().

120  : int
121  {
122  return $this->shufflemode;
123  }
+ Here is the caller graph for this function:

◆ getTermCount()

assMatchingQuestion::getTermCount ( )

Returns the number of terms.

Returns
integer The number of terms
See also
$terms

Definition at line 725 of file class.assMatchingQuestion.php.

725  : int
726  {
727  return count($this->terms);
728  }

◆ getTerms()

assMatchingQuestion::getTerms ( )

Returns the terms of the matching question.

Returns
assAnswerMatchingTerm[] An array containing the terms
See also
$terms

Definition at line 703 of file class.assMatchingQuestion.php.

References $terms.

Referenced by fetchSubmittedMatchingsFromPost(), and toJSON().

703  : array
704  {
705  return $this->terms;
706  }
+ Here is the caller graph for this function:

◆ getTermWithIdentifier()

assMatchingQuestion::getTermWithIdentifier (   $a_identifier)

Returns a term with a given identifier.

Definition at line 599 of file class.assMatchingQuestion.php.

600  {
601  foreach ($this->terms as $term) {
602  if ($term->getIdentifier() == $a_identifier) {
603  return $term;
604  }
605  }
606  return null;
607  }

◆ getThumbGeometry()

assMatchingQuestion::getThumbGeometry ( )

Get the thumbnail geometry.

Returns
integer Geometry

Definition at line 1272 of file class.assMatchingQuestion.php.

References $thumb_geometry.

Referenced by generateThumbForFile(), getThumbSize(), saveAdditionalQuestionDataToDb(), and setImageFile().

1272  : int
1273  {
1274  return $this->thumb_geometry;
1275  }
+ Here is the caller graph for this function:

◆ getThumbPrefix()

assMatchingQuestion::getThumbPrefix ( )

Definition at line 1339 of file class.assMatchingQuestion.php.

Referenced by copyImages(), deleteImagefile(), duplicateImages(), generateThumbForFile(), and setImageFile().

1339  : string
1340  {
1341  return "thumb.";
1342  }
+ Here is the caller graph for this function:

◆ getThumbSize()

assMatchingQuestion::getThumbSize ( )

Get the thumbnail geometry.

Returns
integer Geometry

Definition at line 1282 of file class.assMatchingQuestion.php.

References getThumbGeometry().

1282  : int
1283  {
1284  return $this->getThumbGeometry();
1285  }
getThumbGeometry()
Get the thumbnail geometry.
+ Here is the call graph for this function:

◆ getUserQuestionResult()

assMatchingQuestion::getUserQuestionResult (   $active_id,
  $pass 
)

Get the user solution for a question by active_id and the test pass.

Parameters
int$active_id
int$pass
Returns
ilUserQuestionResult

Implements iQuestionCondition.

Definition at line 1510 of file class.assMatchingQuestion.php.

References $data, $definitions, assQuestion\$points, calculateReachedPoints(), assQuestion\getId(), getMaximumPoints(), and assQuestion\lookupMaxStep().

1511  {
1512  $result = new ilUserQuestionResult($this, $active_id, $pass);
1513 
1514  $data = $this->db->queryF(
1515  "SELECT ident FROM qpl_a_mdef WHERE question_fi = %s ORDER BY def_id",
1516  ["integer"],
1517  [$this->getId()]
1518  );
1519 
1520  $definitions = [];
1521  for ($index = 1; $index <= $this->db->numRows($data); ++$index) {
1522  $row = $this->db->fetchAssoc($data);
1523  $definitions[$row["ident"]] = $index;
1524  }
1525 
1526  $data = $this->db->queryF(
1527  "SELECT ident FROM qpl_a_mterm WHERE question_fi = %s ORDER BY term_id",
1528  ["integer"],
1529  [$this->getId()]
1530  );
1531 
1532  $terms = [];
1533  for ($index = 1; $index <= $this->db->numRows($data); ++$index) {
1534  $row = $this->db->fetchAssoc($data);
1535  $terms[$row["ident"]] = $index;
1536  }
1537 
1538  $maxStep = $this->lookupMaxStep($active_id, $pass);
1539 
1540  if ($maxStep > 0) {
1541  $data = $this->db->queryF(
1542  "SELECT value1, value2 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s AND step = %s",
1543  ["integer", "integer", "integer","integer"],
1544  [$active_id, $pass, $this->getId(), $maxStep]
1545  );
1546  } else {
1547  $data = $this->db->queryF(
1548  "SELECT value1, value2 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s",
1549  ["integer", "integer", "integer"],
1550  [$active_id, $pass, $this->getId()]
1551  );
1552  }
1553 
1554  while ($row = $this->db->fetchAssoc($data)) {
1555  if ($row["value1"] > 0) {
1556  $result->addKeyValue($definitions[$row["value2"]], $terms[$row["value1"]]);
1557  }
1558  }
1559 
1560  $points = $this->calculateReachedPoints($active_id, $pass);
1561  $max_points = $this->getMaximumPoints();
1562 
1563  $result->setReachedPercentage(($points / $max_points) * 100);
1564 
1565  return $result;
1566  }
getMaximumPoints()
Calculates and Returns the maximum points, a learner can reach answering the question.
calculateReachedPoints($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
Returns the points, a learner has reached answering the question.
float $points
The maximum available points for the question.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
lookupMaxStep(int $active_id, int $pass)
+ Here is the call graph for this function:

◆ insertDefinition()

assMatchingQuestion::insertDefinition (   $position,
assAnswerMatchingDefinition  $definition = null 
)

Inserts a definition.

Parameters
object$definitionThe definition
See also
$definitions

Definition at line 783 of file class.assMatchingQuestion.php.

References createMatchingDefinition().

783  : void
784  {
785  if (is_null($definition)) {
786  $definition = $this->createMatchingDefinition();
787  }
788  if ($position < count($this->definitions)) {
789  $part1 = array_slice($this->definitions, 0, $position);
790  $part2 = array_slice($this->definitions, $position);
791  $this->definitions = array_merge($part1, [$definition], $part2);
792  } else {
793  array_push($this->definitions, $definition);
794  }
795  }
createMatchingDefinition(string $term='', string $picture='', int $identifier=0)
+ Here is the call graph for this function:

◆ insertMatchingPair()

assMatchingQuestion::insertMatchingPair (   $position,
  $term = null,
  $definition = null,
  $points = 0.0 
)

Inserts a matching pair for an matching choice question.

The students have to fill in an order for the matching pair. The matching pair is an ASS_AnswerMatching object that will be created and assigned to the array $this->matchingpairs.

Parameters
integer$positionThe insert position in the matching pairs array
object$termA matching term
object$definitionA matching definition
double$pointsThe points for selecting the matching pair (even negative points can be used)
See also
$matchingpairs

Definition at line 566 of file class.assMatchingQuestion.php.

References assQuestion\$points, and createMatchingPair().

566  : void
567  {
568  $pair = $this->createMatchingPair($term, $definition, $points);
569 
570  if ($position < count($this->matchingpairs)) {
571  $part1 = array_slice($this->matchingpairs, 0, $position);
572  $part2 = array_slice($this->matchingpairs, $position);
573  $this->matchingpairs = array_merge($part1, [$pair], $part2);
574  } else {
575  array_push($this->matchingpairs, $pair);
576  }
577  }
float $points
The maximum available points for the question.
createMatchingPair(assAnswerMatchingTerm $term=null, assAnswerMatchingDefinition $definition=null, float $points=0.0)
+ Here is the call graph for this function:

◆ insertTerm()

assMatchingQuestion::insertTerm (   $position,
assAnswerMatchingTerm  $term = null 
)

Inserts a term.

Parameters
string$termThe text of the term
See also
$terms

Definition at line 763 of file class.assMatchingQuestion.php.

References createMatchingTerm().

763  : void
764  {
765  if (is_null($term)) {
766  $term = $this->createMatchingTerm();
767  }
768  if ($position < count($this->terms)) {
769  $part1 = array_slice($this->terms, 0, $position);
770  $part2 = array_slice($this->terms, $position);
771  $this->terms = array_merge($part1, [$term], $part2);
772  } else {
773  array_push($this->terms, $term);
774  }
775  }
createMatchingTerm(string $term='', string $picture='', int $identifier=0)
+ Here is the call graph for this function:

◆ isComplete()

assMatchingQuestion::isComplete ( )

Returns true, if a matching question is complete for use.

Returns
boolean True, if the matching question is complete for use, otherwise false

Definition at line 135 of file class.assMatchingQuestion.php.

References getMaximumPoints().

135  : bool
136  {
137  if (strlen($this->title)
138  && $this->author
139  && $this->question
140  && count($this->matchingpairs)
141  && $this->getMaximumPoints() > 0
142  ) {
143  return true;
144  }
145  return false;
146  }
getMaximumPoints()
Calculates and Returns the maximum points, a learner can reach answering the question.
+ Here is the call graph for this function:

◆ loadFromDb()

assMatchingQuestion::loadFromDb (   $question_id)

Loads a assMatchingQuestion object from a database.

Parameters
object$dbA pear DB object
integer$question_idA unique key which defines the multiple choice test in the database

Definition at line 258 of file class.assMatchingQuestion.php.

References $data, Vendor\Package\$e, ilRTE\_replaceMediaObjectImageSrc(), createMatchingDefinition(), createMatchingPair(), createMatchingTerm(), ilAssQuestionLifecycle\getDraftInstance(), ilAssQuestionLifecycle\getInstance(), assQuestion\setAdditionalContentEditingMode(), assQuestion\setAuthor(), assQuestion\setComment(), assQuestion\setId(), assQuestion\setLifecycle(), setMatchingMode(), assQuestion\setNrOfTries(), assQuestion\setObjId(), assQuestion\setOriginalId(), assQuestion\setOwner(), assQuestion\setPoints(), assQuestion\setQuestion(), setShuffle(), setShuffleMode(), setThumbGeometry(), and assQuestion\setTitle().

258  : void
259  {
260  $query = "
261  SELECT qpl_questions.*,
262  {$this->getAdditionalTableName()}.*
263  FROM qpl_questions
264  LEFT JOIN {$this->getAdditionalTableName()}
265  ON {$this->getAdditionalTableName()}.question_fi = qpl_questions.question_id
266  WHERE qpl_questions.question_id = %s
267  ";
268 
269  $result = $this->db->queryF(
270  $query,
271  ['integer'],
272  [$question_id]
273  );
274 
275  if ($result->numRows() == 1) {
276  $data = $this->db->fetchAssoc($result);
277  $this->setId((int) $question_id);
278  $this->setObjId((int) $data["obj_fi"]);
279  $this->setTitle((string) $data["title"]);
280  $this->setComment((string) $data["description"]);
281  $this->setOriginalId((int) $data["original_id"]);
282  $this->setNrOfTries((int) $data['nr_of_tries']);
283  $this->setAuthor($data["author"]);
284  $this->setPoints((float) $data["points"]);
285  $this->setOwner((int) $data["owner"]);
286  $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc((string) $data["question_text"], 1));
287  $this->setThumbGeometry((int) $data["thumb_geometry"]);
288  $this->setShuffle($data["shuffle"] != '0');
289  $this->setShuffleMode((int) $data['shuffle']);
290  $this->setMatchingMode($data['matching_mode'] === null ? self::MATCHING_MODE_1_ON_1 : $data['matching_mode']);
291 
292  try {
296  }
297 
298  try {
299  $this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);
300  } catch (ilTestQuestionPoolException $e) {
301  }
302  }
303 
304  $termids = [];
305  $result = $this->db->queryF(
306  "SELECT * FROM qpl_a_mterm WHERE question_fi = %s ORDER BY term_id ASC",
307  ['integer'],
308  [$question_id]
309  );
310  $this->terms = [];
311  if ($result->numRows() > 0) {
312  while ($data = $this->db->fetchAssoc($result)) {
313  $term = $this->createMatchingTerm($data['term'] ?? '', $data['picture'] ?? '', (int) $data['ident']);
314  $this->terms[] = $term;
315  $termids[$data['term_id']] = $term;
316  }
317  }
318 
319  $definitionids = [];
320  $result = $this->db->queryF(
321  "SELECT * FROM qpl_a_mdef WHERE question_fi = %s ORDER BY def_id ASC",
322  ['integer'],
323  [$question_id]
324  );
325 
326  $this->definitions = [];
327  if ($result->numRows() > 0) {
328  while ($data = $this->db->fetchAssoc($result)) {
329  $definition = $this->createMatchingDefinition($data['definition'] ?? '', $data['picture'] ?? '', (int) $data['ident']);
330  array_push($this->definitions, $definition);
331  $definitionids[$data['def_id']] = $definition;
332  }
333  }
334 
335  $this->matchingpairs = [];
336  $result = $this->db->queryF(
337  "SELECT * FROM qpl_a_matching WHERE question_fi = %s ORDER BY answer_id",
338  ['integer'],
339  [$question_id]
340  );
341  if ($result->numRows() > 0) {
342  while ($data = $this->db->fetchAssoc($result)) {
343  $pair = $this->createMatchingPair(
344  $termids[$data['term_fi']],
345  $definitionids[$data['definition_fi']],
346  (float) $data['points']
347  );
348  array_push($this->matchingpairs, $pair);
349  }
350  }
351  parent::loadFromDb((int) $question_id);
352  }
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...
setNrOfTries(int $a_nr_of_tries)
setOwner(int $owner=-1)
setComment(string $comment="")
setThumbGeometry(int $a_geometry)
Set the thumbnail geometry.
setPoints(float $points)
setObjId(int $obj_id=0)
createMatchingTerm(string $term='', string $picture='', int $identifier=0)
createMatchingPair(assAnswerMatchingTerm $term=null, assAnswerMatchingDefinition $definition=null, float $points=0.0)
setId(int $id=-1)
setOriginalId(?int $original_id)
setTitle(string $title="")
createMatchingDefinition(string $term='', string $picture='', int $identifier=0)
setLifecycle(ilAssQuestionLifecycle $lifecycle)
setAuthor(string $author="")
setAdditionalContentEditingMode(?string $additionalContentEditingMode)
setQuestion(string $question="")
+ Here is the call graph for this function:

◆ rebuildThumbnails()

assMatchingQuestion::rebuildThumbnails ( )

Rebuild the thumbnail images with a new thumbnail size.

Definition at line 1300 of file class.assMatchingQuestion.php.

References assQuestion\buildHashedImageFilename(), generateThumbForFile(), and assQuestion\getImagePath().

Referenced by saveAnswerSpecificDataToDb().

1300  : void
1301  {
1302  $new_terms = [];
1303  foreach ($this->terms as $term) {
1304  if ($term->getPicture() !== '') {
1305  $current_file_path = $this->getImagePath() . $term->getPicture();
1306  if (!file_exists($current_file_path)) {
1307  $new_terms[] = $term;
1308  continue;
1309  }
1310  $new_file_name = $this->buildHashedImageFilename($term->getPicture(), true);
1311  $new_file_path = $this->getImagePath() . $new_file_name;
1312  rename($current_file_path, $new_file_path);
1313  $term = $term->withPicture($new_file_name);
1314  $this->generateThumbForFile($this->getImagePath(), $term->getPicture());
1315  }
1316  $new_terms[] = $term;
1317  }
1318  $this->terms = $new_terms;
1319 
1320  $new_definitions = [];
1321  foreach ($this->definitions as $definition) {
1322  if ($definition->getPicture() !== '') {
1323  $current_file_path = $this->getImagePath() . $definition->getPicture();
1324  if (!file_exists($current_file_path)) {
1325  $new_definitions[] = $definition;
1326  continue;
1327  }
1328  $new_file_name = $this->buildHashedImageFilename($definition->getPicture(), true);
1329  $new_file_path = $this->getImagePath() . $new_file_name;
1330  rename($current_file_path, $new_file_path);
1331  $definition = $definition->withPicture($new_file_name);
1332  $this->generateThumbForFile($this->getImagePath(), $definition->getPicture());
1333  }
1334  $new_definitions[] = $definition;
1335  }
1336  $this->definitions = $new_definitions;
1337  }
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
buildHashedImageFilename(string $plain_image_filename, bool $unique=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeDefinitionImage()

assMatchingQuestion::removeDefinitionImage (   $index)

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

References deleteImagefile().

993  : void
994  {
995  $definition = $this->definitions[$index] ?? null;
996  if (is_object($definition)) {
997  $this->deleteImagefile($definition->getPicture());
998  $definition = $definition->withPicture('');
999  }
1000  }
deleteImagefile(string $filename)
Deletes an imagefile from the system if the file is deleted manually.
+ Here is the call graph for this function:

◆ removeTermImage()

assMatchingQuestion::removeTermImage (   $index)

Definition at line 984 of file class.assMatchingQuestion.php.

References deleteImagefile().

984  : void
985  {
986  $term = $this->terms[$index] ?? null;
987  if (is_object($term)) {
988  $this->deleteImagefile($term->getPicture());
989  $term = $term->withPicture('');
990  }
991  }
deleteImagefile(string $filename)
Deletes an imagefile from the system if the file is deleted manually.
+ Here is the call graph for this function:

◆ saveAdditionalQuestionDataToDb()

assMatchingQuestion::saveAdditionalQuestionDataToDb ( )

Saves a record to the question types additional data table.

Returns
mixed

Implements ilObjQuestionScoringAdjustable.

Definition at line 235 of file class.assMatchingQuestion.php.

References getAdditionalTableName(), assQuestion\getId(), getMatchingMode(), getShuffleMode(), and getThumbGeometry().

Referenced by saveToDb().

236  {
237  $this->db->manipulateF(
238  "DELETE FROM " . $this->getAdditionalTableName() . " WHERE question_fi = %s",
239  [ "integer" ],
240  [ $this->getId() ]
241  );
242 
243  $this->db->insert($this->getAdditionalTableName(), [
244  'question_fi' => ['integer', $this->getId()],
245  'shuffle' => ['text', $this->getShuffleMode()],
246  'matching_type' => ['text', $this->matching_type],
247  'thumb_geometry' => ['integer', $this->getThumbGeometry()],
248  'matching_mode' => ['text', $this->getMatchingMode()]
249  ]);
250  }
getThumbGeometry()
Get the thumbnail geometry.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAnswerSpecificDataToDb()

assMatchingQuestion::saveAnswerSpecificDataToDb ( )

Saves the answer specific records into a question types answer table.

Returns
mixed

Implements ilObjAnswerScoringAdjustable.

Definition at line 168 of file class.assMatchingQuestion.php.

References ILIAS\LTI\ToolProvider\$key, $matchingpairs, assQuestion\getId(), getMatchingPairs(), and rebuildThumbnails().

Referenced by saveToDb().

169  {
170  $this->rebuildThumbnails();
171 
172  $this->db->manipulateF(
173  "DELETE FROM qpl_a_mterm WHERE question_fi = %s",
174  [ 'integer' ],
175  [ $this->getId() ]
176  );
177 
178  // delete old definitions
179  $this->db->manipulateF(
180  "DELETE FROM qpl_a_mdef WHERE question_fi = %s",
181  [ 'integer' ],
182  [ $this->getId() ]
183  );
184 
185  $termids = [];
186  // write terms
187  foreach ($this->terms as $key => $term) {
188  $next_id = $this->db->nextId('qpl_a_mterm');
189  $this->db->insert('qpl_a_mterm', [
190  'term_id' => ['integer', $next_id],
191  'question_fi' => ['integer', $this->getId()],
192  'picture' => ['text', $term->getPicture()],
193  'term' => ['text', $term->getText()],
194  'ident' => ['integer', $term->getIdentifier()]
195  ]);
196  $termids[$term->getIdentifier()] = $next_id;
197  }
198 
199  $definitionids = [];
200  // write definitions
201  foreach ($this->definitions as $key => $definition) {
202  $next_id = $this->db->nextId('qpl_a_mdef');
203  $this->db->insert('qpl_a_mdef', [
204  'def_id' => ['integer', $next_id],
205  'question_fi' => ['integer', $this->getId()],
206  'picture' => ['text', $definition->getPicture()],
207  'definition' => ['text', $definition->getText()],
208  'ident' => ['integer', $definition->getIdentifier()]
209  ]);
210  $definitionids[$definition->getIdentifier()] = $next_id;
211  }
212 
213  $this->db->manipulateF(
214  "DELETE FROM qpl_a_matching WHERE question_fi = %s",
215  [ 'integer' ],
216  [ $this->getId() ]
217  );
218  $matchingpairs = $this->getMatchingPairs();
219  foreach ($matchingpairs as $key => $pair) {
220  $next_id = $this->db->nextId('qpl_a_matching');
221  $this->db->manipulateF(
222  "INSERT INTO qpl_a_matching (answer_id, question_fi, points, term_fi, definition_fi) VALUES (%s, %s, %s, %s, %s)",
223  [ 'integer', 'integer', 'float', 'integer', 'integer' ],
224  [
225  $next_id,
226  $this->getId(),
227  $pair->getPoints(),
228  $termids[$pair->getTerm()->getIdentifier()],
229  $definitionids[$pair->getDefinition()->getIdentifier()]
230  ]
231  );
232  }
233  }
rebuildThumbnails()
Rebuild the thumbnail images with a new thumbnail size.
string $key
Consumer key/client ID value.
Definition: System.php:193
& getMatchingPairs()
Returns the matchingpairs array.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ savePreviewData()

assMatchingQuestion::savePreviewData ( ilAssQuestionPreviewSession  $previewSession)
protected

Definition at line 1160 of file class.assMatchingQuestion.php.

References checkSubmittedMatchings(), fetchSubmittedMatchingsFromPost(), and ilAssQuestionPreviewSession\setParticipantsSolution().

1160  : void
1161  {
1162  $submittedMatchings = $this->fetchSubmittedMatchingsFromPost();
1163 
1164  if ($this->checkSubmittedMatchings($submittedMatchings)) {
1165  $previewSession->setParticipantsSolution($submittedMatchings);
1166  }
1167  }
checkSubmittedMatchings($submittedMatchings)
+ Here is the call graph for this function:

◆ saveToDb()

assMatchingQuestion::saveToDb (   $original_id = "")

Saves a assMatchingQuestion object to a database.

Parameters
string$original_id

Definition at line 154 of file class.assMatchingQuestion.php.

References assQuestion\$original_id, saveAdditionalQuestionDataToDb(), saveAnswerSpecificDataToDb(), and assQuestion\saveQuestionDataToDb().

154  : void
155  {
156  if ($original_id == "") {
157  $this->saveQuestionDataToDb();
158  } else {
160  }
161 
164 
165  parent::saveToDb();
166  }
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
saveAnswerSpecificDataToDb()
Saves the answer specific records into a question types answer table.
saveQuestionDataToDb(int $original_id=-1)
+ Here is the call graph for this function:

◆ saveWorkingData()

assMatchingQuestion::saveWorkingData (   $active_id,
  $pass = null,
  $authorized = true 
)

Saves the learners input of the question to the database.

public

Parameters
integer$active_idActive id of the user
integer$passTest pass
Returns
boolean $status

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

References ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilObjTest\_getPass(), checkSubmittedMatchings(), fetchSubmittedMatchingsFromPost(), assQuestion\getId(), assQuestion\getProcessLocker(), ILIAS\Repository\lng(), assQuestion\logAction(), assQuestion\removeCurrentSolution(), and assQuestion\saveCurrentSolution().

1113  : bool
1114  {
1115  $submittedMatchings = $this->fetchSubmittedMatchingsFromPost();
1116  $submittedMatchingsValid = $this->checkSubmittedMatchings($submittedMatchings);
1117 
1118  $matchingsExist = false;
1119 
1120  if ($submittedMatchingsValid) {
1121  if (is_null($pass)) {
1122  $pass = ilObjTest::_getPass($active_id);
1123  }
1124 
1125  $this->getProcessLocker()->executeUserSolutionUpdateLockOperation(function () use (&$matchingsExist, $submittedMatchings, $active_id, $pass, $authorized) {
1126  $this->removeCurrentSolution($active_id, $pass, $authorized);
1127 
1128  foreach ($submittedMatchings as $definition => $terms) {
1129  foreach ($terms as $i => $term) {
1130  $this->saveCurrentSolution($active_id, $pass, $term, $definition, $authorized);
1131  $matchingsExist = true;
1132  }
1133  }
1134  });
1135 
1136  $saveWorkingDataResult = true;
1137  } else {
1138  $saveWorkingDataResult = false;
1139  }
1140 
1142  if ($matchingsExist) {
1143  assQuestion::logAction($this->lng->txtlng(
1144  "assessment",
1145  "log_user_entered_values",
1147  ), $active_id, $this->getId());
1148  } else {
1149  assQuestion::logAction($this->lng->txtlng(
1150  "assessment",
1151  "log_user_not_entered_values",
1153  ), $active_id, $this->getId());
1154  }
1155  }
1156 
1157  return $saveWorkingDataResult;
1158  }
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
saveCurrentSolution(int $active_id, int $pass, $value1, $value2, bool $authorized=true, $tstamp=0)
static logAction(string $logtext, int $active_id, int $question_id)
checkSubmittedMatchings($submittedMatchings)
removeCurrentSolution(int $active_id, int $pass, bool $authorized=true)
+ Here is the call graph for this function:

◆ setExportDetailsXLSX()

assMatchingQuestion::setExportDetailsXLSX ( ilAssExcelFormatHelper  $worksheet,
int  $startrow,
int  $col,
int  $active_id,
int  $pass 
)

{}

Definition at line 1231 of file class.assMatchingQuestion.php.

References assQuestion\getImagePath(), getMatchingPairs(), assQuestion\getSolutionValues(), ILIAS\Repository\lng(), and ilAssExcelFormatHelper\setCell().

1231  : int
1232  {
1233  parent::setExportDetailsXLSX($worksheet, $startrow, $col, $active_id, $pass);
1234 
1235  $solutions = $this->getSolutionValues($active_id, $pass);
1236 
1237  $imagepath = $this->getImagePath();
1238  $i = 1;
1239  foreach ($solutions as $solution) {
1240  $matches_written = false;
1241  foreach ($this->getMatchingPairs() as $idx => $pair) {
1242  if (!$matches_written) {
1243  $worksheet->setCell($startrow + $i, $col + 1, $this->lng->txt("matches"));
1244  }
1245  $matches_written = true;
1246  if ($pair->getDefinition()->getIdentifier() == $solution["value2"]) {
1247  if (strlen($pair->getDefinition()->getText())) {
1248  $worksheet->setCell($startrow + $i, $col, $pair->getDefinition()->getText());
1249  } else {
1250  $worksheet->setCell($startrow + $i, $col, $pair->getDefinition()->getPicture());
1251  }
1252  }
1253  if ($pair->getTerm()->getIdentifier() == $solution["value1"]) {
1254  if (strlen($pair->getTerm()->getText())) {
1255  $worksheet->setCell($startrow + $i, $col + 2, $pair->getTerm()->getText());
1256  } else {
1257  $worksheet->setCell($startrow + $i, $col + 2, $pair->getTerm()->getPicture());
1258  }
1259  }
1260  }
1261  $i++;
1262  }
1263 
1264  return $startrow + $i + 1;
1265  }
getSolutionValues($active_id, $pass=null, bool $authorized=true)
Loads solutions of a given user from the database an returns it.
setCell($a_row, $a_col, $a_value, $datatype=null)
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
& getMatchingPairs()
Returns the matchingpairs array.
+ Here is the call graph for this function:

◆ setImageFile()

assMatchingQuestion::setImageFile (   $image_tempfilename,
  $image_filename,
  $previous_filename = '' 
)

Sets the image file and uploads the image to the object's image directory.

Parameters
string$image_filenameName of the original image file
string$image_tempfilenameName of the temporary uploaded image file
Returns
integer An errorcode if the image upload fails, 0 otherwise public

Definition at line 1029 of file class.assMatchingQuestion.php.

References ilShellUtil\convertImage(), deleteImagefile(), assQuestion\getImagePath(), getThumbGeometry(), getThumbPrefix(), ilFileUtils\makeDirParents(), and ilFileUtils\moveUploadedFile().

1030  {
1031  $result = true;
1032  if (strlen($image_tempfilename)) {
1033  $image_filename = str_replace(" ", "_", $image_filename);
1034  $imagepath = $this->getImagePath();
1035  if (!file_exists($imagepath)) {
1036  ilFileUtils::makeDirParents($imagepath);
1037  }
1038  $savename = $image_filename;
1039  if (!ilFileUtils::moveUploadedFile($image_tempfilename, $savename, $imagepath . $savename)) {
1040  $result = false;
1041  } else {
1042  // create thumbnail file
1043  $thumbpath = $imagepath . $this->getThumbPrefix() . $savename;
1044  ilShellUtil::convertImage($imagepath . $savename, $thumbpath, "JPEG", (string) $this->getThumbGeometry());
1045  }
1046  if ($result && (strcmp($image_filename, $previous_filename) != 0) && (strlen($previous_filename))) {
1047  $this->deleteImagefile($previous_filename);
1048  }
1049  }
1050  return $result;
1051  }
getThumbGeometry()
Get the thumbnail geometry.
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
deleteImagefile(string $filename)
Deletes an imagefile from the system if the file is deleted manually.
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
static convertImage(string $a_from, string $a_to, string $a_target_format="", string $a_geometry="", string $a_background_color="")
+ Here is the call graph for this function:

◆ setMatchingMode()

assMatchingQuestion::setMatchingMode (   $matchingMode)

Definition at line 1441 of file class.assMatchingQuestion.php.

References $matchingMode.

Referenced by loadFromDb().

1441  : void
1442  {
1443  $this->matchingMode = $matchingMode;
1444  }
+ Here is the caller graph for this function:

◆ setShuffle()

assMatchingQuestion::setShuffle (   $shuffle = true)

Definition at line 1186 of file class.assMatchingQuestion.php.

References assQuestion\$shuffle.

Referenced by loadFromDb().

1186  : void
1187  {
1188  $this->shuffle = (bool) $shuffle;
1189  }
bool $shuffle
Indicates whether the answers will be shuffled or not.
+ Here is the caller graph for this function:

◆ setShuffleMode()

assMatchingQuestion::setShuffleMode ( int  $shuffle)

Definition at line 125 of file class.assMatchingQuestion.php.

References assQuestion\$shuffle.

Referenced by loadFromDb().

126  {
127  $this->shufflemode = $shuffle;
128  }
bool $shuffle
Indicates whether the answers will be shuffled or not.
+ Here is the caller graph for this function:

◆ setTerm()

assMatchingQuestion::setTerm (   $term,
  $index 
)

Sets a specific term.

Parameters
string$termThe text of the term
string$indexThe index of the term
See also
$terms

Definition at line 846 of file class.assMatchingQuestion.php.

846  : void
847  {
848  $this->terms[$index] = $term;
849  }

◆ setThumbGeometry()

assMatchingQuestion::setThumbGeometry ( int  $a_geometry)

Set the thumbnail geometry.

Parameters
integer$a_geometryGeometry

Definition at line 1292 of file class.assMatchingQuestion.php.

Referenced by loadFromDb().

1292  : void
1293  {
1294  $this->thumb_geometry = ($a_geometry < 1) ? 100 : $a_geometry;
1295  }
+ Here is the caller graph for this function:

◆ toJSON()

assMatchingQuestion::toJSON ( )

Returns a JSON representation of the question.

Implements ilAssQuestionLMExportable.

Definition at line 1369 of file class.assMatchingQuestion.php.

References $definitions, $terms, ilObjMediaObject\_getMobsOfObject(), assQuestion\formatSAQuestion(), getDefinitions(), assQuestion\getId(), getMatchingMode(), getMatchingPairs(), assQuestion\getNrOfTries(), assQuestion\getQuestion(), getQuestionType(), assQuestion\getShuffler(), getTerms(), assQuestion\getTitleForHTMLOutput(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and assQuestion\setShuffler().

1369  : string
1370  {
1371  $result = [];
1372 
1373  $result['id'] = $this->getId();
1374  $result['type'] = (string) $this->getQuestionType();
1375  $result['title'] = $this->getTitleForHTMLOutput();
1376  $result['question'] = $this->formatSAQuestion($this->getQuestion());
1377  $result['nr_of_tries'] = $this->getNrOfTries();
1378  $result['matching_mode'] = $this->getMatchingMode();
1379  $result['shuffle'] = true;
1380  $result['feedback'] = [
1381  'onenotcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), false)),
1382  'allcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), true))
1383  ];
1384 
1385  $this->setShuffler($this->randomGroup->shuffleArray(new RandomSeed()));
1386 
1387  $terms = [];
1388  foreach ($this->getShuffler()->transform($this->getTerms()) as $term) {
1389  $terms[] = [
1390  "text" => $this->formatSAQuestion($term->getText()),
1391  "id" => $this->getId() . $term->getIdentifier()
1392  ];
1393  }
1394  $result['terms'] = $terms;
1395 
1396  $this->setShuffler($this->randomGroup->shuffleArray(new RandomSeed()));
1397 
1398  $definitions = [];
1399  foreach ($this->getShuffler()->transform($this->getDefinitions()) as $def) {
1400  $definitions[] = [
1401  "text" => $this->formatSAQuestion((string) $def->getText()),
1402  "id" => $this->getId() . $def->getIdentifier()
1403  ];
1404  }
1405  $result['definitions'] = $definitions;
1406 
1407  // #10353
1408  $matchings = [];
1409  foreach ($this->getMatchingPairs() as $pair) {
1410  // fau: fixLmMatchingPoints - ignore matching pairs with 0 or negative points
1411  if ($pair->getPoints() <= 0) {
1412  continue;
1413  }
1414  // fau.
1415 
1416  $pid = $pair->getDefinition()->getIdentifier();
1417  if ($this->getMatchingMode() == self::MATCHING_MODE_N_ON_N) {
1418  $pid .= '::' . $pair->getTerm()->getIdentifier();
1419  }
1420 
1421  if (!isset($matchings[$pid]) || $matchings[$pid]["points"] < $pair->getPoints()) {
1422  $matchings[$pid] = [
1423  "term_id" => $this->getId() . $pair->getTerm()->getIdentifier(),
1424  "def_id" => $this->getId() . $pair->getDefinition()->getIdentifier(),
1425  "points" => (int) $pair->getPoints()
1426  ];
1427  }
1428  }
1429 
1430  $result['matchingPairs'] = array_values($matchings);
1431 
1432  $mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $this->getId());
1433  $result['mobs'] = $mobs;
1434 
1435  $this->lng->loadLanguageModule('assessment');
1436  $result['reset_button_label'] = $this->lng->txt("reset_terms");
1437 
1438  return json_encode($result);
1439  }
getQuestionType()
Returns the question type of the question.
getDefinitions()
Returns the definitions of the matching question.
static _getMobsOfObject(string $a_type, int $a_id, int $a_usage_hist_nr=0, string $a_lang="-")
getTerms()
Returns the terms of the matching question.
setShuffler(Transformation $shuffler)
& getMatchingPairs()
Returns the matchingpairs array.
+ Here is the call graph for this function:

◆ withMatchingPairs()

assMatchingQuestion::withMatchingPairs ( array  $pairs)
Parameters
assAnswerMatchingPair[]

Definition at line 678 of file class.assMatchingQuestion.php.

678  : self
679  {
680  $clone = clone $this;
681  $clone->matchingpairs = $pairs;
682  return $clone;
683  }

Field Documentation

◆ $definitions

assMatchingQuestion::$definitions
protected

Definition at line 68 of file class.assMatchingQuestion.php.

Referenced by getDefinitions(), getUserQuestionResult(), and toJSON().

◆ $element_height

assMatchingQuestion::$element_height

Definition at line 81 of file class.assMatchingQuestion.php.

◆ $matching_type

assMatchingQuestion::$matching_type

Definition at line 59 of file class.assMatchingQuestion.php.

Referenced by __construct().

◆ $matchingMode

assMatchingQuestion::$matchingMode = self::MATCHING_MODE_1_ON_1
protected

Definition at line 86 of file class.assMatchingQuestion.php.

Referenced by getMatchingMode(), and setMatchingMode().

◆ $matchingpairs

assMatchingQuestion::$matchingpairs

Definition at line 50 of file class.assMatchingQuestion.php.

Referenced by getMatchingPairs(), and saveAnswerSpecificDataToDb().

◆ $randomGroup

RandomGroup assMatchingQuestion::$randomGroup
private

Definition at line 88 of file class.assMatchingQuestion.php.

◆ $shufflemode

int assMatchingQuestion::$shufflemode = 0
private

Definition at line 41 of file class.assMatchingQuestion.php.

Referenced by getShuffleMode().

◆ $terms

array assMatchingQuestion::$terms = []
protected

Definition at line 66 of file class.assMatchingQuestion.php.

Referenced by getTerms(), and toJSON().

◆ $thumb_geometry

assMatchingQuestion::$thumb_geometry = 100

Definition at line 74 of file class.assMatchingQuestion.php.

Referenced by getThumbGeometry().

◆ MATCHING_MODE_1_ON_1

const assMatchingQuestion::MATCHING_MODE_1_ON_1 = '1:1'

◆ MATCHING_MODE_N_ON_N

const assMatchingQuestion::MATCHING_MODE_N_ON_N = 'n:n'

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