ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
|
Class for cloze tests. More...
Public Member Functions | |
__construct (string $title="", string $comment="", string $author="", int $owner=-1, string $question="") | |
isComplete () | |
Returns TRUE, if a cloze test is complete for use. More... | |
cleanQuestiontext ($text) | |
Cleans cloze question text to remove attributes or tags from older ILIAS versions. More... | |
replaceFirstGap (string $gaptext, string $content) | |
loadFromDb (int $question_id) | |
saveToDb (?int $original_id=null) | |
saveAnswerSpecificDataToDb () | |
Saves the answer specific records into a question types answer table. More... | |
saveAdditionalQuestionDataToDb () | |
Saves a record to the question types additional data table. More... | |
getGaps () | |
flushGaps () | |
setClozeText (string $cloze_text='') | |
setClozeTextValue ($cloze_text="") | |
getClozeText () | |
Returns the cloze text. More... | |
getClozeTextForHTMLOutput () | |
Returns the cloze text as HTML (with optional nl2br) Fix for Mantis 29987: We assume Tiny embeds any text in tags, so if no tags are present, we derive it's non-HTML content and apply nl2br. More... | |
getStartTag () | |
Returns the start tag of a cloze gap. More... | |
setStartTag ($start_tag="[gap]") | |
Sets the start tag of a cloze gap. More... | |
getEndTag () | |
Returns the end tag of a cloze gap. More... | |
setEndTag ($end_tag="[/gap]") | |
Sets the end tag of a cloze gap. More... | |
getFeedbackMode () | |
setFeedbackMode ($feedbackMode) | |
createGapsFromQuestiontext () | |
Create gap entries by parsing the question text. More... | |
setGapType ($gap_index, $gap_type) | |
Set the type of a gap with a given index. More... | |
setGapShuffle ($gap_index=0, $shuffle=1) | |
Sets the shuffle state of a gap with a given index. More... | |
clearGapAnswers () | |
Removes all answers from the gaps. More... | |
getGapCount () | |
Returns the number of gaps. More... | |
addGapAnswer ($gap_index, $order, $answer) | |
Sets the answer text of a gap with a given index. More... | |
getGap (int $gap_index=0) | |
setGapSize ($gap_index, $size) | |
setGapAnswerPoints ($gap_index, $order, $points) | |
Sets the points of a gap with a given index and an answer with a given order. More... | |
addGapText ($gap_index) | |
Adds a new answer text value to a text gap with a given index. More... | |
addGapAtIndex ($gap, $index) | |
Adds a ClozeGap object at a given index. More... | |
setGapAnswerLowerBound ($gap_index, $order, $bound) | |
Sets the lower bound of a gap with a given index and an answer with a given order. More... | |
setGapAnswerUpperBound ($gap_index, $order, $bound) | |
Sets the upper bound of a gap with a given index and an answer with a given order. More... | |
getMaximumPoints () | |
Returns the maximum points, a learner can reach answering the question. More... | |
cloneQuestionTypeSpecificProperties (\assQuestion $target) | |
updateClozeTextFromGaps () | |
Updates the gap parameters in the cloze text from the form input. More... | |
deleteAnswerText ($gap_index, $answer_index) | |
Deletes the answer text of a gap with a given index and an answer with a given order. More... | |
deleteGap ($gap_index) | |
Deletes a gap with a given index. More... | |
getTextgapPoints ($a_original, $a_entered, $max_points) | |
Returns the points for a text gap and compares the given solution with the entered solution using the text gap rating options. More... | |
getNumericgapPoints ($a_original, $a_entered, $max_points, $lowerBound, $upperBound) | |
Returns the points for a text gap and compares the given solution with the entered solution using the text gap rating options. More... | |
checkForValidFormula (string $value) | |
calculateReachedPoints (int $active_id, ?int $pass=null, bool $authorized_solution=true) | |
getUserResultDetails (int $active_id, ?int $pass=null, bool $authorized_solution=true) | |
fetchSolutionSubmit () | |
saveWorkingData (int $active_id, ?int $pass=null, bool $authorized=true) | |
getQuestionType () | |
Returns the question type of the question. More... | |
getTextgapRating () | |
Returns the rating option for text gaps. More... | |
setTextgapRating ($a_textgap_rating) | |
Sets the rating option for text gaps. More... | |
getIdenticalScoring () | |
Returns the identical scoring status of the question. More... | |
setIdenticalScoring (bool $identical_scoring) | |
Sets the identical scoring option for cloze questions. More... | |
getAdditionalTableName () | |
Returns the name of the additional question data table in the database. More... | |
getAnswerTableName () | |
setFixedTextLength (?int $fixed_text_length) | |
Sets a fixed text length for all text fields in the cloze question. More... | |
getFixedTextLength () | |
Gets the fixed text length for all text fields in the cloze question. More... | |
getMaximumGapPoints ($gap_index) | |
Returns the maximum points for a gap. More... | |
getRTETextWithMediaObjects () | |
Collects all text in the question which could contain media objects which were created with the Rich Text Editor. More... | |
getGapCombinationsExists () | |
getGapCombinations () | |
setGapCombinationsExists ($value) | |
setGapCombinations ($value) | |
toJSON () | |
Returns a JSON representation of the question. More... | |
getOperators (string $expression) | |
Get all available operations for a specific question. More... | |
getExpressionTypes () | |
Get all available expression types for a specific question. More... | |
getUserQuestionResult (int $active_id, int $pass) | |
Get the user solution for a question by active_id and the test pass. More... | |
getAvailableAnswerOptions ($index=null) | |
If index is null, the function returns an array with all anwser options Else it returns the specific answer option. More... | |
calculateCombinationResult ($user_result) | |
calculateReachedPointsFromPreviewSession (ilAssQuestionPreviewSession $preview_session) | |
fetchAnswerValueForGap ($userSolution, $gapIndex) | |
isAddableAnswerOptionValue (int $qIndex, string $answerOptionValue) | |
addAnswerOptionValue (int $qIndex, string $answerOptionValue, float $points) | |
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) | |
![]() | |
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) | |
Returns a QTI xml representation of the question. 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 $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) | |
duplicate (bool $for_test=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) | |
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... | |
![]() | |
getOperators (string $expression) | |
Get all available operations for a specific question. More... | |
getExpressionTypes () | |
Get all available expression types for a specific question. More... | |
getUserQuestionResult (int $active_id, int $pass) | |
Get the user solution for a question by active_id and the test pass. More... | |
getAvailableAnswerOptions (?int $index=null) | |
If index is null, the function returns an array with all anwser options else it returns the specific answer option. More... | |
toJSON () | |
Data Fields | |
array | $gaps = [] |
string | $textgap_rating = assClozeGap::TEXTGAP_RATING_CASEINSENSITIVE |
The rating option for text gaps. More... | |
ilAssQuestionFeedback | $feedbackOBJ |
![]() | |
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 = ':' |
![]() | |
const | StringResultExpression = '~TEXT~' |
const | PercentageResultExpression = '%n%' |
const | NumericResultExpression = '#n#' |
const | MatchingResultExpression = ';n:m;' |
const | OrderingResultExpression = '$n,m,o,p$' |
const | NumberOfResultExpression = '+n+' |
const | ExclusiveResultExpression = '*n,m,o,p*' |
const | EmptyAnswerExpression = "?" |
Protected Member Functions | |
saveClozeGapItemsToDb (assClozeGap $gap, int $key) | |
saveClozeTextGapRecordToDb (int $next_id, int $key, assAnswerCloze $item, assClozeGap $gap) | |
saveClozeSelectGapRecordToDb (int $next_id, int $key, assAnswerCloze $item, assClozeGap $gap) | |
saveClozeNumericGapRecordToDb (int $next_id, int $key, assAnswerCloze $item, assClozeGap $gap) | |
isValidNumericSubmitValue ($submittedValue) | |
getSolutionSubmit () | |
lmMigrateQuestionTypeSpecificContent (ilAssSelfAssessmentMigrator $migrator) | |
calculateReachedPointsForSolution (?array $user_result, array &$detailed=[]) | |
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... | |
![]() | |
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 | |
fetchUserResult (int $active_id, ?int $pass) | |
Private Attributes | |
string | $start_tag = '[gap]' |
string | $end_tag = '[/gap]' |
RandomGroup | $randomGroup |
Additional Inherited Members | |
![]() | |
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 | getNumExistingSolutionRecords (int $activeId, int $pass, int $questionId) |
![]() | |
static | $force_pass_results_update_enabled = false |
static | $imageSourceFixReplaceMap |
assClozeTest::__construct | ( | string | $title = "" , |
string | $comment = "" , |
||
string | $author = "" , |
||
int | $owner = -1 , |
||
string | $question = "" |
||
) |
Definition at line 82 of file class.assClozeTest.php.
References assQuestion\$author, assQuestion\$comment, $DIC, assQuestion\$owner, assQuestion\$question, assQuestion\$title, ILIAS\GlobalScreen\Provider\__construct(), and assQuestion\setQuestion().
assClozeTest::addAnswerOptionValue | ( | int | $qIndex, |
string | $answerOptionValue, | ||
float | $points | ||
) |
Reimplemented from assQuestion.
Definition at line 1614 of file class.assClozeTest.php.
References assClozeGap\addItem(), assClozeGap\getItemCount(), and ASS_AnswerSimple\setOrder().
assClozeTest::addGapAnswer | ( | $gap_index, | |
$order, | |||
$answer | |||
) |
Sets the answer text of a gap with a given index.
The index of the first gap is 0, the index of the second gap is 1 and so on.
integer | $gap_index | A nonnegative index of the n-th gap |
integer | $order | The order of the answer text |
string | $answer | The answer text @access public |
Definition at line 626 of file class.assClozeTest.php.
References assClozeGap\TYPE_NUMERIC.
assClozeTest::addGapAtIndex | ( | $gap, | |
$index | |||
) |
Adds a ClozeGap object at a given index.
object | $gap | The gap object |
integer | $index | A nonnegative index of the n-th gap @access public |
Definition at line 697 of file class.assClozeTest.php.
assClozeTest::addGapText | ( | $gap_index | ) |
Adds a new answer text value to a text gap with a given index.
The index of the first gap is 0, the index of the second gap is 1 and so on.
integer | $gap_index | A nonnegative index of the n-th gap @access public |
Definition at line 677 of file class.assClozeTest.php.
assClozeTest::calculateCombinationResult | ( | $user_result | ) |
Definition at line 1399 of file class.assClozeTest.php.
References ILIAS\Survey\Mode\getId(), assClozeGap\TYPE_NUMERIC, assClozeGap\TYPE_SELECT, and assClozeGap\TYPE_TEXT.
assClozeTest::calculateReachedPoints | ( | int | $active_id, |
?int | $pass = null , |
||
bool | $authorized_solution = true |
||
) |
Reimplemented from assQuestion.
Definition at line 968 of file class.assClozeTest.php.
|
protected |
array | $user_result | |
array | $detailed |
Definition at line 1471 of file class.assClozeTest.php.
References true, assClozeGap\TYPE_NUMERIC, assClozeGap\TYPE_SELECT, and assClozeGap\TYPE_TEXT.
assClozeTest::calculateReachedPointsFromPreviewSession | ( | ilAssQuestionPreviewSession | $preview_session | ) |
Reimplemented from assQuestion.
Definition at line 1564 of file class.assClozeTest.php.
References ilAssQuestionPreviewSession\getParticipantsSolution().
assClozeTest::checkForValidFormula | ( | string | $value | ) |
Definition at line 963 of file class.assClozeTest.php.
assClozeTest::cleanQuestiontext | ( | $text | ) |
Cleans cloze question text to remove attributes or tags from older ILIAS versions.
string | $text | The cloze question text |
Definition at line 119 of file class.assClozeTest.php.
assClozeTest::clearGapAnswers | ( | ) |
Removes all answers from the gaps.
@access public
Definition at line 593 of file class.assClozeTest.php.
assClozeTest::cloneQuestionTypeSpecificProperties | ( | \assQuestion | $target | ) |
Definition at line 784 of file class.assClozeTest.php.
References assQuestion\getId().
assClozeTest::createGapsFromQuestiontext | ( | ) |
Create gap entries by parsing the question text.
@access public
Definition at line 540 of file class.assClozeTest.php.
References assClozeGap\addItem(), and assClozeGap\TYPE_TEXT.
assClozeTest::deleteAnswerText | ( | $gap_index, | |
$answer_index | |||
) |
Deletes the answer text of a gap with a given index and an answer with a given order.
The index of the first gap is 0, the index of the second gap is 1 and so on.
integer | $gap_index | A nonnegative index of the n-th gap |
integer | $answer_index | The order of the answer text @access public |
Definition at line 828 of file class.assClozeTest.php.
assClozeTest::deleteGap | ( | $gap_index | ) |
Deletes a gap with a given index.
The index of the first gap is 0, the index of the second gap is 1 and so on.
integer | $gap_index | A nonnegative index of the n-th gap @access public |
Definition at line 850 of file class.assClozeTest.php.
References assClozeGap\getItemsRaw().
assClozeTest::fetchAnswerValueForGap | ( | $userSolution, | |
$gapIndex | |||
) |
Definition at line 1583 of file class.assClozeTest.php.
assClozeTest::fetchSolutionSubmit | ( | ) |
Definition at line 1025 of file class.assClozeTest.php.
References assClozeGap\getType(), assClozeGap\TYPE_NUMERIC, and assClozeGap\TYPE_SELECT.
|
private |
Definition at line 988 of file class.assClozeTest.php.
assClozeTest::flushGaps | ( | ) |
Definition at line 413 of file class.assClozeTest.php.
assClozeTest::getAdditionalTableName | ( | ) |
Returns the name of the additional question data table in the database.
Reimplemented from assQuestion.
Definition at line 1171 of file class.assClozeTest.php.
assClozeTest::getAnswerTableName | ( | ) |
Reimplemented from assQuestion.
Definition at line 1176 of file class.assClozeTest.php.
assClozeTest::getAvailableAnswerOptions | ( | $index = null | ) |
If index is null, the function returns an array with all anwser options Else it returns the specific answer option.
null | int | $index |
Definition at line 1390 of file class.assClozeTest.php.
assClozeTest::getClozeText | ( | ) |
Returns the cloze text.
Definition at line 437 of file class.assClozeTest.php.
Referenced by isComplete().
assClozeTest::getClozeTextForHTMLOutput | ( | ) |
Returns the cloze text as HTML (with optional nl2br) Fix for Mantis 29987: We assume Tiny embeds any text in tags, so if no tags are present, we derive it's non-HTML content and apply nl2br.
Definition at line 450 of file class.assClozeTest.php.
References ilLegacyFormElementsUtil\prepareTextareaOutput().
assClozeTest::getCorrectSolutionForTextOutput | ( | int | $active_id, |
int | $pass | ||
) |
Reimplemented from assQuestion.
Definition at line 1712 of file class.assClozeTest.php.
References assClozeGap\getBestSolutionIndexes(), assClozeGap\getItem(), and ILIAS\Repository\lng().
assClozeTest::getEndTag | ( | ) |
Returns the end tag of a cloze gap.
Definition at line 501 of file class.assClozeTest.php.
assClozeTest::getExpressionTypes | ( | ) |
Get all available expression types for a specific question.
Implements iQuestionCondition.
Definition at line 1323 of file class.assClozeTest.php.
References iQuestionCondition\EmptyAnswerExpression, iQuestionCondition\NumberOfResultExpression, iQuestionCondition\NumericResultExpression, iQuestionCondition\PercentageResultExpression, and iQuestionCondition\StringResultExpression.
assClozeTest::getFeedbackMode | ( | ) |
assClozeTest::getFixedTextLength | ( | ) |
Gets the fixed text length for all text fields in the cloze question.
Definition at line 1198 of file class.assClozeTest.php.
assClozeTest::getGap | ( | int | $gap_index = 0 | ) |
Definition at line 637 of file class.assClozeTest.php.
assClozeTest::getGapCombinations | ( | ) |
Definition at line 1240 of file class.assClozeTest.php.
assClozeTest::getGapCombinationsExists | ( | ) |
Definition at line 1235 of file class.assClozeTest.php.
assClozeTest::getGapCount | ( | ) |
Returns the number of gaps.
Definition at line 607 of file class.assClozeTest.php.
assClozeTest::getGaps | ( | ) |
Definition at line 408 of file class.assClozeTest.php.
Referenced by isComplete().
assClozeTest::getIdenticalScoring | ( | ) |
Returns the identical scoring status of the question.
Definition at line 1148 of file class.assClozeTest.php.
assClozeTest::getMaximumGapPoints | ( | $gap_index | ) |
Returns the maximum points for a gap.
integer | $gap_index | The index of the gap |
Definition at line 1211 of file class.assClozeTest.php.
References assClozeGap\getItems().
assClozeTest::getMaximumPoints | ( | ) |
Returns the maximum points, a learner can reach answering the question.
@access public
Reimplemented from assQuestion.
Definition at line 742 of file class.assClozeTest.php.
References ILIAS\Survey\Mode\getId(), assClozeGap\getItems(), assClozeGap\getType(), assClozeGap\TYPE_NUMERIC, assClozeGap\TYPE_SELECT, and assClozeGap\TYPE_TEXT.
Referenced by isComplete().
assClozeTest::getNumericgapPoints | ( | $a_original, | |
$a_entered, | |||
$max_points, | |||
$lowerBound, | |||
$upperBound | |||
) |
Returns the points for a text gap and compares the given solution with the entered solution using the text gap rating options.
string | $a_original | The original (correct) text |
string | $a_entered | The text entered by the user |
float | $max_points | The maximum number of points for the solution @access public |
Definition at line 937 of file class.assClozeTest.php.
assClozeTest::getOperators | ( | string | $expression | ) |
Get all available operations for a specific question.
$expression |
Implements iQuestionCondition.
Definition at line 1318 of file class.assClozeTest.php.
References ilOperatorsExpressionMapping\getOperatorsByExpression().
assClozeTest::getQuestionType | ( | ) |
Returns the question type of the question.
Reimplemented from assQuestion.
Definition at line 1099 of file class.assClozeTest.php.
assClozeTest::getRTETextWithMediaObjects | ( | ) |
Collects all text in the question which could contain media objects which were created with the Rich Text Editor.
Reimplemented from assQuestion.
Definition at line 1231 of file class.assClozeTest.php.
|
protected |
Definition at line 1058 of file class.assClozeTest.php.
assClozeTest::getStartTag | ( | ) |
Returns the start tag of a cloze gap.
Definition at line 477 of file class.assClozeTest.php.
assClozeTest::getTextgapPoints | ( | $a_original, | |
$a_entered, | |||
$max_points | |||
) |
Returns the points for a text gap and compares the given solution with the entered solution using the text gap rating options.
string | $a_original | The original (correct) text |
string | $a_entered | The text entered by the user |
integer | $max_points | The maximum number of points for the solution @access public |
Definition at line 885 of file class.assClozeTest.php.
References $DIC, ILIAS\UI\examples\Layout\Page\Standard\$refinery, ilStr\strToLower(), assClozeGap\TEXTGAP_RATING_CASEINSENSITIVE, assClozeGap\TEXTGAP_RATING_CASESENSITIVE, assClozeGap\TEXTGAP_RATING_LEVENSHTEIN1, assClozeGap\TEXTGAP_RATING_LEVENSHTEIN2, assClozeGap\TEXTGAP_RATING_LEVENSHTEIN3, assClozeGap\TEXTGAP_RATING_LEVENSHTEIN4, and assClozeGap\TEXTGAP_RATING_LEVENSHTEIN5.
assClozeTest::getTextgapRating | ( | ) |
Returns the rating option for text gaps.
Definition at line 1111 of file class.assClozeTest.php.
assClozeTest::getUserQuestionResult | ( | int | $active_id, |
int | $pass | ||
) |
Get the user solution for a question by active_id and the test pass.
Implements iQuestionCondition.
Definition at line 1334 of file class.assClozeTest.php.
assClozeTest::getUserResultDetails | ( | int | $active_id, |
?int | $pass = null , |
||
bool | $authorized_solution = true |
||
) |
Definition at line 977 of file class.assClozeTest.php.
assClozeTest::isAddableAnswerOptionValue | ( | int | $qIndex, |
string | $answerOptionValue | ||
) |
Reimplemented from assQuestion.
Definition at line 1597 of file class.assClozeTest.php.
References assClozeGap\getItems(), assClozeGap\getType(), and assClozeGap\TYPE_TEXT.
assClozeTest::isComplete | ( | ) |
Returns TRUE, if a cloze test is complete for use.
Reimplemented from assQuestion.
Definition at line 100 of file class.assClozeTest.php.
References assQuestion\getAuthor(), getClozeText(), getGaps(), getMaximumPoints(), and assQuestion\getTitle().
|
protected |
Definition at line 1012 of file class.assClozeTest.php.
|
protected |
ilAssSelfAssessmentMigrator | $migrator |
Reimplemented from assQuestion.
Definition at line 1258 of file class.assClozeTest.php.
References ilAssSelfAssessmentMigrator\migrateToLmContent().
assClozeTest::loadFromDb | ( | int | $question_id | ) |
Reimplemented from assQuestion.
Definition at line 147 of file class.assClozeTest.php.
References $data, Vendor\Package\$e, ilRTE\_replaceMediaObjectImageSrc(), ilAssClozeTestFeedback\FB_MODE_GAP_QUESTION, ilAssQuestionLifecycle\getDraftInstance(), ilAssQuestionLifecycle\getInstance(), assClozeGap\TYPE_NUMERIC, assClozeGap\TYPE_SELECT, and assClozeGap\TYPE_TEXT.
assClozeTest::replaceFirstGap | ( | string | $gaptext, |
string | $content | ||
) |
Definition at line 134 of file class.assClozeTest.php.
assClozeTest::saveAdditionalQuestionDataToDb | ( | ) |
Saves a record to the question types additional data table.
Implements ilObjQuestionScoringAdjustable.
Definition at line 268 of file class.assClozeTest.php.
References ilRTE\_replaceMediaObjectImageSrc(), and ILIAS\Survey\Mode\getId().
assClozeTest::saveAnswerSpecificDataToDb | ( | ) |
Saves the answer specific records into a question types answer table.
Implements ilObjAnswerScoringAdjustable.
Definition at line 255 of file class.assClozeTest.php.
References ILIAS\Survey\Mode\getId().
|
protected |
Definition at line 285 of file class.assClozeTest.php.
References assClozeGap\getType(), assClozeGap\TYPE_NUMERIC, assClozeGap\TYPE_SELECT, and assClozeGap\TYPE_TEXT.
|
protected |
Definition at line 367 of file class.assClozeTest.php.
|
protected |
Definition at line 336 of file class.assClozeTest.php.
|
protected |
Definition at line 305 of file class.assClozeTest.php.
assClozeTest::saveToDb | ( | ?int | $original_id = null | ) |
Reimplemented from assQuestion.
Definition at line 246 of file class.assClozeTest.php.
assClozeTest::saveWorkingData | ( | int | $active_id, |
?int | $pass = null , |
||
bool | $authorized = true |
||
) |
Reimplemented from assQuestion.
Definition at line 1063 of file class.assClozeTest.php.
References ilObjTest\_getPass().
assClozeTest::setClozeText | ( | string | $cloze_text = '' | ) |
Definition at line 418 of file class.assClozeTest.php.
assClozeTest::setClozeTextValue | ( | $cloze_text = "" | ) |
Definition at line 425 of file class.assClozeTest.php.
assClozeTest::setEndTag | ( | $end_tag = "[/gap]" | ) |
Sets the end tag of a cloze gap.
string | $end_tag | The end tag for a cloze gap @access public |
Definition at line 513 of file class.assClozeTest.php.
assClozeTest::setFeedbackMode | ( | $feedbackMode | ) |
string | $feedbackMode |
Definition at line 529 of file class.assClozeTest.php.
assClozeTest::setFixedTextLength | ( | ?int | $fixed_text_length | ) |
Sets a fixed text length for all text fields in the cloze question.
integer | $a_text_len | The text field length @access public |
Definition at line 1187 of file class.assClozeTest.php.
assClozeTest::setGapAnswerLowerBound | ( | $gap_index, | |
$order, | |||
$bound | |||
) |
Sets the lower bound of a gap with a given index and an answer with a given order.
The index of the first gap is 0, the index of the second gap is 1 and so on.
integer | $gap_index | A nonnegative index of the n-th gap |
integer | $order | The order of the answer text |
string | $answer | The lower bound of the answer @access public |
Definition at line 712 of file class.assClozeTest.php.
assClozeTest::setGapAnswerPoints | ( | $gap_index, | |
$order, | |||
$points | |||
) |
Sets the points of a gap with a given index and an answer with a given order.
The index of the first gap is 0, the index of the second gap is 1 and so on.
integer | $gap_index | A nonnegative index of the n-th gap |
integer | $order | The order of the answer text |
string | $answer | The points of the answer @access public |
Definition at line 662 of file class.assClozeTest.php.
assClozeTest::setGapAnswerUpperBound | ( | $gap_index, | |
$order, | |||
$bound | |||
) |
Sets the upper bound of a gap with a given index and an answer with a given order.
The index of the first gap is 0, the index of the second gap is 1 and so on.
integer | $gap_index | A nonnegative index of the n-th gap |
integer | $order | The order of the answer text |
string | $answer | The upper bound of the answer @access public |
Definition at line 729 of file class.assClozeTest.php.
assClozeTest::setGapCombinations | ( | $value | ) |
Definition at line 1250 of file class.assClozeTest.php.
assClozeTest::setGapCombinationsExists | ( | $value | ) |
Definition at line 1245 of file class.assClozeTest.php.
assClozeTest::setGapShuffle | ( | $gap_index = 0 , |
|
$shuffle = 1 |
|||
) |
Sets the shuffle state of a gap with a given index.
The index of the first gap is 0, the index of the second gap is 1 and so on.
integer | $index | A nonnegative index of the n-th gap |
integer | $shuffle | Turn shuffle on (=1) or off (=0) @access public |
Definition at line 580 of file class.assClozeTest.php.
assClozeTest::setGapSize | ( | $gap_index, | |
$size | |||
) |
Definition at line 645 of file class.assClozeTest.php.
assClozeTest::setGapType | ( | $gap_index, | |
$gap_type | |||
) |
Set the type of a gap with a given index.
@access private
Definition at line 564 of file class.assClozeTest.php.
assClozeTest::setIdenticalScoring | ( | bool | $identical_scoring | ) |
Sets the identical scoring option for cloze questions.
boolean | $a_identical_scoring | The identical scoring option for cloze questions |
Definition at line 1160 of file class.assClozeTest.php.
assClozeTest::setStartTag | ( | $start_tag = "[gap]" | ) |
Sets the start tag of a cloze gap.
string | $start_tag | The start tag for a cloze gap @access public |
Definition at line 489 of file class.assClozeTest.php.
assClozeTest::setTextgapRating | ( | $a_textgap_rating | ) |
Sets the rating option for text gaps.
string | $a_textgap_rating | The rating option for text gaps |
Definition at line 1123 of file class.assClozeTest.php.
References assClozeGap\TEXTGAP_RATING_CASEINSENSITIVE, assClozeGap\TEXTGAP_RATING_CASESENSITIVE, assClozeGap\TEXTGAP_RATING_LEVENSHTEIN1, assClozeGap\TEXTGAP_RATING_LEVENSHTEIN2, assClozeGap\TEXTGAP_RATING_LEVENSHTEIN3, assClozeGap\TEXTGAP_RATING_LEVENSHTEIN4, and assClozeGap\TEXTGAP_RATING_LEVENSHTEIN5.
|
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 1668 of file class.assClozeTest.php.
References assClozeGap\getItem(), assClozeGap\getType(), and assClozeGap\TYPE_SELECT.
assClozeTest::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 1690 of file class.assClozeTest.php.
References assClozeGap\getItem(), assClozeGap\getType(), ILIAS\Repository\lng(), and assClozeGap\TYPE_SELECT.
assClozeTest::toJSON | ( | ) |
Returns a JSON representation of the question.
Reimplemented from assQuestion.
Definition at line 1269 of file class.assClozeTest.php.
References ilObjMediaObject\_getMobsOfObject(), assClozeGap\getGapSize(), ILIAS\Survey\Mode\getId(), assClozeGap\getItems(), assClozeGap\getShuffle(), assClozeGap\getType(), assClozeGap\TYPE_NUMERIC, and assClozeGap\TYPE_TEXT.
assClozeTest::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 1624 of file class.assClozeTest.php.
References assClozeGap\getGapSize(), assClozeGap\getItems(), assClozeGap\getShuffle(), ILIAS\Test\Logging\AdditionalInformationGenerator\getTrueFalseTagForBool(), assClozeGap\getType(), and assClozeGap\TYPE_NUMERIC.
assClozeTest::updateClozeTextFromGaps | ( | ) |
Updates the gap parameters in the cloze text from the form input.
@access private
Definition at line 803 of file class.assClozeTest.php.
References assClozeGap\getItemsRaw(), and ilLegacyFormElementsUtil\prepareTextareaOutput().
|
protected |
Definition at line 77 of file class.assClozeTest.php.
|
private |
Definition at line 56 of file class.assClozeTest.php.
|
protected |
Definition at line 79 of file class.assClozeTest.php.
ilAssQuestionFeedback assClozeTest::$feedbackOBJ |
Definition at line 78 of file class.assClozeTest.php.
|
protected |
Definition at line 76 of file class.assClozeTest.php.
|
protected |
Definition at line 53 of file class.assClozeTest.php.
|
protected |
Definition at line 54 of file class.assClozeTest.php.
array assClozeTest::$gaps = [] |
Definition at line 44 of file class.assClozeTest.php.
|
protected |
Defines the scoring for "identical solutions".
If the learner selects the same solution twice or more in different gaps, only the first choice will be scored if identical_scoring is 0.
Definition at line 75 of file class.assClozeTest.php.
|
private |
Definition at line 80 of file class.assClozeTest.php.
|
private |
Definition at line 55 of file class.assClozeTest.php.
string assClozeTest::$textgap_rating = assClozeGap::TEXTGAP_RATING_CASEINSENSITIVE |
The rating option for text gaps.
This could contain one of the following options:
Definition at line 66 of file class.assClozeTest.php.