ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ($shuffleAnswersEnabled)
 
 isShuffleAnswersEnabled ()
 
 setAnswerType ($answerType)
 
 getAnswerType ()
 
 setThumbSize (int $thumbSize)
 
 getThumbSize ()
 
 setScorePartialSolutionEnabled ($scorePartialSolutionEnabled)
 
 isScorePartialSolutionEnabled ()
 
 setOptionLabel ($optionLabel)
 
 getOptionLabel ()
 
 setCustomTrueOptionLabel ($customTrueOptionLabel)
 
 getCustomTrueOptionLabel ()
 
 setCustomFalseOptionLabel ($customFalseOptionLabel)
 
 getCustomFalseOptionLabel ()
 
 setSpecificFeedbackSetting ($specificFeedbackSetting)
 
 getSpecificFeedbackSetting ()
 
 setAnswers ($answers)
 
 getAnswers ()
 
 getAnswer ($position)
 
 addAnswer (ilAssKprimChoiceAnswer $answer)
 
 loadFromDb ($questionId)
 
 saveToDb ($originalId='')
 
 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 ()
 
 calculateReachedPoints ($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
 Returns the points, a learner has reached answering the question. More...
 
 getValidAnswerTypes ()
 
 isValidAnswerType ($answerType)
 
 isSingleLineAnswerType ($answerType)
 
 getAnswerTypeSelectOptions (ilLanguage $lng)
 
 getValidOptionLabels ()
 
 getValidOptionLabelsTranslated (ilLanguage $lng)
 
 isValidOptionLabel ($optionLabel)
 
 getTrueOptionLabelTranslation (ilLanguage $lng, $optionLabel)
 
 getFalseOptionLabelTranslation (ilLanguage $lng, $optionLabel)
 
 getInstructionTextTranslation (ilLanguage $lng, $optionLabel)
 
 isCustomOptionLabel ($labelValue)
 
 handleFileUploads ($answers, $files)
 
 removeAnswerImage ($position)
 
 duplicate (bool $for_test=true, string $title="", string $author="", int $owner=-1, $testObjId=null)
 
 createNewOriginalFromThisDuplicate ($target_parent_id, $target_question_title="")
 
 copyObject ($target_questionpool_id, $title="")
 Copies an assMultipleChoice object. More...
 
 toJSON ()
 Returns a JSON representation of the question. More...
 
 getSpecificFeedbackAllCorrectOptionLabel ()
 
 setExportDetailsXLSX (ilAssExcelFormatHelper $worksheet, int $startrow, int $col, int $active_id, int $pass)
 {} More...
 
 moveAnswerDown ($position)
 
 moveAnswerUp ($position)
 
- 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 ()
 

Static Public Member Functions

static isObligationPossible (int $questionId)
 
- 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...
 

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 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 = ':'
 

Protected Member Functions

 getSolutionSubmit ()
 
 calculateReachedPointsForSolution ($found_values, $active_id=0)
 
 beforeSyncWithOriginal ($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId)
 
 afterSyncWithOriginal ($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId)
 
 getRTETextWithMediaObjects ()
 
 lmMigrateQuestionTypeSpecificContent (ilAssSelfAssessmentMigrator $migrator)
 
- 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 ()
 

Private Member Functions

 loadAnswerData ($questionId)
 
 handleFileUpload (ilAssKprimChoiceAnswer $answer, $fileData)
 
 getNumAllowedFailures ()
 

Private Attributes

 $shuffleAnswersEnabled
 
 $answerType
 
 $thumbSize
 
 $scorePartialSolutionEnabled
 
 $optionLabel
 
 $customTrueOptionLabel
 
 $customFalseOptionLabel
 
 $specificFeedbackSetting
 
 $answers
 

Additional Inherited Members

- 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
 
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
 
- Static Protected Attributes inherited from assQuestion
static $forcePassResultsUpdateEnabled = false
 
static $imageSourceFixReplaceMap
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

66  {
68 
69  $this->shuffleAnswersEnabled = true;
70  $this->answerType = self::ANSWER_TYPE_SINGLE_LINE;
71  $this->thumbSize = self::DEFAULT_THUMB_SIZE;
72  $this->scorePartialSolutionEnabled = true;
73  $this->optionLabel = self::OPTION_LABEL_RIGHT_WRONG;
74  $this->customTrueOptionLabel = '';
75  $this->customFalseOptionLabel = '';
76 
78 
79  $this->answers = [];
80  }
__construct(VocabulariesInterface $vocabularies)
string $question
The question text.
+ Here is the call graph for this function:

Member Function Documentation

◆ addAnswer()

assKprimChoice::addAnswer ( ilAssKprimChoiceAnswer  $answer)

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

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

207  : void
208  {
209  $answer->setAnswertext(
210  $this->getHtmlQuestionContentPurifier()->purify($answer->getAnswertext())
211  );
212  $this->answers[] = $answer;
213  }
+ Here is the call graph for this function:

◆ afterSyncWithOriginal()

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

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

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

826  : void
827  {
828  parent::afterSyncWithOriginal($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId);
829 
830  $this->cloneAnswerImages($dupQuestionId, $dupParentObjId, $origQuestionId, $origParentObjId);
831  }
+ Here is the call graph for this function:

◆ beforeSyncWithOriginal()

assKprimChoice::beforeSyncWithOriginal (   $origQuestionId,
  $dupQuestionId,
  $origParentObjId,
  $dupParentObjId 
)
protected

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

References assQuestion\$question.

815  : void
816  {
817  parent::beforeSyncWithOriginal($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId);
818 
819  $question = self::instantiateQuestion($origQuestionId);
820 
821  foreach ($question->getAnswers() as $answer) {
822  $question->removeAnswerImage($answer->getPosition());
823  }
824  }
string $question
The question text.

◆ calculateReachedPoints()

assKprimChoice::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
float/array $points/$details (array $details is deprecated !!)

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

References $data, $DIC, $ilDB, assQuestion\$points, calculateReachedPointsForSolution(), assQuestion\getCurrentSolutionResultSet(), assQuestion\getSolutionMaxPass(), and ILIAS\Repository\int().

464  : float
465  {
466  if ($returndetails) {
467  throw new ilTestException('return details not implemented for ' . __METHOD__);
468  }
469 
470  global $DIC;
471  $ilDB = $DIC['ilDB'];
472 
473  $found_values = [];
474  if (is_null($pass)) {
475  $pass = $this->getSolutionMaxPass($active_id);
476  }
477 
478  $result = $this->getCurrentSolutionResultSet($active_id, $pass, $authorizedSolution);
479 
480  while ($data = $ilDB->fetchAssoc($result)) {
481  $found_values[(int) $data['value1']] = (int) $data['value2'];
482  }
483 
484  $points = $this->calculateReachedPointsForSolution($found_values, $active_id);
485 
486  return $points;
487  }
float $points
The maximum available points for the question.
Base Exception for all Exceptions relating to Modules/Test.
global $DIC
Definition: feed.php:28
getSolutionMaxPass(int $active_id)
calculateReachedPointsForSolution($found_values, $active_id=0)
getCurrentSolutionResultSet(int $active_id, int $pass, bool $authorized=true)
+ Here is the call graph for this function:

◆ calculateReachedPointsForSolution()

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

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

References ILIAS\LTI\ToolProvider\$key, assQuestion\$points, getAnswers(), assQuestion\getPoints(), and isScorePartialSolutionEnabled().

Referenced by calculateReachedPoints().

672  : float
673  {
674  $numCorrect = 0;
675  if ($found_values == null) {
676  $found_values = [];
677  }
678  foreach ($this->getAnswers() as $key => $answer) {
679  if (!isset($found_values[$answer->getPosition()])) {
680  continue;
681  }
682 
683  if ($found_values[$answer->getPosition()] == $answer->getCorrectness()) {
684  $numCorrect++;
685  }
686  }
687 
688  if ($numCorrect >= self::NUM_REQUIRED_ANSWERS) {
689  $points = $this->getPoints();
690  } elseif ($this->isScorePartialSolutionEnabled() && $numCorrect >= self::PARTIAL_SCORING_NUM_CORRECT_ANSWERS) {
691  $points = $this->getPoints() / 2;
692  } else {
693  $points = 0;
694  }
695 
696  if ($active_id) {
697  if (count($found_values) == 0) {
698  $points = 0;
699  }
700  }
701  return (float) $points;
702  }
float $points
The maximum available points for the question.
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyObject()

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

Copies an assMultipleChoice object.

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

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

787  : int
788  {
789  if ($this->getId() <= 0) {
790  throw new RuntimeException('The question has not been saved. It cannot be duplicated');
791  }
792  // duplicate the question in database
793  $clone = $this;
794 
795  $original_id = $this->questioninfo->getOriginalId($this->id);
796  $clone->id = -1;
797  $source_questionpool_id = $this->getObjId();
798  $clone->setObjId($target_questionpool_id);
799  if ($title) {
800  $clone->setTitle($title);
801  }
802  $clone->saveToDb();
803  // copy question page content
804  $clone->copyPageOfQuestion($original_id);
805  // copy XHTML media objects
806  $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
807  // duplicate the image
808  $clone->cloneAnswerImages($original_id, $source_questionpool_id, $clone->getId(), $clone->getObjId());
809 
810  $clone->onCopy($source_questionpool_id, $original_id, $clone->getObjId(), $clone->getId());
811 
812  return $clone->id;
813  }
+ Here is the call graph for this function:

◆ createNewOriginalFromThisDuplicate()

assKprimChoice::createNewOriginalFromThisDuplicate (   $target_parent_id,
  $target_question_title = "" 
)

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

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

752  : int
753  {
754  if ($this->getId() <= 0) {
755  throw new RuntimeException('The question has not been saved. It cannot be duplicated');
756  }
757 
758  $source_question_id = $this->id;
759  $source_parent_id = $this->getObjId();
760 
761  // duplicate the question in database
762  $clone = $this;
763  $clone->id = -1;
764 
765  $clone->setObjId($target_parent_id);
766 
767  if ($target_question_title) {
768  $clone->setTitle($target_question_title);
769  }
770 
771  $clone->saveToDb();
772  // copy question page content
773  $clone->copyPageOfQuestion($source_question_id);
774  // copy XHTML media objects
775  $clone->copyXHTMLMediaObjectsOfQuestion($source_question_id);
776  // duplicate the image
777  $clone->cloneAnswerImages($source_question_id, $source_parent_id, $clone->getId(), $clone->getObjId());
778 
779  $clone->onCopy($source_parent_id, $source_question_id, $target_parent_id, $clone->getId());
780 
781  return $clone->id;
782  }
+ Here is the call graph for this function:

◆ duplicate()

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

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

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

704  : int
705  {
706  if ($this->id <= 0) {
707  // The question has not been saved. It cannot be duplicated
708  return -1;
709  }
710  // duplicate the question in database
711  $this_id = $this->getId();
712  $thisObjId = $this->getObjId();
713 
714  $clone = $this;
715 
716  $original_id = $this->questioninfo->getOriginalId($this->id);
717  $clone->id = -1;
718 
719  if ((int) $testObjId > 0) {
720  $clone->setObjId($testObjId);
721  }
722 
723  if ($title) {
724  $clone->setTitle($title);
725  }
726 
727  if ($author) {
728  $clone->setAuthor($author);
729  }
730  if ($owner) {
731  $clone->setOwner($owner);
732  }
733 
734  if ($for_test) {
735  $clone->saveToDb($original_id);
736  } else {
737  $clone->saveToDb();
738  }
739 
740  // copy question page content
741  $clone->copyPageOfQuestion($this_id);
742  // copy XHTML media objects
743  $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
744  // duplicate the images
745  $clone->cloneAnswerImages($this_id, $thisObjId, $clone->getId(), $clone->getObjId());
746 
747  $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
748 
749  return $clone->id;
750  }
+ Here is the call graph for this function:

◆ getAdditionalTableName()

assKprimChoice::getAdditionalTableName ( )

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

Referenced by saveAdditionalQuestionDataToDb().

87  : string
88  {
89  return "qpl_qst_kprim";
90  }
+ Here is the caller graph for this function:

◆ getAnswer()

assKprimChoice::getAnswer (   $position)

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

References getAnswers().

Referenced by removeAnswerImage().

197  {
198  foreach ($this->getAnswers() as $answer) {
199  if ($answer->getPosition() == $position) {
200  return $answer;
201  }
202  }
203 
204  return null;
205  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAnswers()

assKprimChoice::getAnswers ( )

◆ getAnswerTableName()

assKprimChoice::getAnswerTableName ( )

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

Referenced by saveAnswerSpecificDataToDb().

92  : string
93  {
94  return "qpl_a_kprim";
95  }
+ Here is the caller graph for this function:

◆ getAnswerType()

assKprimChoice::getAnswerType ( )

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

References $answerType.

Referenced by saveAdditionalQuestionDataToDb().

112  : string
113  {
114  return $this->answerType;
115  }
+ Here is the caller graph for this function:

◆ getAnswerTypeSelectOptions()

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

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

References ilLanguage\txt().

509  : array
510  {
511  return [
512  self::ANSWER_TYPE_SINGLE_LINE => $lng->txt('answers_singleline'),
513  self::ANSWER_TYPE_MULTI_LINE => $lng->txt('answers_multiline')
514  ];
515  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ getCustomFalseOptionLabel()

assKprimChoice::getCustomFalseOptionLabel ( )

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

References $customFalseOptionLabel.

Referenced by getFalseOptionLabelTranslation(), and saveAdditionalQuestionDataToDb().

163  {
165  }
+ Here is the caller graph for this function:

◆ getCustomTrueOptionLabel()

assKprimChoice::getCustomTrueOptionLabel ( )

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

References $customTrueOptionLabel.

Referenced by getTrueOptionLabelTranslation(), and saveAdditionalQuestionDataToDb().

153  {
155  }
+ Here is the caller graph for this function:

◆ getFalseOptionLabelTranslation()

assKprimChoice::getFalseOptionLabelTranslation ( ilLanguage  $lng,
  $optionLabel 
)

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

References $optionLabel, getCustomFalseOptionLabel(), and ilLanguage\txt().

Referenced by getInstructionTextTranslation(), and toJSON().

567  {
568  switch ($optionLabel) {
569  case self::OPTION_LABEL_RIGHT_WRONG:
570  return $lng->txt('option_label_wrong');
571 
572  case self::OPTION_LABEL_PLUS_MINUS:
573  return $lng->txt('option_label_minus');
574 
575  case self::OPTION_LABEL_APPLICABLE_OR_NOT:
576  return $lng->txt('option_label_not_applicable');
577 
578  case self::OPTION_LABEL_ADEQUATE_OR_NOT:
579  return $lng->txt('option_label_not_adequate');
580 
581  case self::OPTION_LABEL_CUSTOM:
582  default:
583  return $this->getCustomFalseOptionLabel();
584  }
585  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstructionTextTranslation()

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

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

References $optionLabel, getFalseOptionLabelTranslation(), getTrueOptionLabelTranslation(), and ilLanguage\txt().

Referenced by toJSON().

587  : string
588  {
589  return sprintf(
590  $lng->txt('kprim_instruction_text'),
593  );
594  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getTrueOptionLabelTranslation(ilLanguage $lng, $optionLabel)
getFalseOptionLabelTranslation(ilLanguage $lng, $optionLabel)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNumAllowedFailures()

assKprimChoice::getNumAllowedFailures ( )
private

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

References isScorePartialSolutionEnabled().

Referenced by toJSON().

969  : int
970  {
971  if ($this->isScorePartialSolutionEnabled()) {
972  return self::NUM_REQUIRED_ANSWERS - self::PARTIAL_SCORING_NUM_CORRECT_ANSWERS;
973  }
974 
975  return 0;
976  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOptionLabel()

assKprimChoice::getOptionLabel ( )

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

References $optionLabel.

Referenced by saveAdditionalQuestionDataToDb(), and toJSON().

142  : string
143  {
144  return $this->optionLabel;
145  }
+ Here is the caller graph for this function:

◆ getQuestionType()

assKprimChoice::getQuestionType ( )

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

Referenced by toJSON().

82  : string
83  {
84  return 'assKprimChoice';
85  }
+ Here is the caller graph for this function:

◆ getRTETextWithMediaObjects()

assKprimChoice::getRTETextWithMediaObjects ( )
protected

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

References getAnswers().

887  : string
888  {
889  $combinedText = parent::getRTETextWithMediaObjects();
890 
891  foreach ($this->getAnswers() as $answer) {
892  $combinedText .= $answer->getAnswertext();
893  }
894 
895  return $combinedText;
896  }
+ Here is the call graph for this function:

◆ getSolutionSubmit()

assKprimChoice::getSolutionSubmit ( )
protected

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

References Vendor\Package\$a, $post, and getAnswers().

Referenced by isComplete().

651  : array
652  {
653  $solutionSubmit = [];
654  $post = $this->dic->http()->wrapper()->post();
655 
656  foreach ($this->getAnswers() as $index => $a) {
657  if ($post->has("kprim_choice_result_$index")) {
658  $value = $post->retrieve(
659  "kprim_choice_result_$index",
660  $this->dic->refinery()->kindlyTo()->string()
661  );
662  if (is_numeric($value)) {
663  $solutionSubmit[] = $value;
664  }
665  } else {
666  $solutionSubmit[] = null;
667  }
668  }
669  return $solutionSubmit;
670  }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
$post
Definition: ltitoken.php:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSpecificFeedbackAllCorrectOptionLabel()

assKprimChoice::getSpecificFeedbackAllCorrectOptionLabel ( )

Implements ilAssSpecificFeedbackOptionLabelProvider.

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

978  : string
979  {
980  return 'feedback_correct_kprim';
981  }

◆ getSpecificFeedbackSetting()

assKprimChoice::getSpecificFeedbackSetting ( )

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

References $specificFeedbackSetting.

Referenced by saveAdditionalQuestionDataToDb().

172  : int
173  {
175  }
+ Here is the caller graph for this function:

◆ getThumbSize()

assKprimChoice::getThumbSize ( )

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

References $thumbSize.

Referenced by handleFileUpload(), saveAdditionalQuestionDataToDb(), and toJSON().

122  : int
123  {
124  return $this->thumbSize;
125  }
+ Here is the caller graph for this function:

◆ getTrueOptionLabelTranslation()

assKprimChoice::getTrueOptionLabelTranslation ( ilLanguage  $lng,
  $optionLabel 
)

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

References $optionLabel, getCustomTrueOptionLabel(), and ilLanguage\txt().

Referenced by getInstructionTextTranslation(), and toJSON().

546  {
547  switch ($optionLabel) {
548  case self::OPTION_LABEL_RIGHT_WRONG:
549  return $lng->txt('option_label_right');
550 
551  case self::OPTION_LABEL_PLUS_MINUS:
552  return $lng->txt('option_label_plus');
553 
554  case self::OPTION_LABEL_APPLICABLE_OR_NOT:
555  return $lng->txt('option_label_applicable');
556 
557  case self::OPTION_LABEL_ADEQUATE_OR_NOT:
558  return $lng->txt('option_label_adequate');
559 
560  case self::OPTION_LABEL_CUSTOM:
561  default:
562  return $this->getCustomTrueOptionLabel();
563  }
564  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidAnswerTypes()

assKprimChoice::getValidAnswerTypes ( )

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

Referenced by isValidAnswerType().

489  : array
490  {
491  return [self::ANSWER_TYPE_SINGLE_LINE, self::ANSWER_TYPE_MULTI_LINE];
492  }
+ Here is the caller graph for this function:

◆ getValidOptionLabels()

assKprimChoice::getValidOptionLabels ( )

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

Referenced by isValidOptionLabel().

517  : array
518  {
519  return [
520  self::OPTION_LABEL_RIGHT_WRONG,
521  self::OPTION_LABEL_PLUS_MINUS,
522  self::OPTION_LABEL_APPLICABLE_OR_NOT,
523  self::OPTION_LABEL_ADEQUATE_OR_NOT,
524  self::OPTION_LABEL_CUSTOM
525  ];
526  }
+ Here is the caller graph for this function:

◆ getValidOptionLabelsTranslated()

assKprimChoice::getValidOptionLabelsTranslated ( ilLanguage  $lng)

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

References ilLanguage\txt().

528  : array
529  {
530  return [
531  self::OPTION_LABEL_RIGHT_WRONG => $lng->txt('option_label_right_wrong'),
532  self::OPTION_LABEL_PLUS_MINUS => $lng->txt('option_label_plus_minus'),
533  self::OPTION_LABEL_APPLICABLE_OR_NOT => $lng->txt('option_label_applicable_or_not'),
534  self::OPTION_LABEL_ADEQUATE_OR_NOT => $lng->txt('option_label_adequate_or_not'),
535  self::OPTION_LABEL_CUSTOM => $lng->txt('option_label_custom')
536  ];
537  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ handleFileUpload()

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

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

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

Referenced by handleFileUploads().

614  : int
615  {
616  $imagePath = $this->getImagePath();
617 
618  if (!file_exists($imagePath)) {
619  ilFileUtils::makeDirParents($imagePath);
620  }
621 
622  $filename = $this->buildHashedImageFilename($fileData['name'], true);
623 
624  $answer->setImageFsDir($imagePath);
625  $answer->setImageFile($filename);
626 
627  if (!ilFileUtils::moveUploadedFile($fileData['tmp_name'], $filename, $answer->getImageFsPath())) {
628  return 2;
629  }
630 
631  $this->generateThumbForFile($filename, $this->getImagePath(), $this->getThumbSize());
632 
633  return 0;
634  }
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.
buildHashedImageFilename(string $plain_image_filename, bool $unique=false)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
$filename
Definition: buildRTE.php:78
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleFileUploads()

assKprimChoice::handleFileUploads (   $answers,
  $files 
)

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

References $answers, and handleFileUpload().

601  : void
602  {
603  foreach ($answers as $answer) {
604  /* @var ilAssKprimChoiceAnswer $answer */
605 
606  if (!isset($files[$answer->getPosition()])) {
607  continue;
608  }
609 
610  $this->handleFileUpload($answer, $files[$answer->getPosition()]);
611  }
612  }
handleFileUpload(ilAssKprimChoiceAnswer $answer, $fileData)
+ Here is the call graph for this function:

◆ isComplete()

assKprimChoice::isComplete ( )

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

References $GLOBALS, $ilDB, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilObjTest\_getPass(), getAnswers(), assQuestion\getId(), assQuestion\getProcessLocker(), getSolutionSubmit(), ILIAS\Repository\lng(), assQuestion\logAction(), assQuestion\removeCurrentSolution(), assQuestion\saveCurrentSolution(), and assQuestion\saveWorkingData().

371  : bool
372  {
373  foreach ([$this->title, $this->author, $this->question] as $text) {
374  if (!strlen($text)) {
375  return false;
376  }
377  }
378 
379  if (!isset($this->points)) {
380  return false;
381  }
382 
383  foreach ($this->getAnswers() as $answer) {
384  /* @var ilAssKprimChoiceAnswer $answer */
385 
386  if (is_null($answer->getCorrectness())) {
387  return false;
388  }
389 
390  if (
391  (!is_string($answer->getAnswertext()) || $answer->getAnswertext() === '') &&
392  (!is_string($answer->getImageFile()) || $answer->getImageFile() === '')
393  ) {
394  return false;
395  }
396  }
397 
398  return true;
399  }
+ Here is the call graph for this function:

◆ isCustomOptionLabel()

assKprimChoice::isCustomOptionLabel (   $labelValue)

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

596  : bool
597  {
598  return $labelValue == self::OPTION_LABEL_CUSTOM;
599  }

◆ isObligationPossible()

static assKprimChoice::isObligationPossible ( int  $questionId)
static

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

983  : bool
984  {
985  return true;
986  }

◆ isScorePartialSolutionEnabled()

assKprimChoice::isScorePartialSolutionEnabled ( )

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

References $scorePartialSolutionEnabled.

Referenced by calculateReachedPointsForSolution(), getNumAllowedFailures(), and saveAdditionalQuestionDataToDb().

132  : bool
133  {
135  }
+ Here is the caller graph for this function:

◆ isShuffleAnswersEnabled()

assKprimChoice::isShuffleAnswersEnabled ( )

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

References $shuffleAnswersEnabled.

Referenced by saveAdditionalQuestionDataToDb(), and toJSON().

102  : bool
103  {
105  }
+ Here is the caller graph for this function:

◆ isSingleLineAnswerType()

assKprimChoice::isSingleLineAnswerType (   $answerType)

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

References $answerType, and ANSWER_TYPE_SINGLE_LINE.

500  : bool
501  {
503  }

◆ isValidAnswerType()

assKprimChoice::isValidAnswerType (   $answerType)

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

References $answerType, and getValidAnswerTypes().

Referenced by loadFromDb().

494  : bool
495  {
496  $validTypes = $this->getValidAnswerTypes();
497  return in_array($answerType, $validTypes);
498  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidOptionLabel()

assKprimChoice::isValidOptionLabel (   $optionLabel)

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

References $optionLabel, and getValidOptionLabels().

Referenced by loadFromDb().

539  : bool
540  {
541  $validLabels = $this->getValidOptionLabels();
542  return in_array($optionLabel, $validLabels);
543  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lmMigrateQuestionTypeSpecificContent()

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

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

References getAnswers(), and ilAssSelfAssessmentMigrator\migrateToLmContent().

901  : void
902  {
903  foreach ($this->getAnswers() as $answer) {
904  /* @var ilAssKprimChoiceAnswer $answer */
905  $answer->setAnswertext($migrator->migrateToLmContent($answer->getAnswertext()));
906  }
907  }
+ Here is the call graph for this function:

◆ loadAnswerData()

assKprimChoice::loadAnswerData (   $questionId)
private

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

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

Referenced by loadFromDb().

282  : void
283  {
284  global $DIC;
285  $ilDB = $DIC['ilDB'];
286 
287  $res = $this->db->queryF(
288  "SELECT * FROM {$this->getAnswerTableName()} WHERE question_fi = %s ORDER BY position ASC",
289  ['integer'],
290  [$questionId]
291  );
292 
293  while ($data = $ilDB->fetchAssoc($res)) {
294  $answer = new ilAssKprimChoiceAnswer();
295 
296  $answer->setPosition($data['position']);
297 
298  $answer->setAnswertext(ilRTE::_replaceMediaObjectImageSrc($data['answertext'] ?? '', 1));
299 
300  $answer->setImageFile($data['imagefile']);
301  $answer->setThumbPrefix($this->getThumbPrefix());
302  $answer->setImageFsDir($this->getImagePath());
303  $answer->setImageWebDir($this->getImagePathWeb());
304 
305  $answer->setCorrectness($data['correctness']);
306 
307  $this->answers[$answer->getPosition()] = $answer;
308  }
309 
310  for ($i = count($this->answers); $i < self::NUM_REQUIRED_ANSWERS; $i++) {
311  $answer = new ilAssKprimChoiceAnswer();
312 
313  $answer->setPosition($i);
314 
315  $this->answers[$answer->getPosition()] = $answer;
316  }
317  }
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...
$res
Definition: ltiservices.php:69
getImagePathWeb()
Returns the web image path for web accessable images of a question.
global $DIC
Definition: feed.php:28
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadFromDb()

assKprimChoice::loadFromDb (   $questionId)

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

References $data, Vendor\Package\$e, $res, ilRTE\_replaceMediaObjectImageSrc(), assQuestion\buildQuestionDataQuery(), ilAssQuestionLifecycle\getDraftInstance(), ilAssQuestionLifecycle\getInstance(), 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().

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

◆ moveAnswerDown()

assKprimChoice::moveAnswerDown (   $position)

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

1015  : bool
1016  {
1017  if ($position < 0 || $position >= (self::NUM_REQUIRED_ANSWERS - 1)) {
1018  return false;
1019  }
1020 
1021  for ($i = 0, $max = count($this->answers); $i < $max; $i++) {
1022  if ($i == $position) {
1023  $movingAnswer = $this->answers[$i];
1024  $targetAnswer = $this->answers[ $i + 1 ];
1025 
1026  $movingAnswer->setPosition($position + 1);
1027  $targetAnswer->setPosition($position);
1028 
1029  $this->answers[ $i + 1 ] = $movingAnswer;
1030  $this->answers[$i] = $targetAnswer;
1031  }
1032  }
1033  return true;
1034  }

◆ moveAnswerUp()

assKprimChoice::moveAnswerUp (   $position)

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

1036  : bool
1037  {
1038  if ($position <= 0 || $position > (self::NUM_REQUIRED_ANSWERS - 1)) {
1039  return false;
1040  }
1041 
1042  for ($i = 0, $max = count($this->answers); $i < $max; $i++) {
1043  if ($i == $position) {
1044  $movingAnswer = $this->answers[$i];
1045  $targetAnswer = $this->answers[ $i - 1 ];
1046 
1047  $movingAnswer->setPosition($position - 1);
1048  $targetAnswer->setPosition($position);
1049 
1050  $this->answers[ $i - 1 ] = $movingAnswer;
1051  $this->answers[$i] = $targetAnswer;
1052  }
1053  }
1054 
1055  return true;
1056  }

◆ removeAnswerImage()

assKprimChoice::removeAnswerImage (   $position)

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

References ilFileUtils\delDir(), and getAnswer().

636  : void
637  {
638  $answer = $this->getAnswer($position);
639 
640  if (file_exists($answer->getImageFsPath())) {
641  ilFileUtils::delDir($answer->getImageFsPath());
642  }
643 
644  if (file_exists($answer->getThumbFsPath())) {
645  ilFileUtils::delDir($answer->getThumbFsPath());
646  }
647 
648  $answer->setImageFile(null);
649  }
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:

◆ saveAdditionalQuestionDataToDb()

assKprimChoice::saveAdditionalQuestionDataToDb ( )

Saves a record to the question types additional data table.

Returns
mixed

Implements ilObjQuestionScoringAdjustable.

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

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

Referenced by saveToDb().

334  {
335  $this->db->replace(
336  $this->getAdditionalTableName(),
337  [
338  'question_fi' => ['integer', $this->getId()]
339  ],
340  [
341  'shuffle_answers' => ['integer', (int) $this->isShuffleAnswersEnabled()],
342  'answer_type' => ['text', $this->getAnswerType()],
343  'thumb_size' => ['integer', $this->getThumbSize()],
344  'opt_label' => ['text', $this->getOptionLabel()],
345  'custom_true' => ['text', $this->getCustomTrueOptionLabel()],
346  'custom_false' => ['text', $this->getCustomFalseOptionLabel()],
347  'score_partsol' => ['integer', (int) $this->isScorePartialSolutionEnabled()],
348  'feedback_setting' => ['integer', $this->getSpecificFeedbackSetting()]
349  ]
350  );
351  }
+ 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 353 of file class.assKprimChoice.php.

References getAnswers(), getAnswerTableName(), assQuestion\getId(), and ILIAS\Repository\int().

Referenced by saveToDb().

354  {
355  foreach ($this->getAnswers() as $answer) {
356  $this->db->replace(
357  $this->getAnswerTableName(),
358  [
359  'question_fi' => ['integer', $this->getId()],
360  'position' => ['integer', (int) $answer->getPosition()]
361  ],
362  [
363  'answertext' => ['text', $answer->getAnswertext()],
364  'imagefile' => ['text', $answer->getImageFile()],
365  'correctness' => ['integer', (int) $answer->getCorrectness()]
366  ]
367  );
368  }
369  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveToDb()

assKprimChoice::saveToDb (   $originalId = '')

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

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

319  : void
320  {
321  if ($originalId == '') {
322  $this->saveQuestionDataToDb();
323  } else {
324  $this->saveQuestionDataToDb($originalId);
325  }
326 
329 
330  parent::saveToDb($originalId);
331  }
saveAnswerSpecificDataToDb()
Saves the answer specific records into a question types answer table.
saveQuestionDataToDb(int $original_id=-1)
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
+ Here is the call graph for this function:

◆ setAnswers()

assKprimChoice::setAnswers (   $answers)

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

References $answers, and assQuestion\getHtmlQuestionContentPurifier().

177  : void
178  {
179  if (is_null($answers)) {
180  return;
181  }
182  $clean_answer_text = function (ilAssKprimChoiceAnswer $answer) {
183  $answer->setAnswertext(
184  $this->getHtmlQuestionContentPurifier()->purify($answer->getAnswertext())
185  );
186  return $answer;
187  };
188  $this->answers = array_map($clean_answer_text, $answers);
189  }
+ Here is the call graph for this function:

◆ setAnswerType()

assKprimChoice::setAnswerType (   $answerType)

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

References $answerType.

Referenced by loadFromDb().

107  : void
108  {
109  $this->answerType = $answerType;
110  }
+ Here is the caller graph for this function:

◆ setCustomFalseOptionLabel()

assKprimChoice::setCustomFalseOptionLabel (   $customFalseOptionLabel)

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

References $customFalseOptionLabel.

Referenced by loadFromDb().

157  : void
158  {
159  $this->customFalseOptionLabel = $customFalseOptionLabel;
160  }
+ Here is the caller graph for this function:

◆ setCustomTrueOptionLabel()

assKprimChoice::setCustomTrueOptionLabel (   $customTrueOptionLabel)

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

References $customTrueOptionLabel.

Referenced by loadFromDb().

147  : void
148  {
149  $this->customTrueOptionLabel = $customTrueOptionLabel;
150  }
+ Here is the caller graph for this function:

◆ setExportDetailsXLSX()

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

{}

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

References assQuestion\$id, getAnswers(), ilExcel\getColumnCoord(), assQuestion\getSolutionValues(), ilExcel\setBold(), and ilAssExcelFormatHelper\setCell().

991  : int
992  {
993  parent::setExportDetailsXLSX($worksheet, $startrow, $col, $active_id, $pass);
994 
995  $solution = $this->getSolutionValues($active_id, $pass);
996 
997  $i = 1;
998  foreach ($this->getAnswers() as $id => $answer) {
999  $worksheet->setCell($startrow + $i, $col, $answer->getAnswertext());
1000  $worksheet->setBold($worksheet->getColumnCoord($col) . ($startrow + $i));
1001  $correctness = false;
1002  foreach ($solution as $solutionvalue) {
1003  if ($id == $solutionvalue['value1']) {
1004  $correctness = $solutionvalue['value2'];
1005  break;
1006  }
1007  }
1008  $worksheet->setCell($startrow + $i, $col + 2, $correctness);
1009  $i++;
1010  }
1011 
1012  return $startrow + $i + 1;
1013  }
getSolutionValues($active_id, $pass=null, bool $authorized=true)
Loads solutions of a given user from the database an returns it.
getColumnCoord(int $a_col)
Get column "name" from number.
setCell($a_row, $a_col, $a_value, $datatype=null)
setBold(string $a_coords)
Set cell(s) to bold.
+ Here is the call graph for this function:

◆ setOptionLabel()

assKprimChoice::setOptionLabel (   $optionLabel)

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

References $optionLabel.

Referenced by loadFromDb().

137  : void
138  {
139  $this->optionLabel = $optionLabel;
140  }
+ Here is the caller graph for this function:

◆ setScorePartialSolutionEnabled()

assKprimChoice::setScorePartialSolutionEnabled (   $scorePartialSolutionEnabled)

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

References $scorePartialSolutionEnabled.

Referenced by loadFromDb().

127  : void
128  {
129  $this->scorePartialSolutionEnabled = $scorePartialSolutionEnabled;
130  }
+ Here is the caller graph for this function:

◆ setShuffleAnswersEnabled()

assKprimChoice::setShuffleAnswersEnabled (   $shuffleAnswersEnabled)

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

References $shuffleAnswersEnabled.

Referenced by loadFromDb().

97  : void
98  {
99  $this->shuffleAnswersEnabled = $shuffleAnswersEnabled;
100  }
+ Here is the caller graph for this function:

◆ setSpecificFeedbackSetting()

assKprimChoice::setSpecificFeedbackSetting (   $specificFeedbackSetting)

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

References $specificFeedbackSetting.

Referenced by loadFromDb().

167  : void
168  {
169  $this->specificFeedbackSetting = $specificFeedbackSetting;
170  }
+ Here is the caller graph for this function:

◆ setThumbSize()

assKprimChoice::setThumbSize ( int  $thumbSize)

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

References $thumbSize.

Referenced by loadFromDb().

117  : void
118  {
119  $this->thumbSize = $thumbSize;
120  }
+ Here is the caller graph for this function:

◆ toJSON()

assKprimChoice::toJSON ( )

Returns a JSON representation of the question.

Implements ilAssQuestionLMExportable.

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

References $answers, ILIAS\LTI\ToolProvider\$key, ilObjMediaObject\_getMobsOfObject(), assQuestion\formatSAQuestion(), getAnswers(), getFalseOptionLabelTranslation(), assQuestion\getId(), assQuestion\getImagePathWeb(), getInstructionTextTranslation(), assQuestion\getNrOfTries(), getNumAllowedFailures(), getOptionLabel(), assQuestion\getQuestion(), getQuestionType(), getThumbSize(), assQuestion\getTitleForHTMLOutput(), getTrueOptionLabelTranslation(), ILIAS\Repository\int(), isShuffleAnswersEnabled(), and ILIAS\Repository\lng().

912  : string
913  {
914  $this->lng->loadLanguageModule('assessment');
915 
916  $result = [];
917  $result['id'] = $this->getId();
918  $result['type'] = $this->getQuestionType();
919  $result['title'] = $this->getTitleForHTMLOutput();
920  $result['question'] = $this->formatSAQuestion($this->getQuestion());
921  $result['instruction'] = $this->getInstructionTextTranslation(
922  $this->lng,
923  $this->getOptionLabel()
924  );
925  $result['nr_of_tries'] = $this->getNrOfTries();
926  $result['shuffle'] = $this->isShuffleAnswersEnabled();
927  $result['feedback'] = [
928  'onenotcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), false)),
929  'allcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), true))
930  ];
931 
932  $result['trueOptionLabel'] = $this->getTrueOptionLabelTranslation($this->lng, $this->getOptionLabel());
933  $result['falseOptionLabel'] = $this->getFalseOptionLabelTranslation($this->lng, $this->getOptionLabel());
934 
935  $result['num_allowed_failures'] = $this->getNumAllowedFailures();
936 
937  $answers = [];
938  $has_image = false;
939 
940  foreach ($this->getAnswers() as $key => $answer) {
941  if (strlen((string) $answer->getImageFile())) {
942  $has_image = true;
943  }
944 
945  $answers[] = [
946  'answertext' => $this->formatSAQuestion($answer->getAnswertext() ?? ''),
947  'correctness' => (bool) $answer->getCorrectness(),
948  'order' => (int) $answer->getPosition(),
949  'image' => (string) $answer->getImageFile(),
950  'feedback' => $this->formatSAQuestion(
951  $this->feedbackOBJ->getSpecificAnswerFeedbackExportPresentation($this->getId(), 0, $key)
952  )
953  ];
954  }
955 
956  $result['answers'] = $answers;
957 
958  if ($has_image) {
959  $result['path'] = $this->getImagePathWeb();
960  $result['thumb'] = $this->getThumbSize();
961  }
962 
963  $mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $this->getId());
964  $result['mobs'] = $mobs;
965 
966  return json_encode($result);
967  }
getImagePathWeb()
Returns the web image path for web accessable images of a question.
getTrueOptionLabelTranslation(ilLanguage $lng, $optionLabel)
string $key
Consumer key/client ID value.
Definition: System.php:193
static _getMobsOfObject(string $a_type, int $a_id, int $a_usage_hist_nr=0, string $a_lang="-")
getFalseOptionLabelTranslation(ilLanguage $lng, $optionLabel)
getInstructionTextTranslation(ilLanguage $lng, $optionLabel)
+ Here is the call graph for this function:

Field Documentation

◆ $answers

assKprimChoice::$answers
private

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

Referenced by getAnswers(), handleFileUploads(), setAnswers(), and toJSON().

◆ $answerType

assKprimChoice::$answerType
private

◆ $customFalseOptionLabel

assKprimChoice::$customFalseOptionLabel
private

◆ $customTrueOptionLabel

assKprimChoice::$customTrueOptionLabel
private

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

Referenced by getCustomTrueOptionLabel(), and setCustomTrueOptionLabel().

◆ $optionLabel

◆ $scorePartialSolutionEnabled

assKprimChoice::$scorePartialSolutionEnabled
private

◆ $shuffleAnswersEnabled

assKprimChoice::$shuffleAnswersEnabled
private

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

Referenced by isShuffleAnswersEnabled(), and setShuffleAnswersEnabled().

◆ $specificFeedbackSetting

assKprimChoice::$specificFeedbackSetting
private

◆ $thumbSize

assKprimChoice::$thumbSize
private

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

Referenced by getThumbSize(), and setThumbSize().

◆ ANSWER_TYPE_MULTI_LINE

const assKprimChoice::ANSWER_TYPE_MULTI_LINE = 'multiLine'

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

Referenced by assKprimChoiceGUI\handleAnswerTextsSubmit().

◆ ANSWER_TYPE_SINGLE_LINE

const assKprimChoice::ANSWER_TYPE_SINGLE_LINE = 'singleLine'

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

Referenced by isSingleLineAnswerType().

◆ DEFAULT_THUMB_SIZE

const assKprimChoice::DEFAULT_THUMB_SIZE = 150

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

◆ NUM_REQUIRED_ANSWERS

const assKprimChoice::NUM_REQUIRED_ANSWERS = 4

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

◆ OPTION_LABEL_ADEQUATE_OR_NOT

const assKprimChoice::OPTION_LABEL_ADEQUATE_OR_NOT = 'adequate_or_not'

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

◆ OPTION_LABEL_APPLICABLE_OR_NOT

const assKprimChoice::OPTION_LABEL_APPLICABLE_OR_NOT = 'applicable_or_not'

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

◆ OPTION_LABEL_CUSTOM

const assKprimChoice::OPTION_LABEL_CUSTOM = 'customlabel'

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

◆ OPTION_LABEL_PLUS_MINUS

const assKprimChoice::OPTION_LABEL_PLUS_MINUS = 'plus_minus'

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

◆ OPTION_LABEL_RIGHT_WRONG

const assKprimChoice::OPTION_LABEL_RIGHT_WRONG = 'right_wrong'

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

◆ PARTIAL_SCORING_NUM_CORRECT_ANSWERS

const assKprimChoice::PARTIAL_SCORING_NUM_CORRECT_ANSWERS = 3

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

◆ THUMB_PREFIX

const assKprimChoice::THUMB_PREFIX = 'thumb.'

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


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