ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
assKprimChoice Class Reference
+ Inheritance diagram for assKprimChoice:
+ Collaboration diagram for assKprimChoice:

Public Member Functions

 __construct ($title='', $comment='', $author='', $owner=-1, $question='')
 
 getQuestionType ()
 
 getAdditionalTableName ()
 
 getAnswerTableName ()
 
 setShuffleAnswersEnabled (bool $shuffle_answers_enabled)
 
 isShuffleAnswersEnabled ()
 
 setAnswerType ($answerType)
 
 getAnswerType ()
 
 setThumbSize (int $thumbSize)
 
 getThumbSize ()
 
 setScorePartialSolutionEnabled ($scorePartialSolutionEnabled)
 
 isScorePartialSolutionEnabled ()
 
 setOptionLabel (string $option_label)
 
 getOptionLabel ()
 
 setCustomTrueOptionLabel ($customTrueOptionLabel)
 
 getCustomTrueOptionLabel ()
 
 setCustomFalseOptionLabel ($customFalseOptionLabel)
 
 getCustomFalseOptionLabel ()
 
 setSpecificFeedbackSetting (int $specific_feedback_setting)
 
 getSpecificFeedbackSetting ()
 
 setAnswers ($answers)
 
 getAnswers ()
 
 getAnswer ($position)
 
 addAnswer (ilAssKprimChoiceAnswer $answer)
 
 loadFromDb ($questionId)
 
 saveToDb (?int $original_id=null)
 
 saveAdditionalQuestionDataToDb ()
 Saves a record to the question types additional data table. More...
 
 saveAnswerSpecificDataToDb ()
 Saves the answer specific records into a question types answer table. More...
 
 isComplete ()
 
 saveWorkingData (int $active_id, ?int $pass=null, bool $authorized=true)
 
 calculateReachedPoints (int $active_id, ?int $pass=null, bool $authorized_solution=true)
 
 getValidAnswerTypes ()
 
 isValidAnswerType ($answerType)
 
 isSingleLineAnswerType ($answerType)
 
 getAnswerTypeSelectOptions (ilLanguage $lng)
 
 getValidOptionLabels ()
 
 getValidOptionLabelsTranslated (ilLanguage $lng)
 
 getLangVarForOptionLabel (string $option_label)
 
 isValidOptionLabel (?string $option_label)
 
 getTrueOptionLabelTranslation (ilLanguage $lng, string $option_label)
 
 getTrueOptionLabel (string $option_label)
 
 getFalseOptionLabelTranslation (ilLanguage $lng, string $option_label)
 
 getInstructionTextTranslation (ilLanguage $lng, $option_label)
 
 isCustomOptionLabel ($labelValue)
 
 handleFileUploads ($answers, $files)
 
 removeAnswerImage ($position)
 
 toJSON ()
 Returns a JSON representation of the question. More...
 
 getSpecificFeedbackAllCorrectOptionLabel ()
 
 moveAnswerDown ($position)
 
 moveAnswerUp ($position)
 
 toLog (AdditionalInformationGenerator $additional_info)
 MUST return an array of the question settings that can be stored in the log. More...
 
 solutionValuesToText (array $solution_values)
 MUST convert the given solution values into text. More...
 
 getCorrectSolutionForTextOutput (int $active_id, int $pass)
 
 toNormalized (Transformations $transformations, array $context=[])
 
 fromNormalized (array $normalized, Transformations $transformations)
 
- Public Member Functions inherited from assQuestion
 getQuestionType ()
 
 isComplete ()
 
 saveWorkingData (int $active_id, ?int $pass=null, bool $authorized=true)
 
 calculateReachedPoints (int $active_id, ?int $pass=null, bool $authorized_solution=true)
 
 getAdditionalTableName ()
 
 getAnswerTableName ()
 
 toLog (AdditionalInformationGenerator $additional_info)
 MUST return an array of the question settings that can be stored in the log. More...
 
 getCurrentUser ()
 
 getShuffler ()
 
 setShuffler (Transformation $shuffler)
 
 setProcessLocker (ilAssQuestionProcessLocker $processLocker)
 
 getProcessLocker ()
 
 fromXML (string $importdirectory, int $user_id, ilQTIItem $item, int $questionpool_id, ?int $tst_id, ?ilObject &$tst_object, int &$question_counter, array $import_mapping)
 
 toXML (bool $a_include_header=true, bool $a_include_binary=true, bool $a_shuffle=false, bool $test_output=false, bool $force_image_references=false)
 
 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 $authorized_solution=true)
 
 calculateResultsFromSolution (int $active_id, int $pass)
 Calculates the question results from a previously saved question solution. More...
 
 persistWorkingState (int $active_id, $pass, bool $authorized=true)
 persists the working state for current testactive and testpass More...
 
 persistPreviewState (ilAssQuestionPreviewSession $preview_session)
 persists the preview state for current user and question More...
 
 validateSolutionSubmit ()
 
 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, ?int $pass=null)
 
 getSolutionValues (int $active_id, ?int $pass=null, bool $authorized=true)
 Loads solutions of a given user from the database an returns it. More...
 
 deleteAnswers (int $question_id)
 
 deleteAdditionalTableData (int $question_id)
 
 delete (int $question_id)
 
 getTotalAnswers ()
 
 cloneXHTMLMediaObjectsOfQuestion (int $source_question_id)
 
 createPageObject ()
 
 clonePageOfQuestion (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=null)
 
 updateOriginalId (?int $original_id=null)
 
 duplicate (bool $set_original_id=true, string $title='', string $author='', int $owner=-1, $test_obj_id=null)
 
 copyObject (int $target_parent_id, string $title='')
 
 createNewOriginalFromThisDuplicate (int $target_parent_id, string $target_question_title='')
 
 saveToDb (?int $original_id=null)
 
 deleteSuggestedSolutions ()
 
 getSuggestedSolution (int $subquestion_index=0)
 
 resolveInternalLink (string $internal_link)
 
 resolveSuggestedSolutionLinks ()
 
 getInternalLinkHref (string $target)
 
 syncWithOriginal ()
 
 getPoints ()
 
 setPoints (float $points)
 
 getSolutionMaxPass (int $active_id)
 
 isWriteable ()
 
 calculateReachedPointsFromPreviewSession (ilAssQuestionPreviewSession $preview_session)
 
 isPreviewSolutionCorrect (ilAssQuestionPreviewSession $preview_session)
 
 adjustReachedPointsByScoringOptions (float $points, int $active_id)
 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="")
 
 getQuestionTypeID ()
 
 cleanupMediaObjectUsage ()
 
 getInstances ()
 
 getActiveUserData (int $active_id)
 Returns the user id and the test id for a given active id. More...
 
 hasSpecificFeedback ()
 
 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)
 
 isAnswered (int $active_id, int $pass)
 
 getAdditionalContentEditingMode ()
 
 setAdditionalContentEditingMode (?string $additionalContentEditingMode)
 
 isAdditionalContentEditingModePageObject ()
 
 isValidAdditionalContentEditingMode (string $additionalContentEditingMode)
 
 getValidAdditionalContentEditingModes ()
 
 getHtmlUserSolutionPurifier ()
 
 getHtmlQuestionContentPurifier ()
 
 setLastChange (int $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 ()
 
 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 $value_pairs)
 
 updateTimestamp ()
 
 getTestPresentationConfig ()
 
 hasWritableOriginalInQuestionPool ()
 
 answerToParticipantInteraction (AdditionalInformationGenerator $additional_info, int $test_ref_id, int $active_id, int $pass, string $source_ip, TestParticipantInteractionTypes $interaction_type)
 
 toQuestionAdministrationInteraction (AdditionalInformationGenerator $additional_info, int $test_ref_id, TestQuestionAdministrationInteractionTypes $interaction_type)
 
 getSolutionForTextOutput (int $active_id, int $pass)
 
 getCorrectSolutionForTextOutput (int $active_id, int $pass)
 
 getVariablesAsTextArray (int $active_id, int $pass)
 
 toNormalized (Transformations $transformations, array $context=[])
 
 fromNormalized (array $normalized, Transformations $transformations)
 
 validateSolutionSubmit ()
 
 toLog (AdditionalInformationGenerator $additional_info)
 
 answerToParticipantInteraction (AdditionalInformationGenerator $additional_info, int $test_id, int $active_id, int $pass, string $source_ip, TestParticipantInteractionTypes $interaction_type)
 
 toQuestionAdministrationInteraction (AdditionalInformationGenerator $additional_info, int $test_id, TestQuestionAdministrationInteractionTypes $interaction_type)
 
 saveAdditionalQuestionDataToDb ()
 Saves a record to the question types additional data table. More...
 
 saveAnswerSpecificDataToDb ()
 Saves the answer specific records into a question types answer table. More...
 
 getSpecificFeedbackAllCorrectOptionLabel ()
 
 toJSON ()
 
 toNormalized (Transformations $transformations, array $context=[])
 Convert the internal state of the implementing object into a language-neutral array structure. More...
 
 fromNormalized (array $normalized, Transformations $transformations)
 Restore the object from its normalized representation. More...
 

Data Fields

const NUM_REQUIRED_ANSWERS = 4
 
const PARTIAL_SCORING_NUM_CORRECT_ANSWERS = 3
 
const ANSWER_TYPE_SINGLE_LINE = 'singleLine'
 
const ANSWER_TYPE_MULTI_LINE = 'multiLine'
 
const OPTION_LABEL_RIGHT_WRONG = 'right_wrong'
 
const OPTION_LABEL_PLUS_MINUS = 'plus_minus'
 
const OPTION_LABEL_APPLICABLE_OR_NOT = 'applicable_or_not'
 
const OPTION_LABEL_ADEQUATE_OR_NOT = 'adequate_or_not'
 
const OPTION_LABEL_CUSTOM = 'customlabel'
 
const DEFAULT_THUMB_SIZE = 150
 
const THUMB_PREFIX = 'thumb.'
 
- Data Fields inherited from assQuestion
const ADDITIONAL_CONTENT_EDITING_MODE_RTE = 'default'
 
const ADDITIONAL_CONTENT_EDITING_MODE_IPE = 'pageobject'
 
const TRIM_PATTERN = '/^[\p{C}\p{Z}]+|[\p{C}\p{Z}]+$/u'
 
ilAssQuestionFeedback $feedbackOBJ
 
bool $prevent_rte_usage = false
 
bool $selfassessmenteditingmode = false
 
int $defaultnroftries = 0
 
string $questionActionCmd = 'handleQuestionAction'
 
const KEY_VALUES_IMPLOSION_SEPARATOR = ':'
 

Protected Member Functions

 getSolutionSubmit ()
 
 calculateReachedPointsForSolution (?array $found_values, int $active_id=0)
 
 cloneQuestionTypeSpecificProperties (\assQuestion $target)
 
 getRTETextWithMediaObjects ()
 
 lmMigrateQuestionTypeSpecificContent (ilAssSelfAssessmentMigrator $migrator)
 
 solutionValuesToLog (AdditionalInformationGenerator $additional_info, array $solution_values)
 MUST convert the given solution values into an array or a string that can be stored in the log. More...
 
- Protected Member Functions inherited from assQuestion
 solutionValuesToLog (AdditionalInformationGenerator $additional_info, array $solution_values)
 MUST convert the given solution values into an array or a string that can be stored in the log. More...
 
 solutionValuesToText (array $solution_values)
 MUST convert the given solution values into text. More...
 
 getQuestionAction ()
 
 isNonEmptyItemListPostSubmission (string $post_submission_field_name)
 
 savePreviewData (ilAssQuestionPreviewSession $preview_session)
 
 deletePageOfQuestion (int $question_id)
 
 cloneQuestionTypeSpecificProperties (self $target)
 
 removeAllImageFiles (string $image_target_path)
 
 onDuplicate (int $original_parent_id, int $original_question_id, int $duplicate_parent_id, int $duplicate_question_id)
 
 afterSyncWithOriginal (int $original_question_id, int $clone_question_id, int $original_parent_id, int $clone_parent_id)
 
 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 ()
 
 cloneSuggestedSolutions (int $source_question_id, int $target_question_id)
 
 duplicateSuggestedSolutionFiles (int $parent_id, int $question_id)
 Duplicates the files of a suggested solution if the question is duplicated. More...
 
 cloneSuggestedSolutionFiles (int $source_question_id, int $target_question_id)
 
 copySuggestedSolutions (int $target_question_id)
 
 ensureNonNegativePoints (float $points)
 
 purifyAndPrepareTextAreaOutput (string $content)
 
 getRTETextWithMediaObjects ()
 
 getSelfAssessmentFormatter ()
 
 lmMigrateQuestionTypeGenericContent (ilAssSelfAssessmentMigrator $migrator)
 
 lmMigrateQuestionTypeSpecificContent (ilAssSelfAssessmentMigrator $migrator)
 
 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 ()
 
 getSuggestedSolutionsRepo ()
 
 loadSuggestedSolutions ()
 
 answerToLog (AdditionalInformationGenerator $additional_info, int $active_id, int $pass)
 

Private Member Functions

 loadAnswerData (int $question_id)
 
 getFalseOptionLabel (string $option_label)
 
 handleFileUpload (ilAssKprimChoiceAnswer $answer, $fileData)
 
 getNumAllowedFailures ()
 

Private Attributes

bool $shuffle_answers_enabled = true
 
string $answerType = self::ANSWER_TYPE_SINGLE_LINE
 
int $thumbSize = self::DEFAULT_THUMB_SIZE
 
bool $scorePartialSolutionEnabled = true
 
string $option_label = self::OPTION_LABEL_RIGHT_WRONG
 
string $customTrueOptionLabel = ''
 
string $customFalseOptionLabel = ''
 
int $specific_feedback_setting = ilAssConfigurableMultiOptionQuestionFeedback::FEEDBACK_SETTING_ALL
 
 $answers = []
 

Additional Inherited Members

- Static Public Member Functions inherited from assQuestion
static setForcePassResultUpdateEnabled (bool $force_pass_results_update_enabled)
 
static isForcePassResultUpdateEnabled ()
 
static _getSuggestedSolutionOutput (int $question_id)
 
static _getReachedPoints (int $active_id, int $question_id, int $pass)
 
static isFileAvailable (string $file)
 
static saveOriginalId (int $questionId, int $originalId)
 
static resetOriginalId (int $questionId)
 
static instantiateQuestion (int $question_id)
 
static _getSolutionMaxPass (int $question_id, int $active_id)
 Returns the maximum pass a users question solution. More...
 
static getFeedbackClassNameByQuestionType (string $questionType)
 
static _questionExistsInTest (int $question_id, int $test_id)
 
static lookupParentObjId (int $question_id)
 
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)
 
- Protected Attributes inherited from assQuestion
const HAS_SPECIFIC_FEEDBACK = true
 
GeneralQuestionPropertiesRepository $questionrepository
 
RequestDataCollector $questionpool_request
 
QuestionFiles $question_files
 
ilAssQuestionProcessLocker $processLocker
 
ilTestQuestionConfig $testQuestionConfig
 
SuggestedSolutionsDatabaseRepository $suggestedsolution_repo
 
ILIAS $ilias
 
ilGlobalPageTemplate $tpl
 
ilLanguage $lng
 
ilDBInterface $db
 
ilObjUser $current_user
 
SkillUsageService $skillUsageService
 
HTTPServices $http
 
Refinery $refinery
 
Transformation $shuffler
 
LoggingServices $log
 
Container $dic
 
ilAssQuestionLifecycle $lifecycle
 
ilAssQuestionPage $page
 
TestResultRepository $test_result_repository
 
int $id
 
string $title
 
string $comment
 
int $owner
 
string $author
 
int $thumb_size
 
string $question
 
float $points = 0.0
 
bool $shuffle = true
 
int $test_id
 
int $obj_id = 0
 
int $original_id = null
 
int $lastChange = null
 
string $external_id = null
 
int $step = null
 
array $suggested_solutions
 
- Static Protected Attributes inherited from assQuestion
static $force_pass_results_update_enabled = false
 
static $imageSourceFixReplaceMap
 

Detailed Description

Definition at line 35 of file class.assKprimChoice.php.

Constructor & Destructor Documentation

◆ __construct()

assKprimChoice::__construct (   $title = '',
  $comment = '',
  $author = '',
  $owner = -1,
  $question = '' 
)

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

67 {
69
70 for ($i = count($this->answers); $i < self::NUM_REQUIRED_ANSWERS; $i++) {
71 $answer = new ilAssKprimChoiceAnswer();
72 $answer->setPosition($i);
73 $this->answers[$answer->getPosition()] = $answer;
74 }
75 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References assQuestion\$author, assQuestion\$comment, assQuestion\$owner, assQuestion\$question, assQuestion\$title, ILIAS\GlobalScreen\Provider\__construct(), and NUM_REQUIRED_ANSWERS.

+ Here is the call graph for this function:

Member Function Documentation

◆ addAnswer()

assKprimChoice::addAnswer ( ilAssKprimChoiceAnswer  $answer)

Definition at line 205 of file class.assKprimChoice.php.

205 : void
206 {
207 $answer->setAnswertext(
208 $this->getHtmlQuestionContentPurifier()->purify($answer->getAnswertext())
209 );
210 $this->answers[] = $answer;
211 }

References ilAssKprimChoiceAnswer\getAnswertext(), assQuestion\getHtmlQuestionContentPurifier(), and ilAssKprimChoiceAnswer\setAnswertext().

+ Here is the call graph for this function:

◆ calculateReachedPoints()

assKprimChoice::calculateReachedPoints ( int  $active_id,
?int  $pass = null,
bool  $authorized_solution = true 
)

Reimplemented from assQuestion.

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

411 : float {
412 $found_values = [];
413 if (is_null($pass)) {
414 $pass = $this->getSolutionMaxPass($active_id);
415 }
416
417 $result = $this->getCurrentSolutionResultSet($active_id, $pass, $authorized_solution);
418
419 while ($data = $this->db->fetchAssoc($result)) {
420 $found_values[(int) $data['value1']] = (int) $data['value2'];
421 }
422
423 $points = $this->calculateReachedPointsForSolution($found_values, $active_id);
424
425 return $points;
426 }
calculateReachedPointsForSolution(?array $found_values, int $active_id=0)
getCurrentSolutionResultSet(int $active_id, int $pass, bool $authorized=true)
getSolutionMaxPass(int $active_id)
$data
Definition: storeScorm.php:45

◆ calculateReachedPointsForSolution()

assKprimChoice::calculateReachedPointsForSolution ( ?array  $found_values,
int  $active_id = 0 
)
protected

Definition at line 643 of file class.assKprimChoice.php.

643 : float
644 {
645 $numCorrect = 0;
646 if ($found_values === null) {
647 $found_values = [];
648 }
649 foreach ($this->getAnswers() as $answer) {
650 if (!isset($found_values[$answer->getPosition()])) {
651 continue;
652 }
653
654 if ($found_values[$answer->getPosition()] == $answer->getCorrectness()) {
655 $numCorrect++;
656 }
657 }
658
659 if ($numCorrect >= self::NUM_REQUIRED_ANSWERS) {
660 $points = $this->getPoints();
661 } elseif ($this->isScorePartialSolutionEnabled() && $numCorrect >= self::PARTIAL_SCORING_NUM_CORRECT_ANSWERS) {
662 $points = $this->getPoints() / 2;
663 } else {
664 $points = 0;
665 }
666
667 if ($active_id) {
668 if (count($found_values) == 0) {
669 $points = 0;
670 }
671 }
672 return (float) $points;
673 }

◆ cloneQuestionTypeSpecificProperties()

assKprimChoice::cloneQuestionTypeSpecificProperties ( \assQuestion  $target)
protected

Definition at line 675 of file class.assKprimChoice.php.

677 : \assQuestion {
678 $this->cloneImages(
679 $this->getId(),
680 $this->getObjId(),
681 $target->getId(),
682 $target->getObjId(),
683 $this->getAnswers()
684 );
685 return $target;
686 }

◆ fromNormalized()

assKprimChoice::fromNormalized ( array  $normalized,
Transformations  $transformations 
)
Parameters
array<array-key,mixed>$normalized

Reimplemented from assQuestion.

Definition at line 948 of file class.assKprimChoice.php.

951 : static
952 {
953 $clone = parent::fromNormalized($normalized, $transformations);
954 $clone->shuffle_answers_enabled = $transformations->bool($normalized['shuffle_answers']);
955 $clone->answerType = $transformations->string($normalized['answer_type']);
956 $clone->option_label = $transformations->string($normalized['option_label']);
957 $clone->customTrueOptionLabel = $transformations->string($normalized['custom_true_option_label']);
958 $clone->customFalseOptionLabel = $transformations->string($normalized['custom_false_option_label']);
959 $clone->scorePartialSolutionEnabled = $transformations->bool($normalized['score_partial_solution']);
960 $clone->specific_feedback_setting = $transformations->int($normalized['specific_feedback_setting']);
961 $clone->answers = array_map(
962 static fn(array $answer): ilAssKprimChoiceAnswer => $transformations->denormalize($answer, new ilAssKprimChoiceAnswer()),
963 $normalized['answers']
964 );
965
966 return $clone;
967 }
denormalize(array|float|bool|int|string|null $normalized, string|object $expected)

References ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Transformations\bool(), ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Transformations\denormalize(), ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Transformations\int(), and ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Transformations\string().

+ Here is the call graph for this function:

◆ getAdditionalTableName()

assKprimChoice::getAdditionalTableName ( )

Reimplemented from assQuestion.

Definition at line 82 of file class.assKprimChoice.php.

82 : string
83 {
84 return "qpl_qst_kprim";
85 }

Referenced by saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ getAnswer()

assKprimChoice::getAnswer (   $position)

Definition at line 194 of file class.assKprimChoice.php.

195 {
196 foreach ($this->getAnswers() as $answer) {
197 if ($answer->getPosition() == $position) {
198 return $answer;
199 }
200 }
201
202 return null;
203 }

References getAnswers().

+ Here is the call graph for this function:

◆ getAnswers()

assKprimChoice::getAnswers ( )
Returns
array<ilAssKprimChoiceAnswer>

Definition at line 189 of file class.assKprimChoice.php.

189 : array
190 {
191 return $this->answers;
192 }

References $answers.

Referenced by getAnswer(), isComplete(), and saveAnswerSpecificDataToDb().

+ Here is the caller graph for this function:

◆ getAnswerTableName()

assKprimChoice::getAnswerTableName ( )

Reimplemented from assQuestion.

Definition at line 87 of file class.assKprimChoice.php.

87 : string
88 {
89 return "qpl_a_kprim";
90 }

Referenced by saveAnswerSpecificDataToDb().

+ Here is the caller graph for this function:

◆ getAnswerType()

assKprimChoice::getAnswerType ( )

Definition at line 107 of file class.assKprimChoice.php.

107 : string
108 {
109 return $this->answerType;
110 }

References $answerType.

Referenced by saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ getAnswerTypeSelectOptions()

assKprimChoice::getAnswerTypeSelectOptions ( ilLanguage  $lng)
Parameters
ilLanguage$lng
Returns
array

Definition at line 448 of file class.assKprimChoice.php.

448 : array
449 {
450 return [
451 self::ANSWER_TYPE_SINGLE_LINE => $lng->txt('answers_singleline'),
452 self::ANSWER_TYPE_MULTI_LINE => $lng->txt('answers_multiline')
453 ];
454 }
ilLanguage $lng
txt(string|LanguageIdentifier $a_topic, ?int $n=null)
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...

References $lng.

◆ getCorrectSolutionForTextOutput()

assKprimChoice::getCorrectSolutionForTextOutput ( int  $active_id,
int  $pass 
)

Reimplemented from assQuestion.

Definition at line 917 of file class.assKprimChoice.php.

917 : array
918 {
919 $true_option_label = $this->getTrueOptionLabelTranslation($this->lng, $this->getOptionLabel());
920 $false_option_label = $this->getFalseOptionLabelTranslation($this->lng, $this->getOptionLabel());
921 return array_map(
922 fn(ilAssKprimChoiceAnswer $v): string => $v->getAnswertext()
923 . ' (' . $v->getCorrectness() ? $true_option_label : $false_option_label . ')',
924 $this->getAnswers()
925 );
926 }
getFalseOptionLabelTranslation(ilLanguage $lng, string $option_label)
getTrueOptionLabelTranslation(ilLanguage $lng, string $option_label)

References ilAssKprimChoiceAnswer\getAnswertext(), ilAssKprimChoiceAnswer\getCorrectness(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getCustomFalseOptionLabel()

assKprimChoice::getCustomFalseOptionLabel ( )

Definition at line 157 of file class.assKprimChoice.php.

158 {
160 }

References $customFalseOptionLabel.

Referenced by saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ getCustomTrueOptionLabel()

assKprimChoice::getCustomTrueOptionLabel ( )

Definition at line 147 of file class.assKprimChoice.php.

148 {
150 }

References $customTrueOptionLabel.

Referenced by saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ getFalseOptionLabel()

assKprimChoice::getFalseOptionLabel ( string  $option_label)
private

Definition at line 538 of file class.assKprimChoice.php.

538 : string
539 {
540 switch ($option_label) {
542 return 'option_label_wrong';
543
545 return 'option_label_minus';
546
548 return 'option_label_not_applicable';
549
551 return 'option_label_not_adequate';
552
553 default:
554 throw new \ErrorException('Invalide Option Label');
555 }
556 }
const OPTION_LABEL_APPLICABLE_OR_NOT

◆ getFalseOptionLabelTranslation()

assKprimChoice::getFalseOptionLabelTranslation ( ilLanguage  $lng,
string  $option_label 
)

Definition at line 527 of file class.assKprimChoice.php.

527 : string
528 {
529 if ($option_label === self::OPTION_LABEL_CUSTOM) {
530 return $this->getCustomFalseOptionLabel();
531 }
532
533 return $lng->txt(
535 );
536 }
getFalseOptionLabel(string $option_label)

References $lng.

◆ getInstructionTextTranslation()

assKprimChoice::getInstructionTextTranslation ( ilLanguage  $lng,
  $option_label 
)

Definition at line 558 of file class.assKprimChoice.php.

558 : string
559 {
560 return sprintf(
561 $lng->txt('kprim_instruction_text'),
562 $this->getTrueOptionLabelTranslation($lng, $option_label),
563 $this->getFalseOptionLabelTranslation($lng, $option_label)
564 );
565 }

References $lng.

◆ getLangVarForOptionLabel()

assKprimChoice::getLangVarForOptionLabel ( string  $option_label)

Definition at line 479 of file class.assKprimChoice.php.

479 : string
480 {
481 return match ($option_label) {
482 self::OPTION_LABEL_RIGHT_WRONG => 'option_label_right_wrong',
483 self::OPTION_LABEL_PLUS_MINUS => 'option_label_plus_minus',
484 self::OPTION_LABEL_APPLICABLE_OR_NOT => 'option_label_applicable_or_not',
485 self::OPTION_LABEL_ADEQUATE_OR_NOT => 'option_label_adequate_or_not',
486 self::OPTION_LABEL_CUSTOM => 'option_label_custom'
487 };
488 }

◆ getNumAllowedFailures()

assKprimChoice::getNumAllowedFailures ( )
private

Definition at line 771 of file class.assKprimChoice.php.

771 : int
772 {
773 if ($this->isScorePartialSolutionEnabled()) {
774 return self::NUM_REQUIRED_ANSWERS - self::PARTIAL_SCORING_NUM_CORRECT_ANSWERS;
775 }
776
777 return 0;
778 }
const PARTIAL_SCORING_NUM_CORRECT_ANSWERS

◆ getOptionLabel()

assKprimChoice::getOptionLabel ( )

Definition at line 137 of file class.assKprimChoice.php.

137 : string
138 {
139 return $this->option_label;
140 }

References $option_label.

Referenced by saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ getQuestionType()

assKprimChoice::getQuestionType ( )

Reimplemented from assQuestion.

Definition at line 77 of file class.assKprimChoice.php.

77 : string
78 {
79 return 'assKprimChoice';
80 }

◆ getRTETextWithMediaObjects()

assKprimChoice::getRTETextWithMediaObjects ( )
protected

Reimplemented from assQuestion.

Definition at line 688 of file class.assKprimChoice.php.

688 : string
689 {
690 $combinedText = parent::getRTETextWithMediaObjects();
691
692 foreach ($this->getAnswers() as $answer) {
693 $combinedText .= $answer->getAnswertext();
694 }
695
696 return $combinedText;
697 }

◆ getSolutionSubmit()

assKprimChoice::getSolutionSubmit ( )
protected

Definition at line 622 of file class.assKprimChoice.php.

622 : array
623 {
624 $solutionSubmit = [];
625 $post = $this->dic->http()->wrapper()->post();
626
627 foreach ($this->getAnswers() as $index => $a) {
628 if ($post->has("kprim_choice_result_$index")) {
629 $value = $post->retrieve(
630 "kprim_choice_result_$index",
631 $this->dic->refinery()->kindlyTo()->string()
632 );
633 if (is_numeric($value)) {
634 $solutionSubmit[] = $value;
635 }
636 } else {
637 $solutionSubmit[] = null;
638 }
639 }
640 return $solutionSubmit;
641 }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

References Vendor\Package\$a.

◆ getSpecificFeedbackAllCorrectOptionLabel()

assKprimChoice::getSpecificFeedbackAllCorrectOptionLabel ( )

Implements ilAssSpecificFeedbackOptionLabelProvider.

Definition at line 780 of file class.assKprimChoice.php.

780 : string
781 {
782 return 'feedback_correct_kprim';
783 }

◆ getSpecificFeedbackSetting()

assKprimChoice::getSpecificFeedbackSetting ( )

Definition at line 167 of file class.assKprimChoice.php.

167 : int
168 {
170 }

References $specific_feedback_setting.

Referenced by saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ getThumbSize()

assKprimChoice::getThumbSize ( )

Reimplemented from assQuestion.

Definition at line 117 of file class.assKprimChoice.php.

117 : int
118 {
119 return $this->thumbSize;
120 }

References $thumbSize.

Referenced by saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ getTrueOptionLabel()

assKprimChoice::getTrueOptionLabel ( string  $option_label)

Definition at line 507 of file class.assKprimChoice.php.

507 : string
508 {
509 switch ($option_label) {
511 return 'option_label_right';
512
514 return 'option_label_plus';
515
517 return 'option_label_applicable';
518
520 return 'option_label_adequate';
521
522 default:
523 throw new \ErrorException('Invalide Option Label');
524 }
525 }

◆ getTrueOptionLabelTranslation()

assKprimChoice::getTrueOptionLabelTranslation ( ilLanguage  $lng,
string  $option_label 
)

Definition at line 496 of file class.assKprimChoice.php.

496 : string
497 {
498 if ($option_label === self::OPTION_LABEL_CUSTOM) {
499 return $this->getCustomTrueOptionLabel();
500 }
501
502 return $lng->txt(
504 );
505 }
getTrueOptionLabel(string $option_label)

References $lng.

◆ getValidAnswerTypes()

assKprimChoice::getValidAnswerTypes ( )

Definition at line 428 of file class.assKprimChoice.php.

428 : array
429 {
431 }

◆ getValidOptionLabels()

assKprimChoice::getValidOptionLabels ( )

◆ getValidOptionLabelsTranslated()

assKprimChoice::getValidOptionLabelsTranslated ( ilLanguage  $lng)

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

467 : array
468 {
469 return array_reduce(
470 $this->getValidOptionLabels(),
471 function (array $c, string $option_label) use ($lng): array {
472 $c[$option_label] = $lng->txt($this->getLangVarForOptionLabel($option_label));
473 return $c;
474 },
475 []
476 );
477 }
getLangVarForOptionLabel(string $option_label)

References Vendor\Package\$c, and $lng.

◆ handleFileUpload()

assKprimChoice::handleFileUpload ( ilAssKprimChoiceAnswer  $answer,
  $fileData 
)
private

Definition at line 585 of file class.assKprimChoice.php.

585 : int
586 {
587 $imagePath = $this->getImagePath();
588
589 if (!file_exists($imagePath)) {
590 ilFileUtils::makeDirParents($imagePath);
591 }
592
593 $filename = $this->buildHashedImageFilename($fileData['name'], true);
594
595 $answer->setImageFsDir($imagePath);
596 $answer->setImageFile($filename);
597
598 if (!ilFileUtils::moveUploadedFile($fileData['tmp_name'], $filename, $answer->getImageFsPath())) {
599 return 2;
600 }
601
602 $this->generateThumbForFile($filename, $this->getImagePath(), $this->getThumbSize());
603
604 return 0;
605 }
$filename
Definition: buildRTE.php:78
buildHashedImageFilename(string $plain_image_filename, bool $unique=false)
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file

References $filename, ilAssKprimChoiceAnswer\getImageFsPath(), ilFileUtils\makeDirParents(), ilFileUtils\moveUploadedFile(), ilAssKprimChoiceAnswer\setImageFile(), and ilAssKprimChoiceAnswer\setImageFsDir().

+ Here is the call graph for this function:

◆ handleFileUploads()

assKprimChoice::handleFileUploads (   $answers,
  $files 
)

Definition at line 572 of file class.assKprimChoice.php.

572 : void
573 {
574 foreach ($answers as $answer) {
575 /* @var ilAssKprimChoiceAnswer $answer */
576
577 if (!isset($files[$answer->getPosition()])) {
578 continue;
579 }
580
581 $this->handleFileUpload($answer, $files[$answer->getPosition()]);
582 }
583 }
handleFileUpload(ilAssKprimChoiceAnswer $answer, $fileData)

References $files.

◆ isComplete()

assKprimChoice::isComplete ( )

Reimplemented from assQuestion.

Definition at line 353 of file class.assKprimChoice.php.

353 : bool
354 {
355 foreach ([$this->title, $this->author, $this->question] as $text) {
356 if (!strlen($text)) {
357 return false;
358 }
359 }
360
361 if (!isset($this->points)) {
362 return false;
363 }
364
365 foreach ($this->getAnswers() as $answer) {
366 /* @var ilAssKprimChoiceAnswer $answer */
367
368 if (is_null($answer->getCorrectness())) {
369 return false;
370 }
371
372 if (
373 (!is_string($answer->getAnswertext()) || $answer->getAnswertext() === '') &&
374 (!is_string($answer->getImageFile()) || $answer->getImageFile() === '')
375 ) {
376 return false;
377 }
378 }
379
380 return true;
381 }
$text
Definition: xapiexit.php:21

References $text, and getAnswers().

+ Here is the call graph for this function:

◆ isCustomOptionLabel()

assKprimChoice::isCustomOptionLabel (   $labelValue)

Definition at line 567 of file class.assKprimChoice.php.

567 : bool
568 {
569 return $labelValue == self::OPTION_LABEL_CUSTOM;
570 }

◆ isScorePartialSolutionEnabled()

assKprimChoice::isScorePartialSolutionEnabled ( )

Definition at line 127 of file class.assKprimChoice.php.

127 : bool
128 {
130 }

References $scorePartialSolutionEnabled.

Referenced by saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ isShuffleAnswersEnabled()

assKprimChoice::isShuffleAnswersEnabled ( )

Definition at line 97 of file class.assKprimChoice.php.

97 : bool
98 {
100 }

References $shuffle_answers_enabled.

Referenced by saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ isSingleLineAnswerType()

assKprimChoice::isSingleLineAnswerType (   $answerType)

Definition at line 439 of file class.assKprimChoice.php.

439 : bool
440 {
442 }

References ANSWER_TYPE_SINGLE_LINE.

◆ isValidAnswerType()

assKprimChoice::isValidAnswerType (   $answerType)

Definition at line 433 of file class.assKprimChoice.php.

433 : bool
434 {
435 $validTypes = $this->getValidAnswerTypes();
436 return in_array($answerType, $validTypes);
437 }

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ isValidOptionLabel()

assKprimChoice::isValidOptionLabel ( ?string  $option_label)

Definition at line 490 of file class.assKprimChoice.php.

490 : bool
491 {
492 $valid_labels = $this->getValidOptionLabels();
493 return in_array($option_label, $valid_labels);
494 }

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ lmMigrateQuestionTypeSpecificContent()

assKprimChoice::lmMigrateQuestionTypeSpecificContent ( ilAssSelfAssessmentMigrator  $migrator)
protected
Parameters
ilAssSelfAssessmentMigrator$migrator

Reimplemented from assQuestion.

Definition at line 702 of file class.assKprimChoice.php.

702 : void
703 {
704 foreach ($this->getAnswers() as $answer) {
705 /* @var ilAssKprimChoiceAnswer $answer */
706 $answer->setAnswertext($migrator->migrateToLmContent($answer->getAnswertext()));
707 }
708 }

References ilAssSelfAssessmentMigrator\migrateToLmContent().

+ Here is the call graph for this function:

◆ loadAnswerData()

assKprimChoice::loadAnswerData ( int  $question_id)
private

Definition at line 280 of file class.assKprimChoice.php.

280 : void
281 {
282 $res = $this->db->queryF(
283 "SELECT * FROM {$this->getAnswerTableName()} WHERE question_fi = %s ORDER BY position ASC",
284 ['integer'],
285 [$question_id]
286 );
287
288 while ($data = $this->db->fetchAssoc($res)) {
289 $answer = new ilAssKprimChoiceAnswer();
290
291 $answer->setPosition($data['position']);
292
293 $answer->setAnswertext(ilRTE::_replaceMediaObjectImageSrc($data['answertext'] ?? '', 1));
294
295 $answer->setImageFile($data['imagefile']);
296 $answer->setThumbPrefix($this->getThumbPrefix());
297 $answer->setImageFsDir($this->getImagePath());
298 $answer->setImageWebDir($this->getImagePathWeb());
299
300 $answer->setCorrectness($data['correctness']);
301
302 $this->answers[$answer->getPosition()] = $answer;
303 }
304 }
getImagePathWeb()
Returns the web image path for web accessable images of a question.
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...
foreach($_POST as $key=> $value) $res

References $data, $res, ilRTE\_replaceMediaObjectImageSrc(), assQuestion\getImagePath(), and assQuestion\getImagePathWeb().

Referenced by loadFromDb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadFromDb()

assKprimChoice::loadFromDb (   $questionId)

Definition at line 213 of file class.assKprimChoice.php.

213 : void
214 {
215 $res = $this->db->queryF($this->buildQuestionDataQuery(), ['integer'], [$questionId]);
216
217 while ($data = $this->db->fetchAssoc($res)) {
218 $this->setId($questionId);
219
220 $this->setOriginalId($data['original_id']);
221
222 $this->setObjId($data['obj_fi']);
223
224 $this->setTitle($data['title'] ?? '');
225 $this->setNrOfTries($data['nr_of_tries']);
226 $this->setComment($data['description'] ?? '');
227 $this->setAuthor($data['author']);
228 $this->setPoints($data['points']);
229 $this->setOwner($data['owner']);
230 $this->setLastChange($data['tstamp']);
231 $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data['question_text'] ?? '', 1));
232
233 $this->setShuffleAnswersEnabled((bool) $data['shuffle_answers']);
234
235 if ($this->isValidAnswerType($data['answer_type'])) {
236 $this->setAnswerType($data['answer_type']);
237 }
238
239 if (is_numeric($data['thumb_size'])) {
240 $this->setThumbSize((int) $data['thumb_size']);
241 }
242
243 if ($this->isValidOptionLabel($data['opt_label'])) {
244 $this->setOptionLabel($data['opt_label']);
245 }
246
247 if ($data['custom_true'] !== null) {
248 $this->setCustomTrueOptionLabel($data['custom_true']);
249 }
250
251 if ($data['custom_false'] !== null) {
252 $this->setCustomFalseOptionLabel($data['custom_false']);
253 }
254
255 if ($data['score_partsol'] !== null) {
256 $this->setScorePartialSolutionEnabled((bool) $data['score_partsol']);
257 }
258
259 if (isset($data['feedback_setting'])) {
260 $this->setSpecificFeedbackSetting((int) $data['feedback_setting']);
261 }
262
263 try {
264 $this->setLifecycle(new ilAssQuestionLifecycle($data['lifecycle']));
267 }
268
269 try {
270 $this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);
272 }
273 }
274
275 $this->loadAnswerData($questionId);
276
277 parent::loadFromDb($questionId);
278 }
setCustomTrueOptionLabel($customTrueOptionLabel)
setSpecificFeedbackSetting(int $specific_feedback_setting)
setShuffleAnswersEnabled(bool $shuffle_answers_enabled)
setCustomFalseOptionLabel($customFalseOptionLabel)
setOptionLabel(string $option_label)
setAnswerType($answerType)
loadAnswerData(int $question_id)
isValidAnswerType($answerType)
isValidOptionLabel(?string $option_label)
setScorePartialSolutionEnabled($scorePartialSolutionEnabled)
setThumbSize(int $thumbSize)
setOriginalId(?int $original_id)
setId(int $id=-1)
setAdditionalContentEditingMode(?string $additionalContentEditingMode)
setQuestion(string $question="")
setAuthor(string $author="")
setComment(string $comment="")
setObjId(int $obj_id=0)
setLastChange(int $lastChange)
setOwner(int $owner=-1)
setNrOfTries(int $a_nr_of_tries)
setLifecycle(ilAssQuestionLifecycle $lifecycle)
setTitle(string $title="")
setPoints(float $points)

References $data, Vendor\Package\$e, $res, ilRTE\_replaceMediaObjectImageSrc(), assQuestion\buildQuestionDataQuery(), isValidAnswerType(), isValidOptionLabel(), loadAnswerData(), assQuestion\setAdditionalContentEditingMode(), setAnswerType(), assQuestion\setAuthor(), assQuestion\setComment(), setCustomFalseOptionLabel(), setCustomTrueOptionLabel(), assQuestion\setId(), assQuestion\setLastChange(), assQuestion\setLifecycle(), assQuestion\setNrOfTries(), assQuestion\setObjId(), setOptionLabel(), assQuestion\setOriginalId(), assQuestion\setOwner(), assQuestion\setPoints(), assQuestion\setQuestion(), setScorePartialSolutionEnabled(), setShuffleAnswersEnabled(), setSpecificFeedbackSetting(), setThumbSize(), and assQuestion\setTitle().

+ Here is the call graph for this function:

◆ moveAnswerDown()

assKprimChoice::moveAnswerDown (   $position)

Definition at line 785 of file class.assKprimChoice.php.

785 : bool
786 {
787 if ($position < 0 || $position >= (self::NUM_REQUIRED_ANSWERS - 1)) {
788 return false;
789 }
790
791 for ($i = 0, $max = count($this->answers); $i < $max; $i++) {
792 if ($i == $position) {
793 $movingAnswer = $this->answers[$i];
794 $targetAnswer = $this->answers[ $i + 1 ];
795
796 $movingAnswer->setPosition($position + 1);
797 $targetAnswer->setPosition($position);
798
799 $this->answers[ $i + 1 ] = $movingAnswer;
800 $this->answers[$i] = $targetAnswer;
801 }
802 }
803 return true;
804 }

◆ moveAnswerUp()

assKprimChoice::moveAnswerUp (   $position)

Definition at line 806 of file class.assKprimChoice.php.

806 : bool
807 {
808 if ($position <= 0 || $position > (self::NUM_REQUIRED_ANSWERS - 1)) {
809 return false;
810 }
811
812 for ($i = 0, $max = count($this->answers); $i < $max; $i++) {
813 if ($i == $position) {
814 $movingAnswer = $this->answers[$i];
815 $targetAnswer = $this->answers[ $i - 1 ];
816
817 $movingAnswer->setPosition($position - 1);
818 $targetAnswer->setPosition($position);
819
820 $this->answers[ $i - 1 ] = $movingAnswer;
821 $this->answers[$i] = $targetAnswer;
822 }
823 }
824
825 return true;
826 }

◆ removeAnswerImage()

assKprimChoice::removeAnswerImage (   $position)

Definition at line 607 of file class.assKprimChoice.php.

607 : void
608 {
609 $answer = $this->getAnswer($position);
610
611 if (file_exists($answer->getImageFsPath())) {
612 ilFileUtils::delDir($answer->getImageFsPath());
613 }
614
615 if (file_exists($answer->getThumbFsPath())) {
616 ilFileUtils::delDir($answer->getThumbFsPath());
617 }
618
619 $answer->setImageFile(null);
620 }
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively

References ilFileUtils\delDir().

+ Here is the call graph for this function:

◆ saveAdditionalQuestionDataToDb()

assKprimChoice::saveAdditionalQuestionDataToDb ( )

Saves a record to the question types additional data table.

Returns
mixed

Implements ilObjQuestionScoringAdjustable.

Definition at line 315 of file class.assKprimChoice.php.

316 {
317 $this->db->replace(
318 $this->getAdditionalTableName(),
319 [
320 'question_fi' => ['integer', $this->getId()]
321 ],
322 [
323 'shuffle_answers' => ['integer', (int) $this->isShuffleAnswersEnabled()],
324 'answer_type' => ['text', $this->getAnswerType()],
325 'thumb_size' => ['integer', $this->getThumbSize()],
326 'opt_label' => ['text', $this->getOptionLabel()],
327 'custom_true' => ['text', $this->getCustomTrueOptionLabel()],
328 'custom_false' => ['text', $this->getCustomFalseOptionLabel()],
329 'score_partsol' => ['integer', (int) $this->isScorePartialSolutionEnabled()],
330 'feedback_setting' => ['integer', $this->getSpecificFeedbackSetting()]
331 ]
332 );
333 }

References getAdditionalTableName(), getAnswerType(), getCustomFalseOptionLabel(), getCustomTrueOptionLabel(), assQuestion\getId(), getOptionLabel(), getSpecificFeedbackSetting(), getThumbSize(), isScorePartialSolutionEnabled(), and isShuffleAnswersEnabled().

Referenced by saveToDb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAnswerSpecificDataToDb()

assKprimChoice::saveAnswerSpecificDataToDb ( )

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

Returns
mixed

Implements ilObjAnswerScoringAdjustable.

Definition at line 335 of file class.assKprimChoice.php.

336 {
337 foreach ($this->getAnswers() as $answer) {
338 $this->db->replace(
339 $this->getAnswerTableName(),
340 [
341 'question_fi' => ['integer', $this->getId()],
342 'position' => ['integer', (int) $answer->getPosition()]
343 ],
344 [
345 'answertext' => ['text', $answer->getAnswertext()],
346 'imagefile' => ['text', $answer->getImageFile()],
347 'correctness' => ['integer', (int) $answer->getCorrectness()]
348 ]
349 );
350 }
351 }

References getAnswers(), getAnswerTableName(), and assQuestion\getId().

Referenced by saveToDb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveToDb()

assKprimChoice::saveToDb ( ?int  $original_id = null)

Reimplemented from assQuestion.

Definition at line 306 of file class.assKprimChoice.php.

306 : void
307 {
311
312 parent::saveToDb();
313 }
saveAnswerSpecificDataToDb()
Saves the answer specific records into a question types answer table.
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
saveQuestionDataToDb(?int $original_id=null)

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

+ Here is the call graph for this function:

◆ saveWorkingData()

assKprimChoice::saveWorkingData ( int  $active_id,
?int  $pass = null,
bool  $authorized = true 
)

Reimplemented from assQuestion.

Definition at line 383 of file class.assKprimChoice.php.

387 : bool {
388 if ($pass === null) {
389 $pass = ilObjTest::_getPass($active_id);
390 }
391
392 $answer = $this->getSolutionSubmit();
393 $this->getProcessLocker()->executeUserSolutionUpdateLockOperation(
394 function () use ($answer, $active_id, $pass, $authorized) {
395 $this->removeCurrentSolution($active_id, $pass, $authorized);
396 foreach ($answer as $index => $value) {
397 if ($value !== null) {
398 $this->saveCurrentSolution($active_id, $pass, (int) $index, (int) $value, $authorized);
399 }
400 }
401 }
402 );
403
404 return true;
405 }
saveCurrentSolution(int $active_id, int $pass, $value1, $value2, bool $authorized=true, $tstamp=0)
removeCurrentSolution(int $active_id, int $pass, bool $authorized=true)
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.

References ilObjTest\_getPass().

+ Here is the call graph for this function:

◆ setAnswers()

assKprimChoice::setAnswers (   $answers)

Definition at line 172 of file class.assKprimChoice.php.

172 : void
173 {
174 if (is_null($answers)) {
175 return;
176 }
177 $clean_answer_text = function (ilAssKprimChoiceAnswer $answer) {
178 $answer->setAnswertext(
179 $this->getHtmlQuestionContentPurifier()->purify($answer->getAnswertext())
180 );
181 return $answer;
182 };
183 $this->answers = array_map($clean_answer_text, $answers);
184 }

References $answers, and assQuestion\getHtmlQuestionContentPurifier().

+ Here is the call graph for this function:

◆ setAnswerType()

assKprimChoice::setAnswerType (   $answerType)

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

102 : void
103 {
104 $this->answerType = $answerType;
105 }

References $answerType.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setCustomFalseOptionLabel()

assKprimChoice::setCustomFalseOptionLabel (   $customFalseOptionLabel)

Definition at line 152 of file class.assKprimChoice.php.

152 : void
153 {
154 $this->customFalseOptionLabel = $customFalseOptionLabel;
155 }

References $customFalseOptionLabel.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setCustomTrueOptionLabel()

assKprimChoice::setCustomTrueOptionLabel (   $customTrueOptionLabel)

Definition at line 142 of file class.assKprimChoice.php.

142 : void
143 {
144 $this->customTrueOptionLabel = $customTrueOptionLabel;
145 }

References $customTrueOptionLabel.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setOptionLabel()

assKprimChoice::setOptionLabel ( string  $option_label)

Definition at line 132 of file class.assKprimChoice.php.

132 : void
133 {
134 $this->option_label = $option_label;
135 }

References $option_label.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setScorePartialSolutionEnabled()

assKprimChoice::setScorePartialSolutionEnabled (   $scorePartialSolutionEnabled)

Definition at line 122 of file class.assKprimChoice.php.

122 : void
123 {
124 $this->scorePartialSolutionEnabled = $scorePartialSolutionEnabled;
125 }

References $scorePartialSolutionEnabled.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setShuffleAnswersEnabled()

assKprimChoice::setShuffleAnswersEnabled ( bool  $shuffle_answers_enabled)

Definition at line 92 of file class.assKprimChoice.php.

92 : void
93 {
94 $this->shuffle_answers_enabled = $shuffle_answers_enabled;
95 }

References $shuffle_answers_enabled.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setSpecificFeedbackSetting()

assKprimChoice::setSpecificFeedbackSetting ( int  $specific_feedback_setting)

Definition at line 162 of file class.assKprimChoice.php.

162 : void
163 {
164 $this->specific_feedback_setting = $specific_feedback_setting;
165 }

References $specific_feedback_setting.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setThumbSize()

assKprimChoice::setThumbSize ( int  $thumbSize)

Reimplemented from assQuestion.

Definition at line 112 of file class.assKprimChoice.php.

112 : void
113 {
114 $this->thumbSize = $thumbSize;
115 }

References $thumbSize.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ solutionValuesToLog()

assKprimChoice::solutionValuesToLog ( AdditionalInformationGenerator  $additional_info,
array  $solution_values 
)
protected

MUST convert the given solution values into an array or a string that can be stored in the log.

Language variables must be generated through the corresponding functions in the AdditionalInformationGenerator. If an array is returned it will be rendered into a line per array entry in the format "key: value". If the key exists as a language variable, it will be translated.

Reimplemented from assQuestion.

Definition at line 865 of file class.assKprimChoice.php.

868 : array {
869 $parsed_solution = [];
870 $true_option_label = $this->getOptionLabel() === self::OPTION_LABEL_CUSTOM
871 ? $this->getCustomTrueOptionLabel()
872 : $this->getTrueOptionLabel($this->getOptionLabel());
873 $false_option_label = $this->getOptionLabel() === self::OPTION_LABEL_CUSTOM
875 : $this->getFalseOptionLabel($this->getOptionLabel());
876 foreach ($this->getAnswers() as $id => $answer) {
877 $value = $additional_info->getNoneTag();
878 foreach ($solution_values as $solution) {
879 if ($solution['value1'] !== (string) $id) {
880 continue;
881 }
882
883 $value = $false_option_label;
884 if ($solution['value2'] === '1') {
885 $value = $true_option_label;
886 }
887 break;
888 }
889 $parsed_solution[$answer->getAnswertext()] = $value;
890 }
891 return $parsed_solution;
892 }

References $id, and ILIAS\Test\Logging\AdditionalInformationGenerator\getNoneTag().

+ Here is the call graph for this function:

◆ solutionValuesToText()

assKprimChoice::solutionValuesToText ( array  $solution_values)

MUST convert the given solution values into text.

If the text has multiple lines each line MUST be placed as an entry in an array.

Reimplemented from assQuestion.

Definition at line 894 of file class.assKprimChoice.php.

894 : array
895 {
896 $parsed_solution = [];
897 $true_option_label = $this->getTrueOptionLabelTranslation($this->lng, $this->getOptionLabel());
898 $false_option_label = $this->getFalseOptionLabelTranslation($this->lng, $this->getOptionLabel());
899 foreach ($this->getAnswers() as $id => $answer) {
900 $value = $this->lng->txt('none');
901 foreach ($solution_values as $solution) {
902 if ($solution['value1'] !== (string) $id) {
903 continue;
904 }
905
906 $value = $false_option_label;
907 if ($solution['value2'] === '1') {
908 $value = $true_option_label;
909 }
910 break;
911 }
912 $parsed_solution[] = "{$answer->getAnswertext()} ({$value})";
913 }
914 return $parsed_solution;
915 }

References $id, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ toJSON()

assKprimChoice::toJSON ( )

Returns a JSON representation of the question.

Reimplemented from assQuestion.

Definition at line 713 of file class.assKprimChoice.php.

713 : string
714 {
715 $this->lng->loadLanguageModule('assessment');
716 $this->lng->loadLanguageModule('qsts');
717
718 $result = [];
719 $result['id'] = $this->getId();
720 $result['type'] = $this->getQuestionType();
721 $result['title'] = $this->getTitleForHTMLOutput();
722 $result['question'] = $this->formatSAQuestion($this->getQuestion());
723 $result['instruction'] = $this->getInstructionTextTranslation(
724 $this->lng,
725 $this->getOptionLabel()
726 );
727 $result['nr_of_tries'] = $this->getNrOfTries();
728 $result['shuffle'] = $this->isShuffleAnswersEnabled();
729 $result['feedback'] = [
730 'onenotcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), false)),
731 'allcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), true))
732 ];
733
734 $result['trueOptionLabel'] = $this->getTrueOptionLabelTranslation($this->lng, $this->getOptionLabel());
735 $result['falseOptionLabel'] = $this->getFalseOptionLabelTranslation($this->lng, $this->getOptionLabel());
736
737 $result['num_allowed_failures'] = $this->getNumAllowedFailures();
738
739 $answers = [];
740 $has_image = false;
741
742 foreach ($this->getAnswers() as $key => $answer) {
743 if (strlen((string) $answer->getImageFile())) {
744 $has_image = true;
745 }
746
747 $answers[] = [
748 'answertext' => $this->formatSAQuestion($answer->getAnswertext() ?? ''),
749 'correctness' => (bool) $answer->getCorrectness(),
750 'order' => (int) $answer->getPosition(),
751 'image' => (string) $answer->getImageFile(),
752 'feedback' => $this->formatSAQuestion(
753 $this->feedbackOBJ->getSpecificAnswerFeedbackExportPresentation($this->getId(), 0, $key)
754 )
755 ];
756 }
757
758 $result['answers'] = $answers;
759
760 if ($has_image) {
761 $result['path'] = $this->getImagePathWeb();
762 $result['thumb'] = $this->getThumbSize();
763 }
764
765 $mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $this->getId());
766 $result['mobs'] = $mobs;
767
768 return json_encode($result);
769 }
getInstructionTextTranslation(ilLanguage $lng, $option_label)
static _getMobsOfObject(string $a_type, int $a_id, int|false $a_usage_hist_nr=0, string $a_lang="-")

References ilObjMediaObject\_getMobsOfObject(), ILIAS\Survey\Mode\getId(), ILIAS\Repository\int(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ toLog()

assKprimChoice::toLog ( AdditionalInformationGenerator  $additional_info)

MUST return an array of the question settings that can be stored in the log.

Language variables must be generated through the corresponding functions in the AdditionalInformationGenerator. If an array is returned it will be rendered into a line per array entry in the format "key: value". If the key exists as a language variable, it will be translated.

Reimplemented from assQuestion.

Definition at line 828 of file class.assKprimChoice.php.

828 : array
829 {
830 $result = [
831 AdditionalInformationGenerator::KEY_QUESTION_TYPE => (string) $this->getQuestionType(),
832 AdditionalInformationGenerator::KEY_QUESTION_TITLE => $this->getTitleForHTMLOutput(),
833 AdditionalInformationGenerator::KEY_QUESTION_TEXT => $this->formatSAQuestion($this->getQuestion()),
834 AdditionalInformationGenerator::KEY_QUESTION_KPRIM_OPTION_LABEL => $additional_info
836 AdditionalInformationGenerator::KEY_QUESTION_SHUFFLE_ANSWER_OPTIONS => $additional_info
838 AdditionalInformationGenerator::KEY_FEEDBACK => [
839 AdditionalInformationGenerator::KEY_QUESTION_FEEDBACK_ON_INCOMPLETE => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), false)),
840 AdditionalInformationGenerator::KEY_QUESTION_FEEDBACK_ON_COMPLETE => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), true))
841 ]
842 ];
843
844 $result[AdditionalInformationGenerator::KEY_QUESTION_KPRIM_SCORE_PARTIAL_SOLUTION_ENABLED] = $additional_info
846
847 $answers = [];
848 foreach ($this->getAnswers() as $key => $answer) {
849 $answers[$key + 1] = [
850 AdditionalInformationGenerator::KEY_QUESTION_ANSWER_OPTION => $this->formatSAQuestion($answer->getAnswertext() ?? ''),
851 AdditionalInformationGenerator::KEY_QUESTION_ANSWER_OPTION_CORRECTNESS => $additional_info->getTrueFalseTagForBool((bool) $answer->getCorrectness()),
852 AdditionalInformationGenerator::KEY_QUESTION_ANSWER_OPTION_ORDER => (int) $answer->getPosition(),
853 AdditionalInformationGenerator::KEY_QUESTION_ANSWER_OPTION_IMAGE => (string) $answer->getImageFile(),
854 AdditionalInformationGenerator::KEY_FEEDBACK => $this->formatSAQuestion(
855 $this->feedbackOBJ->getSpecificAnswerFeedbackExportPresentation($this->getId(), 0, $key)
856 )
857 ];
858 }
859
860 $result[AdditionalInformationGenerator::KEY_QUESTION_ANSWER_OPTIONS] = $answers;
861
862 return $result;
863 }

References ILIAS\Test\Logging\AdditionalInformationGenerator\getEnabledDisabledTagForBool(), ILIAS\Test\Logging\AdditionalInformationGenerator\getTagForLangVar(), ILIAS\Test\Logging\AdditionalInformationGenerator\getTrueFalseTagForBool(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ toNormalized()

assKprimChoice::toNormalized ( Transformations  $transformations,
array  $context = [] 
)
Parameters
array<string,mixed>$context
Returns
array<array-key, mixed>|float|bool|int|string|null

Reimplemented from assQuestion.

Definition at line 929 of file class.assKprimChoice.php.

932 : array|float|bool|int|string|null
933 {
934 return [
935 ...$transformations->normalize(parent::toNormalized($transformations, $context)),
936 'shuffle_answers' => $this->shuffle_answers_enabled,
937 'answer_type' => $this->answerType,
938 'option_label' => $this->option_label,
939 'custom_true_option_label' => $this->customTrueOptionLabel,
940 'custom_false_option_label' => $this->customFalseOptionLabel,
941 'score_partial_solution' => $this->scorePartialSolutionEnabled,
942 'specific_feedback_setting' => $this->specific_feedback_setting,
943 'answers' => $transformations->normalize($this->answers, ['question_id' => $this->getId()]),
944 ];
945 }

References ILIAS\Survey\Mode\getId(), and ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Transformations\normalize().

+ Here is the call graph for this function:

Field Documentation

◆ $answers

assKprimChoice::$answers = []
private

Definition at line 64 of file class.assKprimChoice.php.

Referenced by getAnswers(), and setAnswers().

◆ $answerType

string assKprimChoice::$answerType = self::ANSWER_TYPE_SINGLE_LINE
private

Definition at line 56 of file class.assKprimChoice.php.

Referenced by getAnswerType(), and setAnswerType().

◆ $customFalseOptionLabel

string assKprimChoice::$customFalseOptionLabel = ''
private

◆ $customTrueOptionLabel

string assKprimChoice::$customTrueOptionLabel = ''
private

Definition at line 60 of file class.assKprimChoice.php.

Referenced by getCustomTrueOptionLabel(), and setCustomTrueOptionLabel().

◆ $option_label

string assKprimChoice::$option_label = self::OPTION_LABEL_RIGHT_WRONG
private

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

Referenced by getOptionLabel(), and setOptionLabel().

◆ $scorePartialSolutionEnabled

bool assKprimChoice::$scorePartialSolutionEnabled = true
private

◆ $shuffle_answers_enabled

bool assKprimChoice::$shuffle_answers_enabled = true
private

Definition at line 55 of file class.assKprimChoice.php.

Referenced by isShuffleAnswersEnabled(), and setShuffleAnswersEnabled().

◆ $specific_feedback_setting

int assKprimChoice::$specific_feedback_setting = ilAssConfigurableMultiOptionQuestionFeedback::FEEDBACK_SETTING_ALL
private

◆ $thumbSize

int assKprimChoice::$thumbSize = self::DEFAULT_THUMB_SIZE
private

Definition at line 57 of file class.assKprimChoice.php.

Referenced by getThumbSize(), and setThumbSize().

◆ ANSWER_TYPE_MULTI_LINE

const assKprimChoice::ANSWER_TYPE_MULTI_LINE = 'multiLine'

Definition at line 44 of file class.assKprimChoice.php.

Referenced by assKprimChoiceGUI\handleAnswerTextsSubmit().

◆ ANSWER_TYPE_SINGLE_LINE

const assKprimChoice::ANSWER_TYPE_SINGLE_LINE = 'singleLine'

Definition at line 43 of file class.assKprimChoice.php.

Referenced by isSingleLineAnswerType().

◆ DEFAULT_THUMB_SIZE

const assKprimChoice::DEFAULT_THUMB_SIZE = 150

Definition at line 52 of file class.assKprimChoice.php.

◆ NUM_REQUIRED_ANSWERS

const assKprimChoice::NUM_REQUIRED_ANSWERS = 4

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

Referenced by __construct().

◆ OPTION_LABEL_ADEQUATE_OR_NOT

const assKprimChoice::OPTION_LABEL_ADEQUATE_OR_NOT = 'adequate_or_not'

Definition at line 49 of file class.assKprimChoice.php.

◆ OPTION_LABEL_APPLICABLE_OR_NOT

const assKprimChoice::OPTION_LABEL_APPLICABLE_OR_NOT = 'applicable_or_not'

Definition at line 48 of file class.assKprimChoice.php.

◆ OPTION_LABEL_CUSTOM

const assKprimChoice::OPTION_LABEL_CUSTOM = 'customlabel'

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

◆ OPTION_LABEL_PLUS_MINUS

const assKprimChoice::OPTION_LABEL_PLUS_MINUS = 'plus_minus'

Definition at line 47 of file class.assKprimChoice.php.

◆ OPTION_LABEL_RIGHT_WRONG

const assKprimChoice::OPTION_LABEL_RIGHT_WRONG = 'right_wrong'

Definition at line 46 of file class.assKprimChoice.php.

◆ PARTIAL_SCORING_NUM_CORRECT_ANSWERS

const assKprimChoice::PARTIAL_SCORING_NUM_CORRECT_ANSWERS = 3

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

◆ THUMB_PREFIX

const assKprimChoice::THUMB_PREFIX = 'thumb.'

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


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