ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 ()
 
 setLongMenuTextValue ($long_menu_text="")
 
 getLongMenuTextValue ()
 
 setAnswers ($answers)
 
 getAnswers ()
 
 getJsonStructure ()
 
 setJsonStructure ($json_structure)
 
 setSpecificFeedbackSetting ($specificFeedbackSetting)
 
 getSpecificFeedbackSetting ()
 
 setMinAutoComplete ($minAutoComplete)
 
 getMinAutoComplete ()
 
 isComplete ()
 
 saveToDb ($original_id="")
 
 checkQuestionCustomPart ()
 
 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)
 
 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)
 {} 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)
 
 toJSON ()
 Returns a JSON representation of the question. More...
 
- Public Member Functions inherited from assQuestion
 __construct ( $title="", $comment="", $author="", $owner=-1, $question="")
 assQuestion constructor More...
 
 getShuffler ()
 
 setShuffler (ilArrayElementShuffler $shuffler)
 
 setProcessLocker ($processLocker)
 
 getProcessLocker ()
 
 fromXML (&$item, &$questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping)
 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...
 
 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...
 
 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...
 
 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 ()
 
 createRandomSolution ($test_id, $user_id)
 
 _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...
 
 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)
 
 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...
 

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_DEFAULT = 'default'
 constant for additional content editing mode "default" More...
 
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT = '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)
 
 reworkWorkingData ($active_id, $pass, $obligationsAnswered, $authorized)
 {} More...
 
 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)
 
 reworkWorkingData ($active_id, $pass, $obligationsAnswered, $authorized)
 Reworks the allready saved working data if neccessary. More...
 
 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)
 
 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)
 
 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
 
 $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)
 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)
 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
 
 $outputType = OUTPUT_JAVASCRIPT
 
 $suggested_solutions
 
 $original_id
 
 $page
 
 $external_id = ''
 
 $questionChangeListeners = array()
 
 $processLocker
 
 $step = null
 
 $lastChange
 
 $shuffler
 
 $testQuestionConfig
 
- 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 32 of file class.assLongMenu.php.

References assQuestion\$author, assQuestion\$comment, $GLOBALS, assQuestion\$owner, assQuestion\$question, assQuestion\$title, and ilAssConfigurableMultiOptionQuestionFeedback\FEEDBACK_SETTING_ALL.

