ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
assLongMenu Class Reference
+ Inheritance diagram for assLongMenu:
+ Collaboration diagram for assLongMenu:

Public Member Functions

 __construct ( $title="", $comment="", $author="", $owner=-1, $question="")
 assQuestion constructor More...
 
 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 ()
 
 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...
 
- 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...
 
 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_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)
 {Reworks the allready saved working data if neccessary.
Parameters
integer$active_id
integer$pass
boolean$obligationsAnswered
boolean$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
 
 $answers
 
 $correct_answers
 
 $json_structure
 
 $ilDB
 
 $specificFeedbackSetting
 
 $minAutoComplete
 

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
 
 $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 = "" 
)

assQuestion constructor

Parameters
string$titleA title string to describe the question
string$commentA comment string to describe the question
string$authorA string containing the name of the questions author
integer$ownerA numerical ID to identify the owner/creator
string$questionQuestion text @access public

Reimplemented from assQuestion.

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

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

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

Member Function Documentation

◆ assertDirExists()

assLongMenu::assertDirExists ( )
private

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

347 {
348 $folder_name = $this->buildFolderName();
349 if(!ilUtil::makeDirParents($folder_name))
350 {
351 throw new ilException('Cannot create export directory');
352 }
353
354 if(
355 !is_dir($folder_name) ||
356 !is_readable($folder_name) ||
357 !is_writable($folder_name)
358 )
359 {
360 throw new ilException('Cannot create export directory');
361 }
362 }
Base class for ILIAS Exception handling.
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 77 of file class.assLongMenu.php.

78 {
79 try
80 {
81 $this->assertDirExists();
82 return $this->buildFolderName() . $gap_id . '.txt';
83 }
84 catch (ilException $e) {
85
86 }
87 }

References 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 67 of file class.assLongMenu.php.

68 {
69 return ilUtil::getDataDir() . '/assessment/longMenuQuestion/' . $this->getId() . '/' ;
70 }
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 613 of file class.assLongMenu.php.

614 {
615 if( $returndetails )
616 {
617 throw new ilTestException('return details not implemented for '.__METHOD__);
618 }
619
620 $found_values = array();
621 if (is_null($pass))
622 {
623 $pass = $this->getSolutionMaxPass($active_id);
624 }
625 $result = $this->getCurrentSolutionResultSet($active_id, $pass, $authorizedSolution);
626 while ($data = $this->ilDB->fetchAssoc($result))
627 {
628 $found_values[(int)$data['value1']] = $data['value2'];
629 }
630
631 $points = $this->calculateReachedPointsForSolution($found_values, $active_id);
632
633 return $points;
634 }
$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.
fetchAssoc($a_set)
Fetch row as associative array from result set.
Base Exception for all Exceptions relating to Modules/Test.

References $data, $pass, assQuestion\$points, $result, calculateReachedPointsForSolution(), ilDB\fetchAssoc(), 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 636 of file class.assLongMenu.php.

637 {
638 $points = 0;
639 foreach($found_values as $key => $answer)
640 {
641 if($answer != '')
642 {
643 $correct_answers = $this->getCorrectAnswersForGap($this->id, $key);
644 if(in_array($answer, $correct_answers))
645 {
646 $points += $this->getPointsForGap($this->id, $key);
647 }
648 }
649 }
650 return $points;
651 }
getCorrectAnswersForGap($question_id, $gap_id)
getPointsForGap($question_id, $gap_id)

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

Referenced by calculateReachedPoints().

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

◆ checkQuestionCustomPart()

assLongMenu::checkQuestionCustomPart ( )

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

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

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

+ Here is the call graph for this function:

◆ clearAnswerSpecificDataFromDb()

assLongMenu::clearAnswerSpecificDataFromDb (   $question_id)

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

898 {
899 $this->ilDB->manipulateF( 'DELETE FROM ' . $this->getAnswerTableName() .' WHERE question_fi = %s',
900 array( 'integer' ),
901 array( $question_id )
902 );
903 }
getAnswerTableName()
Returns the name of the answer table in the database.
manipulateF($a_query, $a_types, $a_values)
Formatted manupulate (for DELETE, UPDATE, INSERT).

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

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

342 {
343 ilUtil::delDir($this->buildFolderName(), $let_folder_exists);
344 }
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 540 of file class.assLongMenu.php.

541 {
542 if ($this->id <= 0)
543 {
544 // The question has not been saved. It cannot be duplicated
545 return;
546 }
547 // duplicate the question in database
548 $clone = $this;
549 include_once ("./Modules/TestQuestionPool/classes/class.assQuestion.php");
551 $clone->id = -1;
552 $source_questionpool_id = $this->getObjId();
553 $clone->setObjId($target_questionpool_id);
554 if ($title)
555 {
556 $clone->setTitle($title);
557 }
558 $clone->saveToDb();
559
560 $clone->copyPageOfQuestion($original_id);
561 $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
562
563 $clone->onCopy($source_questionpool_id, $original_id, $clone->getObjId(), $clone->getId());
564
565 return $clone->id;
566 }
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

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

212 {
213 foreach($answers[0] as $key => $answer)
214 {
215 if(!in_array($answer, $answer_options))
216 {
217 return true;
218 }
219 }
220 return false;
221 }

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 {
327 $files = array();
328 }
329
330 $answers = array();
331
332 foreach( $files as $file)
333 {
334 $gap = str_replace('.txt', '', basename($file));
335 $answers[(int) $gap] = explode("\n", file_get_contents($file));
336 }
337 $this->setAnswers($answers);
338 return $answers;
339 }
$files
Definition: add-vimline.php:18
setAnswers($answers)
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

References $answers, $file, $files, 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 300 of file class.assLongMenu.php.

301 {
302 $array = $this->getAnswers();
303 $this->clearFolder();
304 foreach($array as $gap => $values)
305 {
306 $file_content = '';
307 if(is_array($values))
308 {
309 foreach($values as $key => $value)
310 {
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 $file, 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 568 of file class.assLongMenu.php.

569 {
570 if ($this->id <= 0)
571 {
572 // The question has not been saved. It cannot be duplicated
573 return;
574 }
575
576 include_once ("./Modules/TestQuestionPool/classes/class.assQuestion.php");
577
578 $sourceQuestionId = $this->id;
579 $sourceParentId = $this->getObjId();
580
581 // duplicate the question in database
582 $clone = $this;
583 $clone->id = -1;
584
585 $clone->setObjId($targetParentId);
586
587 if ($targetQuestionTitle)
588 {
589 $clone->setTitle($targetQuestionTitle);
590 }
591
592 $clone->saveToDb();
593 $clone->copyPageOfQuestion($sourceQuestionId);
594 $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
595
596 $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
597
598 return $clone->id;
599 }

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

906 {
907 parent::delete($original_id);
908 $this->clearFolder(false);
909 }

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

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

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

806 {
807 return 'qpl_qst_lome';
808 }

Referenced by loadFromDb(), and saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ getAnswers()

assLongMenu::getAnswers ( )

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

105 {
106 return $this->answers;
107 }

References $answers.

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

+ Here is the caller graph for this function:

◆ getAnswersObject()

assLongMenu::getAnswersObject ( )

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

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

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

73 {
74 return "qpl_a_lome";
75 }

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

+ Here is the caller graph for this function:

◆ getAnswerType()

assLongMenu::getAnswerType ( )
Returns
mixed

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

41 {
42 return $this->answerType;
43 }

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

888 {
889 return $this->createArrayFromFile();
890 }

References createArrayFromFile().

+ Here is the call graph for this function:

◆ getCorrectAnswers()

assLongMenu::getCorrectAnswers ( )
Returns
mixed

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

57 {
59 }

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

482 {
483 $this->loadCorrectAnswerData($this->getId());
484 return $this->getJsonStructure();
485 }
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 447 of file class.assLongMenu.php.

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

References $correct_answers, $data, $res, ilDB\fetchAssoc(), 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 425 of file class.assLongMenu.php.

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

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

+ Here is the call graph for this function:

◆ getJsonStructure()

assLongMenu::getJsonStructure ( )
Returns
mixed

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

113 {
115 }

References $json_structure.

Referenced by getCorrectAnswersAsJson().

+ Here is the caller graph for this function:

◆ getLongMenuTextValue()

assLongMenu::getLongMenuTextValue ( )

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

95 {
97 }

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

231 {
232 $sum = 0;
233 $points = $this->getCorrectAnswers();
234 if($points)
235 {
236 foreach($points as $add)
237 {
238 $sum += $add[1];
239 }
240 }
241 return $sum;
242 }

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

141 {
142 return $this->minAutoComplete ? $this->minAutoComplete : self::MIN_LENGTH_AUTOCOMPLETE;
143 }

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

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

References $data, assQuestion\$points, $res, ilDB\fetchAssoc(), 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 795 of file class.assLongMenu.php.

796 {
797 return "assLongMenu";
798 }

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

815 {
816 return parent::getRTETextWithMediaObjects() . $this->getLongMenuTextValue();
817 }

References getLongMenuTextValue().

+ Here is the call graph for this function:

◆ getSolutionSubmit()

assLongMenu::getSolutionSubmit ( )

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

758 {
759 $solutionSubmit = array();
760 $answer = ilUtil::stripSlashesRecursive($_POST['answer']);
761
762 foreach($answer as $key => $value)
763 {
764 $solutionSubmit[$key] = $value;
765 }
766
767 return $solutionSubmit;
768 }
$_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 130 of file class.assLongMenu.php.

131 {
133 }

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

868 {
869 $result = new ilUserQuestionResult($this, $active_id, $pass);
870
871 $points = $this->calculateReachedPoints($active_id, $pass);
872 $max_points = $this->getMaximumPoints();
873
874 $result->setReachedPercentage(($points/$max_points) * 100);
875
876 return $result;
877 }
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 145 of file class.assLongMenu.php.

146 {
147 if (strlen($this->title)
148 && $this->author
149 && $this->question
150 && sizeof($this->answers) > 0
151 && sizeof($this->correct_answers) > 0
152 && $this->getPoints() > 0
153 )
154 {
155 return true;
156 }
157 return false;
158 }
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 892 of file class.assLongMenu.php.

893 {
894 return false;
895 }

◆ lmMigrateQuestionTypeSpecificContent()

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

Reimplemented from assQuestion.

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

915 {
916 $this->setLongMenuTextValue( $migrator->migrateToLmContent($this->getLongMenuTextValue()) );
917 }
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 406 of file class.assLongMenu.php.

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

References $correct_answers, $data, $res, ilDB\fetchAssoc(), 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 364 of file class.assLongMenu.php.

365 {
366 $result = $this->ilDB->queryF("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",
367 array("integer"),
368 array($question_id)
369 );
370 if ($result->numRows() == 1)
371 {
372 $data = $this->ilDB->fetchAssoc($result);
373 $this->setId($question_id);
374 $this->setObjId($data["obj_fi"]);
375 $this->setNrOfTries($data['nr_of_tries']);
376 $this->setTitle($data["title"]);
377 $this->setComment($data["description"]);
378 $this->setOriginalId($data["original_id"]);
379 $this->setAuthor($data["author"]);
380 $this->setPoints($data["points"]);
381 $this->setOwner($data["owner"]);
382 include_once("./Services/RTE/classes/class.ilRTE.php");
383 $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data['question_text'], 1));
384 $this->setEstimatedWorkingTime(substr($data["working_time"], 0, 2), substr($data["working_time"], 3, 2), substr($data["working_time"], 6, 2));
386 $this->loadCorrectAnswerData($question_id);
387 $this->setMinAutoComplete($data["min_auto_complete"]);
388 if( isset($data['feedback_setting']) )
389 {
390 $this->setSpecificFeedbackSetting((int)$data['feedback_setting']);
391 }
392 try
393 {
394 $this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);
395 }
397 {
398 }
399 }
400
401 $this->loadCorrectAnswerData($question_id);
402 $this->createArrayFromFile();
403 parent::loadFromDb($question_id);
404 }
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.
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.
queryF($a_query, $a_types, $a_values)
Formatted query (for SELECTS).
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, $result, ilRTE\_replaceMediaObjectImageSrc(), 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().

+ 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 713 of file class.assLongMenu.php.

714 {
715 global $ilDB;
716
717 $return = array(
718 'authorized' => false,
719 'intermediate' => false
720 );
721
722 $query = "
723 SELECT authorized, COUNT(*) cnt
724 FROM tst_solutions
725 WHERE active_fi = " . $ilDB->quote($activeId, 'integer') ."
726 AND question_fi = ". $ilDB->quote($this->getId(), 'integer') ."
727 AND pass = " .$ilDB->quote($pass, 'integer') ."
728 AND value2 <> '-1'
729 ";
730
731 if( $this->getStep() !== NULL )
732 {
733 $query .= " AND step = " . $ilDB->quote((int)$this->getStep(), 'integer') . " ";
734 }
735
736 $query .= "
737 GROUP BY authorized
738 ";
739
740 $result = $ilDB->query($query);
741
742 while ($row = $ilDB->fetchAssoc($result))
743 {
744 if ($row['authorized']) {
745 $return['authorized'] = $row['cnt'] > 0;
746 }
747 else
748 {
749 $return['intermediate'] = $row['cnt'] > 0;
750 }
751 }
752 return $return;
753 }

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

+ Here is the call graph for this function:

◆ reworkWorkingData()

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

{Reworks the allready saved working data if neccessary.

Parameters
integer$active_id
integer$pass
boolean$obligationsAnswered
boolean$authorized
}

Reimplemented from assQuestion.

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

786 {
787 // nothing to rework!
788 }

◆ saveAdditionalQuestionDataToDb()

assLongMenu::saveAdditionalQuestionDataToDb ( )

Saves a record to the question types additional data table.

Returns
mixed

Implements ilObjQuestionScoringAdjustable.

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

245 {
246 // save additional data
247 $this->ilDB->manipulateF( "DELETE FROM " . $this->getAdditionalTableName() . " WHERE question_fi = %s",
248 array( "integer" ),
249 array( $this->getId() )
250 );
251 $this->ilDB->manipulateF( "INSERT INTO " . $this->getAdditionalTableName(
252 ) . " (question_fi, long_menu_text, feedback_setting, min_auto_complete) VALUES (%s, %s, %s, %s)",
253 array( "integer", "text", "integer", "integer"),
254 array(
255 $this->getId(),
256 $this->getLongMenuTextValue(),
257 (int)$this->getSpecificFeedbackSetting(),
258 (int)$this->getMinAutoComplete()
259 )
260 );
261 $this->createFileFromArray();
262 }

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

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

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

References assQuestion\$points, 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 770 of file class.assLongMenu.php.

771 {
772 if( array_key_exists('answer',$_POST) )
773 {
774 $previewSession->setParticipantsSolution($_POST['answer']);
775 }
776 else
777 {
778 $previewSession->setParticipantsSolution(null);
779 }
780 }

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

161 {
165 parent::saveToDb($original_id);
166 }
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 661 of file class.assLongMenu.php.

662 {
663 if (is_null($pass))
664 {
665 include_once "./Modules/Test/classes/class.ilObjTest.php";
666 $pass = ilObjTest::_getPass($active_id);
667 }
668
669 $entered_values = 0;
670
671 $this->getProcessLocker()->executeUserSolutionUpdateLockOperation(function() use (&$entered_values, $active_id, $pass, $authorized) {
672
673 $this->removeCurrentSolution($active_id, $pass, $authorized);
674
675 foreach($this->getSolutionSubmit() as $val1 => $val2)
676 {
677 $value = ilUtil::stripSlashes($val2, FALSE);
678 if(strlen($value))
679 {
680 $this->saveCurrentSolution($active_id, $pass, $val1, $value, $authorized);
681 $entered_values++;
682 }
683 }
684
685 });
686
687 if ($entered_values)
688 {
689 include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
691 {
692 assQuestion::logAction($this->lng->txtlng("assessment", "log_user_entered_values", ilObjAssessmentFolder::_getLogLanguage()), $active_id, $this->getId());
693 }
694 }
695 else
696 {
697 include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
699 {
700 assQuestion::logAction($this->lng->txtlng("assessment", "log_user_not_entered_values", ilObjAssessmentFolder::_getLogLanguage()), $active_id, $this->getId());
701 }
702 }
703 return true;
704 }
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 99 of file class.assLongMenu.php.

100 {
101 $this->answers = $answers;
102 }

References $answers.

Referenced by createArrayFromFile().

+ Here is the caller graph for this function:

◆ setAnswerType()

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

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

49 {
50 $this->answerType = $answerType;
51 }

References $answerType.

◆ setCorrectAnswers()

assLongMenu::setCorrectAnswers (   $correct_answers)

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

63 {
64 $this->correct_answers = $correct_answers;
65 }

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

823 {
824 parent::setExportDetailsXLS($worksheet, $startrow, $active_id, $pass);
825
826 $solution = $this->getSolutionValues($active_id, $pass);
827
828 $i = 1;
829 foreach ($this->getCorrectAnswers() as $gap_index => $gap)
830 {
831 $worksheet->setCell($startrow + $i, 0, $this->lng->txt('assLongMenu') . " $i");
832 $worksheet->setBold($worksheet->getColumnCoord(0) . ($startrow + $i));
833 foreach ($solution as $solutionvalue)
834 {
835 if ($gap_index == $solutionvalue["value1"])
836 {
837 switch ($gap[2])
838 {
840 $value = $solutionvalue["value2"];
841 if($value == -1)
842 {
843 $value = '';
844 }
845 $worksheet->setCell($startrow + $i, 1, $value);
846 break;
848 $worksheet->setCell($startrow + $i, 1, $solutionvalue["value2"]);
849 break;
850 }
851 }
852 }
853 $i++;
854 }
855
856 return $startrow + $i + 1;
857 }
$worksheet
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.

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

+ Here is the call graph for this function:

◆ setJsonStructure()

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

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

121 {
122 $this->json_structure = $json_structure;
123 }

References $json_structure.

Referenced by loadCorrectAnswerData().

+ Here is the caller graph for this function:

◆ setLongMenuTextValue()

assLongMenu::setLongMenuTextValue (   $long_menu_text = "")

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

90 {
91 $this->long_menu_text = $long_menu_text;
92 }

References $long_menu_text.

Referenced by lmMigrateQuestionTypeSpecificContent(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setMinAutoComplete()

assLongMenu::setMinAutoComplete (   $minAutoComplete)

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

136 {
137 $this->minAutoComplete = $minAutoComplete;
138 }

References $minAutoComplete.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setSpecificFeedbackSetting()

assLongMenu::setSpecificFeedbackSetting (   $specificFeedbackSetting)

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

126 {
127 $this->specificFeedbackSetting = $specificFeedbackSetting;
128 }

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

923 {
924 include_once("./Services/RTE/classes/class.ilRTE.php");
925 $result = array();
926 $result['id'] = (int) $this->getId();
927 $result['type'] = (string) $this->getQuestionType();
928 $result['title'] = (string) $this->getTitle();
929 $replaced_quesiton_text = $this->getLongMenuTextValue();
930 $result['question'] = $this->formatSAQuestion($this->getQuestion());
931 $result['lmtext'] = $this->formatSAQuestion($replaced_quesiton_text);
932 $result['nr_of_tries'] = (int) $this->getNrOfTries();
933 $result['shuffle'] = (bool) $this->getShuffle();
934 $result['feedback'] = array(
935 'onenotcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), false)),
936 'allcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), true))
937 );
938
939 $mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $this->getId());
940 $result['answers'] = $this->getAnswers();
941 $result['correct_answers'] = $this->getCorrectAnswers();
942 $result['mobs'] = $mobs;
943 return json_encode($result);
944 }
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

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

◆ $ilDB

assLongMenu::$ilDB
private

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

Referenced by lookupForExistingSolutions().

◆ $json_structure

assLongMenu::$json_structure
private

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

Referenced by getJsonStructure(), and setJsonStructure().

◆ $long_menu_text

assLongMenu::$long_menu_text
private

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

Referenced by getLongMenuTextValue(), and setLongMenuTextValue().

◆ $minAutoComplete

assLongMenu::$minAutoComplete
private

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

Referenced by setMinAutoComplete().

◆ $specificFeedbackSetting

assLongMenu::$specificFeedbackSetting
private

Definition at line 14 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: