ILIAS  release_7 Revision v7.30-3-g800a261c036
assLongMenu Class Reference
+ Inheritance diagram for assLongMenu:
+ Collaboration diagram for assLongMenu:

Public Member Functions

 __construct ( $title="", $comment="", $author="", $owner=-1, $question="")
 
 getAnswerType ()
 
 setAnswerType ($answerType)
 
 getCorrectAnswers ()
 
 setCorrectAnswers ($correct_answers)
 
 getAnswerTableName ()
 Returns the name of the answer table in the database. More...
 
 setLongMenuTextValue ($long_menu_text="")
 
 getLongMenuTextValue ()
 
 setAnswers ($answers)
 
 getAnswers ()
 
 getJsonStructure ()
 
 setJsonStructure ($json_structure)
 
 setSpecificFeedbackSetting ($specificFeedbackSetting)
 
 getSpecificFeedbackSetting ()
 
 setMinAutoComplete ($minAutoComplete)
 
 getMinAutoComplete ()
 
 isComplete ()
 Returns true, if a question is complete for use. More...
 
 saveToDb ($original_id="")
 Saves the question to the database. More...
 
 checkQuestionCustomPart ($form=null)
 
 getMaximumPoints ()
 Returns the maximum points, a learner can reach answering the question. More...
 
 saveAdditionalQuestionDataToDb ()
 Saves a record to the question types additional data table. More...
 
 saveAnswerSpecificDataToDb ()
 
 loadFromDb ($question_id)
 Loads the question from the database. More...
 
 getCorrectAnswersForQuestionSolution ($question_id)
 
 getAnswersObject ()
 
 getCorrectAnswersAsJson ()
 
 duplicate ($for_test=true, $title="", $author="", $owner="", $testObjId=null)
 
 copyObject ($target_questionpool_id, $title="")
 
 createNewOriginalFromThisDuplicate ($targetParentId, $targetQuestionTitle="")
 
 calculateReachedPoints ($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
 Returns the points, a learner has reached answering the question. More...
 
 saveWorkingData ($active_id, $pass=null, $authorized=true)
 Saves the learners input of the question to the database. More...
 
 lookupForExistingSolutions ($activeId, $pass)
 Lookup if an authorized or intermediate solution exists. More...
 
 getSolutionSubmit ()
 
 getQuestionType ()
 Returns the question type of the question. More...
 
 getAdditionalTableName ()
 Returns the name of the additional question data table in the database. More...
 
 getRTETextWithMediaObjects ()
 Collects all text in the question which could contain media objects which were created with the Rich Text Editor. More...
 
 setExportDetailsXLS ($worksheet, $startrow, $active_id, $pass)
 {Creates an Excel worksheet for the detailed cumulated results of this question.
Parameters
object$worksheetReference to the parent excel worksheet
object$startrowStartrow of the output in the excel worksheet
object$active_idActive id of the participant
object$passTest pass
Returns
object
} More...
 
 getUserQuestionResult ($active_id, $pass)
 Get the user solution for a question by active_id and the test pass. More...
 
 getAvailableAnswerOptions ($index=null)
 If index is null, the function returns an array with all anwser options Else it returns the specific answer option. More...
 
 isShuffleAnswersEnabled ()
 
 clearAnswerSpecificDataFromDb ($question_id)
 
 delete ($original_id)
 Deletes a question and all materials from the database. More...
 
 toJSON ()
 Returns a JSON representation of the question. More...
 
 getIdenticalScoring ()
 
 setIdenticalScoring ($a_identical_scoring)
 
- Public Member Functions inherited from assQuestion
 getShuffler ()
 
 setShuffler (ilArrayElementShuffler $shuffler)
 
 setProcessLocker ($processLocker)
 
 getProcessLocker ()
 
 fromXML (&$item, &$questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping, array $solutionhints=[])
 Receives parameters from a QTI parser and creates a valid ILIAS question object. More...
 
 toXML ($a_include_header=true, $a_include_binary=true, $a_shuffle=false, $test_output=false, $force_image_references=false)
 Returns a QTI xml representation of the question. More...
 
 isComplete ()
 Returns true, if a question is complete for use. More...
 
 questionTitleExists ($questionpool_id, $title)
 Returns TRUE if the question title exists in the database. More...
 
 setTitle ($title="")
 Sets the title string of the assQuestion object. More...
 
 setId ($id=-1)
 Sets the id of the assQuestion object. More...
 
 setTestId ($id=-1)
 Sets the test id of the assQuestion object. More...
 
 setComment ($comment="")
 Sets the comment string of the assQuestion object. More...
 
 setOutputType ($outputType=OUTPUT_HTML)
 Sets the output type. More...
 
 setShuffle ($shuffle=true)
 Sets the shuffle flag. More...
 
 setEstimatedWorkingTime ($hour=0, $min=0, $sec=0)
 Sets the estimated working time of a question from given hour, minute and second. More...
 
 setEstimatedWorkingTimeFromDurationString ($durationString)
 Sets the estimated working time of a question from a given datetime string. More...
 
 keyInArray ($searchkey, $array)
 returns TRUE if the key occurs in an array More...
 
 setAuthor ($author="")
 Sets the authors name of the assQuestion object. More...
 
 setOwner ($owner="")
 Sets the creator/owner ID of the assQuestion object. More...
 
 getTitle ()
 Gets the title string of the assQuestion object. More...
 
 getTitleFilenameCompliant ()
 returns the object title prepared to be used as a filename More...
 
 getId ()
 Gets the id of the assQuestion object. More...
 
 getShuffle ()
 Gets the shuffle flag. More...
 
 getTestId ()
 Gets the test id of the assQuestion object. More...
 
 getComment ()
 Gets the comment string of the assQuestion object. More...
 
 getOutputType ()
 Gets the output type. More...
 
 getDescriptionForHTMLOutput ()
 
 supportsJavascriptOutput ()
 Returns true if the question type supports JavaScript output. More...
 
 supportsNonJsOutput ()
 
 requiresJsSwitch ()
 
 getEstimatedWorkingTime ()
 Gets the estimated working time of a question. More...
 
 getAuthor ()
 Gets the authors name of the assQuestion object. More...
 
 getAuthorForHTMLOutput ()
 
 getOwner ()
 Gets the creator/owner ID of the assQuestion object. More...
 
 getObjId ()
 Get the object id of the container object. More...
 
 setObjId ($obj_id=0)
 Set the object id of the container object. More...
 
 getLifecycle ()
 
 setLifecycle (ilAssQuestionLifecycle $lifecycle)
 
 setExternalId ($external_id)
 
 getExternalId ()
 
 getSuggestedSolutionOutput ()
 
_getSuggestedSolution ($question_id, $subquestion_index=0)
 Returns a suggested solution for a given subquestion index. More...
 
 getSuggestedSolutions ()
 Return the suggested solutions. More...
 
 getReachedPoints ($active_id, $pass=null)
 Returns the points, a learner has reached answering the question This is the fast way to get the points directly from the database. More...
 
 getMaximumPoints ()
 Returns the maximum points, a learner can reach answering the question. More...
 
 getAdjustedReachedPoints ($active_id, $pass=null, $authorizedSolution=true)
 returns the reached points ... More...
 
 calculateResultsFromSolution ($active_id, $pass=null, $obligationsEnabled=false)
 Calculates the question results from a previously saved question solution. More...
 
 persistWorkingState ($active_id, $pass=null, $obligationsEnabled=false, $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 ($active_id, $pass=null, $authorized=true)
 Saves the learners input of the question to the database. More...
 
 moveUploadedMediaFile ($file, $name)
 Move an uploaded media file to an public accessible temp dir to present it. More...
 
 getSuggestedSolutionPath ()
 Returns the path for a suggested solution. More...
 
 getJavaPath ()
 Returns the image path for web accessable images of a question. More...
 
 getImagePath ($question_id=null, $object_id=null)
 Returns the image path for web accessable images of a question. More...
 
 buildImagePath ($questionId, $parentObjectId)
 
 getFlashPath ()
 Returns the image path for web accessable flash files of a question. More...
 
 getJavaPathWeb ()
 Returns the web image path for web accessable java applets of a question. More...
 
 getSuggestedSolutionPathWeb ()
 Returns the web path for a suggested solution. More...
 
 getImagePathWeb ()
 Returns the web image path for web accessable images of a question. More...
 
 getFlashPathWeb ()
 Returns the web image path for web accessable flash applications of a question. More...
 
 getTestOutputSolutions ($activeId, $pass)
 
 getUserSolutionPreferingIntermediate ($active_id, $pass=null)
 
 getSolutionValues ($active_id, $pass=null, $authorized=true)
 Loads solutions of a given user from the database an returns it. More...
 
 isInUse ($question_id="")
 Checks whether the question is in use or not. More...
 
 isClone ($question_id="")
 Checks whether the question is a clone of another question or not. More...
 
 pcArrayShuffle ($array)
 Shuffles the values of a given array. More...
 
 getAdditionalTableName ()
 Returns the name of the additional question data table in the database. More...
 
 getAnswerTableName ()
 Returns the name of the answer table in the database. More...
 
 deleteAnswers ($question_id)
 Deletes datasets from answers tables. More...
 
 deleteAdditionalTableData ($question_id)
 Deletes datasets from the additional question table in the database. More...
 
 delete ($question_id)
 Deletes a question and all materials from the database. More...
 
 getTotalAnswers ()
 get total number of answers More...
 
 _getTotalAnswers ($a_q_id)
 get number of answers for question id (static) note: do not use $this inside this method More...
 
 copyXHTMLMediaObjectsOfQuestion ($a_q_id)
 
 syncXHTMLMediaObjectsOfQuestion ()
 
 createPageObject ()
 create page object of question More...
 
 copyPageOfQuestion ($a_q_id)
 
 getPageOfQuestion ()
 
 setOriginalId ($original_id)
 
 getOriginalId ()
 
 fixSvgToPng ($imageFilenameContainingString)
 
 fixUnavailableSkinImageSources ($html)
 
 loadFromDb ($question_id)
 Loads the question from the database. More...
 
 createNewQuestion ($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 ($original_id="")
 
 saveToDb ($original_id="")
 Saves the question to the database. More...
 
 setNewOriginalId ($newId)
 
 deleteSuggestedSolutions ()
 Deletes all suggestes solutions in the database. More...
 
 getSuggestedSolution ($subquestion_index=0)
 Returns a suggested solution for a given subquestion index. More...
 
 getSuggestedSolutionTitle ($subquestion_index=0)
 Returns the title of a suggested solution at a given subquestion_index. More...
 
 setSuggestedSolution ($solution_id="", $subquestion_index=0, $is_import=false)
 Sets a suggested solution for the question. More...
 
 _resolveInternalLink ($internal_link)
 
 _resolveIntLinks ($question_id)
 
 syncWithOriginal ()
 
 _questionExists ($question_id)
 Returns true if the question already exists in the database. More...
 
 _questionExistsInPool ($question_id)
 Returns true if the question already exists in the database and is assigned to a question pool. More...
 
 getPoints ()
 Returns the maximum available points for the question. More...
 
 setPoints ($a_points)
 Sets the maximum available points for the question. More...
 
 getSolutionMaxPass ($active_id)
 Returns the maximum pass a users question solution. More...
 
 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...
 
 isHTML ($a_text)
 Checks if a given string contains HTML or not. More...
 
 prepareTextareaOutput ($txt_output, $prepare_for_latex_output=false, $omitNl2BrWhenTextArea=false)
 Prepares a string for a text area output in tests. More...
 
 QTIMaterialToString ($a_material)
 Reads an QTI material tag an creates a text string. More...
 
 addQTIMaterial (&$a_xml_writer, $a_material, $close_material_tag=true, $add_mobs=true)
 Creates a QTI material tag from a plain text or xhtml text. More...
 
 buildHashedImageFilename ($plain_image_filename, $unique=false)
 
 getQuestion ()
 Gets the question string of the question object. More...
 
 setQuestion ($question="")
 Sets the question string of the question object. More...
 
 getQuestionForHTMLOutput ()
 
 getQuestionType ()
 Returns the question type of the question. More...
 
 getQuestionTypeID ()
 Returns the question type of the question. More...
 
 cleanupMediaObjectUsage ()
 synchronises appearances of media objects in the question with media object usage table More...
 
getInstances ()
 Gets all instances of the question. More...
 
 getActiveUserData ($active_id)
 Returns the user id and the test id for a given active id. More...
 
 setExportDetailsXLS ($worksheet, $startrow, $active_id, $pass)
 Creates an Excel worksheet for the detailed cumulated results of this question. More...
 
 __get ($value)
 Object getter. More...
 
 __set ($key, $value)
 Object setter. More...
 
 getNrOfTries ()
 
 setNrOfTries ($a_nr_of_tries)
 
 setExportImagePath ($a_path)
 
 formatSAQuestion ($a_q)
 Format self assessment question. More...
 
 setPreventRteUsage ($a_val)
 Set prevent rte usage. More...
 
 getPreventRteUsage ()
 Get prevent rte usage. More...
 
 migrateContentForLearningModule (ilAssSelfAssessmentMigrator $migrator)
 
 setSelfAssessmentEditingMode ($a_selfassessmenteditingmode)
 Set Self-Assessment Editing Mode. More...
 
 getSelfAssessmentEditingMode ()
 Get Self-Assessment Editing Mode. More...
 
 setDefaultNrOfTries ($a_defaultnroftries)
 Set Default Nr of Tries. More...
 
 getDefaultNrOfTries ()
 Get Default Nr of Tries. More...
 
 syncSkillAssignments ($srcParentId, $srcQuestionId, $trgParentId, $trgQuestionId)
 
 isAnswered ($active_id, $pass=null)
 returns boolean wether the question is answered during test pass or not More...
 
 isAutosaveable ()
 
 getAdditionalContentEditingMode ()
 getter for additional content editing mode for this question More...
 
 setAdditionalContentEditingMode ($additinalContentEditingMode)
 setter for additional content editing mode for this question More...
 
 isAdditionalContentEditingModePageObject ()
 isser for additional "pageobject" content editing mode More...
 
 isValidAdditionalContentEditingMode ($additionalContentEditingMode)
 returns the fact wether the passed additional content mode is valid or not More...
 
 getValidAdditionalContentEditingModes ()
 getter for valid additional content editing modes More...
 
 addQuestionChangeListener (ilQuestionChangeListener $listener)
 
 getQuestionChangeListeners ()
 
 getHtmlUserSolutionPurifier ()
 
 getHtmlQuestionContentPurifier ()
 
 setLastChange ($lastChange)
 
 getLastChange ()
 
 removeIntermediateSolution ($active_id, $pass)
 
 removeCurrentSolution ($active_id, $pass, $authorized=true)
 
 saveCurrentSolution ($active_id, $pass, $value1, $value2, $authorized=true, $tstamp=null)
 
 updateCurrentSolution ($solutionId, $value1, $value2, $authorized=true)
 
 updateCurrentSolutionsAuthorization ($activeId, $pass, $authorized, $keepTime=false)
 
 setStep ($step)
 
 getStep ()
 
 toJSON ()
 
 duplicate ($for_test=true, $title="", $author="", $owner="", $testObjId=null)
 
 intermediateSolutionExists ($active_id, $pass)
 
 authorizedSolutionExists ($active_id, $pass)
 
 authorizedOrIntermediateSolutionExists ($active_id, $pass)
 
 isAddableAnswerOptionValue ($qIndex, $answerOptionValue)
 
 addAnswerOptionValue ($qIndex, $answerOptionValue, $points)
 
 removeAllExistingSolutions ()
 
 removeExistingSolutions ($activeId, $pass)
 
 resetUsersAnswer ($activeId, $pass)
 
 removeResultRecord ($activeId, $pass)
 
 fetchValuePairsFromIndexedValues (array $indexedValues)
 
 fetchIndexedValuesFromValuePairs (array $valuePairs)
 
 areObligationsToBeConsidered ()
 
 setObligationsToBeConsidered ($obligationsToBeConsidered)
 
 updateTimestamp ()
 
 getTestPresentationConfig ()
 Get the test question configuration (initialised once) More...
 
 savePartial ()
 
 isInActiveTest ()
 
 saveAdditionalQuestionDataToDb ()
 Saves a record to the question types additional data table. More...
 

Data Fields

const ANSWER_TYPE_SELECT_VAL = 0
 
const ANSWER_TYPE_TEXT_VAL = 1
 
const GAP_PLACEHOLDER = 'Longmenu'
 
const MIN_LENGTH_AUTOCOMPLETE = 3
 
const MAX_INPUT_FIELDS = 500
 
- Data Fields inherited from assQuestion
const IMG_MIME_TYPE_JPG = 'image/jpeg'
 
const IMG_MIME_TYPE_PNG = 'image/png'
 
const IMG_MIME_TYPE_GIF = 'image/gif'
 
const ADDITIONAL_CONTENT_EDITING_MODE_RTE = 'default'
 constant for additional content editing mode "default" More...
 
const ADDITIONAL_CONTENT_EDITING_MODE_IPE = 'pageobject'
 constant for additional content editing mode "pageobject" More...
 
 $feedbackOBJ = null
 
 $prevent_rte_usage = false
 
 $selfassessmenteditingmode = false
 
 $defaultnroftries = 0
 
 $questionActionCmd = 'handleQuestionAction'
 
const KEY_VALUES_IMPLOSION_SEPARATOR = ':'
 

Protected Member Functions

 calculateReachedPointsForSolution ($found_values, $active_id=0)
 
 savePreviewData (ilAssQuestionPreviewSession $previewSession)
 
 lmMigrateQuestionTypeSpecificContent (ilAssSelfAssessmentMigrator $migrator)
 
- Protected Member Functions inherited from assQuestion
 getQuestionAction ()
 
 isNonEmptyItemListPostSubmission ($postSubmissionFieldname)
 
 ensureCurrentTestPass ($active_id, $pass)
 
 lookupCurrentTestPass ($active_id, $pass)
 
 lookupTestId ($active_id)
 
 log ($active_id, $langVar)
 
 savePreviewData (ilAssQuestionPreviewSession $previewSession)
 
 deletePageOfQuestion ($question_id)
 Deletes the page object of a question with a given ID. More...
 
 onDuplicate ($originalParentId, $originalQuestionId, $duplicateParentId, $duplicateQuestionId)
 Will be called when a question is duplicated (inside a question pool or for insertion in a test) More...
 
 beforeSyncWithOriginal ($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId)
 
 afterSyncWithOriginal ($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId)
 
 onCopy ($sourceParentId, $sourceQuestionId, $targetParentId, $targetQuestionId)
 Will be called when a question is copied (into another question pool) More...
 
 duplicateSuggestedSolutionFiles ($parent_id, $question_id)
 Duplicates the files of a suggested solution if the question is duplicated. More...
 
 syncSuggestedSolutionFiles ($original_id)
 Syncs the files of a suggested solution if the question is synced. More...
 
 copySuggestedSolutionFiles ($source_questionpool_id, $source_question_id)
 
 ensureNonNegativePoints ($points)
 
 purifyAndPrepareTextAreaOutput (string $content)
 
 getRTETextWithMediaObjects ()
 Collects all text in the question which could contain media objects which were created with the Rich Text Editor. More...
 
 getSelfAssessmentFormatter ()
 
 lmMigrateQuestionTypeGenericContent (ilAssSelfAssessmentMigrator $migrator)
 
 lmMigrateQuestionTypeSpecificContent (ilAssSelfAssessmentMigrator $migrator)
 
 duplicateQuestionHints ($originalQuestionId, $duplicateQuestionId)
 
 duplicateSkillAssignments ($srcParentId, $srcQuestionId, $trgParentId, $trgQuestionId)
 
 buildQuestionDataQuery ()
 
 getCurrentSolutionResultSet ($active_id, $pass, $authorized=true)
 Get a restulset for the current user solution for a this question by active_id and pass. More...
 
 removeSolutionRecordById ($solutionId)
 
 getSolutionRecordById ($solutionId)
 
 deleteDummySolutionRecord ($activeId, $passIndex)
 
 isDummySolutionRecord ($solutionRecord)
 
 deleteSolutionRecordByValues ($activeId, $passIndex, $authorized, $matchValues)
 
 duplicateIntermediateSolutionAuthorized ($activeId, $passIndex)
 
 forceExistingIntermediateSolution ($activeId, $passIndex, $considerDummyRecordCreation)
 
 buildTestPresentationConfig ()
 build basic test question configuration instance More...
 

Private Member Functions

 buildFolderName ()
 
 buildFileName ($gap_id)
 
 correctAnswerDoesNotExistInAnswerOptions ($answers, $answer_options)
 
 createFileFromArray ()
 
 createArrayFromFile ()
 
 clearFolder ($let_folder_exists=true)
 
 assertDirExists ()
 
 loadCorrectAnswerData ($question_id)
 
 getCorrectAnswersForGap ($question_id, $gap_id)
 
 getPointsForGap ($question_id, $gap_id)
 

Private Attributes

 $answerType
 
 $long_menu_text
 
 $json_structure
 
 $ilDB
 
 $specificFeedbackSetting
 
 $minAutoComplete
 
 $identical_scoring
 
 $correct_answers = []
 
 $answers = []
 

Additional Inherited Members

- Static Public Member Functions inherited from assQuestion
static setForcePassResultUpdateEnabled ($forcePassResultsUpdateEnabled)
 
static isForcePassResultUpdateEnabled ()
 
static isAllowedImageMimeType ($mimeType)
 
static fetchMimeTypeIdentifier ($contentTypeString)
 
static getAllowedFileExtensionsForMimeType ($mimeType)
 
static isAllowedImageFileExtension ($mimeType, $fileExtension)
 
static getAllowedImageMaterialFileExtensions ()
 
static _getMaximumPoints ($question_id)
 Returns the maximum points, a learner can reach answering the question. More...
 
static _getQuestionInfo ($question_id)
 Returns question information from the database. More...
 
static _getSuggestedSolutionCount ($question_id)
 Returns the number of suggested solutions associated with a question. More...
 
static _getSuggestedSolutionOutput ($question_id)
 Returns the output of the suggested solution. More...
 
static _getReachedPoints ($active_id, $question_id, $pass=null)
 Returns the points, a learner has reached answering the question. More...
 
static _updateTestResultCache ($active_id, ilAssQuestionProcessLocker $processLocker=null)
 @TODO Move this to a proper place. More...
 
static logAction ($logtext="", $active_id="", $question_id="")
 Logs an action into the Test&Assessment log. More...
 
static getQuestionTypeFromDb ($question_id)
 get question type for question id More...
 
static _getTotalRightAnswers ($a_q_id)
 get number of answers for question id (static) note: do not use $this inside this method More...
 
static _getTitle ($a_q_id)
 Returns the title of a question. More...
 
static _getQuestionText ($a_q_id)
 Returns question text. More...
 
static isFileAvailable ($file)
 
static _getQuestionType ($question_id)
 Returns the question type of a question with a given id. More...
 
static _getQuestionTitle ($question_id)
 Returns the question title of a question with a given id. More...
 
static saveOriginalId ($questionId, $originalId)
 
static resetOriginalId ($questionId)
 
static _getInternalLinkHref ($target="")
 
static _getOriginalId ($question_id)
 Returns the original id of a question. More...
 
static originalQuestionExists ($questionId)
 
static _instanciateQuestion ($question_id)
 Creates an instance of a question with a given question id. More...
 
static _instantiateQuestion ($question_id)
 
static _getSolutionMaxPass ($question_id, $active_id)
 Returns the maximum pass a users question solution. More...
 
static _isWriteable ($question_id, $user_id)
 Returns true if the question is writeable by a certain user. More...
 
static _isUsedInRandomTest ($question_id="")
 Checks whether the question is used in a random test or not. More...
 
static _isWorkedThrough ($active_id, $question_id, $pass=null)
 Returns true if the question was worked through in the given pass Worked through means that the user entered at least one value. More...
 
static _areAnswered ($a_user_id, $a_question_ids)
 Checks if an array of question ids is answered by an user or not. More...
 
static _setReachedPoints ($active_id, $question_id, $points, $maxpoints, $pass, $manualscoring, $obligationsEnabled)
 Sets the points, a learner has reached answering the question Additionally objective results are updated. More...
 
static _needsManualScoring ($question_id)
 
static _includeClass ($question_type, $gui=0)
 Include the php class file for a given question type. More...
 
static getGuiClassNameByQuestionType ($questionType)
 
static getObjectClassNameByQuestionType ($questionType)
 
static getFeedbackClassNameByQuestionType ($questionType)
 
static isCoreQuestionType ($questionType)
 
static includeCoreClass ($questionType, $withGuiClass)
 
static includePluginClass ($questionType, $withGuiClass)
 
static _getQuestionTypeName ($type_tag)
 Return the translation for a given question type tag. More...
 
static & _instanciateQuestionGUI ($question_id)
 Creates an instance of a question gui with a given question id. More...
 
static instantiateQuestionGUI ($a_question_id)
 Creates an instance of a question gui with a given question id. More...
 
static _questionExistsInTest ($question_id, $test_id)
 
static lookupParentObjId ($questionId)
 @global ilDBInterface $ilDB More...
 
static lookupOriginalParentObjId ($originalQuestionId)
 returns the parent object id for given original question id (should be a qpl id, but theoretically it can be a tst id, too) More...
 
static isObligationPossible ($questionId)
 returns boolean wether it is possible to set this question type as obligatory or not considering the current question configuration More...
 
static implodeKeyValues ($keyValues)
 
static explodeKeyValues ($keyValues)
 
static setResultGateway ($resultGateway)
 
static getResultGateway ()
 
static sumTimesInISO8601FormatH_i_s_Extended ($time1, $time2)
 
static convertISO8601FormatH_i_s_ExtendedToSeconds ($time)
 
static missingResultRecordExists ($activeId, $pass, $questionIds)
 
static getQuestionsMissingResultRecord ($activeId, $pass, $questionIds)
 
static lookupResultRecordExist ($activeId, $questionId, $pass)
 
- Static Protected Member Functions inherited from assQuestion
static getNumExistingSolutionRecords ($activeId, $pass, $questionId)
 returns the number of existing solution records for the given test active / pass and given question id More...
 
static getKeyValuesImplosionSeparator ()
 
- Protected Attributes inherited from assQuestion
 $id
 
 $title
 
 $comment
 
 $owner
 
 $author
 
 $question
 
 $points
 
 $est_working_time
 
 $shuffle
 
 $test_id
 
 $obj_id
 
 $ilias
 
 $tpl
 
 $lng
 
 $db
 
 $refinery
 
 $outputType = OUTPUT_JAVASCRIPT
 
 $suggested_solutions
 
 $original_id
 
 $page
 
 $external_id = ''
 
 $questionChangeListeners = array()
 
 $processLocker
 
 $step = null
 
 $lastChange
 
 $shuffler
 
 $testQuestionConfig
 
 $lifecycle
 
- Static Protected Attributes inherited from assQuestion
static $allowedFileExtensionsByMimeType
 
static $allowedCharsetsByMimeType
 
static $allowedImageMaterialFileExtensionsByMimeType
 
static $forcePassResultsUpdateEnabled = false
 
static $imageSourceFixReplaceMap
 

Detailed Description

Definition at line 11 of file class.assLongMenu.php.

Constructor & Destructor Documentation

◆ __construct()

assLongMenu::__construct (   $title = "",
  $comment = "",
  $author = "",
  $owner = -1,
  $question = "" 
)

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

39 {
40 global $DIC;
41 require_once 'Modules/TestQuestionPool/classes/feedback/class.ilAssConfigurableMultiOptionQuestionFeedback.php';
43 $this->minAutoComplete = self::MIN_LENGTH_AUTOCOMPLETE;
45 $this->ilDB = $DIC->database();
46 $this->identical_scoring = 1;
47 }
const MIN_LENGTH_AUTOCOMPLETE
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References assQuestion\$author, assQuestion\$comment, $DIC, assQuestion\$owner, assQuestion\$question, assQuestion\$title, ILIAS\GlobalScreen\Provider\__construct(), ilAssConfigurableMultiOptionQuestionFeedback\FEEDBACK_SETTING_ALL, and MIN_LENGTH_AUTOCOMPLETE.

+ Here is the call graph for this function:

Member Function Documentation

◆ assertDirExists()

assLongMenu::assertDirExists ( )
private

Definition at line 349 of file class.assLongMenu.php.

350 {
351 $folder_name = $this->buildFolderName();
352 if (!ilUtil::makeDirParents($folder_name)) {
353 throw new ilException('Cannot create export directory');
354 }
355
356 if (
357 !is_dir($folder_name) ||
358 !is_readable($folder_name) ||
359 !is_writable($folder_name)
360 ) {
361 throw new ilException('Cannot create export directory');
362 }
363 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static makeDirParents($a_dir)
Create a new directory and all parent directories.

References buildFolderName(), and ilUtil\makeDirParents().

Referenced by buildFileName().

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

◆ buildFileName()

assLongMenu::buildFileName (   $gap_id)
private

Definition at line 89 of file class.assLongMenu.php.

90 {
91 try {
92 $this->assertDirExists();
93 return $this->buildFolderName() . $gap_id . '.txt';
94 } catch (ilException $e) {
95 }
96 }

References Vendor\Package\$e, assertDirExists(), and buildFolderName().

Referenced by createFileFromArray().

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

◆ buildFolderName()

assLongMenu::buildFolderName ( )
private

Definition at line 79 of file class.assLongMenu.php.

80 {
81 return ilUtil::getDataDir() . '/assessment/longMenuQuestion/' . $this->getId() . '/' ;
82 }
getId()
Gets the id of the assQuestion object.
static getDataDir()
get data directory (outside webspace)

References ilUtil\getDataDir(), and assQuestion\getId().

Referenced by assertDirExists(), buildFileName(), clearFolder(), and createArrayFromFile().

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

◆ calculateReachedPoints()

assLongMenu::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.

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

Reimplemented from assQuestion.

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

602 {
603 if ($returndetails) {
604 throw new ilTestException('return details not implemented for ' . __METHOD__);
605 }
606
607 $found_values = array();
608 if (is_null($pass)) {
609 $pass = $this->getSolutionMaxPass($active_id);
610 }
611 $result = $this->getCurrentSolutionResultSet($active_id, $pass, $authorizedSolution);
612 while ($data = $this->ilDB->fetchAssoc($result)) {
613 $found_values[(int) $data['value1']] = $data['value2'];
614 }
615
616 $points = $this->calculateReachedPointsForSolution($found_values, $active_id);
617
618 return $points;
619 }
$result
calculateReachedPointsForSolution($found_values, $active_id=0)
getCurrentSolutionResultSet($active_id, $pass, $authorized=true)
Get a restulset for the current user solution for a this question by active_id and pass.
getSolutionMaxPass($active_id)
Returns the maximum pass a users question solution.
Base Exception for all Exceptions relating to Modules/Test.
$data
Definition: storeScorm.php:23

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

Referenced by getUserQuestionResult().

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

◆ calculateReachedPointsForSolution()

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

Definition at line 621 of file class.assLongMenu.php.

622 {
623 $points = 0;
624 $solution_values_text = array();
625 foreach ($found_values as $key => $answer) {
626 if ($answer != '') {
627 $correct_answers = $this->getCorrectAnswersForGap($this->id, $key);
628 if (in_array($answer, $correct_answers)) {
629 $points_gap = $this->getPointsForGap($this->id, $key);
630 if (!$this->getIdenticalScoring()) {
631 // check if the same solution text was already entered
632 if ((in_array($answer, $solution_values_text)) && ($points > 0)) {
633 $points_gap = 0;
634 }
635 }
636 $points += $points_gap;
637 array_push($solution_values_text, $answer);
638 }
639 }
640 }
641 return $points;
642 }
getCorrectAnswersForGap($question_id, $gap_id)
getPointsForGap($question_id, $gap_id)

References $correct_answers, assQuestion\$points, getCorrectAnswersForGap(), getIdenticalScoring(), and getPointsForGap().

Referenced by calculateReachedPoints().

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

◆ checkQuestionCustomPart()

assLongMenu::checkQuestionCustomPart (   $form = null)
Parameters
ilPropertyFormGUI | null$form
Returns
bool

Definition at line 180 of file class.assLongMenu.php.

181 {
182 $hidden_text_files = $this->getAnswers();
184 $points = array();
185 if (sizeof($correct_answers) == 0 || sizeof($hidden_text_files) == 0) {
186 return false;
187 }
188 if (sizeof($correct_answers) != sizeof($hidden_text_files)) {
189 return false;
190 }
191 foreach ($correct_answers as $key => $correct_answers_row) {
192 if ($this->correctAnswerDoesNotExistInAnswerOptions($correct_answers_row, $hidden_text_files[$key])) {
193 return false;
194 }
195 if (!is_array($correct_answers_row[0]) || sizeof($correct_answers_row[0]) == 0) {
196 return false;
197 }
198 if ($correct_answers_row[1] > 0) {
199 array_push($points, $correct_answers_row[1]);
200 }
201 }
202 if (sizeof($correct_answers) != sizeof($points)) {
203 return false;
204 }
205
206 foreach ($points as $row) {
207 if ($row <= 0) {
208 return false;
209 }
210 }
211 return true;
212 }
correctAnswerDoesNotExistInAnswerOptions($answers, $answer_options)

References $correct_answers, assQuestion\$points, correctAnswerDoesNotExistInAnswerOptions(), getAnswers(), and getCorrectAnswers().

+ Here is the call graph for this function:

◆ clearAnswerSpecificDataFromDb()

assLongMenu::clearAnswerSpecificDataFromDb (   $question_id)

Definition at line 860 of file class.assLongMenu.php.

861 {
862 $this->ilDB->manipulateF(
863 'DELETE FROM ' . $this->getAnswerTableName() . ' WHERE question_fi = %s',
864 array( 'integer' ),
865 array( $question_id )
866 );
867 }
getAnswerTableName()
Returns the name of the answer table in the database.

References getAnswerTableName().

Referenced by saveAnswerSpecificDataToDb().

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

◆ clearFolder()

assLongMenu::clearFolder (   $let_folder_exists = true)
private

Definition at line 344 of file class.assLongMenu.php.

345 {
346 ilUtil::delDir($this->buildFolderName(), $let_folder_exists);
347 }
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively

References buildFolderName(), and ilUtil\delDir().

Referenced by createFileFromArray(), and delete().

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

◆ copyObject()

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

Definition at line 532 of file class.assLongMenu.php.

533 {
534 if ($this->id <= 0) {
535 // The question has not been saved. It cannot be duplicated
536 return;
537 }
538 // duplicate the question in database
539 $clone = $this;
540 include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
542 $clone->id = -1;
543 $source_questionpool_id = $this->getObjId();
544 $clone->setObjId($target_questionpool_id);
545 if ($title) {
546 $clone->setTitle($title);
547 }
548 $clone->saveToDb();
549
550 $clone->copyPageOfQuestion($original_id);
551 $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
552
553 $clone->onCopy($source_questionpool_id, $original_id, $clone->getObjId(), $clone->getId());
554
555 return $clone->id;
556 }
static _getOriginalId($question_id)
Returns the original id of a question.
getObjId()
Get the object id of the container object.

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

+ Here is the call graph for this function:

◆ correctAnswerDoesNotExistInAnswerOptions()

assLongMenu::correctAnswerDoesNotExistInAnswerOptions (   $answers,
  $answer_options 
)
private
Parameters
$answers
$answer_options
Returns
bool

Definition at line 219 of file class.assLongMenu.php.

220 {
221 foreach ($answers[0] as $key => $answer) {
222 if (!in_array($answer, $answer_options)) {
223 return true;
224 }
225 }
226 return false;
227 }

References $answers.

Referenced by checkQuestionCustomPart().

+ Here is the caller graph for this function:

◆ createArrayFromFile()

assLongMenu::createArrayFromFile ( )
private

Definition at line 321 of file class.assLongMenu.php.

322 {
323 $files = glob($this->buildFolderName() . '*.txt');
324
325 if ($files === false) {
326 $files = array();
327 }
328
329 $answers = array();
330
331 foreach ($files as $file) {
332 $gap = str_replace('.txt', '', basename($file));
333 $answers[(int) $gap] = explode("\n", file_get_contents($file));
334 }
335 // Sort by gap keys, to ensure the numbers are in ascending order.
336 // Glob will report the keys in files order like 0, 1, 10, 11, 2,...
337 // json_encoding the array with keys in order 0,1,10,11,2,.. will create
338 // a json_object instead of a list when keys are numeric, sorted and start with 0
339 ksort($answers);
340 $this->setAnswers($answers);
341 return $answers;
342 }
setAnswers($answers)

References $answers, buildFolderName(), and setAnswers().

Referenced by getAnswersObject(), getAvailableAnswerOptions(), and loadFromDb().

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

◆ createFileFromArray()

assLongMenu::createFileFromArray ( )
private

Definition at line 303 of file class.assLongMenu.php.

304 {
305 $array = $this->getAnswers();
306 $this->clearFolder();
307 foreach ($array as $gap => $values) {
308 $file_content = '';
309 if (is_array($values)) {
310 foreach ($values as $key => $value) {
311 $file_content .= $value . "\n";
312 }
313 $file_content = rtrim($file_content, "\n");
314 $file = fopen($this->buildFileName($gap), "w");
315 fwrite($file, $file_content);
316 fclose($file);
317 }
318 }
319 }
buildFileName($gap_id)
clearFolder($let_folder_exists=true)

References buildFileName(), clearFolder(), and getAnswers().

Referenced by saveAdditionalQuestionDataToDb().

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

◆ createNewOriginalFromThisDuplicate()

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

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

559 {
560 if ($this->id <= 0) {
561 // The question has not been saved. It cannot be duplicated
562 return;
563 }
564
565 include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
566
567 $sourceQuestionId = $this->id;
568 $sourceParentId = $this->getObjId();
569
570 // duplicate the question in database
571 $clone = $this;
572 $clone->id = -1;
573
574 $clone->setObjId($targetParentId);
575
576 if ($targetQuestionTitle) {
577 $clone->setTitle($targetQuestionTitle);
578 }
579
580 $clone->saveToDb();
581 $clone->copyPageOfQuestion($sourceQuestionId);
582 $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
583
584 $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
585
586 return $clone->id;
587 }

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

+ Here is the call graph for this function:

◆ delete()

assLongMenu::delete (   $question_id)

Deletes a question and all materials from the database.

Parameters
integer$question_idThe database id of the question @access private

Reimplemented from assQuestion.

Definition at line 869 of file class.assLongMenu.php.

870 {
871 parent::delete($original_id);
872 $this->clearFolder(false);
873 }

References assQuestion\$original_id, and clearFolder().

+ Here is the call graph for this function:

◆ duplicate()

assLongMenu::duplicate (   $for_test = true,
  $title = "",
  $author = "",
  $owner = "",
  $testObjId = null 
)

Reimplemented from assQuestion.

Definition at line 488 of file class.assLongMenu.php.

489 {
490 if ($this->id <= 0) {
491 // The question has not been saved. It cannot be duplicated
492 return;
493 }
494
495 // duplicate the question in database
496 $this_id = $this->getId();
497 $thisObjId = $this->getObjId();
498
499 $clone = $this;
500 include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
502 $clone->id = -1;
503
504 if ((int) $testObjId > 0) {
505 $clone->setObjId($testObjId);
506 }
507
508 if ($title) {
509 $clone->setTitle($title);
510 }
511
512 if ($author) {
513 $clone->setAuthor($author);
514 }
515 if ($owner) {
516 $clone->setOwner($owner);
517 }
518
519 if ($for_test) {
520 $clone->saveToDb($original_id);
521 } else {
522 $clone->saveToDb();
523 }
524
525 $clone->copyPageOfQuestion($this_id);
526 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
527 $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
528
529 return $clone->id;
530 }

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

+ Here is the call graph for this function:

◆ getAdditionalTableName()

assLongMenu::getAdditionalTableName ( )

Returns the name of the additional question data table in the database.

Returns
string The additional table name

Reimplemented from assQuestion.

Definition at line 773 of file class.assLongMenu.php.

774 {
775 return 'qpl_qst_lome';
776 }

Referenced by loadFromDb(), and saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ getAnswers()

assLongMenu::getAnswers ( )

Definition at line 113 of file class.assLongMenu.php.

114 {
115 return $this->answers;
116 }

References $answers.

Referenced by checkQuestionCustomPart(), createFileFromArray(), and toJSON().

+ Here is the caller graph for this function:

◆ getAnswersObject()

assLongMenu::getAnswersObject ( )

Definition at line 477 of file class.assLongMenu.php.

478 {
479 return json_encode($this->createArrayFromFile());
480 }

References createArrayFromFile().

+ Here is the call graph for this function:

◆ getAnswerTableName()

assLongMenu::getAnswerTableName ( )

Returns the name of the answer table in the database.

Returns
string The answer table name @access public

Reimplemented from assQuestion.

Definition at line 84 of file class.assLongMenu.php.

85 {
86 return "qpl_a_lome";
87 }

Referenced by clearAnswerSpecificDataFromDb(), getCorrectAnswersForGap(), getCorrectAnswersForQuestionSolution(), getPointsForGap(), and saveAnswerSpecificDataToDb().

+ Here is the caller graph for this function:

◆ getAnswerType()

assLongMenu::getAnswerType ( )
Returns
mixed

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

53 {
54 return $this->answerType;
55 }

References $answerType.

Referenced by saveAnswerSpecificDataToDb().

+ Here is the caller graph for this function:

◆ getAvailableAnswerOptions()

assLongMenu::getAvailableAnswerOptions (   $index = null)

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

Parameters
null | int$index
Returns
array|ASS_AnswerSimple

Definition at line 850 of file class.assLongMenu.php.

851 {
852 return $this->createArrayFromFile();
853 }

References createArrayFromFile().

+ Here is the call graph for this function:

◆ getCorrectAnswers()

assLongMenu::getCorrectAnswers ( )
Returns
mixed

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

69 {
71 }

References $correct_answers.

Referenced by checkQuestionCustomPart(), getMaximumPoints(), saveAnswerSpecificDataToDb(), setExportDetailsXLS(), and toJSON().

+ Here is the caller graph for this function:

◆ getCorrectAnswersAsJson()

assLongMenu::getCorrectAnswersAsJson ( )

Definition at line 482 of file class.assLongMenu.php.

483 {
484 $this->loadCorrectAnswerData($this->getId());
485 return $this->getJsonStructure();
486 }
loadCorrectAnswerData($question_id)

References assQuestion\getId(), getJsonStructure(), and loadCorrectAnswerData().

+ Here is the call graph for this function:

◆ getCorrectAnswersForGap()

assLongMenu::getCorrectAnswersForGap (   $question_id,
  $gap_id 
)
private

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

449 {
450 $correct_answers = array();
451 $res = $this->db->queryF(
452 'SELECT answer_text FROM ' . $this->getAnswerTableName() . ' WHERE question_fi = %s AND gap_number = %s',
453 array('integer', 'integer'),
454 array($question_id, $gap_id)
455 );
456 while ($data = $this->ilDB->fetchAssoc($res)) {
457 $correct_answers[] = rtrim($data['answer_text']);
458 }
459 return $correct_answers;
460 }
foreach($_POST as $key=> $value) $res

References $correct_answers, $data, $res, and getAnswerTableName().

Referenced by calculateReachedPointsForSolution().

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

◆ getCorrectAnswersForQuestionSolution()

assLongMenu::getCorrectAnswersForQuestionSolution (   $question_id)

Definition at line 429 of file class.assLongMenu.php.

430 {
431 $correct_answers = array();
432 $res = $this->db->queryF(
433 'SELECT gap_number, answer_text FROM ' . $this->getAnswerTableName() . ' WHERE question_fi = %s',
434 array('integer'),
435 array($question_id)
436 );
437 while ($data = $this->ilDB->fetchAssoc($res)) {
438 if (array_key_exists($data['gap_number'], $correct_answers)) {
439 $correct_answers[$data['gap_number']] .= ' ' . $this->lng->txt("or") . ' ';
440 $correct_answers[$data['gap_number']] .= rtrim($data['answer_text']);
441 } else {
442 $correct_answers[$data['gap_number']] .= rtrim($data['answer_text']);
443 }
444 }
445 return $correct_answers;
446 }

References $correct_answers, $data, $res, and getAnswerTableName().

+ Here is the call graph for this function:

◆ getIdenticalScoring()

assLongMenu::getIdenticalScoring ( )

Definition at line 910 of file class.assLongMenu.php.

911 {
912 return ($this->identical_scoring) ? 1 : 0;
913 }

Referenced by calculateReachedPointsForSolution(), and saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ getJsonStructure()

assLongMenu::getJsonStructure ( )
Returns
mixed

Definition at line 121 of file class.assLongMenu.php.

122 {
124 }

References $json_structure.

Referenced by getCorrectAnswersAsJson().

+ Here is the caller graph for this function:

◆ getLongMenuTextValue()

assLongMenu::getLongMenuTextValue ( )

Definition at line 103 of file class.assLongMenu.php.

104 {
106 }

References $long_menu_text.

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

+ Here is the caller graph for this function:

◆ getMaximumPoints()

assLongMenu::getMaximumPoints ( )

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

@access public

See also
$points

Reimplemented from assQuestion.

Definition at line 236 of file class.assLongMenu.php.

237 {
238 $sum = 0;
239 $points = $this->getCorrectAnswers();
240 if ($points) {
241 foreach ($points as $add) {
242 $sum += $add[1];
243 }
244 }
245 return $sum;
246 }

References assQuestion\$points, and getCorrectAnswers().

Referenced by getUserQuestionResult().

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

◆ getMinAutoComplete()

assLongMenu::getMinAutoComplete ( )

Definition at line 149 of file class.assLongMenu.php.

150 {
151 return $this->minAutoComplete ? $this->minAutoComplete : self::MIN_LENGTH_AUTOCOMPLETE;
152 }

References MIN_LENGTH_AUTOCOMPLETE.

Referenced by saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ getPointsForGap()

assLongMenu::getPointsForGap (   $question_id,
  $gap_id 
)
private

Definition at line 462 of file class.assLongMenu.php.

463 {
464 $points = 0;
465 $res = $this->db->queryF(
466 'SELECT points FROM ' . $this->getAnswerTableName() . ' WHERE question_fi = %s AND gap_number = %s GROUP BY gap_number, points',
467 array('integer', 'integer'),
468 array($question_id, $gap_id)
469 );
470 while ($data = $this->ilDB->fetchAssoc($res)) {
471 $points = $data['points'];
472 }
473 return $points;
474 }

References $data, assQuestion\$points, $res, and getAnswerTableName().

Referenced by calculateReachedPointsForSolution().

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

◆ getQuestionType()

assLongMenu::getQuestionType ( )

Returns the question type of the question.

Returns
integer The question type of the question

Reimplemented from assQuestion.

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

764 {
765 return "assLongMenu";
766 }

Referenced by toJSON().

+ Here is the caller graph for this function:

◆ getRTETextWithMediaObjects()

assLongMenu::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 782 of file class.assLongMenu.php.

783 {
784 return parent::getRTETextWithMediaObjects() . $this->getLongMenuTextValue();
785 }

References getLongMenuTextValue().

+ Here is the call graph for this function:

◆ getSolutionSubmit()

assLongMenu::getSolutionSubmit ( )

Definition at line 735 of file class.assLongMenu.php.

736 {
737 $solutionSubmit = array();
738 $answer = ilUtil::stripSlashesRecursive($_POST['answer']);
739
740 foreach ($answer as $key => $value) {
741 $solutionSubmit[$key] = $value;
742 }
743
744 return $solutionSubmit;
745 }
$_POST["username"]
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.

References $_POST, and ilUtil\stripSlashesRecursive().

Referenced by saveWorkingData().

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

◆ getSpecificFeedbackSetting()

assLongMenu::getSpecificFeedbackSetting ( )

Definition at line 139 of file class.assLongMenu.php.

140 {
142 }

References $specificFeedbackSetting.

Referenced by saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ getUserQuestionResult()

assLongMenu::getUserQuestionResult (   $active_id,
  $pass 
)

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

Parameters
int$active_id
int$pass
Returns
ilUserQuestionResult

Definition at line 830 of file class.assLongMenu.php.

831 {
832 $result = new ilUserQuestionResult($this, $active_id, $pass);
833
834 $points = $this->calculateReachedPoints($active_id, $pass);
835 $max_points = $this->getMaximumPoints();
836
837 $result->setReachedPercentage(($points / $max_points) * 100);
838
839 return $result;
840 }
getMaximumPoints()
Returns the maximum points, a learner can reach answering the question.
calculateReachedPoints($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
Returns the points, a learner has reached answering the question.
Class ilUserQuestionResult.

References $pass, assQuestion\$points, $result, calculateReachedPoints(), and getMaximumPoints().

+ Here is the call graph for this function:

◆ isComplete()

assLongMenu::isComplete ( )

Returns true, if a question is complete for use.

Returns
boolean True, if the question is complete for use, otherwise false @access public

Reimplemented from assQuestion.

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

155 {
156 if (strlen($this->title)
157 && $this->author
158 && $this->long_menu_text
159 && sizeof($this->answers) > 0
160 && sizeof($this->correct_answers) > 0
161 && $this->getPoints() > 0
162 ) {
163 return true;
164 }
165 return false;
166 }
getPoints()
Returns the maximum available points for the question.

References assQuestion\getPoints().

+ Here is the call graph for this function:

◆ isShuffleAnswersEnabled()

assLongMenu::isShuffleAnswersEnabled ( )

Definition at line 855 of file class.assLongMenu.php.

856 {
857 return false;
858 }

◆ lmMigrateQuestionTypeSpecificContent()

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

Reimplemented from assQuestion.

Definition at line 878 of file class.assLongMenu.php.

879 {
880 $this->setLongMenuTextValue($migrator->migrateToLmContent($this->getLongMenuTextValue()));
881 }
setLongMenuTextValue($long_menu_text="")

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

+ Here is the call graph for this function:

◆ loadCorrectAnswerData()

assLongMenu::loadCorrectAnswerData (   $question_id)
private

Definition at line 411 of file class.assLongMenu.php.

412 {
413 $res = $this->db->queryF(
414 "SELECT * FROM {$this->getAnswerTableName()} WHERE question_fi = %s ORDER BY gap_number, position ASC",
415 array('integer'),
416 array($question_id)
417 );
418
419 $correct_answers = array();
420 while ($data = $this->ilDB->fetchAssoc($res)) {
421 $correct_answers[$data['gap_number']][0][$data['position']] = rtrim($data['answer_text']);
422 $correct_answers[$data['gap_number']][1] = $data['points'];
423 $correct_answers[$data['gap_number']][2] = $data['type'];
424 }
425 $this->setJsonStructure(json_encode($correct_answers));
427 }
setCorrectAnswers($correct_answers)
setJsonStructure($json_structure)

References $correct_answers, $data, $res, setCorrectAnswers(), and setJsonStructure().

Referenced by getCorrectAnswersAsJson(), and loadFromDb().

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

◆ loadFromDb()

assLongMenu::loadFromDb (   $question_id)

Loads the question from the database.

Parameters
integer$question_idA unique key which defines the question in the database @access public

Reimplemented from assQuestion.

Definition at line 365 of file class.assLongMenu.php.

366 {
367 $result = $this->ilDB->queryF(
368 "SELECT qpl_questions.*, " . $this->getAdditionalTableName() . ".* FROM qpl_questions LEFT JOIN " . $this->getAdditionalTableName() . " ON " . $this->getAdditionalTableName() . ".question_fi = qpl_questions.question_id WHERE qpl_questions.question_id = %s",
369 array("integer"),
370 array($question_id)
371 );
372 if ($result->numRows() == 1) {
373 $data = $this->ilDB->fetchAssoc($result);
374 $this->setId($question_id);
375 $this->setObjId($data["obj_fi"]);
376 $this->setNrOfTries($data['nr_of_tries']);
377 $this->setTitle($data["title"]);
378 $this->setComment($data["description"]);
379 $this->setOriginalId($data["original_id"]);
380 $this->setAuthor($data["author"]);
381 $this->setPoints($data["points"]);
382 $this->setIdenticalScoring($data["identical_scoring"]);
383 $this->setOwner($data["owner"]);
384 include_once("./Services/RTE/classes/class.ilRTE.php");
385 $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data['question_text'], 1));
386 $this->setEstimatedWorkingTime(substr($data["working_time"], 0, 2), substr($data["working_time"], 3, 2), substr($data["working_time"], 6, 2));
388 $this->loadCorrectAnswerData($question_id);
389 $this->setMinAutoComplete($data["min_auto_complete"]);
390 if (isset($data['feedback_setting'])) {
391 $this->setSpecificFeedbackSetting((int) $data['feedback_setting']);
392 }
393
394 try {
398 }
399
400 try {
401 $this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);
403 }
404 }
405
406 $this->loadCorrectAnswerData($question_id);
407 $this->createArrayFromFile();
408 parent::loadFromDb($question_id);
409 }
setIdenticalScoring($a_identical_scoring)
getAdditionalTableName()
Returns the name of the additional question data table in the database.
setMinAutoComplete($minAutoComplete)
setSpecificFeedbackSetting($specificFeedbackSetting)
setId($id=-1)
Sets the id of the assQuestion object.
setOriginalId($original_id)
setObjId($obj_id=0)
Set the object id of the container object.
setTitle($title="")
Sets the title string of the assQuestion object.
setOwner($owner="")
Sets the creator/owner ID of the assQuestion object.
setEstimatedWorkingTime($hour=0, $min=0, $sec=0)
Sets the estimated working time of a question from given hour, minute and second.
setAuthor($author="")
Sets the authors name of the assQuestion object.
setLifecycle(ilAssQuestionLifecycle $lifecycle)
setPoints($a_points)
Sets the maximum available points for the question.
setComment($comment="")
Sets the comment string of the assQuestion object.
setNrOfTries($a_nr_of_tries)
setAdditionalContentEditingMode($additinalContentEditingMode)
setter for additional content editing mode for this question
setQuestion($question="")
Sets the question string of the question object.
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...

References $data, Vendor\Package\$e, $result, ilRTE\_replaceMediaObjectImageSrc(), createArrayFromFile(), getAdditionalTableName(), ilAssQuestionLifecycle\getDraftInstance(), ilAssQuestionLifecycle\getInstance(), loadCorrectAnswerData(), assQuestion\setAdditionalContentEditingMode(), assQuestion\setAuthor(), assQuestion\setComment(), assQuestion\setEstimatedWorkingTime(), assQuestion\setId(), setIdenticalScoring(), assQuestion\setLifecycle(), setLongMenuTextValue(), setMinAutoComplete(), assQuestion\setNrOfTries(), assQuestion\setObjId(), assQuestion\setOriginalId(), assQuestion\setOwner(), assQuestion\setPoints(), assQuestion\setQuestion(), setSpecificFeedbackSetting(), and assQuestion\setTitle().

+ Here is the call graph for this function:

◆ lookupForExistingSolutions()

assLongMenu::lookupForExistingSolutions (   $activeId,
  $pass 
)

Lookup if an authorized or intermediate solution exists.

Parameters
int$activeId
int$pass
Returns
array ['authorized' => bool, 'intermediate' => bool]

Definition at line 694 of file class.assLongMenu.php.

695 {
696 global $DIC;
697 $ilDB = $DIC['ilDB'];
698
699 $return = array(
700 'authorized' => false,
701 'intermediate' => false
702 );
703
704 $query = "
705 SELECT authorized, COUNT(*) cnt
706 FROM tst_solutions
707 WHERE active_fi = " . $ilDB->quote($activeId, 'integer') . "
708 AND question_fi = " . $ilDB->quote($this->getId(), 'integer') . "
709 AND pass = " . $ilDB->quote($pass, 'integer') . "
710 AND value2 <> '-1'
711 ";
712
713 if ($this->getStep() !== null) {
714 $query .= " AND step = " . $ilDB->quote((int) $this->getStep(), 'integer') . " ";
715 }
716
717 $query .= "
718 GROUP BY authorized
719 ";
720
721 $result = $ilDB->query($query);
722
723 while ($row = $ilDB->fetchAssoc($result)) {
724 if ($row['authorized']) {
725 $return['authorized'] = $row['cnt'] > 0;
726 } else {
727 $return['intermediate'] = $row['cnt'] > 0;
728 }
729 }
730 return $return;
731 }
$query

References $DIC, $ilDB, $pass, $query, $result, assQuestion\getId(), and assQuestion\getStep().

+ Here is the call graph for this function:

◆ saveAdditionalQuestionDataToDb()

assLongMenu::saveAdditionalQuestionDataToDb ( )

Saves a record to the question types additional data table.

Returns
mixed

Implements ilObjQuestionScoringAdjustable.

Definition at line 248 of file class.assLongMenu.php.

249 {
250 // save additional data
251 $this->ilDB->manipulateF(
252 "DELETE FROM " . $this->getAdditionalTableName() . " WHERE question_fi = %s",
253 array( "integer" ),
254 array( $this->getId() )
255 );
256 $this->ilDB->manipulateF(
257 "INSERT INTO " . $this->getAdditionalTableName(
258 ) . " (question_fi, long_menu_text, feedback_setting, min_auto_complete, identical_scoring) VALUES (%s, %s, %s, %s, %s)",
259 array( "integer", "text", "integer", "integer", "integer"),
260 array(
261 $this->getId(),
262 $this->getLongMenuTextValue(),
263 (int) $this->getSpecificFeedbackSetting(),
264 (int) $this->getMinAutoComplete(),
265 (int) $this->getIdenticalScoring()
266 )
267 );
268
269 $this->createFileFromArray();
270 }

References createFileFromArray(), getAdditionalTableName(), assQuestion\getId(), getIdenticalScoring(), getLongMenuTextValue(), getMinAutoComplete(), and getSpecificFeedbackSetting().

Referenced by saveToDb().

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

◆ saveAnswerSpecificDataToDb()

assLongMenu::saveAnswerSpecificDataToDb ( )

Definition at line 272 of file class.assLongMenu.php.

273 {
274 $this->clearAnswerSpecificDataFromDb($this->getId());
275 $type_array = $this->getAnswerType();
276 $points = 0;
277 foreach ($this->getCorrectAnswers() as $gap_number => $gap) {
278 foreach ($gap[0] as $position => $answer) {
279 if ($type_array == null) {
280 $type = $gap[2];
281 } else {
282 $type = $type_array[$gap_number];
283 }
284 $this->db->replace(
285 $this->getAnswerTableName(),
286 array(
287 'question_fi' => array('integer', (int) $this->getId()),
288 'gap_number' => array('integer', (int) $gap_number),
289 'position' => array('integer', (int) $position)
290 ),
291 array(
292 'answer_text' => array('text', $answer),
293 'points' => array('float', $gap[1]),
294 'type' => array('integer', (int) $type)
295 )
296 );
297 }
298 $points += $gap[1];
299 }
300 $this->setPoints($points);
301 }
clearAnswerSpecificDataFromDb($question_id)
$type

References assQuestion\$points, $type, clearAnswerSpecificDataFromDb(), getAnswerTableName(), getAnswerType(), getCorrectAnswers(), assQuestion\getId(), and assQuestion\setPoints().

Referenced by saveToDb().

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

◆ savePreviewData()

assLongMenu::savePreviewData ( ilAssQuestionPreviewSession  $previewSession)
protected

Reimplemented from assQuestion.

Definition at line 747 of file class.assLongMenu.php.

748 {
749 if (array_key_exists('answer', $_POST)) {
750 $previewSession->setParticipantsSolution(array_map(function ($value) {
751 return trim($value);
752 }, $_POST['answer']));
753 } else {
754 $previewSession->setParticipantsSolution(null);
755 }
756 }

References $_POST, and ilAssQuestionPreviewSession\setParticipantsSolution().

+ Here is the call graph for this function:

◆ saveToDb()

assLongMenu::saveToDb (   $original_id = "")

Saves the question to the database.

Parameters
integer$original_id@access public

Reimplemented from assQuestion.

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

169 {
173 parent::saveToDb($original_id);
174 }
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
saveQuestionDataToDb($original_id="")

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

+ Here is the call graph for this function:

◆ saveWorkingData()

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

Saves the learners input of the question to the database.

@access public

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

Reimplemented from assQuestion.

Definition at line 652 of file class.assLongMenu.php.

653 {
654 if (is_null($pass)) {
655 include_once "./Modules/Test/classes/class.ilObjTest.php";
656 $pass = ilObjTest::_getPass($active_id);
657 }
658
659 $entered_values = 0;
660
661 $this->getProcessLocker()->executeUserSolutionUpdateLockOperation(function () use (&$entered_values, $active_id, $pass, $authorized) {
662 $this->removeCurrentSolution($active_id, $pass, $authorized);
663
664 foreach ($this->getSolutionSubmit() as $val1 => $val2) {
665 $value = ilUtil::stripSlashes(trim($val2), false);
666 if (strlen($value)) {
667 $this->saveCurrentSolution($active_id, $pass, $val1, $value, $authorized);
668 $entered_values++;
669 }
670 }
671 });
672
673 if ($entered_values) {
674 include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
676 assQuestion::logAction($this->lng->txtlng("assessment", "log_user_entered_values", ilObjAssessmentFolder::_getLogLanguage()), $active_id, $this->getId());
677 }
678 } else {
679 include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
681 assQuestion::logAction($this->lng->txtlng("assessment", "log_user_not_entered_values", ilObjAssessmentFolder::_getLogLanguage()), $active_id, $this->getId());
682 }
683 }
684 return true;
685 }
saveCurrentSolution($active_id, $pass, $value1, $value2, $authorized=true, $tstamp=null)
static logAction($logtext="", $active_id="", $question_id="")
Logs an action into the Test&Assessment log.
removeCurrentSolution($active_id, $pass, $authorized=true)
static _getLogLanguage()
retrieve the log language for assessment logging
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $pass, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilObjTest\_getPass(), assQuestion\getProcessLocker(), getSolutionSubmit(), assQuestion\logAction(), assQuestion\removeCurrentSolution(), assQuestion\saveCurrentSolution(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ setAnswers()

assLongMenu::setAnswers (   $answers)

Definition at line 108 of file class.assLongMenu.php.

109 {
110 $this->answers = $answers;
111 }

References $answers.

Referenced by createArrayFromFile().

+ Here is the caller graph for this function:

◆ setAnswerType()

assLongMenu::setAnswerType (   $answerType)
Parameters
mixed$answerType

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

61 {
62 $this->answerType = $answerType;
63 }

References $answerType.

◆ setCorrectAnswers()

assLongMenu::setCorrectAnswers (   $correct_answers)

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

75 {
76 $this->correct_answers = $correct_answers;
77 }

References $correct_answers.

Referenced by loadCorrectAnswerData().

+ Here is the caller graph for this function:

◆ setExportDetailsXLS()

assLongMenu::setExportDetailsXLS (   $worksheet,
  $startrow,
  $active_id,
  $pass 
)

{Creates an Excel worksheet for the detailed cumulated results of this question.

Parameters
object$worksheetReference to the parent excel worksheet
object$startrowStartrow of the output in the excel worksheet
object$active_idActive id of the participant
object$passTest pass
Returns
object
}

Reimplemented from assQuestion.

Definition at line 790 of file class.assLongMenu.php.

791 {
792 parent::setExportDetailsXLS($worksheet, $startrow, $active_id, $pass);
793
794 $solution = $this->getSolutionValues($active_id, $pass);
795
796 $i = 1;
797 foreach ($this->getCorrectAnswers() as $gap_index => $gap) {
798 $worksheet->setCell($startrow + $i, 0, $this->lng->txt('assLongMenu') . " $i");
799 $worksheet->setBold($worksheet->getColumnCoord(0) . ($startrow + $i));
800 foreach ($solution as $solutionvalue) {
801 if ($gap_index == $solutionvalue["value1"]) {
802 switch ($gap[2]) {
804 $value = $solutionvalue["value2"];
805 if ($value == -1) {
806 $value = '';
807 }
808 $worksheet->setCell($startrow + $i, 2, $value);
809 break;
811 $worksheet->setCell($startrow + $i, 2, $solutionvalue["value2"]);
812 break;
813 }
814 }
815 }
816 $i++;
817 }
818
819 return $startrow + $i + 1;
820 }
const ANSWER_TYPE_TEXT_VAL
const ANSWER_TYPE_SELECT_VAL
getSolutionValues($active_id, $pass=null, $authorized=true)
Loads solutions of a given user from the database an returns it.
$i
Definition: metadata.php:24

References $i, $pass, ANSWER_TYPE_SELECT_VAL, ANSWER_TYPE_TEXT_VAL, getCorrectAnswers(), and assQuestion\getSolutionValues().

+ Here is the call graph for this function:

◆ setIdenticalScoring()

assLongMenu::setIdenticalScoring (   $a_identical_scoring)
Parameters
$a_identical_scoring

Definition at line 918 of file class.assLongMenu.php.

919 {
920 $this->identical_scoring = ($a_identical_scoring) ? 1 : 0;
921 }

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setJsonStructure()

assLongMenu::setJsonStructure (   $json_structure)
Parameters
mixed$json_structure

Definition at line 129 of file class.assLongMenu.php.

130 {
131 $this->json_structure = $json_structure;
132 }

References $json_structure.

Referenced by loadCorrectAnswerData().

+ Here is the caller graph for this function:

◆ setLongMenuTextValue()

assLongMenu::setLongMenuTextValue (   $long_menu_text = "")

Definition at line 98 of file class.assLongMenu.php.

99 {
100 $this->long_menu_text = $this->getHtmlQuestionContentPurifier()->purify($long_menu_text);
101 }

References $long_menu_text, and assQuestion\getHtmlQuestionContentPurifier().

Referenced by lmMigrateQuestionTypeSpecificContent(), and loadFromDb().

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

◆ setMinAutoComplete()

assLongMenu::setMinAutoComplete (   $minAutoComplete)

Definition at line 144 of file class.assLongMenu.php.

145 {
146 $this->minAutoComplete = $minAutoComplete;
147 }

References $minAutoComplete.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setSpecificFeedbackSetting()

assLongMenu::setSpecificFeedbackSetting (   $specificFeedbackSetting)

Definition at line 134 of file class.assLongMenu.php.

135 {
136 $this->specificFeedbackSetting = $specificFeedbackSetting;
137 }

References $specificFeedbackSetting.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ toJSON()

assLongMenu::toJSON ( )

Returns a JSON representation of the question.

Reimplemented from assQuestion.

Definition at line 886 of file class.assLongMenu.php.

887 {
888 include_once("./Services/RTE/classes/class.ilRTE.php");
889 $result = array();
890 $result['id'] = (int) $this->getId();
891 $result['type'] = (string) $this->getQuestionType();
892 $result['title'] = (string) $this->getTitle();
893 $replaced_quesiton_text = $this->getLongMenuTextValue();
894 $result['question'] = $this->formatSAQuestion($this->getQuestion());
895 $result['lmtext'] = $this->formatSAQuestion($replaced_quesiton_text);
896 $result['nr_of_tries'] = (int) $this->getNrOfTries();
897 $result['shuffle'] = (bool) $this->getShuffle();
898 $result['feedback'] = array(
899 'onenotcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), false)),
900 'allcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), true))
901 );
902
903 $mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $this->getId());
904 $result['answers'] = $this->getAnswers();
905 $result['correct_answers'] = $this->getCorrectAnswers();
906 $result['mobs'] = $mobs;
907 return json_encode($result);
908 }
getQuestionType()
Returns the question type of the question.
formatSAQuestion($a_q)
Format self assessment question.
getShuffle()
Gets the shuffle flag.
getTitle()
Gets the title string of the assQuestion object.
getQuestion()
Gets the question string of the question object.
static _getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
$mobs
Definition: imgupload.php:54

References $mobs, $result, ilObjMediaObject\_getMobsOfObject(), assQuestion\formatSAQuestion(), getAnswers(), getCorrectAnswers(), assQuestion\getId(), getLongMenuTextValue(), assQuestion\getNrOfTries(), assQuestion\getQuestion(), getQuestionType(), assQuestion\getShuffle(), and assQuestion\getTitle().

+ Here is the call graph for this function:

Field Documentation

◆ $answers

assLongMenu::$answers = []
private

◆ $answerType

assLongMenu::$answerType
private

Definition at line 13 of file class.assLongMenu.php.

Referenced by getAnswerType(), and setAnswerType().

◆ $correct_answers

◆ $identical_scoring

assLongMenu::$identical_scoring
private

Definition at line 19 of file class.assLongMenu.php.

◆ $ilDB

assLongMenu::$ilDB
private

Definition at line 16 of file class.assLongMenu.php.

Referenced by lookupForExistingSolutions().

◆ $json_structure

assLongMenu::$json_structure
private

Definition at line 15 of file class.assLongMenu.php.

Referenced by getJsonStructure(), and setJsonStructure().

◆ $long_menu_text

assLongMenu::$long_menu_text
private

Definition at line 14 of file class.assLongMenu.php.

Referenced by getLongMenuTextValue(), and setLongMenuTextValue().

◆ $minAutoComplete

assLongMenu::$minAutoComplete
private

Definition at line 18 of file class.assLongMenu.php.

Referenced by setMinAutoComplete().

◆ $specificFeedbackSetting

assLongMenu::$specificFeedbackSetting
private

Definition at line 17 of file class.assLongMenu.php.

Referenced by getSpecificFeedbackSetting(), and setSpecificFeedbackSetting().

◆ ANSWER_TYPE_SELECT_VAL

const assLongMenu::ANSWER_TYPE_SELECT_VAL = 0

◆ ANSWER_TYPE_TEXT_VAL

const assLongMenu::ANSWER_TYPE_TEXT_VAL = 1

◆ GAP_PLACEHOLDER

◆ MAX_INPUT_FIELDS

const assLongMenu::MAX_INPUT_FIELDS = 500

◆ MIN_LENGTH_AUTOCOMPLETE

const assLongMenu::MIN_LENGTH_AUTOCOMPLETE = 3

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