38  {
39  require_once 'Modules/TestQuestionPool/classes/feedback/class.ilAssConfigurableMultiOptionQuestionFeedback.php';
41  $this->minAutoComplete = self::MIN_LENGTH_AUTOCOMPLETE;
42  parent::__construct($title, $comment, $author, $owner, $question);
43  $this->ilDB = $GLOBALS['DIC']['ilDB'];
44  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Database Wrapper.
Definition: class.ilDB.php:29

Member Function Documentation

◆ assertDirExists()

assLongMenu::assertDirExists ( )
private

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

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

Referenced by buildFileName().

331  {
332  $folder_name = $this->buildFolderName();
333  if (!ilUtil::makeDirParents($folder_name)) {
334  throw new ilException('Cannot create export directory');
335  }
336 
337  if (
338  !is_dir($folder_name) ||
339  !is_readable($folder_name) ||
340  !is_writable($folder_name)
341  ) {
342  throw new ilException('Cannot create export directory');
343  }
344  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
+ 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 86 of file class.assLongMenu.php.

References assertDirExists(), and buildFolderName().

Referenced by createFileFromArray().

87  {
88  try {
89  $this->assertDirExists();
90  return $this->buildFolderName() . $gap_id . '.txt';
91  } catch (ilException $e) {
92  }
93  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildFolderName()

assLongMenu::buildFolderName ( )
private

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

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

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

77  {
78  return ilUtil::getDataDir() . '/assessment/longMenuQuestion/' . $this->getId() . '/' ;
79  }
getId()
Gets the id of the assQuestion object.
static getDataDir()
get data directory (outside webspace)
+ 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 !!)

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

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

Referenced by getUserQuestionResult().

575  {
576  if ($returndetails) {
577  throw new ilTestException('return details not implemented for ' . __METHOD__);
578  }
579 
580  $found_values = array();
581  if (is_null($pass)) {
582  $pass = $this->getSolutionMaxPass($active_id);
583  }
584  $result = $this->getCurrentSolutionResultSet($active_id, $pass, $authorizedSolution);
585  while ($data = $this->ilDB->fetchAssoc($result)) {
586  $found_values[(int) $data['value1']] = $data['value2'];
587  }
588 
589  $points = $this->calculateReachedPointsForSolution($found_values, $active_id);
590 
591  return $points;
592  }
$result
getSolutionMaxPass($active_id)
Returns the maximum pass a users question solution.
calculateReachedPointsForSolution($found_values, $active_id=0)
Base Exception for all Exceptions relating to Modules/Test.
fetchAssoc($a_set)
Fetch row as associative array from result set.
Create styles array
The data for the language used.
Database Wrapper.
Definition: class.ilDB.php:29
getCurrentSolutionResultSet($active_id, $pass, $authorized=true)
Get a restulset for the current user solution for a this question by active_id and pass...
+ 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 594 of file class.assLongMenu.php.

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

Referenced by calculateReachedPoints().

595  {
596  $points = 0;
597  foreach ($found_values as $key => $answer) {
598  if ($answer != '') {
599  $correct_answers = $this->getCorrectAnswersForGap($this->id, $key);
600  if (in_array($answer, $correct_answers)) {
601  $points += $this->getPointsForGap($this->id, $key);
602  }
603  }
604  }
605  return $points;
606  }
getCorrectAnswersForGap($question_id, $gap_id)
getPointsForGap($question_id, $gap_id)
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkQuestionCustomPart()

assLongMenu::checkQuestionCustomPart ( )

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

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

174  {
175  $hidden_text_files = $this->getAnswers();
177  $points = array();
178  if (sizeof($correct_answers) == 0 || sizeof($hidden_text_files) == 0) {
179  return false;
180  }
181  if (sizeof($correct_answers) != sizeof($hidden_text_files)) {
182  return false;
183  }
184  foreach ($correct_answers as $key => $correct_answers_row) {
185  if ($this->correctAnswerDoesNotExistInAnswerOptions($correct_answers_row, $hidden_text_files[$key])) {
186  return false;
187  }
188  if (!is_array($correct_answers_row[0]) || sizeof($correct_answers_row[0]) == 0) {
189  return false;
190  }
191  if ($correct_answers_row[1] > 0) {
192  array_push($points, $correct_answers_row[1]);
193  }
194  }
195  if (sizeof($correct_answers) != sizeof($points)) {
196  return false;
197  }
198 
199  foreach ($points as $row) {
200  if ($row <= 0) {
201  return false;
202  }
203  }
204  return true;
205  }
correctAnswerDoesNotExistInAnswerOptions($answers, $answer_options)
Create styles array
The data for the language used.
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

◆ clearAnswerSpecificDataFromDb()

assLongMenu::clearAnswerSpecificDataFromDb (   $question_id)

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

References array, getAnswerTableName(), and ilDB\manipulateF().

Referenced by saveAnswerSpecificDataToDb().

830  {
831  $this->ilDB->manipulateF(
832  'DELETE FROM ' . $this->getAnswerTableName() . ' WHERE question_fi = %s',
833  array( 'integer' ),
834  array( $question_id )
835  );
836  }
manipulateF($a_query, $a_types, $a_values)
Formatted manupulate (for DELETE, UPDATE, INSERT).
Create styles array
The data for the language used.
Database Wrapper.
Definition: class.ilDB.php:29
+ 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 325 of file class.assLongMenu.php.

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

Referenced by createFileFromArray(), and delete().

326  {
327  ilUtil::delDir($this->buildFolderName(), $let_folder_exists);
328  }
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ 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 505 of file class.assLongMenu.php.

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

506  {
507  if ($this->id <= 0) {
508  // The question has not been saved. It cannot be duplicated
509  return;
510  }
511  // duplicate the question in database
512  $clone = $this;
513  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
515  $clone->id = -1;
516  $source_questionpool_id = $this->getObjId();
517  $clone->setObjId($target_questionpool_id);
518  if ($title) {
519  $clone->setTitle($title);
520  }
521  $clone->saveToDb();
522 
523  $clone->copyPageOfQuestion($original_id);
524  $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
525 
526  $clone->onCopy($source_questionpool_id, $original_id, $clone->getObjId(), $clone->getId());
527 
528  return $clone->id;
529  }
static _getOriginalId($question_id)
Returns the original id of a question.
getObjId()
Get the object id of the container object.
+ Here is the call graph for this function:

◆ correctAnswerDoesNotExistInAnswerOptions()

assLongMenu::correctAnswerDoesNotExistInAnswerOptions (   $answers,
  $answer_options 
)
private

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

References $answers, and $key.

Referenced by checkQuestionCustomPart().

208  {
209  foreach ($answers[0] as $key => $answer) {
210  if (!in_array($answer, $answer_options)) {
211  return true;
212  }
213  }
214  return false;
215  }
$key
Definition: croninfo.php:18
+ Here is the caller graph for this function:

◆ createArrayFromFile()

assLongMenu::createArrayFromFile ( )
private

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

References $answers, $file, $files, array, buildFolderName(), and setAnswers().

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

308  {
309  $files = glob($this->buildFolderName() . '*.txt');
310 
311  if ($files === false) {
312  $files = array();
313  }
314 
315  $answers = array();
316 
317  foreach ($files as $file) {
318  $gap = str_replace('.txt', '', basename($file));
319  $answers[(int) $gap] = explode("\n", file_get_contents($file));
320  }
321  $this->setAnswers($answers);
322  return $answers;
323  }
$files
Definition: add-vimline.php:18
setAnswers($answers)
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createFileFromArray()

assLongMenu::createFileFromArray ( )
private

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

References $file, $key, buildFileName(), clearFolder(), and getAnswers().

Referenced by saveAdditionalQuestionDataToDb().

290  {
291  $array = $this->getAnswers();
292  $this->clearFolder();
293  foreach ($array as $gap => $values) {
294  $file_content = '';
295  if (is_array($values)) {
296  foreach ($values as $key => $value) {
297  $file_content .= $value . "\n";
298  }
299  $file_content = rtrim($file_content, "\n");
300  $file = fopen($this->buildFileName($gap), "w");
301  fwrite($file, $file_content);
302  fclose($file);
303  }
304  }
305  }
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
clearFolder($let_folder_exists=true)
$key
Definition: croninfo.php:18
buildFileName($gap_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createNewOriginalFromThisDuplicate()

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

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

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

532  {
533  if ($this->id <= 0) {
534  // The question has not been saved. It cannot be duplicated
535  return;
536  }
537 
538  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
539 
540  $sourceQuestionId = $this->id;
541  $sourceParentId = $this->getObjId();
542 
543  // duplicate the question in database
544  $clone = $this;
545  $clone->id = -1;
546 
547  $clone->setObjId($targetParentId);
548 
549  if ($targetQuestionTitle) {
550  $clone->setTitle($targetQuestionTitle);
551  }
552 
553  $clone->saveToDb();
554  $clone->copyPageOfQuestion($sourceQuestionId);
555  $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
556 
557  $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
558 
559  return $clone->id;
560  }
getObjId()
Get the object id of the container object.
+ Here is the call graph for this function:

◆ delete()

assLongMenu::delete (   $original_id)

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

References assQuestion\$original_id, and clearFolder().

839  {
840  parent::delete($original_id);
841  $this->clearFolder(false);
842  }
clearFolder($let_folder_exists=true)
+ Here is the call graph for this function:

◆ duplicate()

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

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

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

462  {
463  if ($this->id <= 0) {
464  // The question has not been saved. It cannot be duplicated
465  return;
466  }
467 
468  // duplicate the question in database
469  $this_id = $this->getId();
470  $thisObjId = $this->getObjId();
471 
472  $clone = $this;
473  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
475  $clone->id = -1;
476 
477  if ((int) $testObjId > 0) {
478  $clone->setObjId($testObjId);
479  }
480 
481  if ($title) {
482  $clone->setTitle($title);
483  }
484 
485  if ($author) {
486  $clone->setAuthor($author);
487  }
488  if ($owner) {
489  $clone->setOwner($owner);
490  }
491 
492  if ($for_test) {
493  $clone->saveToDb($original_id);
494  } else {
495  $clone->saveToDb();
496  }
497 
498  $clone->copyPageOfQuestion($this_id);
499  $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
500  $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
501 
502  return $clone->id;
503  }
getId()
Gets the id of the assQuestion object.
static _getOriginalId($question_id)
Returns the original id of a question.
getObjId()
Get the object id of the container object.
+ 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

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

Referenced by loadFromDb(), and saveAdditionalQuestionDataToDb().

743  {
744  return 'qpl_qst_lome';
745  }
+ Here is the caller graph for this function:

◆ getAnswers()

assLongMenu::getAnswers ( )

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

References $answers.

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

111  {
112  return $this->answers;
113  }
+ Here is the caller graph for this function:

◆ getAnswersObject()

assLongMenu::getAnswersObject ( )

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

References createArrayFromFile().

451  {
452  return json_encode($this->createArrayFromFile());
453  }
+ Here is the call graph for this function:

◆ getAnswerTableName()

assLongMenu::getAnswerTableName ( )

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

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

82  {
83  return "qpl_a_lome";
84  }
+ Here is the caller graph for this function:

◆ getAnswerType()

assLongMenu::getAnswerType ( )
Returns
mixed

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

References $answerType.

Referenced by saveAnswerSpecificDataToDb().

50  {
51  return $this->answerType;
52  }
+ 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 819 of file class.assLongMenu.php.

References createArrayFromFile().

820  {
821  return $this->createArrayFromFile();
822  }
+ Here is the call graph for this function:

◆ getCorrectAnswers()

assLongMenu::getCorrectAnswers ( )
Returns
mixed

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

References $correct_answers.

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

66  {
68  }
+ Here is the caller graph for this function:

◆ getCorrectAnswersAsJson()

assLongMenu::getCorrectAnswersAsJson ( )

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

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

456  {
457  $this->loadCorrectAnswerData($this->getId());
458  return $this->getJsonStructure();
459  }
getId()
Gets the id of the assQuestion object.
loadCorrectAnswerData($question_id)
+ Here is the call graph for this function:

◆ getCorrectAnswersForGap()

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

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

References $correct_answers, $data, $res, array, ilDB\fetchAssoc(), and getAnswerTableName().

Referenced by calculateReachedPointsForSolution().

422  {
424  $res = $this->db->queryF(
425  'SELECT answer_text FROM ' . $this->getAnswerTableName() . ' WHERE question_fi = %s AND gap_number = %s',
426  array('integer', 'integer'),
427  array($question_id, $gap_id)
428  );
429  while ($data = $this->ilDB->fetchAssoc($res)) {
430  $correct_answers[] = rtrim($data['answer_text']);
431  }
432  return $correct_answers;
433  }
fetchAssoc($a_set)
Fetch row as associative array from result set.
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
Database Wrapper.
Definition: class.ilDB.php:29
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCorrectAnswersForQuestionSolution()

assLongMenu::getCorrectAnswersForQuestionSolution (   $question_id)

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

References $correct_answers, $data, $res, array, ilDB\fetchAssoc(), and getAnswerTableName().

403  {
405  $res = $this->db->queryF(
406  'SELECT gap_number, answer_text FROM ' . $this->getAnswerTableName() . ' WHERE question_fi = %s',
407  array('integer'),
408  array($question_id)
409  );
410  while ($data = $this->ilDB->fetchAssoc($res)) {
411  if (array_key_exists($data['gap_number'], $correct_answers)) {
412  $correct_answers[$data['gap_number']] .= ' ' . $this->lng->txt("or") . ' ';
413  $correct_answers[$data['gap_number']] .= rtrim($data['answer_text']);
414  } else {
415  $correct_answers[$data['gap_number']] .= rtrim($data['answer_text']);
416  }
417  }
418  return $correct_answers;
419  }
fetchAssoc($a_set)
Fetch row as associative array from result set.
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
Database Wrapper.
Definition: class.ilDB.php:29
+ Here is the call graph for this function:

◆ getJsonStructure()

assLongMenu::getJsonStructure ( )
Returns
mixed

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

References $json_structure.

Referenced by getCorrectAnswersAsJson().

119  {
120  return $this->json_structure;
121  }
+ Here is the caller graph for this function:

◆ getLongMenuTextValue()

assLongMenu::getLongMenuTextValue ( )

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

References $long_menu_text.

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

101  {
102  return $this->long_menu_text;
103  }
+ Here is the caller graph for this function:

◆ getMaximumPoints()

assLongMenu::getMaximumPoints ( )

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

public

See also
$points

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

References assQuestion\$points, and getCorrectAnswers().

Referenced by getUserQuestionResult().

225  {
226  $sum = 0;
227  $points = $this->getCorrectAnswers();
228  if ($points) {
229  foreach ($points as $add) {
230  $sum += $add[1];
231  }
232  }
233  return $sum;
234  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMinAutoComplete()

assLongMenu::getMinAutoComplete ( )

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

Referenced by saveAdditionalQuestionDataToDb().

147  {
148  return $this->minAutoComplete ? $this->minAutoComplete : self::MIN_LENGTH_AUTOCOMPLETE;
149  }
+ Here is the caller graph for this function:

◆ getPointsForGap()

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

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

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

Referenced by calculateReachedPointsForSolution().

436  {
437  $points = 0;
438  $res = $this->db->queryF(
439  'SELECT points FROM ' . $this->getAnswerTableName() . ' WHERE question_fi = %s AND gap_number = %s GROUP BY gap_number, points',
440  array('integer', 'integer'),
441  array($question_id, $gap_id)
442  );
443  while ($data = $this->ilDB->fetchAssoc($res)) {
444  $points = $data['points'];
445  }
446  return $points;
447  }
fetchAssoc($a_set)
Fetch row as associative array from result set.
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
Database Wrapper.
Definition: class.ilDB.php:29
+ 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

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

Referenced by toJSON().

733  {
734  return "assLongMenu";
735  }
+ 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.

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

References getLongMenuTextValue().

752  {
753  return parent::getRTETextWithMediaObjects() . $this->getLongMenuTextValue();
754  }
+ Here is the call graph for this function:

◆ getSolutionSubmit()

assLongMenu::getSolutionSubmit ( )

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

References $_POST, $key, array, and ilUtil\stripSlashesRecursive().

Referenced by saveWorkingData().

699  {
700  $solutionSubmit = array();
701  $answer = ilUtil::stripSlashesRecursive($_POST['answer']);
702 
703  foreach ($answer as $key => $value) {
704  $solutionSubmit[$key] = $value;
705  }
706 
707  return $solutionSubmit;
708  }
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
Create styles array
The data for the language used.
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSpecificFeedbackSetting()

assLongMenu::getSpecificFeedbackSetting ( )

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

References $specificFeedbackSetting.

Referenced by saveAdditionalQuestionDataToDb().

137  {
139  }
+ 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 799 of file class.assLongMenu.php.

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

800  {
801  $result = new ilUserQuestionResult($this, $active_id, $pass);
802 
803  $points = $this->calculateReachedPoints($active_id, $pass);
804  $max_points = $this->getMaximumPoints();
805 
806  $result->setReachedPercentage(($points/$max_points) * 100);
807 
808  return $result;
809  }
calculateReachedPoints($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
Returns the points, a learner has reached answering the question.
$result
getMaximumPoints()
Returns the maximum points, a learner can reach answering the question.
Class ilUserQuestionResult.
+ Here is the call graph for this function:

◆ isComplete()

assLongMenu::isComplete ( )

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

References assQuestion\getPoints().

152  {
153  if (strlen($this->title)
154  && $this->author
155  && $this->question
156  && sizeof($this->answers) > 0
157  && sizeof($this->correct_answers) > 0
158  && $this->getPoints() > 0
159  ) {
160  return true;
161  }
162  return false;
163  }
getPoints()
Returns the maximum available points for the question.
+ Here is the call graph for this function:

◆ isShuffleAnswersEnabled()

assLongMenu::isShuffleAnswersEnabled ( )

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

825  {
826  return false;
827  }

◆ lmMigrateQuestionTypeSpecificContent()

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

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

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

848  {
849  $this->setLongMenuTextValue($migrator->migrateToLmContent($this->getLongMenuTextValue()));
850  }
setLongMenuTextValue($long_menu_text="")
+ Here is the call graph for this function:

◆ loadCorrectAnswerData()

assLongMenu::loadCorrectAnswerData (   $question_id)
private

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

References $correct_answers, $data, $res, array, ilDB\fetchAssoc(), setCorrectAnswers(), and setJsonStructure().

Referenced by getCorrectAnswersAsJson(), and loadFromDb().

385  {
386  $res = $this->db->queryF(
387  "SELECT * FROM {$this->getAnswerTableName()} WHERE question_fi = %s ORDER BY gap_number, position ASC",
388  array('integer'),
389  array($question_id)
390  );
391 
393  while ($data = $this->ilDB->fetchAssoc($res)) {
394  $correct_answers[$data['gap_number']][0][$data['position']] = rtrim($data['answer_text']);
395  $correct_answers[$data['gap_number']][1] = $data['points'];
396  $correct_answers[$data['gap_number']][2] = $data['type'];
397  }
398  $this->setJsonStructure(json_encode($correct_answers));
400  }
setJsonStructure($json_structure)
fetchAssoc($a_set)
Fetch row as associative array from result set.
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
Database Wrapper.
Definition: class.ilDB.php:29
setCorrectAnswers($correct_answers)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadFromDb()

assLongMenu::loadFromDb (   $question_id)

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

References $data, $result, ilRTE\_replaceMediaObjectImageSrc(), array, createArrayFromFile(), ilDB\fetchAssoc(), getAdditionalTableName(), loadCorrectAnswerData(), ilDB\queryF(), assQuestion\setAdditionalContentEditingMode(), assQuestion\setAuthor(), assQuestion\setComment(), assQuestion\setEstimatedWorkingTime(), assQuestion\setId(), setLongMenuTextValue(), setMinAutoComplete(), assQuestion\setNrOfTries(), assQuestion\setObjId(), assQuestion\setOriginalId(), assQuestion\setOwner(), assQuestion\setPoints(), assQuestion\setQuestion(), setSpecificFeedbackSetting(), and assQuestion\setTitle().

347  {
348  $result = $this->ilDB->queryF(
349  "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",
350  array("integer"),
351  array($question_id)
352  );
353  if ($result->numRows() == 1) {
354  $data = $this->ilDB->fetchAssoc($result);
355  $this->setId($question_id);
356  $this->setObjId($data["obj_fi"]);
357  $this->setNrOfTries($data['nr_of_tries']);
358  $this->setTitle($data["title"]);
359  $this->setComment($data["description"]);
360  $this->setOriginalId($data["original_id"]);
361  $this->setAuthor($data["author"]);
362  $this->setPoints($data["points"]);
363  $this->setOwner($data["owner"]);
364  include_once("./Services/RTE/classes/class.ilRTE.php");
365  $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data['question_text'], 1));
366  $this->setEstimatedWorkingTime(substr($data["working_time"], 0, 2), substr($data["working_time"], 3, 2), substr($data["working_time"], 6, 2));
367  $this->setLongMenuTextValue(ilRTE::_replaceMediaObjectImageSrc($data['long_menu_text'], 1));
368  $this->loadCorrectAnswerData($question_id);
369  $this->setMinAutoComplete($data["min_auto_complete"]);
370  if (isset($data['feedback_setting'])) {
371  $this->setSpecificFeedbackSetting((int) $data['feedback_setting']);
372  }
373  try {
374  $this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);
375  } catch (ilTestQuestionPoolException $e) {
376  }
377  }
378 
379  $this->loadCorrectAnswerData($question_id);
380  $this->createArrayFromFile();
381  parent::loadFromDb($question_id);
382  }
$result
setMinAutoComplete($minAutoComplete)
getAdditionalTableName()
Returns the name of the additional question data table in the database.
setId($id=-1)
Sets the id of the assQuestion object.
setSpecificFeedbackSetting($specificFeedbackSetting)
setEstimatedWorkingTime($hour=0, $min=0, $sec=0)
Sets the estimated working time of a question from given hour, minute and second. ...
setNrOfTries($a_nr_of_tries)
setAdditionalContentEditingMode($additinalContentEditingMode)
setter for additional content editing mode for this question
loadCorrectAnswerData($question_id)
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...
fetchAssoc($a_set)
Fetch row as associative array from result set.
setAuthor($author="")
Sets the authors name of the assQuestion object.
setLongMenuTextValue($long_menu_text="")
Create styles array
The data for the language used.
queryF($a_query, $a_types, $a_values)
Formatted query (for SELECTS).
setPoints($a_points)
Sets the maximum available points for the question.
Database Wrapper.
Definition: class.ilDB.php:29
setQuestion($question="")
Sets the question string of the question object.
setOriginalId($original_id)
setTitle($title="")
Sets the title string of the assQuestion object.
setObjId($obj_id=0)
Set the object id of the container object.
setComment($comment="")
Sets the comment string of the assQuestion object.
setOwner($owner="")
Sets the creator/owner ID of the assQuestion object.
+ 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 658 of file class.assLongMenu.php.

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

659  {
660  global $ilDB;
661 
662  $return = array(
663  'authorized' => false,
664  'intermediate' => false
665  );
666 
667  $query = "
668  SELECT authorized, COUNT(*) cnt
669  FROM tst_solutions
670  WHERE active_fi = " . $ilDB->quote($activeId, 'integer') . "
671  AND question_fi = " . $ilDB->quote($this->getId(), 'integer') . "
672  AND pass = " . $ilDB->quote($pass, 'integer') . "
673  AND value2 <> '-1'
674  ";
675 
676  if ($this->getStep() !== null) {
677  $query .= " AND step = " . $ilDB->quote((int) $this->getStep(), 'integer') . " ";
678  }
679 
680  $query .= "
681  GROUP BY authorized
682  ";
683 
684  $result = $ilDB->query($query);
685 
686  while ($row = $ilDB->fetchAssoc($result)) {
687  if ($row['authorized']) {
688  $return['authorized'] = $row['cnt'] > 0;
689  } else {
690  $return['intermediate'] = $row['cnt'] > 0;
691  }
692  }
693  return $return;
694  }
getId()
Gets the id of the assQuestion object.
$result
$query
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ reworkWorkingData()

assLongMenu::reworkWorkingData (   $active_id,
  $pass,
  $obligationsAnswered,
  $authorized 
)
protected

{}

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

723  {
724  // nothing to rework!
725  }

◆ saveAdditionalQuestionDataToDb()

assLongMenu::saveAdditionalQuestionDataToDb ( )

Saves a record to the question types additional data table.

Returns
mixed

Implements ilObjQuestionScoringAdjustable.

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

References array, createFileFromArray(), getAdditionalTableName(), assQuestion\getId(), getLongMenuTextValue(), getMinAutoComplete(), getSpecificFeedbackSetting(), and ilDB\manipulateF().

Referenced by saveToDb().

237  {
238  // save additional data
239  $this->ilDB->manipulateF(
240  "DELETE FROM " . $this->getAdditionalTableName() . " WHERE question_fi = %s",
241  array( "integer" ),
242  array( $this->getId() )
243  );
244  $this->ilDB->manipulateF(
245  "INSERT INTO " . $this->getAdditionalTableName(
246  ) . " (question_fi, long_menu_text, feedback_setting, min_auto_complete) VALUES (%s, %s, %s, %s)",
247  array( "integer", "text", "integer", "integer"),
248  array(
249  $this->getId(),
250  $this->getLongMenuTextValue(),
251  (int) $this->getSpecificFeedbackSetting(),
252  (int) $this->getMinAutoComplete()
253  )
254  );
255  $this->createFileFromArray();
256  }
getId()
Gets the id of the assQuestion object.
getAdditionalTableName()
Returns the name of the additional question data table in the database.
manipulateF($a_query, $a_types, $a_values)
Formatted manupulate (for DELETE, UPDATE, INSERT).
Create styles array
The data for the language used.
Database Wrapper.
Definition: class.ilDB.php:29
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAnswerSpecificDataToDb()

assLongMenu::saveAnswerSpecificDataToDb ( )

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

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

Referenced by saveToDb().

259  {
260  $this->clearAnswerSpecificDataFromDb($this->getId());
261  $type_array = $this->getAnswerType();
262  $points = 0;
263  foreach ($this->getCorrectAnswers() as $gap_number => $gap) {
264  foreach ($gap[0] as $position => $answer) {
265  if ($type_array == null) {
266  $type = $gap[2];
267  } else {
268  $type = $type_array[$gap_number];
269  }
270  $this->db->replace(
271  $this->getAnswerTableName(),
272  array(
273  'question_fi' => array('integer', (int) $this->getId()),
274  'gap_number' => array('integer', (int) $gap_number),
275  'position' => array('integer', (int) $position)
276  ),
277  array(
278  'answer_text' => array('text', $answer),
279  'points' => array('float', $gap[1]),
280  'type' => array('integer', (int) $type)
281  )
282  );
283  }
284  $points += $gap[1];
285  }
286  $this->setPoints($points);
287  }
getId()
Gets the id of the assQuestion object.
$type
Create styles array
The data for the language used.
setPoints($a_points)
Sets the maximum available points for the question.
clearAnswerSpecificDataFromDb($question_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ savePreviewData()

assLongMenu::savePreviewData ( ilAssQuestionPreviewSession  $previewSession)
protected

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

References $_POST, and ilAssQuestionPreviewSession\setParticipantsSolution().

711  {
712  if (array_key_exists('answer', $_POST)) {
713  $previewSession->setParticipantsSolution($_POST['answer']);
714  } else {
715  $previewSession->setParticipantsSolution(null);
716  }
717  }
$_POST["username"]
+ Here is the call graph for this function:

◆ saveToDb()

assLongMenu::saveToDb (   $original_id = "")

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

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

166  {
170  parent::saveToDb($original_id);
171  }
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
saveQuestionDataToDb($original_id="")
+ 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.

public

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

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

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

617  {
618  if (is_null($pass)) {
619  include_once "./Modules/Test/classes/class.ilObjTest.php";
620  $pass = ilObjTest::_getPass($active_id);
621  }
622 
623  $entered_values = 0;
624 
625  $this->getProcessLocker()->executeUserSolutionUpdateLockOperation(function () use (&$entered_values, $active_id, $pass, $authorized) {
626  $this->removeCurrentSolution($active_id, $pass, $authorized);
627 
628  foreach ($this->getSolutionSubmit() as $val1 => $val2) {
629  $value = ilUtil::stripSlashes($val2, false);
630  if (strlen($value)) {
631  $this->saveCurrentSolution($active_id, $pass, $val1, $value, $authorized);
632  $entered_values++;
633  }
634  }
635  });
636 
637  if ($entered_values) {
638  include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
640  assQuestion::logAction($this->lng->txtlng("assessment", "log_user_entered_values", ilObjAssessmentFolder::_getLogLanguage()), $active_id, $this->getId());
641  }
642  } else {
643  include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
645  assQuestion::logAction($this->lng->txtlng("assessment", "log_user_not_entered_values", ilObjAssessmentFolder::_getLogLanguage()), $active_id, $this->getId());
646  }
647  }
648  return true;
649  }
static logAction($logtext="", $active_id="", $question_id="")
Logs an action into the Test&Assessment log.
getId()
Gets the id of the assQuestion object.
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
static _getLogLanguage()
retrieve the log language for assessment logging
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
saveCurrentSolution($active_id, $pass, $value1, $value2, $authorized=true, $tstamp=null)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
removeCurrentSolution($active_id, $pass, $authorized=true)
+ Here is the call graph for this function:

◆ setAnswers()

assLongMenu::setAnswers (   $answers)

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

References $answers.

Referenced by createArrayFromFile().

106  {
107  $this->answers = $answers;
108  }
+ Here is the caller graph for this function:

◆ setAnswerType()

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

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

References $answerType.

58  {
59  $this->answerType = $answerType;
60  }

◆ setCorrectAnswers()

assLongMenu::setCorrectAnswers (   $correct_answers)

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

References $correct_answers.

Referenced by loadCorrectAnswerData().

72  {
73  $this->correct_answers = $correct_answers;
74  }
+ Here is the caller graph for this function:

◆ setExportDetailsXLS()

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

{}

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

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

760  {
761  parent::setExportDetailsXLS($worksheet, $startrow, $active_id, $pass);
762 
763  $solution = $this->getSolutionValues($active_id, $pass);
764 
765  $i = 1;
766  foreach ($this->getCorrectAnswers() as $gap_index => $gap) {
767  $worksheet->setCell($startrow + $i, 0, $this->lng->txt('assLongMenu') . " $i");
768  $worksheet->setBold($worksheet->getColumnCoord(0) . ($startrow + $i));
769  foreach ($solution as $solutionvalue) {
770  if ($gap_index == $solutionvalue["value1"]) {
771  switch ($gap[2]) {
772  case self::ANSWER_TYPE_SELECT_VAL:
773  $value = $solutionvalue["value2"];
774  if ($value == -1) {
775  $value = '';
776  }
777  $worksheet->setCell($startrow + $i, 1, $value);
778  break;
779  case self::ANSWER_TYPE_TEXT_VAL:
780  $worksheet->setCell($startrow + $i, 1, $solutionvalue["value2"]);
781  break;
782  }
783  }
784  }
785  $i++;
786  }
787 
788  return $startrow + $i + 1;
789  }
$worksheet
getSolutionValues($active_id, $pass=null, $authorized=true)
Loads solutions of a given user from the database an returns it.
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:

◆ setJsonStructure()

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

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

References $json_structure.

Referenced by loadCorrectAnswerData().

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

◆ setLongMenuTextValue()

assLongMenu::setLongMenuTextValue (   $long_menu_text = "")

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

References $long_menu_text.

Referenced by lmMigrateQuestionTypeSpecificContent(), and loadFromDb().

96  {
97  $this->long_menu_text = $long_menu_text;
98  }
+ Here is the caller graph for this function:

◆ setMinAutoComplete()

assLongMenu::setMinAutoComplete (   $minAutoComplete)

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

References $minAutoComplete.

Referenced by loadFromDb().

142  {
143  $this->minAutoComplete = $minAutoComplete;
144  }
+ Here is the caller graph for this function:

◆ setSpecificFeedbackSetting()

assLongMenu::setSpecificFeedbackSetting (   $specificFeedbackSetting)

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

References $specificFeedbackSetting.

Referenced by loadFromDb().

132  {
133  $this->specificFeedbackSetting = $specificFeedbackSetting;
134  }
+ Here is the caller graph for this function:

◆ toJSON()

assLongMenu::toJSON ( )

Returns a JSON representation of the question.

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

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

856  {
857  include_once("./Services/RTE/classes/class.ilRTE.php");
858  $result = array();
859  $result['id'] = (int) $this->getId();
860  $result['type'] = (string) $this->getQuestionType();
861  $result['title'] = (string) $this->getTitle();
862  $replaced_quesiton_text = $this->getLongMenuTextValue();
863  $result['question'] = $this->formatSAQuestion($this->getQuestion());
864  $result['lmtext'] = $this->formatSAQuestion($replaced_quesiton_text);
865  $result['nr_of_tries'] = (int) $this->getNrOfTries();
866  $result['shuffle'] = (bool) $this->getShuffle();
867  $result['feedback'] = array(
868  'onenotcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), false)),
869  'allcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), true))
870  );
871 
872  $mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $this->getId());
873  $result['answers'] = $this->getAnswers();
874  $result['correct_answers'] = $this->getCorrectAnswers();
875  $result['mobs'] = $mobs;
876  return json_encode($result);
877  }
getId()
Gets the id of the assQuestion object.
Add rich text string
static _getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
formatSAQuestion($a_q)
Format self assessment question.
$result
getShuffle()
Gets the shuffle flag.
$mobs
getQuestion()
Gets the question string of the question object.
Create styles array
The data for the language used.
getQuestionType()
Returns the question type of the question.
getTitle()
Gets the title string of the assQuestion object.
+ 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

◆ $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: