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

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor. More...
 
 getTitleFilenameCompliant ()
 returns the object title prepared to be used as a filename More...
 
 getTmpCopyWizardCopyId ()
 
 setTmpCopyWizardCopyId ($tmpCopyWizardCopyId)
 
 create ()
 create test object More...
 
 update ()
 update object data More...
 
 read ()
 read object data from db into object More...
 
 delete ()
 delete object and all related data More...
 
 deleteTest ()
 Deletes the test and all related objects, files and database entries. More...
 
 createExportDirectory ()
 creates data directory for export files (data_dir/tst_data/tst_<id>/export, depending on data directory that is set in ILIAS setup/ini) More...
 
 getExportDirectory ()
 Get the location of the export directory for the test. More...
 
 getImportDirectory ()
 
 hasSingleChoiceQuestions ()
 Returns TRUE if the test contains single choice results. More...
 
 isSingleChoiceTest ()
 Returns TRUE if the test contains single choice results only. More...
 
 isSingleChoiceTestWithoutShuffle ()
 Returns TRUE if the test contains single choice results and no shuffle only. More...
 
 isComplete (ilTestQuestionSetConfig $testQuestionSetConfig)
 Returns true, if a test is complete for use and can be set online. More...
 
 _isComplete ($obj_id)
 Returns true, if a test is complete for use. More...
 
 saveCompleteStatus (ilTestQuestionSetConfig $testQuestionSetConfig)
 Checks if the test is complete and saves the status in the database. More...
 
 getAllRTEContent ()
 Returns the content of all RTE enabled text areas in the test. More...
 
 cleanupMediaobjectUsage ()
 Cleans up the media objects for all text fields in a test which are using an RTE field. More...
 
 saveToDb ($properties_only=false)
 Saves a ilObjTest object to a database. More...
 
 saveQuestionsToDb ()
 Saves the test questions to the database. More...
 
 randomSelectQuestions ($nr_of_questions, $questionpool, $use_obj_id=0, $qpls="", $pass=null)
 Returns a random selection of questions. More...
 
 getNrOfResultsForPass ($active_id, $pass)
 Calculates the number of user results for a specific test pass. More...
 
 hasRandomQuestionsForPass ($active_id, $pass)
 Checkes wheather a random test has already created questions for a given pass or not. More...
 
 loadFromDb ()
 Loads a ilObjTest object from a database. More...
 
 loadQuestions ($active_id="", $pass=null)
 Load the test question id's from the database. More...
 
 isIntroductionEnabled ()
 
 setIntroductionEnabled ($introductionEnabled)
 
 getIntroduction ()
 Gets the introduction text of the ilObjTest object. More...
 
 setIntroduction ($introduction="")
 Sets the introduction text of the ilObjTest object. More...
 
 setFinalStatement ($a_statement="")
 Sets the final statement text of the ilObjTest object. More...
 
 setShowInfo ($a_info=1)
 Set whether the complete information page is shown or the required data only. More...
 
 setForceJS ($a_js=1)
 Set whether JavaScript should be forced for tests. More...
 
 setCustomStyle ($a_customStyle=null)
 Set the custom style. More...
 
 getCustomStyle ()
 Get the custom style. More...
 
 setShowFinalStatement ($show=0)
 Sets whether the final statement should be shown or not. More...
 
 getFinalStatement ()
 Gets the final statement. More...
 
 getShowInfo ()
 Gets whether the complete information page is shown or the required data only. More...
 
 getForceJS ()
 Gets whether JavaScript should be forced for tests. More...
 
 getShowFinalStatement ()
 Returns whether the final statement should be shown or not. More...
 
 getTestId ()
 Gets the database id of the additional test data. More...
 
 getECTSOutput ()
 {
Returns
int|bool
} More...
 
 setECTSOutput ($a_ects_output)
 {
Parameters
int | bool$status
} More...
 
 getECTSFX ()
 {
Returns
float|null
} More...
 
 setECTSFX ($a_ects_fx)
 {
Parameters
float | null$ects_fx
} More...
 
 getECTSGrades ()
 {
Returns
array
} More...
 
 setECTSGrades (array $a_ects_grades)
 {
Parameters
array$grades
} More...
 
 getSequenceSettings ()
 SEQUENCE SETTING = POSTPONING ENABLED !! More...
 
 setSequenceSettings ($sequence_settings=0)
 SEQUENCE SETTING = POSTPONING ENABLED !! More...
 
 isPostponingEnabled ()
 
 setPostponingEnabled ($postponingEnabled)
 
 setScoreReporting ($score_reporting=0)
 Sets the score reporting of the ilObjTest object. More...
 
 setInstantFeedbackSolution ($instant_feedback=0)
 Sets the instant feedback for the solution. More...
 
 setAnswerFeedback ($answer_feedback=0)
 Sets the generic feedback for the test @deprecate Use setGenericAnswerFeedback instead. More...
 
 setGenericAnswerFeedback ($generic_answer_feedback=0)
 Sets if the generic feedback is to be shown in the test. More...
 
 setAnswerFeedbackPoints ($answer_feedback_points=0)
 Sets the answer specific feedback of reached points for the test. More...
 
 setReportingDate ($reporting_date)
 Sets the reporting date of the ilObjTest object. More...
 
 getScoreReporting ()
 Gets the score reporting of the ilObjTest object. More...
 
 isScoreReportingEnabled ()
 
 getInstantFeedbackSolution ()
 Returns 1 if the correct solution will be shown after answering a question. More...
 
 getAnswerFeedback ()
 Returns 1 if generic answer feedback is activated. More...
 
 getGenericAnswerFeedback ()
 Returns 1 if generic answer feedback is to be shown. More...
 
 getAnswerFeedbackPoints ()
 Returns 1 if answer specific feedback as reached points is activated. More...
 
 getCountSystem ()
 Gets the count system for the calculation of points. More...
 
 getMCScoring ()
 Gets the scoring type for multiple choice questions. More...
 
 getScoreCutting ()
 Determines if the score of a question should be cut at 0 points or the score of the whole test. More...
 
 getPassScoring ()
 Gets the pass scoring type. More...
 
 getReportingDate ()
 Gets the reporting date of the ilObjTest object. More...
 
 getNrOfTries ()
 Returns the nr of tries for the test. More...
 
 isBlockPassesAfterPassedEnabled ()
 
 setBlockPassesAfterPassedEnabled ($blockPassesAfterPassedEnabled)
 
 getKiosk ()
 Returns the kiosk mode. More...
 
 setKiosk ($kiosk=0)
 Sets the kiosk mode for the test. More...
 
 getKioskMode ()
 Returns the kiosk mode. More...
 
 setKioskMode ($a_kiosk=false)
 Sets the kiosk mode for the test. More...
 
 getShowKioskModeTitle ()
 Returns the status of the kiosk mode title. More...
 
 setShowKioskModeTitle ($a_title=false)
 Set to true, if the full test title should be shown in kiosk mode. More...
 
 getShowKioskModeParticipant ()
 Returns the status of the kiosk mode participant. More...
 
 setShowKioskModeParticipant ($a_participant=false)
 Set to true, if the participant's name should be shown in kiosk mode. More...
 
 getUsePreviousAnswers ()
 Returns if the previous answers should be shown for a learner. More...
 
 getTitleOutput ()
 Returns the value of the title_output status. More...
 
 _getTitleOutput ($active_id)
 Returns the value of the title_output status. More...
 
 isPreviousSolutionReuseEnabled ($activeId)
 
 getProcessingTime ()
 Returns the processing time for the test. More...
 
 getProcessingTimeAsArray ()
 Returns the processing time for the test. More...
 
 getProcessingTimeAsMinutes ()
 
 getProcessingTimeInSeconds ($active_id="")
 Returns the processing time for the test in seconds. More...
 
 getSecondsUntilEndingTime ()
 Returns the seconds left from the actual time until the ending time. More...
 
 getEnableProcessingTime ()
 Returns the state of the processing time (enabled/disabled) More...
 
 getResetProcessingTime ()
 Returns wheather the processing time should be reset or not. More...
 
 isStartingTimeEnabled ()
 
 setStartingTimeEnabled ($starting_time_enabled)
 
 getStartingTime ()
 Returns the starting time of the test. More...
 
 setStartingTime ($starting_time=null)
 Sets the starting time in database timestamp format for the test. More...
 
 isEndingTimeEnabled ()
 
 setEndingTimeEnabled ($ending_time_enabled)
 
 getEndingTime ()
 Returns the ending time of the test. More...
 
 setEndingTime ($ending_time=null)
 Sets the ending time in database timestamp format for the test. More...
 
 setNrOfTries ($nr_of_tries=0)
 Sets the nr of tries for the test. More...
 
 setUsePreviousAnswers ($use_previous_answers=1)
 Sets the status of the visibility of previous learner answers. More...
 
 setRedirectionMode ($redirection_mode=0)
 
 getRedirectionMode ()
 
 setRedirectionUrl ($redirection_url=null)
 
 getRedirectionUrl ()
 
 setTitleOutput ($title_output=0)
 Sets the status of the title output. More...
 
 setProcessingTime ($processing_time="00:00:00")
 Sets the processing time for the test. More...
 
 setProcessingTimeByMinutes ($minutes)
 
 setEnableProcessingTime ($enable=0)
 Sets the processing time enabled or disabled. More...
 
 setResetProcessingTime ($reset=0)
 Sets wheather the processing time should be reset or not. More...
 
 setCountSystem ($a_count_system=COUNT_PARTIAL_SOLUTIONS)
 Sets the count system for the calculation of points. More...
 
 isPasswordEnabled ()
 
 setPasswordEnabled ($passwordEnabled)
 
 getPassword ()
 Returns the password for test access. More...
 
 setPassword ($a_password=null)
 Sets the password for test access. More...
 
 setScoreCutting ($a_score_cutting=SCORE_CUT_QUESTION)
 Sets the type of score cutting. More...
 
 setMCScoring ($a_mc_scoring=SCORE_ZERO_POINTS_WHEN_UNANSWERED)
 Sets the multiple choice scoring. More...
 
 setPassScoring ($a_pass_scoring=SCORE_LAST_PASS)
 Sets the pass scoring. More...
 
 getPassWaiting ()
 
 setPassWaiting ($pass_waiting)
 
 isPassWaitingEnabled ()
 
 removeQuestionFromSequences ($questionId, $activeIds, ilTestReindexedSequencePositionMap $reindexedSequencePositionMap)
 
 removeQuestions ($removeQuestionIds)
 
 removeQuestion ($question_id)
 Removes a question from the test object. More...
 
 removeTestResultsFromSoapLpAdministration ($userIds)
 
 removeTestResults (ilTestParticipantData $participantData)
 
 removeTestResultsByUserIds ($userIds)
 
 removeTestResultsByActiveIds ($activeIds)
 
 removeTestActives ($activeIds)
 
 questionMoveUp ($question_id)
 Moves a question up in order. More...
 
 questionMoveDown ($question_id)
 Moves a question down in order. More...
 
 duplicateQuestionForTest ($question_id)
 Takes a question and creates a copy of the question for use in the test. More...
 
 insertQuestion (ilTestQuestionSetConfig $testQuestionSetConfig, $question_id, $linkOnly=false)
 Insert a question in the list of questions. More...
 
getQuestionTitles ()
 Returns the titles of the test questions in question sequence. More...
 
getQuestionTitlesAndIndexes ()
 Returns the titles of the test questions in question sequence. More...
 
 getQuestionTitle ($title, $nr=null)
 Returns the title of a test question and checks if the title output is allowed. More...
 
 getQuestionDataset ($question_id)
 Returns the dataset for a given question id. More...
 
getExistingQuestions ($pass=null)
 Get the id's of the questions which are already part of the test. More...
 
 getQuestionType ($question_id)
 Returns the question type of a question with a given id. More...
 
 startWorkingTime ($active_id, $pass)
 Write the initial entry for the tests working time to the database. More...
 
 updateWorkingTime ($times_id)
 Update the working time of a test when a question is answered. More...
 
getWorkedQuestions ($active_id, $pass=null)
 Gets the id's of all questions a user already worked through. More...
 
 isTestFinishedToViewResults ($active_id, $currentpass)
 Returns true if an active user completed a test pass and did not start a new pass. More...
 
getAllQuestions ($pass=null)
 Returns all questions of a test in test order. More...
 
 getActiveIdOfUser ($user_id="", $anonymous_id="")
 Gets the active id of a given user. More...
 
 pcArrayShuffle ($array)
 Shuffles the values of a given array. More...
 
getTestResult ($active_id, $pass=null, $ordered_sequence=false, $considerHiddenQuestions=true, $considerOptionalQuestions=true)
 Calculates the results of a test for a given user and returns an array with all test results. More...
 
 evalTotalPersons ()
 Returns the number of persons who started the test. More...
 
 getCompleteWorkingTime ($user_id)
 Returns the complete working time in seconds a user worked on the test. More...
 
getCompleteWorkingTimeOfParticipants ()
 Returns the complete working time in seconds for all test participants. More...
 
_getCompleteWorkingTimeOfParticipants ($test_id)
 Returns the complete working time in seconds for all test participants. More...
 
 getCompleteWorkingTimeOfParticipant ($active_id)
 Returns the complete working time in seconds for a test participant. More...
 
 getVisitTimeOfParticipant ($active_id)
 Returns the first and last visit of a participant. More...
 
 _getVisitTimeOfParticipant ($test_id, $active_id)
 Returns the first and last visit of a participant. More...
 
evalStatistical ($active_id)
 Returns the statistical evaluation of the test for a specified user. More...
 
getTotalPointsPassedArray ()
 Returns an array with the total points of all users who passed the test This array could be used for statistics. More...
 
getParticipants ()
 Returns all persons who started the test. More...
 
evalTotalPersonsArray ($name_sort_order="asc")
 Returns all persons who started the test. More...
 
evalTotalParticipantsArray ($name_sort_order="asc")
 Returns all participants who started the test. More...
 
getQuestionsOfTest ($active_id)
 Retrieves all the assigned questions for all test passes of a test participant. More...
 
getQuestionsOfPass ($active_id, $pass)
 Retrieves all the assigned questions for a test participant in a given test pass. More...
 
 getAccessFilteredParticipantList ()
 
 setAccessFilteredParticipantList ($accessFilteredParticipantList)
 
 buildStatisticsAccessFilteredParticipantList ()
 
getCompleteEvaluationData ($withStatistics=true, $filterby="", $filtertext="")
 
evalResultsOverview ()
 Creates an associated array with the results of all participants of a test. More...
 
_evalResultsOverview ($test_id)
 Creates an associated array with the results of all participants of a test. More...
 
evalResultsOverviewOfParticipant ($active_id)
 Creates an associated array with the results for a given participant of a test. More...
 
 buildName ($user_id, $firstname, $lastname, $title)
 Builds a user name for the output depending on test type and existence of the user. More...
 
 _buildName ($is_anonymous, $user_id, $firstname, $lastname, $title)
 Builds a user name for the output depending on test type and existence of the user. More...
 
 evalTotalStartedAverageTime ($activeIdsFilter=null)
 Returns the average processing time for all started tests. More...
 
getAvailableQuestionpools ($use_object_id=false, $equal_points=false, $could_be_offline=false, $show_path=false, $with_questioncount=false, $permission="read")
 Returns the available question pools for the active user. More...
 
 getEstimatedWorkingTime ()
 Returns the estimated working time for the test calculated from the working time of the contained questions. More...
 
 getImagePath ()
 Returns the image path for web accessable images of a test The image path is under the CLIENT_WEB_DIR in assessment/REFERENCE_ID_OF_TEST/images. More...
 
 getImagePathWeb ()
 Returns the web image path for web accessable images of a test The image path is under the web accessable data dir in assessment/REFERENCE_ID_OF_TEST/images. More...
 
createQuestionGUI ($question_type, $question_id=-1)
 Creates a question GUI instance of a given question type. More...
 
 moveQuestions ($move_questions, $target_index, $insert_mode)
 Move questions to another position. More...
 
 startingTimeReached ()
 Returns true if the starting time of a test is reached A starting time is not available for self assessment tests. More...
 
 endingTimeReached ()
 Returns true if the ending time of a test is reached An ending time is not available for self assessment tests. More...
 
 getAvailableQuestions ($arrFilter, $completeonly=0)
 Calculates the available questions for a test. More...
 
 fromXML (ilQTIAssessment $assessment)
 Receives parameters from a QTI parser and creates a valid ILIAS test object. More...
 
 toXML ()
 Returns a QTI xml representation of the test. More...
 
 exportPagesXML (&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 export pages of test to xml (see ilias_co.dtd) More...
 
 exportXMLMetaData (&$a_xml_writer)
 export content objects meta data to xml (see ilias_co.dtd) More...
 
 modifyExportIdentifier ($a_tag, $a_param, $a_value)
 Returns the installation id for a given identifier. More...
 
 exportXMLPageObjects (&$a_xml_writer, $a_inst, &$expLog)
 export page objects to xml (see ilias_co.dtd) More...
 
 exportXMLMediaObjects (&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 export media objects to xml (see ilias_co.dtd) More...
 
 exportFileItems ($target_dir, &$expLog)
 export files of file itmes More...
 
 getImportMapping ()
 get array of (two) new created questions for import id More...
 
 canEditEctsGrades ()
 {
Returns
boolean
} More...
 
 canShowEctsGrades ()
 {
Returns
boolean
} More...
 
 getECTSGrade ($passed_array, $reached_points, $max_points)
 {Returns the ECTS grade for a number of reached points.
Parameters
array$passed_arrayAn array with the points of all users who passed the test
double$reached_pointsThe points reached in the test
double$max_pointsThe maximum number of points for the test
Returns
string The ECTS grade short description
} More...
 
 checkMarks ()
 {
Returns
boolean|string True or an error string which can be used for display purposes
} More...
 
 getMarkSchema ()
 {
Returns
ASS_MarkSchema
} More...
 
 getMarkSchemaForeignId ()
 {
Returns
int
} More...
 
 canEditMarks ()
 
 setAuthor ($author="")
 Sets the authors name of the ilObjTest object. More...
 
 saveAuthorToMetadata ($a_author="")
 Saves an authors name into the lifecycle metadata if no lifecycle metadata exists This will only be called for conversion of "old" tests where the author hasn't been stored in the lifecycle metadata. More...
 
 createMetaData ()
 Create meta data entry. More...
 
 getAuthor ()
 Gets the authors name of the ilObjTest object. More...
 
 getQuestionCount ()
 Returns the number of questions in the test. More...
 
 logAction ($logtext="", $question_id="")
 Logs an action into the Test&Assessment log. More...
 
 getTextAnswer ($active_id, $question_id, $pass=null)
 Returns the text answer of a given user for a given question. More...
 
 getQuestiontext ($question_id)
 Returns the question text for a given question. More...
 
 getInvitedParticipantList ()
 
 getActiveParticipantList ()
 
getInvitedUsers ($user_id="", $order="login, lastname, firstname")
 Returns a list of all invited users in a test. More...
 
getTestParticipants ()
 Returns a list of all participants in a test. More...
 
 getTestParticipantsForManualScoring ($filter=null)
 
getUserData ($ids)
 Returns a data of all users specified by id list. More...
 
getGroupData ($ids)
 
getRoleData ($ids)
 
 inviteGroup ($group_id)
 Invites all users of a group to a test. More...
 
 inviteRole ($role_id)
 Invites all users of a role to a test. More...
 
 disinviteUser ($user_id)
 Disinvites a user from a test. More...
 
 inviteUser ($user_id, $client_ip="")
 Invites a user to a test. More...
 
 setClientIP ($user_id, $client_ip)
 
 setQuestionSetSolved ($value, $question_id, $user_id)
 sets question solved state to value for given user_id More...
 
 isTestFinished ($active_id)
 returns if the active for user_id has been submitted More...
 
 isActiveTestSubmitted ($user_id=null)
 returns if the active for user_id has been submitted More...
 
 hasNrOfTriesRestriction ()
 returns if the numbers of tries have to be checked More...
 
 isNrOfTriesReached ($tries)
 returns if number of tries are reached More...
 
 getAllTestResults ($participants, $prepareForCSV=true)
 returns all test results for all participants More...
 
processCSVRow ($row, $quoteAll=false, $separator=";")
 Processes an array as a CSV row and converts the array values to correct CSV values. More...
 
 getAnsweredQuestionCount ($active_id, $pass=null)
 Retrieves the number of answered questions for a given user in a given test. More...
 
 isExecutable ($testSession, $user_id, $allowPassIncrease=false)
 Checks if the test is executable by the given user. More...
 
 canShowTestResults (ilTestSession $testSession)
 
 hasAnyTestResult (ilTestSession $testSession)
 
 getStartingTimeOfUser ($active_id, $pass=null)
 Returns the unix timestamp of the time a user started a test. More...
 
 isMaxProcessingTimeReached ($starting_time, $active_id)
 Returns whether the maximum processing time for a test is reached or not. More...
 
getTestQuestions ()
 
 isTestQuestion ($questionId)
 
 checkQuestionParent ($questionId)
 
 getFixedQuestionSetTotalPoints ()
 
 getFixedQuestionSetTotalWorkingTime ()
 
 getShuffleQuestions ()
 Returns the status of the shuffle_questions variable. More...
 
 setShuffleQuestions ($a_shuffle)
 Sets the status of the shuffle_questions variable. More...
 
 getListOfQuestionsSettings ()
 Returns the settings for the list of questions options in the test properties This could contain one of the following values: 0 = No list of questions offered 1 = A list of questions is offered 3 = A list of questions is offered and the list of questions is shown as first page of the test 5 = A list of questions is offered and the list of questions is shown as last page of the test 7 = A list of questions is offered and the list of questions is shown as first and last page of the test. More...
 
 setListOfQuestionsSettings ($a_value=0)
 Sets the settings for the list of questions options in the test properties This could contain one of the following values: 0 = No list of questions offered 1 = A list of questions is offered 3 = A list of questions is offered and the list of questions is shown as first page of the test 5 = A list of questions is offered and the list of questions is shown as last page of the test 7 = A list of questions is offered and the list of questions is shown as first and last page of the test. More...
 
 getListOfQuestions ()
 Returns if the list of questions should be presented to the user or not. More...
 
 setListOfQuestions ($a_value=true)
 Sets if the the list of questions should be presented to the user or not. More...
 
 getListOfQuestionsStart ()
 Returns if the list of questions should be presented as the first page of the test. More...
 
 setListOfQuestionsStart ($a_value=true)
 Sets if the the list of questions as the start page of the test. More...
 
 getListOfQuestionsEnd ()
 Returns if the list of questions should be presented as the last page of the test. More...
 
 setListOfQuestionsEnd ($a_value=true)
 Sets if the the list of questions as the end page of the test. More...
 
 getListOfQuestionsDescription ()
 Returns TRUE if the list of questions should be presented with the question descriptions. More...
 
 setListOfQuestionsDescription ($a_value=true)
 Sets the show_summary attribute to TRUE if the list of questions should be presented with the question descriptions. More...
 
 getResultsPresentation ()
 Returns the combined results presentation value. More...
 
 getShowPassDetails ()
 Returns if the pass details should be shown when a test is not finished. More...
 
 getShowSolutionDetails ()
 Returns if the solution details should be presented to the user or not. More...
 
 getShowSolutionPrintview ()
 Returns if the solution printview should be presented to the user or not. More...
 
 getShowSolutionFeedback ()
 Returns if the feedback should be presented to the solution or not. More...
 
 getShowSolutionAnswersOnly ()
 Returns if the full solution (including ILIAS content) should be presented to the solution or not. More...
 
 getShowSolutionSignature ()
 Returns if the signature field should be shown in the test results. More...
 
 getShowSolutionSuggested ()
 
 getShowSolutionListComparison ()
 
 setResultsPresentation ($a_results_presentation=3)
 Sets the combined results presentation value. More...
 
 setShowPassDetails ($a_details=1)
 Sets if the pass details should be shown when a test is not finished. More...
 
 setShowSolutionDetails ($a_details=1)
 Sets if the the solution details should be presented to the user or not. More...
 
 canShowSolutionPrintview ($user_id=null)
 Calculates if a user may see the solution printview of his/her test results. More...
 
 setShowSolutionPrintview ($a_printview=1)
 Sets if the the solution printview should be presented to the user or not. More...
 
 setShowSolutionFeedback ($a_feedback=true)
 Sets if the the feedback should be presented to the user in the solution or not. More...
 
 setShowSolutionAnswersOnly ($a_full=true)
 Set to true, if the full solution (including the ILIAS content pages) should be shown in the solution output. More...
 
 setShowSolutionSignature ($a_signature=false)
 Set to TRUE, if the signature field should be shown in the solution. More...
 
 setShowSolutionSuggested ($a_solution=false)
 Set to TRUE, if the suggested solution should be shown in the solution. More...
 
 setShowSolutionListComparison ($a_comparison=false)
 Set to TRUE, if the list of answers should be shown prior to finish the test. More...
 
 isLimitUsersEnabled ()
 
 setLimitUsersEnabled ($limitUsersEnabled)
 
 getAllowedUsers ()
 
 setAllowedUsers ($a_allowed_users)
 
 getAllowedUsersTimeGap ()
 
 setAllowedUsersTimeGap ($a_allowed_users_time_gap)
 
 checkMaximumAllowedUsers ()
 
 _getLastAccess ($active_id)
 
 isHTML ($a_text)
 Checks if a given string contains HTML or not. More...
 
 QTIMaterialToString ($a_material)
 Reads an QTI material tag an creates a text string. More...
 
 addQTIMaterial (&$a_xml_writer, $a_material='')
 Creates a QTI material tag from a plain text or xhtml text. More...
 
 prepareTextareaOutput ($txt_output, $prepare_for_latex_output=false, $omitNl2BrWhenTextArea=false)
 Prepares a string for a text area output in tests. More...
 
 saveCertificateVisibility ($a_value)
 Saves the visibility settings of the certificate. More...
 
 getCertificateVisibility ()
 Returns the visibility settings of the certificate. More...
 
 setCertificateVisibility ($a_value)
 Sets the visibility settings of the certificate. More...
 
 getAnonymity ()
 Returns the anonymity status of the test. More...
 
 setAnonymity ($a_value=0)
 Sets the anonymity status of the test. More...
 
 getShowCancel ()
 Returns wheather the cancel test button is shown or not. More...
 
 setShowCancel ($a_value=1)
 Sets the cancel test button status. More...
 
 getShowMarker ()
 Returns wheather the marker button is shown or not. More...
 
 setShowMarker ($a_value=1)
 Sets the marker button status. More...
 
 getFixedParticipants ()
 Returns the fixed participants status. More...
 
 setFixedParticipants ($a_value=1)
 Sets the fixed participants status. More...
 
 _lookupRandomTestFromActiveId ($active_id)
 Returns the random status of a test with a given object id. More...
 
 userLookupFullName ($user_id, $overwrite_anonymity=false, $sorted_order=false, $suffix="")
 Returns the full name of a test user according to the anonymity status. More...
 
 getStartTestLabel ($active_id)
 Returns the "Start the Test" label for the Info page. More...
 
getTestDefaults ($test_defaults_id)
 Returns the test defaults for a given id. More...
 
 deleteDefaults ($test_default_id)
 Deletes the defaults for a test. More...
 
 addDefaults ($a_name)
 Adds the defaults of this test to the test defaults. More...
 
 applyDefaults ($test_defaults)
 Applies given test defaults to this test. More...
 
 processPrintoutput2FO ($print_output)
 Convert a print output to XSL-FO. More...
 
 deliverPDFfromHTML ($content, $title=null)
 Delivers a PDF file from XHTML. More...
 
 deliverPDFfromFO ($fo, $title=null)
 Delivers a PDF file from a XSL-FO string. More...
 
 saveManualFeedback ($active_id, $question_id, $pass, $feedback, $finalized=false, $is_single_feedback=false)
 Saves the manual feedback for a question in a test. More...
 
 getJavaScriptOutput ()
 Returns if Javascript should be chosen for drag & drop actions for the active user. More...
 
createTestSequence ($active_id, $pass, $shuffle)
 
 setTestId ($a_id)
 Sets the test ID. More...
 
 getDetailedTestResults ($participants)
 returns all test results for all participants More...
 
 isPluginActive ($a_pname)
 Checks wheather or not a question plugin with a given name is active. More...
 
 getPassed ($active_id)
 
 canShowCertificate ($testSession, $user_id, $active_id)
 Checks whether the certificate button could be shown on the info page or not. More...
 
 getAggregatedResultsData ()
 Returns the aggregated test results. More...
 
 getXMLZip ()
 Get zipped xml file for test. More...
 
 getMailNotification ()
 Get mail notification settings. More...
 
 setMailNotification ($a_notification)
 Set mail notification settings. More...
 
 sendSimpleNotification ($active_id)
 
 getEvaluationAdditionalFields ()
 Gets additional user fields that should be shown in the user evaluation. More...
 
 sendAdvancedNotification ($active_id)
 
 getResultsForActiveId ($active_id)
 
 getMailNotificationType ()
 
 setMailNotificationType ($a_type)
 
 getExportSettings ()
 
 setExportSettings ($a_settings)
 
 getExportSettingsSingleChoiceShort ()
 
 setExportSettingsSingleChoiceShort ($a_settings)
 
 getEnabledViewMode ()
 
 setEnabledViewMode ($mode)
 
 setTemplate ($template_id)
 
 getTemplate ()
 
 moveQuestionAfterOLD ($previous_question_id, $new_question_id)
 
 isAnyInstantFeedbackOptionEnabled ()
 
 getInstantFeedbackOptionsAsArray ()
 
 setInstantFeedbackOptionsByArray ($options)
 
 setResultsPresentationOptionsByArray ($options)
 
 getPoolUsage ()
 
 setPoolUsage ($usage)
 
 reindexFixedQuestionOrdering ()
 
 setQuestionOrderAndObligations ($orders, $obligations)
 
 moveQuestionAfter ($question_to_move, $question_before)
 
 hasQuestionsWithoutQuestionpool ()
 
 getQuestions ()
 
 isOnline ()
 
 setOnline ($a_online=true)
 
 getOldOnlineStatus ()
 
 setOldOnlineStatus ($oldOnlineStatus)
 
 setPrintBestSolutionWithResult ($status)
 
 isBestSolutionPrintedWithResult ()
 
 isOfferingQuestionHintsEnabled ()
 returns the fact wether offering hints is enabled or not More...
 
 setOfferingQuestionHintsEnabled ($offeringQuestionHintsEnabled)
 sets offering question hints enabled/disabled More...
 
 setActivationVisibility ($a_value)
 
 getActivationVisibility ()
 
 isActivationLimited ()
 
 setActivationLimited ($a_value)
 
 setHighscoreEnabled ($a_enabled)
 Sets if the highscore feature should be enabled. More...
 
 getHighscoreEnabled ()
 Gets the setting which determines if the highscore feature is enabled. More...
 
 setHighscoreAnon ($a_anon)
 Sets if the highscores should be anonymized. More...
 
 getHighscoreAnon ()
 Gets if the highscores should be anonymized per setting. More...
 
 isHighscoreAnon ()
 Gets if the highscores should be displayed anonymized. More...
 
 setHighscoreAchievedTS ($a_achieved_ts)
 Sets if the date and time of the scores achievement should be displayed. More...
 
 getHighscoreAchievedTS ()
 Returns if date and time of the scores achievement should be displayed. More...
 
 setHighscoreScore ($a_score)
 Sets if the actual score should be displayed. More...
 
 getHighscoreScore ()
 Gets if the score column should be shown. More...
 
 setHighscorePercentage ($a_percentage)
 Sets if the percentages of the scores pass should be shown. More...
 
 getHighscorePercentage ()
 Gets if the percentage column should be shown. More...
 
 setHighscoreHints ($a_hints)
 Sets if the number of requested hints should be shown. More...
 
 getHighscoreHints ()
 Gets, if the column with the number of requested hints should be shown. More...
 
 setHighscoreWTime ($a_wtime)
 Sets if the workingtime of the scores should be shown. More...
 
 getHighscoreWTime ()
 Gets if the column with the workingtime should be shown. More...
 
 setHighscoreOwnTable ($a_own_table)
 Sets if the table with the own ranking should be shown. More...
 
 getHighscoreOwnTable ()
 Gets if the own rankings table should be shown. More...
 
 setHighscoreTopTable ($a_top_table)
 Sets if the top-rankings table should be shown. More...
 
 getHighscoreTopTable ()
 Gets, if the top-rankings table should be shown. More...
 
 setHighscoreTopNum ($a_top_num)
 Sets the number of entries which are to be shown in the top-rankings table. More...
 
 getHighscoreTopNum ($a_retval=10)
 Gets the number of entries which are to be shown in the top-rankings table. More...
 
 getHighscoreMode ()
 
 setHighscoreMode ($mode)
 
 setSpecificAnswerFeedback ($specific_answer_feedback)
 
 getSpecificAnswerFeedback ()
 
 setObligationsEnabled ($obligationsEnabled=true)
 sets obligations enabled/disabled More...
 
 areObligationsEnabled ()
 returns the fact wether obligations are enabled or not More...
 
 setAutosave ($autosave)
 
 getAutosave ()
 
 setAutosaveIval ($autosave_ival)
 
 getAutosaveIval ()
 
 isPassDeletionAllowed ()
 getter for the test setting passDeletionAllowed More...
 
 setPassDeletionAllowed ($passDeletionAllowed)
 setter for the test setting passDeletionAllowed More...
 
 setShowExamviewHtml ($show_examview_html)
 
 getShowExamviewHtml ()
 
 setShowExamviewPdf ($show_examview_pdf)
 
 getShowExamviewPdf ()
 
 setEnableExamview ($enable_examview)
 
 getEnableExamview ()
 
 setActivationStartingTime ($starting_time=null)
 
 setActivationEndingTime ($ending_time=null)
 
 getActivationStartingTime ()
 
 getActivationEndingTime ()
 
 getStartingTimeOfParticipants ()
 Note, this function should only be used if absolutely necessary, since it perform joins on tables that tend to grow huge and returns vast amount of data. More...
 
 getTimeExtensionsOfParticipants ()
 
 getExtraTime ($active_id)
 
 addExtraTime ($active_id, $minutes)
 
 setEnableArchiving ($enable_archiving)
 
 getEnableArchiving ()
 
 setShowExamIdInTestPassEnabled ($show_exam_id_in_test_pass_enabled)
 
 isShowExamIdInTestPassEnabled ()
 
 setShowExamIdInTestResultsEnabled ($show_exam_id_in_test_results_enabled)
 
 isShowExamIdInTestResultsEnabled ()
 
 setSignSubmission ($sign_submission)
 
 getSignSubmission ()
 
 setCharSelectorAvailability ($availability)
 
 getCharSelectorAvailability ()
 
 setCharSelectorDefinition ($definition='')
 
 getCharSelectorDefinition ()
 
 setQuestionSetType ($questionSetType)
 setter for question set type More...
 
 getQuestionSetType ()
 getter for question set type More...
 
 isFixedTest ()
 Returns the fact wether this test is a fixed question set test or not. More...
 
 isRandomTest ()
 Returns the fact wether this test is a random questions test or not. More...
 
 isDynamicTest ()
 Returns the fact wether this test is a dynamic question set test or not. More...
 
 getQuestionSetTypeTranslation (ilLanguage $lng, $questionSetType)
 
 participantDataExist ()
 
 recalculateScores ($preserve_manscoring=false)
 
 setSkillServiceEnabled ($skillServiceEnabled)
 
 isSkillServiceEnabled ()
 
 setResultFilterTaxIds ($resultFilterTaxIds)
 
 getResultFilterTaxIds ()
 
 isSkillServiceToBeConsidered ()
 
 setShowGradingStatusEnabled ($showGradingStatusEnabled)
 
 isShowGradingStatusEnabled ()
 
 setShowGradingMarkEnabled ($showGradingMarkEnabled)
 
 isShowGradingMarkEnabled ()
 
 setFollowupQuestionAnswerFixationEnabled ($followupQuestionAnswerFixationEnabled)
 
 isFollowupQuestionAnswerFixationEnabled ()
 
 setInstantFeedbackAnswerFixationEnabled ($instantFeedbackAnswerFixationEnabled)
 
 isInstantFeedbackAnswerFixationEnabled ()
 
 isForceInstantFeedbackEnabled ()
 
 setForceInstantFeedbackEnabled ($forceInstantFeedbackEnabled)
 
 isTestFinalBroken ()
 
 setTestFinalBroken ($testFinalBroken)
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor @access public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 read object data from db into object More...
 
 getId ()
 get object id @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 setOfflineStatus ($a_status)
 Set offline status. More...
 
 getOfflineStatus ()
 Get offline status. More...
 
 supportsOfflineHandling ()
 Check whether object supports offline handling. More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) @access public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 
- Public Member Functions inherited from ilMarkSchemaAware
 getMarkSchema ()
 
 checkMarks ()
 
 canEditMarks ()
 
 getMarkSchemaForeignId ()
 
 onMarkSchemaSaved ()
 
- Public Member Functions inherited from ilEctsGradesEnabled
 setECTSGrades (array $grades)
 
 getECTSGrades ()
 
 setECTSFX ($ects_fx)
 
 getECTSFX ()
 
 setECTSOutput ($status)
 
 getECTSOutput ()
 
 saveECTSStatus ()
 
 canEditEctsGrades ()
 
 canShowEctsGrades ()
 
 getECTSGrade ($passed_array, $reached_points, $max_points)
 Returns the ECTS grade for a number of reached points. More...
 

Static Public Member Functions

static _setImportDirectory ($a_import_dir=null)
 set import directory More...
 
static _getImportDirectory ()
 Get the import directory location of the test. More...
 
static _createImportDirectory ()
 creates data directory for import files (data_dir/tst_data/tst_<id>/import, depending on data directory that is set in ILIAS setup/ini) More...
 
static _getCountSystem ($active_id)
 Gets the count system for the calculation of points. More...
 
static _getPassScoring ($active_id)
 Gets the pass scoring type. More...
 
static _getMCScoring ($active_id)
 Gets the scoring type for multiple choice questions. More...
 
static _getScoreCutting ($active_id)
 Determines if the score of a question should be cut at 0 points or the score of the whole test. More...
 
static _getUsePreviousAnswers ($active_id, $user_active_user_setting=false)
 Returns if the previous results should be hidden for a learner. More...
 
static _getActiveIdOfUser ($user_id="", $test_id="")
 Gets the active id of the tst_active table for the active user. More...
 
static _getWorkingTimeOfParticipantForPass ($active_id, $pass)
 Returns the complete working time in seconds for a test participant. More...
 
static _getQuestionCountAndPointsForPassOfParticipant ($active_id, $pass)
 
static _instanciateQuestion ($question_id)
 Creates an instance of a question with a given question id. More...
 
static _getECTSGrade ($points_passed, $reached_points, $max_points, $a, $b, $c, $d, $e, $fx)
 {Returns the ECTS grade for a number of reached points.
Parameters
double$reached_pointsThe points reached in the test
double$max_pointsThe maximum number of points for the test
Returns
string The ECTS grade short description
} More...
 
static _lookupAuthor ($obj_id)
 Gets the authors name of the ilObjTest object. More...
 
static _getAvailableTests ($use_object_id=false)
 Returns the available tests for the active user. More...
 
static _getObjectIDFromTestID ($test_id)
 Returns the ILIAS test object id for a given test id. More...
 
static _getObjectIDFromActiveID ($active_id)
 Returns the ILIAS test object id for a given active id. More...
 
static _getTestIDFromObjectID ($object_id)
 Returns the ILIAS test id for a given object id. More...
 
static _getSolvedQuestions ($active_id, $question_fi=null)
 get solved questions More...
 
static _getPass ($active_id)
 Retrieves the actual pass of a given user for a given test. More...
 
static _getMaxPass ($active_id)
 Retrieves the maximum pass of a given user for a given test in which the user answered at least one question. More...
 
static _getBestPass ($active_id)
 Retrieves the best pass of a given user for a given test. More...
 
static _getResultPass ($active_id)
 Retrieves the pass number that should be counted for a given user. More...
 
static lookupPassResultsUpdateTimestamp ($active_id, $pass)
 
static _getUserIdFromActiveId ($active_id)
 
static lookupLastTestPassAccess ($activeId, $passIndex)
 
static _lookupAnonymity ($a_obj_id)
 Returns the anonymity status of a test with a given object id. More...
 
static lookupQuestionSetTypeByActiveId ($active_id)
 returns the question set type of test relating to passed active id More...
 
static _getTestDefaults ($test_defaults_id)
 
static getManualFeedback ($active_id, $question_id, $pass)
 Retrieves the feedback comment for a question in a test if it is finalized. More...
 
static getSingleManualFeedback ($active_id, $question_id, $pass)
 Retrieves the manual feedback for a question in a test. More...
 
static getCompleteManualFeedback (int $question_id)
 Retrieves the manual feedback for a question in a test. More...
 
static _lookupTestObjIdForQuestionId ($a_q_id)
 Get test Object ID for question ID. More...
 
static _lookupFinishedUserTests ($a_user_id)
 Gather all finished tests for user. More...
 
static isQuestionObligationPossible ($questionId)
 checks wether the obligation for question with given id is possible or not More...
 
static isQuestionObligatory ($question_id)
 checks wether the question with given id is marked as obligatory or not More...
 
static allObligationsAnswered ($test_id, $active_id, $pass)
 checks wether all questions marked as obligatory were answered within the test pass with given testId, activeId and pass index More...
 
static hasObligations ($test_id)
 returns the fact wether the test with given test id contains questions markes as obligatory or not More...
 
static lookupExamId ($active_id, $pass)
 
static buildExamId ($active_id, $pass, $test_obj_id=null)
 
static lookupQuestionSetType ($objId)
 lookup-er for question set type More...
 
static _lookupRandomTest ($a_obj_id)
 Returns the fact wether the test with passed obj id is a random questions test or not. More...
 
static getPoolQuestionChangeListeners (ilDBInterface $db, $poolObjId)
 
static getTestObjIdsWithActiveForUserId ($userId)
 
static isSkillManagementGloballyActivated ()
 
static ensureParticipantsLastActivePassFinished ($testObjId, $userId, $a_force_new_run=false)
 
static isParticipantsLastPassActive ($testRefId, $userId)
 
static getDataWebPath (string $relative_path='')
 This is originally a fix for https://mantis.ilias.de/view.php?id=35707; in general, the handling of those pathes shold be improved or better, avoided entirely (e.g. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static lookupOfflineStatus ($a_obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id, $a_deleted_by)
 
static setDeletedDates ($a_ref_ids, $a_user_id)
 Set deleted date. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data@access public More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 
static _getECTSGrade ($points_passed, $reached_points, $max_points, $a, $b, $c, $d, $e, $fx)
 Returns the ECTS grade for a number of reached points. More...
 

Data Fields

const DEFAULT_PROCESSING_TIME_MINUTES = 90
 
const QUESTION_SET_TYPE_FIXED = 'FIXED_QUEST_SET'
 type setting value for fixed question set More...
 
const QUESTION_SET_TYPE_RANDOM = 'RANDOM_QUEST_SET'
 type setting value for random question set More...
 
const QUESTION_SET_TYPE_DYNAMIC = 'DYNAMIC_QUEST_SET'
 type setting value for dynamic question set (continues testing mode) More...
 
const HIGHSCORE_SHOW_OWN_TABLE = 1
 
const HIGHSCORE_SHOW_TOP_TABLE = 2
 
const HIGHSCORE_SHOW_ALL_TABLES = 3
 
 $test_id
 
 $invitation = INVITATION_OFF
 
 $author
 
 $metadata
 
 $questions
 
 $mark_schema
 
 $sequence_settings
 
 $score_reporting
 
 $instant_verification
 
 $answer_feedback_points
 
 $reporting_date
 
 $evaluation_data
 
 $nr_of_tries
 
 $use_previous_answers
 
 $title_output
 
 $processing_time
 
 $enable_processing_time
 
 $reset_processing_time
 
 $count_system
 
 $mc_scoring
 
 $pass_scoring
 
 $shuffle_questions
 
 $results_presentation
 
 $show_summary
 
 $score_cutting
 
 $certificate_visibility
 
 $anonymity
 
 $show_cancel
 
 $show_marker
 
 $fixed_participants
 
 $answer_feedback
 
 $testSession
 
 $testSequence
 
const SCORE_REPORTING_DISABLED = 0
 
const SCORE_REPORTING_FINISHED = 1
 
const SCORE_REPORTING_IMMIDIATLY = 2
 
const SCORE_REPORTING_DATE = 3
 
const SCORE_REPORTING_AFTER_PASSED = 4
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 

Protected Member Functions

 isNewRandomTest ()
 Checks wheather the test is a new random test (using tst_rnd_cpy) or an old one. More...
 
 buildIso8601PeriodFromUnixtimeForExportCompatibility ($unix_timestamp)
 
 getHtmlQuestionContentPurifier ()
 

Protected Attributes

 $_kiosk
 
 $introductionEnabled
 
 $introduction
 
 $blockPassesAfterPassedEnabled = false
 
 $starting_time_enabled
 
 $starting_time
 
 $ending_time_enabled
 
 $ending_time
 
 $ects_output = false
 
 $ects_fx = null
 
 $ects_grades = array()
 
 $passwordEnabled
 
 $password
 
 $limitUsersEnabled
 
 $allowedUsers
 
 $allowedUsersTimeGap
 
 $mailnotification
 
 $mailnottype
 
 $exportsettings
 
 $poolUsage
 
 $oldOnlineStatus = null
 
 $print_best_solution_with_result = true
 
 $activation_visibility
 
 $activation_starting_time
 
 $activation_ending_time
 
 $autosave
 
 $autosave_ival
 
 $enable_examview
 
 $show_examview_html
 
 $show_examview_pdf
 
 $enable_archiving
 
 $show_exam_id_in_test_pass_enabled
 
 $show_exam_id_in_test_results_enabled
 
 $sign_submission
 
 $char_selector_availability
 
 $char_selector_definition
 
 $showGradingStatusEnabled
 
 $showGradingMarkEnabled
 
 $followupQuestionAnswerFixationEnabled
 
 $instantFeedbackAnswerFixationEnabled
 
 $forceInstantFeedbackEnabled
 
 $testFinalBroken
 
 $pass_waiting = "00:000:00:00:00"
 
 $accessFilteredParticipantList
 
- Protected Attributes inherited from ilObject
 $objDefinition
 
 $db
 
 $log
 
 $error
 
 $tree
 
 $app_event_handler
 
 $rbacadmin
 
 $rbacreview
 

Private Member Functions

 insertManualFeedback ($active_id, $question_id, $pass, $feedback, $finalized, $feedback_old)
 Inserts a manual feedback into the DB. More...
 
 logManualFeedback ($active_id, $question_id, $feedback)
 Creates a log for the manual feedback. More...
 

Private Attributes

 $questionSetType = self::QUESTION_SET_TYPE_FIXED
 
 $skillServiceEnabled = false
 
 $resultFilterTaxIds = array()
 
 $_showfinalstatement
 
 $_finalstatement
 
 $_showinfo
 
 $_forcejs = true
 
 $_customStyle
 
 $template_id
 
 $offeringQuestionHintsEnabled = null
 
 $obligationsEnabled = null
 
 $passDeletionAllowed = null
 
 $participantDataExist = null
 holds the fact wether participant data exists or not DO NOT USE TIS PROPERTY DRIRECTLY ALWAYS USE ilObjTest::paricipantDataExist() since this method initialises this property More...
 
 $redirection_mode = 0
 
 $redirection_url = null
 
 $tmpCopyWizardCopyId
 

Static Private Attributes

static $isSkillManagementGloballyActivated = null
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilObjTest::__construct (   $a_id = 0,
  $a_call_by_reference = true 
)

Constructor.

Parameters
$a_idinteger Reference_id or object_id.
$a_call_by_referenceboolean Treat the id as reference_id (true) or object_id (false).
Returns
\ilObjTest

Reimplemented from ilObject.

Definition at line 600 of file class.ilObjTest.php.

601 {
602 global $DIC;
603 $ilUser = $DIC['ilUser'];
604 $lng = $DIC['lng'];
605 $this->refinery = $DIC['refinery'];
606 $this->type = "tst";
607
608 $lng->loadLanguageModule("assessment");
609 // Defaults:
610 include_once "./Modules/Test/classes/class.assMarkSchema.php";
611 $this->mark_schema = new ASS_MarkSchema();
612 $this->mark_schema->createSimpleSchema(
613 $lng->txt("failed_short"),
614 $lng->txt("failed_official"),
615 0,
616 0,
617 $lng->txt("passed_short"),
618 $lng->txt("passed_official"),
619 50,
620 1
621 );
622
623 $this->test_id = -1;
624 $this->author = $ilUser->fullname;
625 $this->introductionEnabled = false;
626 $this->introduction = "";
627 $this->questions = array();
628 $this->sequence_settings = TEST_FIXED_SEQUENCE;
629 $this->score_reporting = self::SCORE_REPORTING_FINISHED;
630 $this->instant_verification = 0;
631 $this->answer_feedback_points = 0;
632 $this->reporting_date = "";
633 $this->nr_of_tries = 0;
634 $this->_kiosk = 0;
635 $this->use_previous_answers = 1;
636 $this->title_output = 0;
637 $this->starting_time = "";
638 $this->ending_time = "";
639 $this->processing_time = "";
640 $this->enable_processing_time = "0";
641 $this->reset_processing_time = 0;
642 $this->ects_output = false;
643 $this->ects_fx = null;
644 $this->shuffle_questions = false;
645 $this->mailnottype = 0;
646 $this->exportsettings = 0;
647 $this->show_summary = 8;
648 $this->count_system = COUNT_PARTIAL_SOLUTIONS;
649 $this->mc_scoring = SCORE_ZERO_POINTS_WHEN_UNANSWERED;
650 $this->score_cutting = SCORE_CUT_QUESTION;
651 $this->pass_scoring = SCORE_LAST_PASS;
652 $this->answer_feedback = 0;
653 $this->password = "";
654 $this->certificate_visibility = 0;
655 $this->allowedUsers = "";
656 $this->_showfinalstatement = false;
657 $this->_finalstatement = "";
658 $this->_showinfo = true;
659 $this->_forcejs = true;
660 $this->_customStyle = "";
661 $this->allowedUsersTimeGap = "";
662 $this->anonymity = 0;
663 $this->show_cancel = 0;
664 $this->show_marker = 0;
665 $this->fixed_participants = 0;
666 $this->setShowPassDetails(true);
667 $this->setShowSolutionDetails(true);
668 $this->setShowSolutionAnswersOnly(false);
669 $this->setShowSolutionSignature(false);
670 $this->testSession = false;
671 $this->testSequence = false;
672 $this->mailnotification = 0;
673 $this->poolUsage = 1;
674
675 $this->ects_grades = array(
676 'A' => 90,
677 'B' => 65,
678 'C' => 35,
679 'D' => 10,
680 'E' => 0
681 );
682
683 $this->autosave = false;
684 $this->autosave_ival = 30000;
685
686 $this->enable_examview = false;
687 $this->show_examview_html = false;
688 $this->show_examview_pdf = false;
689 $this->enable_archiving = false;
690
691 $this->express_mode = false;
692 $this->template_id = '';
693 $this->redirection_mode = 0;
694 $this->redirection_url = null;
695 $this->show_exam_id_in_test_pass_enabled = false;
696 $this->show_exam_id_in_test_results_enabled = false;
697 $this->sign_submission = false;
698 $this->char_selector_availability = 0;
699 $this->char_selector_definition = null;
700
701 $this->showGradingStatusEnabled = true;
702 $this->showGradingMarkEnabled = true;
703
704 $this->followupQuestionAnswerFixationEnabled = false;
705 $this->instantFeedbackAnswerFixationEnabled = false;
706
707 $this->testFinalBroken = false;
708
709 $this->tmpCopyWizardCopyId = null;
710
711 parent::__construct($a_id, $a_call_by_reference);
712 }
A class defining mark schemas for assessment test objects.
setShowSolutionSignature($a_signature=false)
Set to TRUE, if the signature field should be shown in the solution.
setShowSolutionDetails($a_details=1)
Sets if the the solution details should be presented to the user or not.
setShowPassDetails($a_details=1)
Sets if the pass details should be shown when a test is not finished.
const SCORE_REPORTING_FINISHED
setShowSolutionAnswersOnly($a_full=true)
Set to true, if the full solution (including the ILIAS content pages) should be shown in the solution...
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18
const SCORE_ZERO_POINTS_WHEN_UNANSWERED
const COUNT_PARTIAL_SOLUTIONS
const TEST_FIXED_SEQUENCE
Test constants.
const SCORE_CUT_QUESTION
const SCORE_LAST_PASS
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, $ilUser, ilObject\$lng, ILIAS\GlobalScreen\Provider\__construct(), COUNT_PARTIAL_SOLUTIONS, SCORE_CUT_QUESTION, SCORE_LAST_PASS, SCORE_REPORTING_FINISHED, SCORE_ZERO_POINTS_WHEN_UNANSWERED, setShowPassDetails(), setShowSolutionAnswersOnly(), setShowSolutionDetails(), setShowSolutionSignature(), and TEST_FIXED_SEQUENCE.

+ Here is the call graph for this function:

Member Function Documentation

◆ _buildName()

ilObjTest::_buildName (   $is_anonymous,
  $user_id,
  $firstname,
  $lastname,
  $title 
)

Builds a user name for the output depending on test type and existence of the user.

Parameters
boolean$is_anonymousIndicates if it is an anonymized test or not
int$user_idThe database ID of the user
string$firstnameThe first name of the user
string$lastnameThe last name of the user
string$titleThe title of the user
Returns
string The output name of the user @access public

Definition at line 5313 of file class.ilObjTest.php.

5314 {
5315 global $DIC;
5316 $lng = $DIC['lng'];
5317 $name = "";
5318 if (strlen($firstname . $lastname . $title) == 0) {
5319 $name = $lng->txt("deleted_user");
5320 } else {
5321 if ($user_id == ANONYMOUS_USER_ID) {
5322 $name = $lastname;
5323 } else {
5324 $name = trim($lastname . ", " . $firstname . " " . $title);
5325 }
5326 if ($is_anonymous) {
5327 $name = $lng->txt("anonymous");
5328 }
5329 }
5330 return $name;
5331 }
const ANONYMOUS_USER_ID
Definition: constants.php:25
if($format !==null) $name
Definition: metadata.php:230

References $DIC, ilObject\$lng, $name, ilObject\$title, and ANONYMOUS_USER_ID.

◆ _createImportDirectory()

static ilObjTest::_createImportDirectory ( )
static

creates data directory for import files (data_dir/tst_data/tst_<id>/import, depending on data directory that is set in ILIAS setup/ini)

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

979 {
980 global $DIC;
981 $ilias = $DIC['ilias'];
982 include_once "./Services/Utilities/classes/class.ilUtil.php";
983 $tst_data_dir = ilUtil::getDataDir() . "/tst_data";
984 ilUtil::makeDir($tst_data_dir);
985
986 if (!is_writable($tst_data_dir)) {
987 $ilias->raiseError("Test Data Directory (" . $tst_data_dir
988 . ") not writeable.", $ilias->error_obj->FATAL);
989 }
990
991 // create test directory (data_dir/tst_data/tst_import)
992 $tst_dir = $tst_data_dir . "/tst_import";
993 ilUtil::makeDir($tst_dir);
994 if (!@is_dir($tst_dir)) {
995 $ilias->raiseError("Creation of test import directory failed.", $ilias->error_obj->FATAL);
996 }
997
998 // assert that this is empty and does not contain old data
999 ilUtil::delDir($tst_dir, true);
1000
1001 return $tst_dir;
1002 }
static getDataDir()
get data directory (outside webspace)
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...

References $DIC, ilUtil\delDir(), ilUtil\getDataDir(), and ilUtil\makeDir().

Referenced by ilObjTestGUI\uploadTstObject().

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

◆ _evalResultsOverview()

& ilObjTest::_evalResultsOverview (   $test_id)

Creates an associated array with the results of all participants of a test.

Returns
array An associated array containing the results @access public

Definition at line 5183 of file class.ilObjTest.php.

5184 {
5185 global $DIC;
5186 $ilDB = $DIC['ilDB'];
5187
5188 $result = $ilDB->queryF(
5189 "SELECT usr_data.usr_id, usr_data.firstname, usr_data.lastname, usr_data.title, usr_data.login, " .
5190 "tst_test_result.*, qpl_questions.original_id, qpl_questions.title questiontitle, " .
5191 "qpl_questions.points maxpoints " .
5192 "FROM tst_test_result, qpl_questions, tst_active " .
5193 "LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id " .
5194 "WHERE tst_active.active_id = tst_test_result.active_fi " .
5195 "AND qpl_questions.question_id = tst_test_result.question_fi " .
5196 "AND tst_active.test_fi = %s " .
5197 "ORDER BY tst_active.active_id, tst_test_result.pass, tst_test_result.tstamp",
5198 array('integer'),
5199 array($test_id)
5200 );
5201 $overview = array();
5202 while ($row = $ilDB->fetchAssoc($result)) {
5203 if (!array_key_exists($row["active_fi"], $overview)) {
5204 $overview[$row["active_fi"]] = array();
5205 $overview[$row["active_fi"]]["firstname"] = $row["firstname"];
5206 $overview[$row["active_fi"]]["lastname"] = $row["lastname"];
5207 $overview[$row["active_fi"]]["title"] = $row["title"];
5208 $overview[$row["active_fi"]]["login"] = $row["login"];
5209 $overview[$row["active_fi"]]["usr_id"] = $row["usr_id"];
5210 $overview[$row["active_fi"]]["started"] = $row["started"];
5211 $overview[$row["active_fi"]]["finished"] = $row["finished"];
5212 }
5213 if (!array_key_exists($row["pass"], $overview[$row["active_fi"]])) {
5214 $overview[$row["active_fi"]][$row["pass"]] = array();
5215 $overview[$row["active_fi"]][$row["pass"]]["reached"] = 0;
5216 $overview[$row["active_fi"]][$row["pass"]]["maxpoints"] = $row["maxpoints"];
5217 }
5218 array_push($overview[$row["active_fi"]][$row["pass"]], $row);
5219 $overview[$row["active_fi"]][$row["pass"]]["reached"] += $row["points"];
5220 }
5221 return $overview;
5222 }
$result
global $ilDB

References $DIC, $ilDB, $result, and $test_id.

Referenced by evalResultsOverview().

+ Here is the caller graph for this function:

◆ _getActiveIdOfUser()

static ilObjTest::_getActiveIdOfUser (   $user_id = "",
  $test_id = "" 
)
static

Gets the active id of the tst_active table for the active user.

Parameters
integer$user_idThe database id of the user
integer$test_idThe database id of the test
Returns
object The database row of the tst_active table @access public

Definition at line 3990 of file class.ilObjTest.php.

3991 {
3992 global $DIC;
3993 $ilDB = $DIC['ilDB'];
3994 $ilUser = $DIC['ilUser'];
3995
3996 if (!$user_id) {
3997 $user_id = $ilUser->id;
3998 }
3999 if (!$test_id) {
4000 return "";
4001 }
4002 $result = $ilDB->queryF(
4003 "SELECT tst_active.active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s",
4004 array('integer', 'integer'),
4005 array($user_id, $test_id)
4006 );
4007 if ($result->numRows()) {
4008 $row = $ilDB->fetchAssoc($result);
4009 return $row["active_id"];
4010 } else {
4011 return "";
4012 }
4013 }

References $DIC, $ilDB, $ilUser, $result, and $test_id.

Referenced by ilLOUtils\getTestResultLinkForUser().

+ Here is the caller graph for this function:

◆ _getAvailableTests()

static ilObjTest::_getAvailableTests (   $use_object_id = false)
static

Returns the available tests for the active user.

Returns
array The available tests @access public

Definition at line 7051 of file class.ilObjTest.php.

7052 {
7053 global $DIC;
7054 $ilUser = $DIC['ilUser'];
7055 $ilDB = $DIC['ilDB'];
7056
7057 $result_array = array();
7058 $tests = array_slice(
7059 array_reverse(
7060 ilUtil::_getObjectsByOperations("tst", "write", $ilUser->getId(), PHP_INT_MAX)
7061 ),
7062 0,
7063 10000
7064 );
7065
7066 if (count($tests)) {
7067 $titles = ilObject::_prepareCloneSelection($tests, "tst");
7068 foreach ($tests as $ref_id) {
7069 if ($use_object_id) {
7071 $result_array[$obj_id] = $titles[$ref_id];
7072 } else {
7073 $result_array[$ref_id] = $titles[$ref_id];
7074 }
7075 }
7076 }
7077 return $result_array;
7078 }
static _lookupObjId($a_id)
static _prepareCloneSelection($a_ref_ids, $new_type, $show_path=true)
Prepare copy wizard object selection.
static _getObjectsByOperations($a_obj_type, $a_operation, $a_usr_id=0, $limit=0)
Get all objects of a specific type and check access This function is not recursive,...

References $DIC, $ilDB, $ilUser, ilObject\$ref_id, ilUtil\_getObjectsByOperations(), ilObject\_lookupObjId(), and ilObject\_prepareCloneSelection().

Referenced by ilObjAssessmentFolderGUI\exportLogObject(), ilObjAssessmentFolderGUI\getLogDataOutputForm(), and ilObjAssessmentFolderGUI\logAdminObject().

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

◆ _getBestPass()

static ilObjTest::_getBestPass (   $active_id)
static

Retrieves the best pass of a given user for a given test.

Parameters
int$active_id
Returns
int|mixed

Definition at line 8132 of file class.ilObjTest.php.

8133 {
8134 global $DIC;
8135 $ilDB = $DIC['ilDB'];
8136
8137 $result = $ilDB->queryF(
8138 "SELECT * FROM tst_pass_result WHERE active_fi = %s",
8139 array('integer'),
8140 array($active_id)
8141 );
8142 if ($result->numRows()) {
8143 $bestrow = null;
8144 $bestfactor = 0.0;
8145 while ($row = $ilDB->fetchAssoc($result)) {
8146 if ($row["maxpoints"] > 0) {
8147 $factor = (float) ($row["points"] / $row["maxpoints"]);
8148 } else {
8149 $factor = 0.0;
8150 }
8151
8152 if ($factor === 0.0 && $bestfactor === 0.0
8153 || $factor > $bestfactor) {
8154 $bestrow = $row;
8155 $bestfactor = $factor;
8156 }
8157 }
8158 if (is_array($bestrow)) {
8159 return $bestrow["pass"];
8160 } else {
8161 return null;
8162 }
8163 } else {
8164 return null;
8165 }
8166 }

References $DIC, $ilDB, and $result.

Referenced by _getResultPass().

+ Here is the caller graph for this function:

◆ _getCompleteWorkingTimeOfParticipants()

& ilObjTest::_getCompleteWorkingTimeOfParticipants (   $test_id)

Returns the complete working time in seconds for all test participants.

Parameters
integer$test_idThe database ID of the test
Returns
array An array containing the working time in seconds for all test participants @access public

Definition at line 4313 of file class.ilObjTest.php.

4314 {
4315 global $DIC;
4316 $ilDB = $DIC['ilDB'];
4317
4318 $result = $ilDB->queryF(
4319 "SELECT tst_times.* FROM tst_active, tst_times WHERE tst_active.test_fi = %s AND tst_active.active_id = tst_times.active_fi ORDER BY tst_times.active_fi, tst_times.started",
4320 array('integer'),
4321 array($test_id)
4322 );
4323 $time = 0;
4324 $times = array();
4325 while ($row = $ilDB->fetchAssoc($result)) {
4326 if (!array_key_exists($row["active_fi"], $times)) {
4327 $times[$row["active_fi"]] = 0;
4328 }
4329 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
4330 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4331 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4332 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4333 $times[$row["active_fi"]] += ($epoch_2 - $epoch_1);
4334 }
4335 return $times;
4336 }

References $DIC, $ilDB, $result, and $test_id.

Referenced by getCompleteWorkingTimeOfParticipants().

+ Here is the caller graph for this function:

◆ _getCountSystem()

static ilObjTest::_getCountSystem (   $active_id)
static

Gets the count system for the calculation of points.

Returns
integer The count system for the calculation of points @access public
See also
$count_system

Definition at line 2500 of file class.ilObjTest.php.

2501 {
2502 global $DIC;
2503 $ilDB = $DIC['ilDB'];
2504 $result = $ilDB->queryF(
2505 "SELECT tst_tests.count_system FROM tst_tests, tst_active WHERE tst_active.active_id = %s AND tst_active.test_fi = tst_tests.test_id",
2506 array('integer'),
2507 array($active_id)
2508 );
2509 if ($result->numRows()) {
2510 $row = $ilDB->fetchAssoc($result);
2511 return $row["count_system"];
2512 }
2513 return false;
2514 }

References $DIC, $ilDB, and $result.

Referenced by assQuestion\adjustReachedPointsByScoringOptions().

+ Here is the caller graph for this function:

◆ _getECTSGrade()

static ilObjTest::_getECTSGrade (   $points_passed,
  $reached_points,
  $max_points,
  $a,
  $b,
  $c,
  $d,
  $e,
  $fx 
)
static

{Returns the ECTS grade for a number of reached points.

Parameters
double$reached_pointsThe points reached in the test
double$max_pointsThe maximum number of points for the test
Returns
string The ECTS grade short description
}

Implements ilEctsGradesEnabled.

Definition at line 6822 of file class.ilObjTest.php.

6823 {
6824 include_once "./Modules/Test/classes/class.ilStatistics.php";
6825 // calculate the median
6826 $passed_statistics = new ilStatistics();
6827 $passed_statistics->setData($points_passed);
6828 $ects_percentiles = array(
6829 "A" => $passed_statistics->quantile($a),
6830 "B" => $passed_statistics->quantile($b),
6831 "C" => $passed_statistics->quantile($c),
6832 "D" => $passed_statistics->quantile($d),
6833 "E" => $passed_statistics->quantile($e)
6834 );
6835 if (count($points_passed) && ($reached_points >= $ects_percentiles["A"])) {
6836 return "A";
6837 } elseif (count($points_passed) && ($reached_points >= $ects_percentiles["B"])) {
6838 return "B";
6839 } elseif (count($points_passed) && ($reached_points >= $ects_percentiles["C"])) {
6840 return "C";
6841 } elseif (count($points_passed) && ($reached_points >= $ects_percentiles["D"])) {
6842 return "D";
6843 } elseif (count($points_passed) && ($reached_points >= $ects_percentiles["E"])) {
6844 return "E";
6845 } elseif (strcmp($fx, "") != 0) {
6846 if ($max_points > 0) {
6847 $percentage = ($reached_points / $max_points) * 100.0;
6848 if ($percentage < 0) {
6849 $percentage = 0.0;
6850 }
6851 } else {
6852 $percentage = 0.0;
6853 }
6854 if ($percentage >= $fx) {
6855 return "FX";
6856 } else {
6857 return "F";
6858 }
6859 } else {
6860 return "F";
6861 }
6862 }
$c
Definition: cli.php:37
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

References Vendor\Package\$a, Vendor\Package\$b, $c, $d, and Vendor\Package\$e.

Referenced by getECTSGrade().

+ Here is the caller graph for this function:

◆ _getImportDirectory()

static ilObjTest::_getImportDirectory ( )
static

Get the import directory location of the test.

Returns
string The location of the import directory or false if the directory doesn't exist @access public

Definition at line 960 of file class.ilObjTest.php.

961 {
962 if (strlen($_SESSION["tst_import_dir"])) {
963 return $_SESSION["tst_import_dir"];
964 }
965 return null;
966 }
$_SESSION["AccountId"]

References $_SESSION.

Referenced by assFormulaQuestionImport\fromXML(), fromXML(), getImportDirectory(), assQuestionImport\getTstImportArchivDirectory(), ilObjTestGUI\importVerifiedFileObject(), and ilObjTestGUI\uploadTstObject().

+ Here is the caller graph for this function:

◆ _getLastAccess()

ilObjTest::_getLastAccess (   $active_id)

Definition at line 9185 of file class.ilObjTest.php.

9186 {
9187 global $DIC;
9188 $ilDB = $DIC['ilDB'];
9189
9190 $result = $ilDB->queryF(
9191 "SELECT finished FROM tst_times WHERE active_fi = %s ORDER BY finished DESC",
9192 array('integer'),
9193 array($active_id)
9194 );
9195 if ($result->numRows()) {
9196 $row = $ilDB->fetchAssoc($result);
9197 return $row["finished"];
9198 }
9199 return "";
9200 }

References $DIC, $ilDB, and $result.

◆ _getMaxPass()

static ilObjTest::_getMaxPass (   $active_id)
static

Retrieves the maximum pass of a given user for a given test in which the user answered at least one question.

Parameters
integer$user_idThe user id
integer$test_idThe test id
Returns
integer The pass of the user for the given test @access public

Definition at line 8109 of file class.ilObjTest.php.

8110 {
8111 global $DIC;
8112 $ilDB = $DIC['ilDB'];
8113 $result = $ilDB->queryF(
8114 "SELECT MAX(pass) maxpass FROM tst_pass_result WHERE active_fi = %s",
8115 array('integer'),
8116 array($active_id)
8117 );
8118 if ($result->numRows()) {
8119 $row = $ilDB->fetchAssoc($result);
8120 $max = $row["maxpass"];
8121 } else {
8122 $max = null;
8123 }
8124 return $max;
8125 }

References $DIC, $ilDB, and $result.

Referenced by _getResultPass(), and ilTestParticipantList\lookupNrOfTries().

+ Here is the caller graph for this function:

◆ _getMCScoring()

static ilObjTest::_getMCScoring (   $active_id)
static

Gets the scoring type for multiple choice questions.

Returns
mixed The scoring type for multiple choice questions @access public
See also
$mc_scoring

Definition at line 2582 of file class.ilObjTest.php.

2583 {
2584 global $DIC;
2585 $ilDB = $DIC['ilDB'];
2586 $result = $ilDB->queryF(
2587 "SELECT tst_tests.mc_scoring FROM tst_tests, tst_active WHERE tst_active.active_id = %s AND tst_active.test_fi = tst_tests.test_id",
2588 array('integer'),
2589 array($active_id)
2590 );
2591 if ($result->numRows()) {
2592 $row = $ilDB->fetchAssoc($result);
2593 return $row["mc_scoring"];
2594 }
2595 return false;
2596 }

References $DIC, $ilDB, and $result.

Referenced by assKprimChoice\calculateReachedPointsForSolution(), and assMultipleChoice\calculateReachedPointsForSolution().

+ Here is the caller graph for this function:

◆ _getObjectIDFromActiveID()

static ilObjTest::_getObjectIDFromActiveID (   $active_id)
static

Returns the ILIAS test object id for a given active id.

Parameters
integer$active_idThe active id
Returns
mixed The ILIAS test object id or FALSE if the query was not successful @access public

Definition at line 7332 of file class.ilObjTest.php.

7333 {
7334 global $DIC;
7335 $ilDB = $DIC['ilDB'];
7336 $object_id = false;
7337 $result = $ilDB->queryF(
7338 "SELECT tst_tests.obj_fi FROM tst_tests, tst_active WHERE tst_tests.test_id = tst_active.test_fi AND tst_active.active_id = %s",
7339 array('integer'),
7340 array($active_id)
7341 );
7342 if ($result->numRows()) {
7343 $row = $ilDB->fetchAssoc($result);
7344 $object_id = $row["obj_fi"];
7345 }
7346 return $object_id;
7347 }

References $DIC, $ilDB, and $result.

Referenced by buildExamId(), assFileUpload\handleSubmission(), and assQuestion\logAction().

+ Here is the caller graph for this function:

◆ _getObjectIDFromTestID()

static ilObjTest::_getObjectIDFromTestID (   $test_id)
static

Returns the ILIAS test object id for a given test id.

Parameters
integer$test_idThe test id
Returns
mixed The ILIAS test object id or FALSE if the query was not successful @access public

Definition at line 7308 of file class.ilObjTest.php.

7309 {
7310 global $DIC;
7311 $ilDB = $DIC['ilDB'];
7312 $object_id = false;
7313 $result = $ilDB->queryF(
7314 "SELECT obj_fi FROM tst_tests WHERE test_id = %s",
7315 array('integer'),
7316 array($test_id)
7317 );
7318 if ($result->numRows()) {
7319 $row = $ilDB->fetchAssoc($result);
7320 $object_id = $row["obj_fi"];
7321 }
7322 return $object_id;
7323 }

References $DIC, $ilDB, $result, and $test_id.

Referenced by _lookupFinishedUserTests(), assJavaAppletGUI\getSolutionOutput(), and assJavaAppletGUI\getTestOutput().

+ Here is the caller graph for this function:

◆ _getPass()

static ilObjTest::_getPass (   $active_id)
static

Retrieves the actual pass of a given user for a given test.

Parameters
integer$user_idThe user id
integer$test_idThe test id
Returns
integer The pass of the user for the given test @access public

Definition at line 8083 of file class.ilObjTest.php.

8084 {
8085 global $DIC;
8086 $ilDB = $DIC['ilDB'];
8087 $result = $ilDB->queryF(
8088 "SELECT tries FROM tst_active WHERE active_id = %s",
8089 array('integer'),
8090 array($active_id)
8091 );
8092 if ($result->numRows()) {
8093 $row = $ilDB->fetchAssoc($result);
8094 return $row["tries"];
8095 } else {
8096 return 0;
8097 }
8098 }

References $DIC, $ilDB, and $result.

Referenced by assQuestion\calculateResultsFromSolution(), ilTestPlayerAbstractGUI\finishTestCmd(), assQuestion\getAdjustedReachedPoints(), getAllQuestions(), ilTestService\getPassOverviewData(), assFileUploadGUI\getSolutionOutput(), assFlashQuestionGUI\getSolutionOutput(), assFormulaQuestionGUI\getSolutionOutput(), assJavaAppletGUI\getSolutionOutput(), getStartTestLabel(), assLongMenuGUI\getTestOutput(), assFlashQuestionGUI\getTestOutput(), assFormulaQuestionGUI\getTestOutput(), assJavaAppletGUI\getTestOutput(), loadQuestions(), assQuestion\lookupCurrentTestPass(), assQuestion\persistWorkingState(), ilTestPlayerAbstractGUI\redirectAfterAutosaveCmd(), ilTestPlayerAbstractGUI\redirectAfterDashboardCmd(), ilTestOutputGUI\saveQuestionSolution(), assClozeTest\saveWorkingData(), assErrorText\saveWorkingData(), assFormulaQuestion\saveWorkingData(), assImagemapQuestion\saveWorkingData(), assLongMenu\saveWorkingData(), assMatchingQuestion\saveWorkingData(), assOrderingHorizontal\saveWorkingData(), assOrderingQuestion\saveWorkingData(), assSingleChoice\saveWorkingData(), assTextQuestion\saveWorkingData(), and assTextSubset\saveWorkingData().

+ Here is the caller graph for this function:

◆ _getPassScoring()

static ilObjTest::_getPassScoring (   $active_id)
static

Gets the pass scoring type.

Returns
integer The pass scoring type @access public
See also
$pass_scoring

Definition at line 2559 of file class.ilObjTest.php.

2560 {
2561 global $DIC;
2562 $ilDB = $DIC['ilDB'];
2563 $result = $ilDB->queryF(
2564 "SELECT tst_tests.pass_scoring FROM tst_tests, tst_active WHERE tst_tests.test_id = tst_active.test_fi AND tst_active.active_id = %s",
2565 array('integer'),
2566 array($active_id)
2567 );
2568 if ($result->numRows()) {
2569 $row = $ilDB->fetchAssoc($result);
2570 return $row["pass_scoring"];
2571 }
2572 return 0;
2573 }

References $DIC, $ilDB, and $result.

Referenced by _getResultPass().

+ Here is the caller graph for this function:

◆ _getQuestionCountAndPointsForPassOfParticipant()

static ilObjTest::_getQuestionCountAndPointsForPassOfParticipant (   $active_id,
  $pass 
)
static

Definition at line 5061 of file class.ilObjTest.php.

5062 {
5063 global $DIC;
5064 $ilDB = $DIC['ilDB'];
5065
5067
5068 switch ($questionSetType) {
5070
5071 $res = $ilDB->queryF(
5072 "
5073 SELECT COUNT(qpl_questions.question_id) qcount,
5074 SUM(qpl_questions.points) qsum
5075 FROM tst_active
5076 INNER JOIN tst_tests
5077 ON tst_tests.test_id = tst_active.test_fi
5078 INNER JOIN tst_dyn_quest_set_cfg
5079 ON tst_dyn_quest_set_cfg.test_fi = tst_tests.test_id
5080 INNER JOIN qpl_questions
5081 ON qpl_questions.obj_fi = tst_dyn_quest_set_cfg.source_qpl_fi
5082 AND qpl_questions.original_id IS NULL
5083 AND qpl_questions.complete = %s
5084 WHERE tst_active.active_id = %s
5085 ",
5086 array('integer', 'integer'),
5087 array(1, $active_id)
5088 );
5089
5090 break;
5091
5093
5094 $res = $ilDB->queryF(
5095 "
5096 SELECT tst_test_rnd_qst.pass,
5097 COUNT(tst_test_rnd_qst.question_fi) qcount,
5098 SUM(qpl_questions.points) qsum
5099
5100 FROM tst_test_rnd_qst,
5101 qpl_questions
5102
5103 WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id
5104 AND tst_test_rnd_qst.active_fi = %s
5105 AND pass = %s
5106
5107 GROUP BY tst_test_rnd_qst.active_fi,
5108 tst_test_rnd_qst.pass
5109 ",
5110 array('integer', 'integer'),
5111 array($active_id, $pass)
5112 );
5113
5114 break;
5115
5117
5118 $res = $ilDB->queryF(
5119 "
5120 SELECT COUNT(tst_test_question.question_fi) qcount,
5121 SUM(qpl_questions.points) qsum
5122
5123 FROM tst_test_question,
5124 qpl_questions,
5125 tst_active
5126
5127 WHERE tst_test_question.question_fi = qpl_questions.question_id
5128 AND tst_test_question.test_fi = tst_active.test_fi
5129 AND tst_active.active_id = %s
5130
5131 GROUP BY tst_test_question.test_fi
5132 ",
5133 array('integer'),
5134 array($active_id)
5135 );
5136
5137 break;
5138
5139 default:
5140
5141 throw new ilTestException("not supported question set type: $questionSetType");
5142 }
5143
5144 $row = $ilDB->fetchAssoc($res);
5145
5146 if (is_array($row)) {
5147 return array("count" => $row["qcount"], "points" => $row["qsum"]);
5148 }
5149
5150 return array("count" => 0, "points" => 0);
5151 }
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
static lookupQuestionSetTypeByActiveId($active_id)
returns the question set type of test relating to passed active id
Base Exception for all Exceptions relating to Modules/Test.
foreach($_POST as $key=> $value) $res

References $DIC, $ilDB, $pass, $questionSetType, $res, lookupQuestionSetTypeByActiveId(), QUESTION_SET_TYPE_DYNAMIC, QUESTION_SET_TYPE_FIXED, and QUESTION_SET_TYPE_RANDOM.

Referenced by ilTestEvaluationData\generateOverview().

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

◆ _getResultPass()

static ilObjTest::_getResultPass (   $active_id)
static

Retrieves the pass number that should be counted for a given user.

Parameters
integer$user_idThe user id
integer$test_idThe test id
Returns
integer The result pass of the user for the given test @access public

Definition at line 8176 of file class.ilObjTest.php.

8177 {
8178 $counted_pass = null;
8179 if (ilObjTest::_getPassScoring($active_id) == SCORE_BEST_PASS) {
8180 $counted_pass = ilObjTest::_getBestPass($active_id);
8181 } else {
8182 $counted_pass = ilObjTest::_getMaxPass($active_id);
8183 }
8184 return $counted_pass;
8185 }
static _getPassScoring($active_id)
Gets the pass scoring type.
static _getMaxPass($active_id)
Retrieves the maximum pass of a given user for a given test in which the user answered at least one q...
static _getBestPass($active_id)
Retrieves the best pass of a given user for a given test.
const SCORE_BEST_PASS

References _getBestPass(), _getMaxPass(), _getPassScoring(), and SCORE_BEST_PASS.

Referenced by assQuestion\_updateTestResultCache(), evalStatistical(), getPassed(), ilCertificateTestObjectHelper\getResultPass(), getResultsForActiveId(), ilTestParticipantList\getScoredParticipantList(), and ilTestEvaluationGUI\outParticipantsResultsOverview().

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

◆ _getScoreCutting()

static ilObjTest::_getScoreCutting (   $active_id)
static

Determines if the score of a question should be cut at 0 points or the score of the whole test.

Returns
boolean The score cutting type. 0 for question cutting, 1 for test cutting @access public
See also
$score_cutting

Definition at line 2605 of file class.ilObjTest.php.

2606 {
2607 global $DIC;
2608 $ilDB = $DIC['ilDB'];
2609 $result = $ilDB->queryF(
2610 "SELECT tst_tests.score_cutting FROM tst_tests, tst_active WHERE tst_active.active_id = %s AND tst_tests.test_id = tst_active.test_fi",
2611 array('integer'),
2612 array($active_id)
2613 );
2614 if ($result->numRows()) {
2615 $row = $ilDB->fetchAssoc($result);
2616 return $row["score_cutting"];
2617 }
2618 return false;
2619 }

References $DIC, $ilDB, and $result.

Referenced by assQuestion\adjustReachedPointsByScoringOptions().

+ Here is the caller graph for this function:

◆ _getSolvedQuestions()

static ilObjTest::_getSolvedQuestions (   $active_id,
  $question_fi = null 
)
static

get solved questions

Returns
array of int containing all question ids which have been set solved for the given user and test

Definition at line 7855 of file class.ilObjTest.php.

7856 {
7857 global $DIC;
7858 $ilDB = $DIC['ilDB'];
7859 if (is_numeric($question_fi)) {
7860 $result = $ilDB->queryF(
7861 "SELECT question_fi, solved FROM tst_qst_solved WHERE active_fi = %s AND question_fi=%s",
7862 array('integer', 'integer'),
7863 array($active_id, $question_fi)
7864 );
7865 } else {
7866 $result = $ilDB->queryF(
7867 "SELECT question_fi, solved FROM tst_qst_solved WHERE active_fi = %s",
7868 array('integer'),
7869 array($active_id)
7870 );
7871 }
7872 $result_array = array();
7873 while ($row = $ilDB->fetchAssoc($result)) {
7874 $result_array[$row["question_fi"]] = $row;
7875 }
7876 return $result_array;
7877 }

References $DIC, $ilDB, and $result.

Referenced by ilTestPlayerAbstractGUI\buildEditableStateQuestionNavigationGUI(), ilTestPlayerAbstractGUI\buildReadOnlyStateQuestionNavigationGUI(), ilTestService\getQuestionSummaryData(), ilTestSequence\getSequenceSummary(), and ilTestSequenceDynamicQuestionSet\getSequenceSummary().

+ Here is the caller graph for this function:

◆ _getTestDefaults()

static ilObjTest::_getTestDefaults (   $test_defaults_id)
static

Definition at line 9653 of file class.ilObjTest.php.

9654 {
9655 global $DIC;
9656 $ilDB = $DIC['ilDB'];
9657
9658 $result = $ilDB->queryF(
9659 "SELECT * FROM tst_test_defaults WHERE test_defaults_id = %s",
9660 array('integer'),
9661 array($test_defaults_id)
9662 );
9663 if ($result->numRows() == 1) {
9664 $row = $ilDB->fetchAssoc($result);
9665 return $row;
9666 } else {
9667 return null;
9668 }
9669 }

References $DIC, $ilDB, and $result.

Referenced by ilObjTestGUI\afterSave(), and getTestDefaults().

+ Here is the caller graph for this function:

◆ _getTestIDFromObjectID()

static ilObjTest::_getTestIDFromObjectID (   $object_id)
static

Returns the ILIAS test id for a given object id.

Parameters
integer$object_idThe object id
Returns
mixed The ILIAS test id or FALSE if the query was not successful @access public

Definition at line 7356 of file class.ilObjTest.php.

7357 {
7358 global $DIC;
7359 $ilDB = $DIC['ilDB'];
7360 $test_id = false;
7361 $result = $ilDB->queryF(
7362 "SELECT test_id FROM tst_tests WHERE obj_fi = %s",
7363 array('integer'),
7364 array($object_id)
7365 );
7366 if ($result->numRows()) {
7367 $row = $ilDB->fetchAssoc($result);
7368 $test_id = $row["test_id"];
7369 }
7370 return $test_id;
7371 }

References $DIC, $ilDB, $result, and $test_id.

Referenced by ilLOUtils\getTestResultLinkForUser().

+ Here is the caller graph for this function:

◆ _getTitleOutput()

ilObjTest::_getTitleOutput (   $active_id)

Returns the value of the title_output status.

Parameters
integer$active_idThe active id of a user
Returns
integer 0 for full title, 1 for title without points, 2 for no title @access public
See also
$title_output

Definition at line 2818 of file class.ilObjTest.php.

2819 {
2820 global $DIC;
2821 $ilDB = $DIC['ilDB'];
2822
2823 $result = $ilDB->queryF(
2824 "SELECT tst_tests.title_output FROM tst_tests, tst_active WHERE tst_tests.test_id = tst_active.test_fi AND tst_active.active_id = %s",
2825 array('integer'),
2826 array($active_id)
2827 );
2828 if ($result->numRows()) {
2829 $row = $ilDB->fetchAssoc($result);
2830 return $row["title_output"];
2831 }
2832 return 0;
2833 }

References $DIC, $ilDB, and $result.

◆ _getUsePreviousAnswers()

static ilObjTest::_getUsePreviousAnswers (   $active_id,
  $user_active_user_setting = false 
)
static

Returns if the previous results should be hidden for a learner.

Parameters
integer$test_idThe test id
boolean$use_active_user_settingIf true, the tst_use_previous_answers- of the active user should be used as well
Returns
integer 1 if the previous results should be hidden, 0 otherwise @access public
See also
$use_previous_answers

Definition at line 2852 of file class.ilObjTest.php.

2853 {
2854 global $DIC;
2855 $ilDB = $DIC['ilDB'];
2856 $ilUser = $DIC['ilUser'];
2857
2859
2860 $result = $ilDB->queryF(
2861 "SELECT tst_tests.use_previous_answers FROM tst_tests, tst_active WHERE tst_tests.test_id = tst_active.test_fi AND tst_active.active_id = %s",
2862 array("integer"),
2863 array($active_id)
2864 );
2865 if ($result->numRows()) {
2866 $row = $ilDB->fetchAssoc($result);
2867 $use_previous_answers = $row["use_previous_answers"];
2868 }
2869
2870 if ($use_previous_answers == 1) {
2871 if ($user_active_user_setting) {
2872 $res = $ilUser->getPref("tst_use_previous_answers");
2873 if ($res !== false) {
2875 }
2876 }
2877 }
2878 return $use_previous_answers;
2879 }

References $DIC, $ilDB, $ilUser, $res, $result, and $use_previous_answers.

Referenced by ilTestPlayerAbstractGUI\determineSolutionPassIndex(), assFileUploadGUI\getSolutionOutput(), assFormulaQuestionGUI\getSolutionOutput(), assLongMenuGUI\getTestOutput(), and isPreviousSolutionReuseEnabled().

+ Here is the caller graph for this function:

◆ _getUserIdFromActiveId()

static ilObjTest::_getUserIdFromActiveId (   $active_id)
static
Deprecated:
: use ilTestParticipantData instead

Definition at line 9096 of file class.ilObjTest.php.

9097 {
9098 global $DIC;
9099 $ilDB = $DIC['ilDB'];
9100 $result = $ilDB->queryF(
9101 "SELECT user_fi FROM tst_active WHERE active_id = %s",
9102 array('integer'),
9103 array($active_id)
9104 );
9105 if ($result->numRows()) {
9106 $row = $ilDB->fetchAssoc($result);
9107 return $row["user_fi"];
9108 } else {
9109 return -1;
9110 }
9111 }

References $DIC, $ilDB, and $result.

Referenced by assQuestion\_setReachedPoints(), sendAdvancedNotification(), and sendSimpleNotification().

+ Here is the caller graph for this function:

◆ _getVisitTimeOfParticipant()

ilObjTest::_getVisitTimeOfParticipant (   $test_id,
  $active_id 
)

Returns the first and last visit of a participant.

Parameters
integer$test_idThe database ID of the test
integer$active_idThe active ID of the participant
Returns
array The first and last visit of a participant @access public

Definition at line 4412 of file class.ilObjTest.php.

4413 {
4414 global $DIC;
4415 $ilDB = $DIC['ilDB'];
4416
4417 $result = $ilDB->queryF(
4418 "SELECT tst_times.* FROM tst_active, tst_times WHERE tst_active.test_fi = %s AND tst_active.active_id = tst_times.active_fi AND tst_active.active_id = %s ORDER BY tst_times.started",
4419 array('integer','integer'),
4420 array($test_id, $active_id)
4421 );
4422 $firstvisit = 0;
4423 $lastvisit = 0;
4424 while ($row = $ilDB->fetchAssoc($result)) {
4425 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
4426 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4427 if ($firstvisit == 0 || $epoch_1 < $firstvisit) {
4428 $firstvisit = $epoch_1;
4429 }
4430 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4431 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4432 if ($epoch_2 > $lastvisit) {
4433 $lastvisit = $epoch_2;
4434 }
4435 }
4436 return array("firstvisit" => $firstvisit, "lastvisit" => $lastvisit);
4437 }

References $DIC, $ilDB, $result, and $test_id.

Referenced by getVisitTimeOfParticipant().

+ Here is the caller graph for this function:

◆ _getWorkingTimeOfParticipantForPass()

static ilObjTest::_getWorkingTimeOfParticipantForPass (   $active_id,
  $pass 
)
static

Returns the complete working time in seconds for a test participant.

Returns
integer The working time in seconds for the test participant @access public

Definition at line 4371 of file class.ilObjTest.php.

4372 {
4373 global $DIC;
4374 $ilDB = $DIC['ilDB'];
4375
4376 $result = $ilDB->queryF(
4377 "SELECT * FROM tst_times WHERE active_fi = %s AND pass = %s ORDER BY started",
4378 array('integer','integer'),
4379 array($active_id, $pass)
4380 );
4381 $time = 0;
4382 while ($row = $ilDB->fetchAssoc($result)) {
4383 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
4384 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4385 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4386 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4387 $time += ($epoch_2 - $epoch_1);
4388 }
4389 return $time;
4390 }

References $DIC, $ilDB, $pass, and $result.

◆ _instanciateQuestion()

static ilObjTest::_instanciateQuestion (   $question_id)
static

Creates an instance of a question with a given question id.

Parameters
integer$question_idThe question id
Returns
object The question instance @access public
Deprecated:
use assQuestion::_instanciateQuestion($question_id) instead

Definition at line 5487 of file class.ilObjTest.php.

5488 {
5489 if (strcmp($question_id, "") != 0) {
5490 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
5491 return assQuestion::_instanciateQuestion($question_id);
5492 }
5493 }
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.

References assQuestion\_instanciateQuestion().

Referenced by ilCourseObjectiveQuestion\__read(), duplicateQuestionForTest(), ilTestExport\exportToExcel(), getAllTestResults(), getDetailedTestResults(), getEstimatedWorkingTime(), ilCourseObjectiveQuestion\getMaxPointsByObjective(), ilCourseObjectiveQuestion\getMaxPointsByTest(), ilTestSequence\getSequenceSummary(), ilTestSequenceDynamicQuestionSet\getSequenceSummary(), ilCourseObjectiveQuestionAssignmentTableGUI\parse(), and removeQuestion().

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

◆ _isComplete()

ilObjTest::_isComplete (   $obj_id)

Returns true, if a test is complete for use.

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

Definition at line 1121 of file class.ilObjTest.php.

1122 {
1123 global $DIC;
1124 $tree = $DIC['tree'];
1125 $ilDB = $DIC['ilDB'];
1126 $ilPluginAdmin = $DIC['ilPluginAdmin'];
1127
1128 $test = new ilObjTest($obj_id, false);
1129 $test->loadFromDb();
1130
1131 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
1132 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
1133
1134 return $test->isComplete($testQuestionSetConfigFactory->getQuestionSetConfig());
1135 }
$test
Definition: Utf8Test.php:84

References $DIC, $ilDB, $test, and ilObject\$tree.

◆ _lookupAnonymity()

static ilObjTest::_lookupAnonymity (   $a_obj_id)
static

Returns the anonymity status of a test with a given object id.

Parameters
int$a_obj_idThe object id of the test object
Returns
integer The value for the anonymity status (0 = personalized, 1 = anonymized) @access public

Definition at line 9491 of file class.ilObjTest.php.

9492 {
9493 global $DIC;
9494 $ilDB = $DIC['ilDB'];
9495
9496 $result = $ilDB->queryF(
9497 "SELECT anonymity FROM tst_tests WHERE obj_fi = %s",
9498 array('integer'),
9499 array($a_obj_id)
9500 );
9501 while ($row = $ilDB->fetchAssoc($result)) {
9502 return $row['anonymity'];
9503 }
9504 return 0;
9505 }

References $DIC, $ilDB, and $result.

Referenced by ilObjTestAccess\_getParticipantData(), assJavaAppletGUI\getSolutionOutput(), assJavaAppletGUI\getTestOutput(), and ilTestLP\isAnonymized().

+ Here is the caller graph for this function:

◆ _lookupAuthor()

static ilObjTest::_lookupAuthor (   $obj_id)
static

Gets the authors name of the ilObjTest object.

Returns
string The string containing the name of the test author @access public
See also
$author

Definition at line 7023 of file class.ilObjTest.php.

7024 {
7025 $author = array();
7026 include_once "./Services/MetaData/classes/class.ilMD.php";
7027 $md = new ilMD($obj_id, 0, "tst");
7028 $md_life = &$md->getLifecycle();
7029 if ($md_life) {
7030 $ids = &$md_life->getContributeIds();
7031 foreach ($ids as $id) {
7032 $md_cont = &$md_life->getContribute($id);
7033 if (strcmp($md_cont->getRole(), "Author") == 0) {
7034 $entids = &$md_cont->getEntityIds();
7035 foreach ($entids as $entid) {
7036 $md_ent = &$md_cont->getEntity($entid);
7037 array_push($author, $md_ent->getEntity());
7038 }
7039 }
7040 }
7041 }
7042 return join(",", $author);
7043 }

References $author, and ilObject\$id.

Referenced by assQuestion\getInstances().

+ Here is the caller graph for this function:

◆ _lookupFinishedUserTests()

static ilObjTest::_lookupFinishedUserTests (   $a_user_id)
static

Gather all finished tests for user.

Parameters
int$a_user_id
Returns
array(test id => passed)

Definition at line 10983 of file class.ilObjTest.php.

10984 {
10985 global $DIC;
10986 $ilDB = $DIC['ilDB'];
10987
10988 $result = $ilDB->queryF(
10989 "SELECT test_fi,MAX(pass) AS pass FROM tst_active" .
10990 " JOIN tst_pass_result ON (tst_pass_result.active_fi = tst_active.active_id)" .
10991 " WHERE user_fi=%s" .
10992 " GROUP BY test_fi",
10993 array('integer', 'integer'),
10994 array($a_user_id, 1)
10995 );
10996 $all = array();
10997 while ($row = $ilDB->fetchAssoc($result)) {
10998 $obj_id = self::_getObjectIDFromTestID($row["test_fi"]);
10999 $all[$obj_id] = (bool) $row["pass"];
11000 }
11001 return $all;
11002 }
static _getObjectIDFromTestID($test_id)
Returns the ILIAS test object id for a given test id.

References $DIC, $ilDB, $result, and _getObjectIDFromTestID().

+ Here is the call graph for this function:

◆ _lookupRandomTest()

static ilObjTest::_lookupRandomTest (   $a_obj_id)
static

Returns the fact wether the test with passed obj id is a random questions test or not.

Parameters
integer$a_obj_id
Returns
boolean $isRandomTest
Deprecated:

Definition at line 11962 of file class.ilObjTest.php.

11963 {
11965 }
static lookupQuestionSetType($objId)
lookup-er for question set type

References lookupQuestionSetType(), and QUESTION_SET_TYPE_RANDOM.

Referenced by ilCourseObjectivesGUI\isRandomTestType(), ilLOSettings\isRandomTestType(), ilLOUtils\lookupRandomTest(), and ilCourseObjectiveQuestionAssignmentTableGUI\parse().

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

◆ _lookupRandomTestFromActiveId()

ilObjTest::_lookupRandomTestFromActiveId (   $active_id)

Returns the random status of a test with a given object id.

Parameters
int$a_obj_idThe object id of the test object
Returns
integer The value for the anonymity status (0 = no random, 1 = random) @access public
Deprecated:

Definition at line 9543 of file class.ilObjTest.php.

9544 {
9545 throw new Exception(__METHOD__ . ' is deprecated ... use ilObjTest::lookupQuestionSetTypeByActiveId() instead!');
9546
9547 global $DIC;
9548 $ilDB = $DIC['ilDB'];
9549
9550 $result = $ilDB->queryF(
9551 "SELECT tst_tests.random_test FROM tst_tests, tst_active WHERE tst_active.active_id = %s AND tst_active.test_fi = tst_tests.test_id",
9552 array('integer'),
9553 array($active_id)
9554 );
9555 while ($row = $ilDB->fetchAssoc($result)) {
9556 return $row['random_test'];
9557 }
9558 return 0;
9559 }

References $DIC, $ilDB, and $result.

◆ _lookupTestObjIdForQuestionId()

static ilObjTest::_lookupTestObjIdForQuestionId (   $a_q_id)
static

Get test Object ID for question ID.

Definition at line 10331 of file class.ilObjTest.php.

10332 {
10333 global $DIC;
10334 $ilDB = $DIC['ilDB'];
10335
10336 $result = $ilDB->queryF(
10337 "SELECT t.obj_fi obj_id FROM tst_test_question q, tst_tests t WHERE q.test_fi = t.test_id AND q.question_fi = %s",
10338 array('integer'),
10339 array($a_q_id)
10340 );
10341 $rec = $ilDB->fetchAssoc($result);
10342 return $rec["obj_id"];
10343 }

References $DIC, $ilDB, and $result.

Referenced by ilObjMediaObject\getParentObjectIdForUsage().

+ Here is the caller graph for this function:

◆ _setImportDirectory()

static ilObjTest::_setImportDirectory (   $a_import_dir = null)
static

set import directory

Definition at line 945 of file class.ilObjTest.php.

946 {
947 if (strlen($a_import_dir)) {
948 $_SESSION["tst_import_dir"] = $a_import_dir;
949 } else {
950 unset($_SESSION["tst_import_dir"]);
951 }
952 }

References $_SESSION.

Referenced by ilTestImporter\importXmlRepresentation(), ilObjQuestionPoolGUI\uploadQplObject(), and ilObjTestGUI\uploadTstObject().

+ Here is the caller graph for this function:

◆ addDefaults()

ilObjTest::addDefaults (   $a_name)

Adds the defaults of this test to the test defaults.

Parameters
string$a_nameThe name of the test defaults @access public

Definition at line 9694 of file class.ilObjTest.php.

9695 {
9696 global $DIC;
9697 $ilDB = $DIC['ilDB'];
9698 $ilUser = $DIC['ilUser'];
9699 $testsettings = array(
9700 "TitleOutput" => $this->getTitleOutput(),
9701 "PassScoring" => $this->getPassScoring(),
9702 "IntroEnabled" => $this->isIntroductionEnabled(),
9703 "Introduction" => $this->getIntroduction(),
9704 "FinalStatement" => $this->getFinalStatement(),
9705 "ShowInfo" => $this->getShowInfo(),
9706 "ForceJS" => $this->getForceJS(),
9707 "CustomStyle" => $this->getCustomStyle(),
9708 "ShowFinalStatement" => $this->getShowFinalStatement(),
9709 "SequenceSettings" => $this->getSequenceSettings(),
9710 "ScoreReporting" => $this->getScoreReporting(),
9711 "ScoreCutting" => $this->getScoreCutting(),
9712 'SpecificAnswerFeedback' => $this->getSpecificAnswerFeedback(),
9713 'PrintBsWithRes' => (int) $this->isBestSolutionPrintedWithResult(),
9714 "InstantFeedbackSolution" => $this->getInstantFeedbackSolution(),
9715 "AnswerFeedback" => $this->getAnswerFeedback(),
9716 "AnswerFeedbackPoints" => $this->getAnswerFeedbackPoints(),
9717 "ResultsPresentation" => $this->getResultsPresentation(),
9718 "Anonymity" => $this->getAnonymity(),
9719 "ShowCancel" => $this->getShowCancel(),
9720 "ShowMarker" => $this->getShowMarker(),
9721 "ReportingDate" => $this->getReportingDate(),
9722 "NrOfTries" => $this->getNrOfTries(),
9723 'BlockAfterPassed' => (int) $this->isBlockPassesAfterPassedEnabled(),
9724 "Shuffle" => $this->getShuffleQuestions(),
9725 "Kiosk" => $this->getKiosk(),
9726 "UsePreviousAnswers" => $this->getUsePreviousAnswers(),
9727 "ProcessingTime" => $this->getProcessingTime(),
9728 "EnableProcessingTime" => $this->getEnableProcessingTime(),
9729 "ResetProcessingTime" => $this->getResetProcessingTime(),
9730 "StartingTimeEnabled" => $this->isStartingTimeEnabled(),
9731 "StartingTime" => $this->getStartingTime(),
9732 "EndingTimeEnabled" => $this->isEndingTimeEnabled(),
9733 "EndingTime" => $this->getEndingTime(),
9734 "ECTSOutput" => $this->getECTSOutput(),
9735 "ECTSFX" => $this->getECTSFX(),
9736 "ECTSGrades" => $this->getECTSGrades(),
9737 "questionSetType" => $this->getQuestionSetType(),
9738 "CountSystem" => $this->getCountSystem(),
9739 "MCScoring" => $this->getMCScoring(),
9740 "mailnotification" => $this->getMailNotification(),
9741 "mailnottype" => $this->getMailNotificationType(),
9742 "exportsettings" => $this->getExportSettings(),
9743 "ListOfQuestionsSettings" => $this->getListOfQuestionsSettings(),
9744 'obligations_enabled' => (int) $this->areObligationsEnabled(),
9745 'offer_question_hints' => (int) $this->isOfferingQuestionHintsEnabled(),
9746 'pass_deletion_allowed' => (int) $this->isPassDeletionAllowed(),
9747 'enable_examview' => $this->getEnableExamview(),
9748 'show_examview_html' => $this->getShowExamviewHtml(),
9749 'show_examview_pdf' => $this->getShowExamviewPdf(),
9750 'char_selector_availability' => $this->getCharSelectorAvailability(),
9751 'char_selector_definition' => $this->getCharSelectorDefinition(),
9752 'skill_service' => (int) $this->isSkillServiceEnabled(),
9753 'result_tax_filters' => (array) $this->getResultFilterTaxIds(),
9754 'show_grading_status' => (int) $this->isShowGradingStatusEnabled(),
9755 'show_grading_mark' => (int) $this->isShowGradingMarkEnabled(),
9756
9757 'follow_qst_answer_fixation' => $this->isFollowupQuestionAnswerFixationEnabled(),
9758 'inst_fb_answer_fixation' => $this->isInstantFeedbackAnswerFixationEnabled(),
9759 'force_inst_fb' => $this->isForceInstantFeedbackEnabled(),
9760 'redirection_mode' => $this->getRedirectionMode(),
9761 'redirection_url' => $this->getRedirectionUrl(),
9762 'sign_submission' => $this->getSignSubmission(),
9763 'autosave' => (int) $this->getAutosave(),
9764 'autosave_ival' => (int) $this->getAutosaveIval(),
9765 'examid_in_test_pass' => (int) $this->isShowExamIdInTestPassEnabled(),
9766 'examid_in_test_res' => (int) $this->isShowExamIdInTestResultsEnabled(),
9767
9768 'enable_archiving' => (int) $this->getEnableArchiving(),
9769 'password_enabled' => (int) $this->isPasswordEnabled(),
9770 'password' => (string) $this->getPassword(),
9771 'fixed_participants' => $this->getFixedParticipants(),
9772 'limit_users_enabled' => $this->isLimitUsersEnabled(),
9773 'allowedusers' => $this->getAllowedUsers(),
9774 'alloweduserstimegap' => $this->getAllowedUsersTimeGap(),
9775 'pool_usage' => $this->getPoolUsage(),
9776 'activation_limited' => $this->isActivationLimited(),
9777 'activation_start_time' => $this->getActivationStartingTime(),
9778 'activation_end_time' => $this->getActivationEndingTime(),
9779 'activation_visibility' => $this->getActivationVisibility(),
9780 'highscore_enabled' => $this->getHighscoreEnabled(),
9781 'highscore_anon' => $this->getHighscoreAnon(),
9782 'highscore_achieved_ts' => $this->getHighscoreAchievedTS(),
9783 'highscore_score' => $this->getHighscoreScore(),
9784 'highscore_percentage' => $this->getHighscorePercentage(),
9785 'highscore_hints' => $this->getHighscoreHints(),
9786 'highscore_wtime' => $this->getHighscoreWTime(),
9787 'highscore_own_table' => $this->getHighscoreOwnTable(),
9788 'highscore_top_table' => $this->getHighscoreTopTable(),
9789 'highscore_top_num' => $this->getHighscoreTopNum(),
9790 'use_previous_answers' => (string) $this->getUsePreviousAnswers(),
9791 'pass_waiting' => $this->getPassWaiting()
9792 );
9793
9794 $next_id = $ilDB->nextId('tst_test_defaults');
9795 $ilDB->insert(
9796 'tst_test_defaults',
9797 array(
9798 'test_defaults_id' => array('integer', $next_id),
9799 'name' => array('text', $a_name),
9800 'user_fi' => array('integer', $ilUser->getId()),
9801 'defaults' => array('clob', serialize($testsettings)),
9802 'marks' => array('clob', serialize($this->mark_schema)),
9803 'tstamp' => array('integer', time())
9804 )
9805 );
9806 }
getResetProcessingTime()
Returns wheather the processing time should be reset or not.
getECTSOutput()
{int|bool}
getQuestionSetType()
getter for question set type
getHighscoreWTime()
Gets if the column with the workingtime should be shown.
getHighscoreOwnTable()
Gets if the own rankings table should be shown.
getHighscoreTopTable()
Gets, if the top-rankings table should be shown.
getCountSystem()
Gets the count system for the calculation of points.
isShowExamIdInTestPassEnabled()
getEnableProcessingTime()
Returns the state of the processing time (enabled/disabled)
getInstantFeedbackSolution()
Returns 1 if the correct solution will be shown after answering a question.
getFixedParticipants()
Returns the fixed participants status.
isBestSolutionPrintedWithResult()
getFinalStatement()
Gets the final statement.
getHighscoreAnon()
Gets if the highscores should be anonymized per setting.
getPassScoring()
Gets the pass scoring type.
getPassword()
Returns the password for test access.
getStartingTime()
Returns the starting time of the test.
getResultsPresentation()
Returns the combined results presentation value.
getSequenceSettings()
SEQUENCE SETTING = POSTPONING ENABLED !!
getKiosk()
Returns the kiosk mode.
getAnswerFeedbackPoints()
Returns 1 if answer specific feedback as reached points is activated.
getScoreCutting()
Determines if the score of a question should be cut at 0 points or the score of the whole test.
getHighscorePercentage()
Gets if the percentage column should be shown.
getHighscoreHints()
Gets, if the column with the number of requested hints should be shown.
getMCScoring()
Gets the scoring type for multiple choice questions.
getShowInfo()
Gets whether the complete information page is shown or the required data only.
getHighscoreEnabled()
Gets the setting which determines if the highscore feature is enabled.
getReportingDate()
Gets the reporting date of the ilObjTest object.
getTitleOutput()
Returns the value of the title_output status.
getHighscoreAchievedTS()
Returns if date and time of the scores achievement should be displayed.
getUsePreviousAnswers()
Returns if the previous answers should be shown for a learner.
getListOfQuestionsSettings()
Returns the settings for the list of questions options in the test properties This could contain one ...
isFollowupQuestionAnswerFixationEnabled()
getHighscoreTopNum($a_retval=10)
Gets the number of entries which are to be shown in the top-rankings table.
isOfferingQuestionHintsEnabled()
returns the fact wether offering hints is enabled or not
getForceJS()
Gets whether JavaScript should be forced for tests.
isShowExamIdInTestResultsEnabled()
areObligationsEnabled()
returns the fact wether obligations are enabled or not
getEndingTime()
Returns the ending time of the test.
getScoreReporting()
Gets the score reporting of the ilObjTest object.
getMailNotification()
Get mail notification settings.
isInstantFeedbackAnswerFixationEnabled()
getECTSGrades()
{array}
getAnonymity()
Returns the anonymity status of the test.
getShowCancel()
Returns wheather the cancel test button is shown or not.
getHighscoreScore()
Gets if the score column should be shown.
isBlockPassesAfterPassedEnabled()
getShowMarker()
Returns wheather the marker button is shown or not.
getShuffleQuestions()
Returns the status of the shuffle_questions variable.
getCustomStyle()
Get the custom style.
isPassDeletionAllowed()
getter for the test setting passDeletionAllowed
getNrOfTries()
Returns the nr of tries for the test.
getECTSFX()
{float|null}
getShowFinalStatement()
Returns whether the final statement should be shown or not.
getProcessingTime()
Returns the processing time for the test.
isForceInstantFeedbackEnabled()
getIntroduction()
Gets the introduction text of the ilObjTest object.
getAnswerFeedback()
Returns 1 if generic answer feedback is activated.

References $DIC, $ilDB, $ilUser, areObligationsEnabled(), getActivationEndingTime(), getActivationStartingTime(), getActivationVisibility(), getAllowedUsers(), getAllowedUsersTimeGap(), getAnonymity(), getAnswerFeedback(), getAnswerFeedbackPoints(), getAutosave(), getAutosaveIval(), getCharSelectorAvailability(), getCharSelectorDefinition(), getCountSystem(), getCustomStyle(), getECTSFX(), getECTSGrades(), getECTSOutput(), getEnableArchiving(), getEnableExamview(), getEnableProcessingTime(), getEndingTime(), getExportSettings(), getFinalStatement(), getFixedParticipants(), getForceJS(), getHighscoreAchievedTS(), getHighscoreAnon(), getHighscoreEnabled(), getHighscoreHints(), getHighscoreOwnTable(), getHighscorePercentage(), getHighscoreScore(), getHighscoreTopNum(), getHighscoreTopTable(), getHighscoreWTime(), getInstantFeedbackSolution(), getIntroduction(), getKiosk(), getListOfQuestionsSettings(), getMailNotification(), getMailNotificationType(), getMCScoring(), getNrOfTries(), getPassScoring(), getPassWaiting(), getPassword(), getPoolUsage(), getProcessingTime(), getQuestionSetType(), getRedirectionMode(), getRedirectionUrl(), getReportingDate(), getResetProcessingTime(), getResultFilterTaxIds(), getResultsPresentation(), getScoreCutting(), getScoreReporting(), getSequenceSettings(), getShowCancel(), getShowExamviewHtml(), getShowExamviewPdf(), getShowFinalStatement(), getShowInfo(), getShowMarker(), getShuffleQuestions(), getSignSubmission(), getSpecificAnswerFeedback(), getStartingTime(), getTitleOutput(), getUsePreviousAnswers(), isActivationLimited(), isBestSolutionPrintedWithResult(), isBlockPassesAfterPassedEnabled(), isEndingTimeEnabled(), isFollowupQuestionAnswerFixationEnabled(), isForceInstantFeedbackEnabled(), isInstantFeedbackAnswerFixationEnabled(), isIntroductionEnabled(), isLimitUsersEnabled(), isOfferingQuestionHintsEnabled(), isPassDeletionAllowed(), isPasswordEnabled(), isShowExamIdInTestPassEnabled(), isShowExamIdInTestResultsEnabled(), isShowGradingMarkEnabled(), isShowGradingStatusEnabled(), isSkillServiceEnabled(), and isStartingTimeEnabled().

+ Here is the call graph for this function:

◆ addExtraTime()

ilObjTest::addExtraTime (   $active_id,
  $minutes 
)

Definition at line 11669 of file class.ilObjTest.php.

11670 {
11671 global $DIC; /* @var ILIAS\DI\Container $DIC */
11672
11673 require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
11674 $participantData = new ilTestParticipantData($DIC->database(), $DIC->language());
11675
11676 $participantData->setParticipantAccessFilter(
11678 );
11679
11680 if ($active_id) {
11681 $participantData->setActiveIdsFilter(array($active_id));
11682 }
11683
11684 $participantData->load($this->getTestId());
11685
11686 foreach ($participantData->getActiveIds() as $active_id) {
11687 $result = $DIC->database()->queryF(
11688 "SELECT active_fi FROM tst_addtime WHERE active_fi = %s",
11689 array('integer'),
11690 array($active_id)
11691 );
11692
11693 if ($result->numRows() > 0) {
11694 $DIC->database()->manipulateF(
11695 "DELETE FROM tst_addtime WHERE active_fi = %s",
11696 array('integer'),
11697 array($active_id)
11698 );
11699 }
11700
11701 $DIC->database()->manipulateF(
11702 "UPDATE tst_active SET tries = %s, submitted = %s, submittimestamp = %s WHERE active_id = %s",
11703 array('integer','integer','timestamp','integer'),
11704 array(0, 0, null, $active_id)
11705 );
11706
11707 $DIC->database()->manipulateF(
11708 "INSERT INTO tst_addtime (active_fi, additionaltime, tstamp) VALUES (%s, %s, %s)",
11709 array('integer','integer','integer'),
11710 array($active_id, $minutes, time())
11711 );
11712
11713 require_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
11715 $this->logAction(sprintf($this->lng->txtlng("assessment", "log_added_extratime", ilObjAssessmentFolder::_getLogLanguage()), $minutes, $active_id));
11716 }
11717 }
11718 }
static _getLogLanguage()
retrieve the log language for assessment logging
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
getTestId()
Gets the database id of the additional test data.
logAction($logtext="", $question_id="")
Logs an action into the Test&Assessment log.
getRefId()
get reference id @access public

References $DIC, $result, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilTestParticipantAccessFilter\getManageParticipantsUserFilter(), ilObject\getRefId(), getTestId(), and logAction().

+ Here is the call graph for this function:

◆ addQTIMaterial()

ilObjTest::addQTIMaterial ( $a_xml_writer,
  $a_material = '' 
)

Creates a QTI material tag from a plain text or xhtml text.

Parameters
object$a_xml_writerReference to the ILIAS XML writer
string$a_materialplain text or html text containing the material
Returns
string QTI material tag @access public

Definition at line 9282 of file class.ilObjTest.php.

9283 {
9284 include_once "./Services/RTE/classes/class.ilRTE.php";
9285 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
9286
9287 $a_xml_writer->xmlStartTag("material");
9288 $txt = $a_material;
9289 $attrs = array(
9290 "texttype" => "text/plain"
9291 );
9292 if ($this->isHTML($a_material)) {
9293 $attrs["texttype"] = "text/xhtml";
9294 $txt = ilRTE::_replaceMediaObjectImageSrc($a_material, 0);
9295 }
9296
9297 $a_xml_writer->xmlElement("mattext", $attrs, $txt);
9298
9299 $mobs = ilObjMediaObject::_getMobsOfObject("tst:html", $this->getId());
9300 foreach ($mobs as $mob) {
9301 $moblabel = "il_" . IL_INST_ID . "_mob_" . $mob;
9302 if (strpos($a_material, "mm_$mob") !== false) {
9303 if (ilObjMediaObject::_exists($mob)) {
9304 $mob_obj = new ilObjMediaObject($mob);
9305 $imgattrs = array(
9306 "label" => $moblabel,
9307 "uri" => "objects/" . "il_" . IL_INST_ID . "_mob_" . $mob . "/" . $mob_obj->getTitle()
9308 );
9309 }
9310 $a_xml_writer->xmlElement("matimage", $imgattrs, null);
9311 }
9312 }
9313 $a_xml_writer->xmlEndTag("material");
9314 }
Class ilObjMediaObject.
static _getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
static _exists($a_id, $a_reference=false, $a_type=null)
checks wether a lm content object with specified id exists or not
isHTML($a_text)
Checks if a given string contains HTML or not.
getId()
get object id @access public
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...
const IL_INST_ID
Definition: constants.php:38
$txt
Definition: error.php:13
$mobs
Definition: imgupload.php:54

References $mobs, $txt, ilObjMediaObject\_exists(), ilObjMediaObject\_getMobsOfObject(), ilRTE\_replaceMediaObjectImageSrc(), ilObject\getId(), IL_INST_ID, and isHTML().

Referenced by toXML().

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

◆ allObligationsAnswered()

static ilObjTest::allObligationsAnswered (   $test_id,
  $active_id,
  $pass 
)
static

checks wether all questions marked as obligatory were answered within the test pass with given testId, activeId and pass index

@access public @global ilDBInterface $ilDB

Parameters
integer$test_id
integer$active_id
integer$pass
Returns
boolean $allObligationsAnswered

Definition at line 11459 of file class.ilObjTest.php.

11460 {
11461 global $DIC;
11462 $ilDB = $DIC['ilDB'];
11463
11464 $rset = $ilDB->queryF(
11465 'SELECT obligations_answered FROM tst_pass_result WHERE active_fi = %s AND pass = %s',
11466 array('integer', 'integer'),
11467 array($active_id, $pass)
11468 );
11469
11470 if ($row = $ilDB->fetchAssoc($rset)) {
11471 return (bool) $row['obligations_answered'];
11472 }
11473
11475 }
static hasObligations($test_id)
returns the fact wether the test with given test id contains questions markes as obligatory or not

References $DIC, $ilDB, $pass, $test_id, and hasObligations().

Referenced by ilTestPlayerAbstractGUI\finishTestCmd(), ilTestPlayerAbstractGUI\getFinishTestCommand(), and ilTestPlayerAbstractGUI\outQuestionSummaryCmd().

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

◆ applyDefaults()

ilObjTest::applyDefaults (   $test_defaults)

Applies given test defaults to this test.

Parameters
array$test_defaultThe test defaults database id.
Returns
boolean TRUE if the application succeeds, FALSE otherwise

Definition at line 9815 of file class.ilObjTest.php.

9816 {
9817 $testsettings = unserialize($test_defaults["defaults"]);
9818 include_once "./Modules/Test/classes/class.assMarkSchema.php";
9819 $this->mark_schema = unserialize($test_defaults["marks"]);
9820
9821 $this->setTitleOutput($testsettings["TitleOutput"]);
9822 $this->setPassScoring($testsettings["PassScoring"]);
9823 $this->setIntroductionEnabled($testsettings["IntroEnabled"]);
9824 $this->setIntroduction($testsettings["Introduction"]);
9825 $this->setFinalStatement($testsettings["FinalStatement"]);
9826 $this->setShowInfo($testsettings["ShowInfo"]);
9827 $this->setForceJS($testsettings["ForceJS"]);
9828 $this->setCustomStyle($testsettings["CustomStyle"]);
9829 $this->setShowFinalStatement($testsettings["ShowFinalStatement"]);
9830 $this->setSequenceSettings($testsettings["SequenceSettings"]);
9831 $this->setScoreReporting($testsettings["ScoreReporting"]);
9832 $this->setScoreCutting($testsettings['ScoreCutting']);
9833 $this->setSpecificAnswerFeedback($testsettings['SpecificAnswerFeedback']);
9834 $this->setPrintBestSolutionWithResult((bool) $testsettings['PrintBsWithRes']);
9835 $this->setInstantFeedbackSolution($testsettings["InstantFeedbackSolution"]);
9836 $this->setAnswerFeedback($testsettings["AnswerFeedback"]);
9837 $this->setAnswerFeedbackPoints($testsettings["AnswerFeedbackPoints"]);
9838 $this->setResultsPresentation($testsettings["ResultsPresentation"]);
9839 $this->setAnonymity($testsettings["Anonymity"]);
9840 $this->setShowCancel($testsettings["ShowCancel"]);
9841 $this->setShuffleQuestions($testsettings["Shuffle"]);
9842 $this->setShowMarker($testsettings["ShowMarker"]);
9843 $this->setReportingDate($testsettings["ReportingDate"]);
9844 $this->setNrOfTries($testsettings["NrOfTries"]);
9845 $this->setBlockPassesAfterPassedEnabled((bool) $testsettings['BlockAfterPassed']);
9846 $this->setUsePreviousAnswers($testsettings["UsePreviousAnswers"]);
9847 $this->setRedirectionMode($testsettings['redirection_mode']);
9848 $this->setRedirectionUrl($testsettings['redirection_url']);
9849 $this->setProcessingTime($testsettings["ProcessingTime"]);
9850 $this->setResetProcessingTime($testsettings["ResetProcessingTime"]);
9851 $this->setEnableProcessingTime($testsettings["EnableProcessingTime"]);
9852 $this->setStartingTimeEnabled($testsettings["StartingTimeEnabled"]);
9853 $this->setStartingTime($testsettings["StartingTime"]);
9854 $this->setKiosk($testsettings["Kiosk"]);
9855 $this->setEndingTimeEnabled($testsettings["EndingTimeEnabled"]);
9856 $this->setEndingTime($testsettings["EndingTime"]);
9857 $this->setECTSOutput($testsettings["ECTSOutput"]);
9858 $this->setECTSFX($testsettings["ECTSFX"]);
9859 $this->setECTSGrades($testsettings["ECTSGrades"]);
9860 if (isset($testsettings["isRandomTest"])) {
9861 if ($testsettings["isRandomTest"]) {
9862 $this->setQuestionSetType(self::QUESTION_SET_TYPE_RANDOM);
9863 } else {
9864 $this->setQuestionSetType(self::QUESTION_SET_TYPE_FIXED);
9865 }
9866 } elseif (isset($testsettings["questionSetType"])) {
9867 $this->setQuestionSetType($testsettings["questionSetType"]);
9868 }
9869 $this->setCountSystem($testsettings["CountSystem"]);
9870 $this->setMCScoring($testsettings["MCScoring"]);
9871 $this->setMailNotification($testsettings["mailnotification"]);
9872 $this->setMailNotificationType($testsettings["mailnottype"]);
9873 $this->setExportSettings($testsettings['exportsettings']);
9874 $this->setListOfQuestionsSettings($testsettings["ListOfQuestionsSettings"]);
9875 $this->setObligationsEnabled($testsettings["obligations_enabled"]);
9876 $this->setOfferingQuestionHintsEnabled($testsettings["offer_question_hints"]);
9877 $this->setHighscoreEnabled($testsettings['highscore_enabled']);
9878 $this->setHighscoreAnon($testsettings['highscore_anon']);
9879 $this->setHighscoreAchievedTS($testsettings['highscore_achieved_ts']);
9880 $this->setHighscoreScore($testsettings['highscore_score']);
9881 $this->setHighscorePercentage($testsettings['highscore_percentage']);
9882 $this->setHighscoreHints($testsettings['highscore_hints']);
9883 $this->setHighscoreWTime($testsettings['highscore_wtime']);
9884 $this->setHighscoreOwnTable($testsettings['highscore_own_table']);
9885 $this->setHighscoreTopTable($testsettings['highscore_top_table']);
9886 $this->setHighscoreTopNum($testsettings['highscore_top_num']);
9887 $this->setPassDeletionAllowed($testsettings['pass_deletion_allowed']);
9888 if (isset($testsettings['examid_in_kiosk'])) {
9889 $this->setShowExamIdInTestPassEnabled($testsettings['examid_in_kiosk']);
9890 } else {
9891 $this->setShowExamIdInTestPassEnabled($testsettings['examid_in_test_pass']);
9892 }
9893 if (isset($testsettings['show_exam_id'])) {
9894 $this->setShowExamIdInTestResultsEnabled($testsettings['show_exam_id']);
9895 } else {
9896 $this->setShowExamIdInTestResultsEnabled($testsettings['examid_in_test_res']);
9897 }
9898 $this->setEnableExamview($testsettings['enable_examview']);
9899 $this->setShowExamviewHtml($testsettings['show_examview_html']);
9900 $this->setShowExamviewPdf($testsettings['show_examview_pdf']);
9901 $this->setEnableArchiving($testsettings['enable_archiving']);
9902 $this->setSignSubmission($testsettings['sign_submission']);
9903 $this->setCharSelectorAvailability($testsettings['char_selector_availability']);
9904 $this->setCharSelectorDefinition($testsettings['char_selector_definition']);
9905 $this->setSkillServiceEnabled((bool) $testsettings['skill_service']);
9906 $this->setResultFilterTaxIds((array) $testsettings['result_tax_filters']);
9907 $this->setShowGradingStatusEnabled((bool) $testsettings['show_grading_status']);
9908 $this->setShowGradingMarkEnabled((bool) $testsettings['show_grading_mark']);
9909
9910 $this->setFollowupQuestionAnswerFixationEnabled($testsettings['follow_qst_answer_fixation']);
9911 $this->setInstantFeedbackAnswerFixationEnabled($testsettings['inst_fb_answer_fixation']);
9912 $this->setForceInstantFeedbackEnabled($testsettings['force_inst_fb']);
9913 $this->setRedirectionMode($testsettings['redirection_mode']);
9914 $this->setRedirectionUrl($testsettings['redirection_url']);
9915
9916 $this->setAutosave($testsettings['autosave']);
9917 $this->setAutosaveIval($testsettings['autosave_ival']);
9918 $this->setShowExamIdInTestResultsEnabled((int) $testsettings['examid_in_test_res']);
9919 $this->setPasswordEnabled($testsettings['password_enabled']);
9920 $this->setPassword($testsettings['password']);
9921 $this->setFixedParticipants($testsettings['fixed_participants']);
9922 $this->setLimitUsersEnabled($testsettings['limit_users_enabled']);
9923 $this->setAllowedUsers($testsettings['allowedusers']);
9924 $this->setAllowedUsersTimeGap($testsettings['alloweduserstimegap']);
9925 $this->setUsePreviousAnswers($testsettings['use_previous_answers']);
9926 $this->setPoolUsage($testsettings['pool_usage']);
9927 $this->setActivationLimited($testsettings['activation_limited']);
9928 $this->setActivationStartingTime($testsettings['activation_start_time']);
9929 $this->setActivationEndingTime($testsettings['activation_end_time']);
9930 $this->setActivationVisibility($testsettings['activation_visibility']);
9931 $this->setPassWaiting($testsettings['pass_waiting']);
9932
9933 $this->saveToDb();
9934
9935 return true;
9936 }
setHighscorePercentage($a_percentage)
Sets if the percentages of the scores pass should be shown.
setPrintBestSolutionWithResult($status)
setAnswerFeedback($answer_feedback=0)
Sets the generic feedback for the test @deprecate Use setGenericAnswerFeedback instead.
setIntroduction($introduction="")
Sets the introduction text of the ilObjTest object.
setECTSFX($a_ects_fx)
{}
setShowInfo($a_info=1)
Set whether the complete information page is shown or the required data only.
setAllowedUsersTimeGap($a_allowed_users_time_gap)
setKiosk($kiosk=0)
Sets the kiosk mode for the test.
setInstantFeedbackSolution($instant_feedback=0)
Sets the instant feedback for the solution.
setFinalStatement($a_statement="")
Sets the final statement text of the ilObjTest object.
setFixedParticipants($a_value=1)
Sets the fixed participants status.
setProcessingTime($processing_time="00:00:00")
Sets the processing time for the test.
setHighscoreAnon($a_anon)
Sets if the highscores should be anonymized.
setAllowedUsers($a_allowed_users)
setShowExamviewPdf($show_examview_pdf)
setShowExamIdInTestPassEnabled($show_exam_id_in_test_pass_enabled)
setScoreCutting($a_score_cutting=SCORE_CUT_QUESTION)
Sets the type of score cutting.
setFollowupQuestionAnswerFixationEnabled($followupQuestionAnswerFixationEnabled)
setPassDeletionAllowed($passDeletionAllowed)
setter for the test setting passDeletionAllowed
setHighscoreScore($a_score)
Sets if the actual score should be displayed.
setShowGradingStatusEnabled($showGradingStatusEnabled)
setPassword($a_password=null)
Sets the password for test access.
setShowFinalStatement($show=0)
Sets whether the final statement should be shown or not.
setEndingTimeEnabled($ending_time_enabled)
setRedirectionUrl($redirection_url=null)
setCountSystem($a_count_system=COUNT_PARTIAL_SOLUTIONS)
Sets the count system for the calculation of points.
setInstantFeedbackAnswerFixationEnabled($instantFeedbackAnswerFixationEnabled)
setHighscoreHints($a_hints)
Sets if the number of requested hints should be shown.
setPasswordEnabled($passwordEnabled)
setPassScoring($a_pass_scoring=SCORE_LAST_PASS)
Sets the pass scoring.
setOfferingQuestionHintsEnabled($offeringQuestionHintsEnabled)
sets offering question hints enabled/disabled
setAutosave($autosave)
setHighscoreTopNum($a_top_num)
Sets the number of entries which are to be shown in the top-rankings table.
setHighscoreEnabled($a_enabled)
Sets if the highscore feature should be enabled.
setRedirectionMode($redirection_mode=0)
setMailNotification($a_notification)
Set mail notification settings.
setQuestionSetType($questionSetType)
setter for question set type
setReportingDate($reporting_date)
Sets the reporting date of the ilObjTest object.
setCharSelectorDefinition($definition='')
setIntroductionEnabled($introductionEnabled)
setResetProcessingTime($reset=0)
Sets wheather the processing time should be reset or not.
setListOfQuestionsSettings($a_value=0)
Sets the settings for the list of questions options in the test properties This could contain one of ...
setActivationStartingTime($starting_time=null)
setObligationsEnabled($obligationsEnabled=true)
sets obligations enabled/disabled
setSkillServiceEnabled($skillServiceEnabled)
setHighscoreTopTable($a_top_table)
Sets if the top-rankings table should be shown.
setActivationVisibility($a_value)
setForceJS($a_js=1)
Set whether JavaScript should be forced for tests.
setShowExamIdInTestResultsEnabled($show_exam_id_in_test_results_enabled)
setActivationEndingTime($ending_time=null)
saveToDb($properties_only=false)
Saves a ilObjTest object to a database.
setShuffleQuestions($a_shuffle)
Sets the status of the shuffle_questions variable.
setForceInstantFeedbackEnabled($forceInstantFeedbackEnabled)
setBlockPassesAfterPassedEnabled($blockPassesAfterPassedEnabled)
setSpecificAnswerFeedback($specific_answer_feedback)
setMailNotificationType($a_type)
setTitleOutput($title_output=0)
Sets the status of the title output.
setPassWaiting($pass_waiting)
setAnswerFeedbackPoints($answer_feedback_points=0)
Sets the answer specific feedback of reached points for the test.
setStartingTimeEnabled($starting_time_enabled)
setECTSGrades(array $a_ects_grades)
{}
setActivationLimited($a_value)
setPoolUsage($usage)
setHighscoreOwnTable($a_own_table)
Sets if the table with the own ranking should be shown.
setShowGradingMarkEnabled($showGradingMarkEnabled)
setStartingTime($starting_time=null)
Sets the starting time in database timestamp format for the test.
setEnableExamview($enable_examview)
setSignSubmission($sign_submission)
setEnableArchiving($enable_archiving)
setResultFilterTaxIds($resultFilterTaxIds)
setShowCancel($a_value=1)
Sets the cancel test button status.
setAutosaveIval($autosave_ival)
setResultsPresentation($a_results_presentation=3)
Sets the combined results presentation value.
setLimitUsersEnabled($limitUsersEnabled)
setHighscoreWTime($a_wtime)
Sets if the workingtime of the scores should be shown.
setNrOfTries($nr_of_tries=0)
Sets the nr of tries for the test.
setECTSOutput($a_ects_output)
{}
setHighscoreAchievedTS($a_achieved_ts)
Sets if the date and time of the scores achievement should be displayed.
setCharSelectorAvailability($availability)
setAnonymity($a_value=0)
Sets the anonymity status of the test.
setShowExamviewHtml($show_examview_html)
setMCScoring($a_mc_scoring=SCORE_ZERO_POINTS_WHEN_UNANSWERED)
Sets the multiple choice scoring.
setEnableProcessingTime($enable=0)
Sets the processing time enabled or disabled.
setUsePreviousAnswers($use_previous_answers=1)
Sets the status of the visibility of previous learner answers.
setExportSettings($a_settings)
setEndingTime($ending_time=null)
Sets the ending time in database timestamp format for the test.
setScoreReporting($score_reporting=0)
Sets the score reporting of the ilObjTest object.
setCustomStyle($a_customStyle=null)
Set the custom style.
setSequenceSettings($sequence_settings=0)
SEQUENCE SETTING = POSTPONING ENABLED !!
setShowMarker($a_value=1)
Sets the marker button status.

References saveToDb(), setActivationEndingTime(), setActivationLimited(), setActivationStartingTime(), setActivationVisibility(), setAllowedUsers(), setAllowedUsersTimeGap(), setAnonymity(), setAnswerFeedback(), setAnswerFeedbackPoints(), setAutosave(), setAutosaveIval(), setBlockPassesAfterPassedEnabled(), setCharSelectorAvailability(), setCharSelectorDefinition(), setCountSystem(), setCustomStyle(), setECTSFX(), setECTSGrades(), setECTSOutput(), setEnableArchiving(), setEnableExamview(), setEnableProcessingTime(), setEndingTime(), setEndingTimeEnabled(), setExportSettings(), setFinalStatement(), setFixedParticipants(), setFollowupQuestionAnswerFixationEnabled(), setForceInstantFeedbackEnabled(), setForceJS(), setHighscoreAchievedTS(), setHighscoreAnon(), setHighscoreEnabled(), setHighscoreHints(), setHighscoreOwnTable(), setHighscorePercentage(), setHighscoreScore(), setHighscoreTopNum(), setHighscoreTopTable(), setHighscoreWTime(), setInstantFeedbackAnswerFixationEnabled(), setInstantFeedbackSolution(), setIntroduction(), setIntroductionEnabled(), setKiosk(), setLimitUsersEnabled(), setListOfQuestionsSettings(), setMailNotification(), setMailNotificationType(), setMCScoring(), setNrOfTries(), setObligationsEnabled(), setOfferingQuestionHintsEnabled(), setPassDeletionAllowed(), setPassScoring(), setPassWaiting(), setPassword(), setPasswordEnabled(), setPoolUsage(), setPrintBestSolutionWithResult(), setProcessingTime(), setQuestionSetType(), setRedirectionMode(), setRedirectionUrl(), setReportingDate(), setResetProcessingTime(), setResultFilterTaxIds(), setResultsPresentation(), setScoreCutting(), setScoreReporting(), setSequenceSettings(), setShowCancel(), setShowExamIdInTestPassEnabled(), setShowExamIdInTestResultsEnabled(), setShowExamviewHtml(), setShowExamviewPdf(), setShowFinalStatement(), setShowGradingMarkEnabled(), setShowGradingStatusEnabled(), setShowInfo(), setShowMarker(), setShuffleQuestions(), setSignSubmission(), setSkillServiceEnabled(), setSpecificAnswerFeedback(), setStartingTime(), setStartingTimeEnabled(), setTitleOutput(), and setUsePreviousAnswers().

+ Here is the call graph for this function:

◆ areObligationsEnabled()

ilObjTest::areObligationsEnabled ( )

returns the fact wether obligations are enabled or not

Returns
boolean

Definition at line 11401 of file class.ilObjTest.php.

11402 {
11403 return (bool) $this->obligationsEnabled;
11404 }

References $obligationsEnabled.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ buildExamId()

static ilObjTest::buildExamId (   $active_id,
  $pass,
  $test_obj_id = null 
)
static
Parameters
$active_id
$pass
$test_obj_id
Returns
array

Definition at line 11787 of file class.ilObjTest.php.

11788 {
11789 global $DIC;
11790 $ilSetting = $DIC['ilSetting'];
11791
11792 $inst_id = $ilSetting->get('inst_id', null);
11793
11794 if ($test_obj_id === null) {
11795 $obj_id = self::_getObjectIDFromActiveID($active_id);
11796 } else {
11797 $obj_id = $test_obj_id;
11798 }
11799
11800 $examId = 'I' . $inst_id . '_T' . $obj_id . '_A' . $active_id . '_P' . $pass;
11801
11802 return $examId;
11803 }
static _getObjectIDFromActiveID($active_id)
Returns the ILIAS test object id for a given active id.
global $ilSetting
Definition: privfeed.php:17

References $DIC, $ilSetting, $pass, and _getObjectIDFromActiveID().

Referenced by ilTestPlayerAbstractGUI\getKioskHead().

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

◆ buildIso8601PeriodFromUnixtimeForExportCompatibility()

ilObjTest::buildIso8601PeriodFromUnixtimeForExportCompatibility (   $unix_timestamp)
protected
Parameters
$unix_timestamp
Returns
string

Definition at line 6597 of file class.ilObjTest.php.

6598 {
6599 $date_time_unix = new ilDateTime($unix_timestamp, IL_CAL_UNIX);
6600 $date_time = $date_time_unix->get(IL_CAL_DATETIME);
6601 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $date_time, $matches);
6602 $iso8601_period = sprintf("P%dY%dM%dDT%dH%dM%dS", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]);
6603 return $iso8601_period;
6604 }
const IL_CAL_UNIX
const IL_CAL_DATETIME
@classDescription Date and time handling

References IL_CAL_DATETIME, and IL_CAL_UNIX.

Referenced by toXML().

+ Here is the caller graph for this function:

◆ buildName()

ilObjTest::buildName (   $user_id,
  $firstname,
  $lastname,
  $title 
)

Builds a user name for the output depending on test type and existence of the user.

Parameters
int$user_idThe database ID of the user
string$firstnameThe first name of the user
string$lastnameThe last name of the user
string$titleThe title of the user
Returns
string The output name of the user @access public

Definition at line 5283 of file class.ilObjTest.php.

5284 {
5285 $name = "";
5286 if (strlen($firstname . $lastname . $title) == 0) {
5287 $name = $this->lng->txt("deleted_user");
5288 } else {
5289 if ($user_id == ANONYMOUS_USER_ID) {
5290 $name = $lastname;
5291 } else {
5292 $name = trim($lastname . ", " . $firstname . " " . $title);
5293 }
5294 if ($this->getAnonymity()) {
5295 $name = $this->lng->txt("anonymous");
5296 }
5297 }
5298 return $name;
5299 }

References $name, ilObject\$title, ANONYMOUS_USER_ID, and getAnonymity().

+ Here is the call graph for this function:

◆ buildStatisticsAccessFilteredParticipantList()

ilObjTest::buildStatisticsAccessFilteredParticipantList ( )
Returns
ilTestParticipantList

Definition at line 4798 of file class.ilObjTest.php.

4799 {
4800 require_once 'Modules/Test/classes/class.ilTestParticipantList.php';
4801 require_once 'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
4802
4803 $list = new ilTestParticipantList($this);
4804 $list->initializeFromDbRows($this->getTestParticipants());
4805
4806 $list = $list->getAccessFilteredList(
4808 );
4809
4810 return $list;
4811 }
& getTestParticipants()
Returns a list of all participants in a test.

References ilTestParticipantAccessFilter\getAccessStatisticsUserFilter(), ilObject\getRefId(), and getTestParticipants().

+ Here is the call graph for this function:

◆ canEditEctsGrades()

ilObjTest::canEditEctsGrades ( )

{

Returns
boolean
}

Implements ilEctsGradesEnabled.

Definition at line 6798 of file class.ilObjTest.php.

6799 {
6800 return $this->canShowEctsGrades() && $this->canEditMarks();
6801 }
canShowEctsGrades()
{boolean}

References canEditMarks(), and canShowEctsGrades().

+ Here is the call graph for this function:

◆ canEditMarks()

ilObjTest::canEditMarks ( )
Returns
{}

Implements ilMarkSchemaAware.

Definition at line 6914 of file class.ilObjTest.php.

6915 {
6916 $total = $this->evalTotalPersons();
6917 if ($total > 0) {
6918 if ($this->getReportingDate()) {
6919 if (preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getReportingDate(), $matches)) {
6920 $epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
6921 $now = time();
6922 if ($now < $epoch_time) {
6923 return true;
6924 }
6925 }
6926 }
6927 return false;
6928 } else {
6929 return true;
6930 }
6931 }
$total
Definition: Utf8Test.php:87
evalTotalPersons()
Returns the number of persons who started the test.

References $total, evalTotalPersons(), and getReportingDate().

Referenced by canEditEctsGrades().

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

◆ canShowCertificate()

ilObjTest::canShowCertificate (   $testSession,
  $user_id,
  $active_id 
)

Checks whether the certificate button could be shown on the info page or not.

@access public

Definition at line 10387 of file class.ilObjTest.php.

10388 {
10389 if ($this->canShowTestResults($testSession)) {
10390 $isComplete = false;
10391 $userCertificateRepository = new ilUserCertificateRepository($this->db, $this->log);
10392 try {
10393 $userCertificateRepository->fetchActiveCertificate($user_id, $this->getId());
10394 $isComplete = true;
10395 } catch (ilException $e) {
10396 }
10397
10398 if ($isComplete) {
10399 $vis = $this->getCertificateVisibility();
10400 $showcert = false;
10401 switch ($vis) {
10402 case 0:
10403 $showcert = true;
10404 break;
10405 case 1:
10406 if ($this->getPassed($active_id)) {
10407 $showcert = true;
10408 }
10409 break;
10410 case 2:
10411 $showcert = false;
10412 break;
10413 }
10414 if ($showcert) {
10415 return true;
10416 } else {
10417 return false;
10418 }
10419 } else {
10420 return false;
10421 }
10422 } else {
10423 return false;
10424 }
10425 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPassed($active_id)
canShowTestResults(ilTestSession $testSession)
getCertificateVisibility()
Returns the visibility settings of the certificate.

References Vendor\Package\$e, $testSession, canShowTestResults(), getCertificateVisibility(), ilObject\getId(), and getPassed().

+ Here is the call graph for this function:

◆ canShowEctsGrades()

ilObjTest::canShowEctsGrades ( )

{

Returns
boolean
}

Implements ilEctsGradesEnabled.

Definition at line 6806 of file class.ilObjTest.php.

6807 {
6808 return $this->getReportingDate();
6809 }

References getReportingDate().

Referenced by canEditEctsGrades().

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

◆ canShowSolutionPrintview()

ilObjTest::canShowSolutionPrintview (   $user_id = null)

Calculates if a user may see the solution printview of his/her test results.

Returns
boolean TRUE if the user may see the printview, FALSE otherwise @access public

Definition at line 8987 of file class.ilObjTest.php.

8988 {
8989 return $this->getShowSolutionPrintview();
8990 }
getShowSolutionPrintview()
Returns if the solution printview should be presented to the user or not.

References getShowSolutionPrintview().

+ Here is the call graph for this function:

◆ canShowTestResults()

ilObjTest::canShowTestResults ( ilTestSession  $testSession)

Definition at line 8378 of file class.ilObjTest.php.

8379 {
8380 global $DIC; /* @var ILIAS\DI\Container $DIC */
8381
8382 require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
8383 $passSelector = new ilTestPassesSelector($DIC->database(), $this);
8384
8385 $passSelector->setActiveId($testSession->getActiveId());
8386 $passSelector->setLastFinishedPass($testSession->getLastFinishedPass());
8387
8388 return $passSelector->hasReportablePasses();
8389 }

References $DIC, and $testSession.

Referenced by canShowCertificate(), and ilTestSession\reportableResultsAvailable().

+ Here is the caller graph for this function:

◆ checkMarks()

ilObjTest::checkMarks ( )

{

Returns
boolean|string True or an error string which can be used for display purposes
}

Implements ilMarkSchemaAware.

Definition at line 6867 of file class.ilObjTest.php.

6868 {
6869 return $this->mark_schema->checkMarks();
6870 }

◆ checkMaximumAllowedUsers()

ilObjTest::checkMaximumAllowedUsers ( )

Definition at line 9149 of file class.ilObjTest.php.

9150 {
9151 global $DIC;
9152 $ilDB = $DIC['ilDB'];
9153
9154 $nr_of_users = $this->getAllowedUsers();
9155 $time_gap = ($this->getAllowedUsersTimeGap()) ? $this->getAllowedUsersTimeGap() : 60;
9156 if (($nr_of_users > 0) && ($time_gap > 0)) {
9157 $now = time();
9158 $time_border = $now - $time_gap;
9159 $str_time_border = strftime("%Y%m%d%H%M%S", $time_border);
9160 $query = "
9161 SELECT DISTINCT tst_times.active_fi
9162 FROM tst_times
9163 INNER JOIN tst_active
9164 ON tst_times.active_fi = tst_active.active_id
9165 AND (
9166 tst_times.pass > tst_active.last_finished_pass OR tst_active.last_finished_pass IS NULL
9167 )
9168 WHERE tst_times.tstamp > %s
9169 AND tst_active.test_fi = %s
9170 ";
9171 $result = $ilDB->queryF($query, array('integer', 'integer'), array($time_border, $this->getTestId()));
9172 if ($result->numRows() >= $nr_of_users) {
9173 include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
9175 $this->logAction($this->lng->txtlng("assessment", "log_could_not_enter_test_due_to_simultaneous_users", ilObjAssessmentFolder::_getLogLanguage()));
9176 }
9177 return false;
9178 } else {
9179 return true;
9180 }
9181 }
9182 return true;
9183 }
$query

References $DIC, $ilDB, $query, $result, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), getAllowedUsers(), getAllowedUsersTimeGap(), getTestId(), and logAction().

+ Here is the call graph for this function:

◆ checkQuestionParent()

ilObjTest::checkQuestionParent (   $questionId)

Definition at line 8529 of file class.ilObjTest.php.

8530 {
8531 global $DIC; /* @var ILIAS\DI\Container $DIC */
8532
8533 $row = $DIC->database()->fetchAssoc($DIC->database()->queryF(
8534 "SELECT COUNT(question_id) cnt FROM qpl_questions WHERE question_id = %s AND obj_fi = %s",
8535 array('integer', 'integer'),
8536 array($questionId, $this->getId())
8537 ));
8538
8539 return (bool) $row['cnt'];
8540 }

References $DIC, and ilObject\getId().

+ Here is the call graph for this function:

◆ cleanupMediaobjectUsage()

ilObjTest::cleanupMediaobjectUsage ( )

Cleans up the media objects for all text fields in a test which are using an RTE field.

@access private

Definition at line 1210 of file class.ilObjTest.php.

1211 {
1212 include_once("./Services/RTE/classes/class.ilRTE.php");
1213 $completecontent = "";
1214 foreach ($this->getAllRTEContent() as $content) {
1215 $completecontent .= $content;
1216 }
1218 $completecontent,
1219 $this->getType() . ":html",
1220 $this->getId()
1221 );
1222 }
getAllRTEContent()
Returns the content of all RTE enabled text areas in the test.
getType()
get object type @access public
static _cleanupMediaObjectUsage($a_text, $a_usage_type, $a_usage_id)
Synchronises appearances of media objects in $a_text with media object usage table.

References ilRTE\_cleanupMediaObjectUsage(), getAllRTEContent(), ilObject\getId(), and ilObject\getType().

Referenced by saveToDb().

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

◆ create()

ilObjTest::create ( )

create test object

Reimplemented from ilObject.

Definition at line 744 of file class.ilObjTest.php.

745 {
746 $this->setOfflineStatus(true);
747 parent::create();
748
749 // meta data will be created by
750 // import parser
751 if (!$a_upload) {
752 $this->createMetaData();
753 }
754 }
createMetaData()
Create meta data entry.
setOfflineStatus($a_status)
Set offline status.

References createMetaData(), and ilObject\setOfflineStatus().

+ Here is the call graph for this function:

◆ createExportDirectory()

ilObjTest::createExportDirectory ( )

creates data directory for export files (data_dir/tst_data/tst_<id>/export, depending on data directory that is set in ILIAS setup/ini)

Definition at line 876 of file class.ilObjTest.php.

877 {
878 include_once "./Services/Utilities/classes/class.ilUtil.php";
879 $tst_data_dir = ilUtil::getDataDir() . "/tst_data";
880 ilUtil::makeDir($tst_data_dir);
881 if (!is_writable($tst_data_dir)) {
882 $this->ilias->raiseError("Test Data Directory (" . $tst_data_dir
883 . ") not writeable.", $this->ilias->error_obj->MESSAGE);
884 }
885
886 // create learning module directory (data_dir/lm_data/lm_<id>)
887 $tst_dir = $tst_data_dir . "/tst_" . $this->getId();
888 ilUtil::makeDir($tst_dir);
889 if (!@is_dir($tst_dir)) {
890 $this->ilias->raiseError("Creation of Test Directory failed.", $this->ilias->error_obj->MESSAGE);
891 }
892 // create Export subdirectory (data_dir/lm_data/lm_<id>/Export)
893 $export_dir = $tst_dir . "/export";
894 ilUtil::makeDir($export_dir);
895 if (!@is_dir($export_dir)) {
896 $this->ilias->raiseError("Creation of Export Directory failed.", $this->ilias->error_obj->MESSAGE);
897 }
898 }
redirection script todo: (a better solution should control the processing via a xml file)

References ilUtil\getDataDir(), ilObject\getId(), and ilUtil\makeDir().

+ Here is the call graph for this function:

◆ createMetaData()

ilObjTest::createMetaData ( )

Create meta data entry.

@access public

Reimplemented from ilObject.

Definition at line 6981 of file class.ilObjTest.php.

6982 {
6983 parent::createMetaData();
6984 $this->saveAuthorToMetadata();
6985 }
saveAuthorToMetadata($a_author="")
Saves an authors name into the lifecycle metadata if no lifecycle metadata exists This will only be c...

References saveAuthorToMetadata().

Referenced by create().

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

◆ createQuestionGUI()

& ilObjTest::createQuestionGUI (   $question_type,
  $question_id = -1 
)

Creates a question GUI instance of a given question type.

Parameters
integer$question_typeThe question type of the question
integer$question_idThe question id of the question, if available
Returns
assQuestionGUI $questionGUI The question GUI instance @access public

Definition at line 5437 of file class.ilObjTest.php.

5438 {
5439 if ((!$question_type) and ($question_id > 0)) {
5440 $question_type = $this->getQuestionType($question_id);
5441 }
5442
5443 if (!strlen($question_type)) {
5444 return null;
5445 }
5446
5447 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
5448 assQuestion::_includeClass($question_type, 1);
5449
5450 $question_type_gui = assQuestion::getGuiClassNameByQuestionType($question_type);
5451 $question = new $question_type_gui();
5452
5453 if ($question_id > 0) {
5454 $question->object->loadFromDb($question_id);
5455
5456 global $DIC;
5457 $ilCtrl = $DIC['ilCtrl'];
5458 $ilDB = $DIC['ilDB'];
5459 $ilUser = $DIC['ilUser'];
5460 $lng = $DIC['lng'];
5461
5462 $feedbackObjectClassname = assQuestion::getFeedbackClassNameByQuestionType($question_type);
5463 $question->object->feedbackOBJ = new $feedbackObjectClassname($question->object, $ilCtrl, $ilDB, $lng);
5464
5465 $assSettings = new ilSetting('assessment');
5466 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockerFactory.php';
5467 $processLockerFactory = new ilAssQuestionProcessLockerFactory($assSettings, $ilDB);
5468 $processLockerFactory->setQuestionId($question->object->getId());
5469 $processLockerFactory->setUserId($ilUser->getId());
5470 include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
5471 $processLockerFactory->setAssessmentLogEnabled(ilObjAssessmentFolder::_enabledAssessmentLogging());
5472 $question->object->setProcessLocker($processLockerFactory->getLocker());
5473 }
5474
5475 return $question;
5476 }
static getFeedbackClassNameByQuestionType($questionType)
static getGuiClassNameByQuestionType($questionType)
static _includeClass($question_type, $gui=0)
Include the php class file for a given question type.
getQuestionType($question_id)
Returns the question type of a question with a given id.
ILIAS Setting Class.

References $DIC, $ilDB, $ilUser, ilObject\$lng, ilObjAssessmentFolder\_enabledAssessmentLogging(), assQuestion\_includeClass(), assQuestion\getFeedbackClassNameByQuestionType(), assQuestion\getGuiClassNameByQuestionType(), and getQuestionType().

+ Here is the call graph for this function:

◆ createTestSequence()

& ilObjTest::createTestSequence (   $active_id,
  $pass,
  $shuffle 
)

Definition at line 10259 of file class.ilObjTest.php.

10260 {
10261 include_once "./Modules/Test/classes/class.ilTestSequence.php";
10262 $this->testSequence = new ilTestSequence($active_id, $pass, $this->isRandomTest());
10263 }
isRandomTest()
Returns the fact wether this test is a random questions test or not.
Test sequence handler.

References $pass, and isRandomTest().

+ Here is the call graph for this function:

◆ delete()

ilObjTest::delete ( )

delete object and all related data

@access public

Returns
boolean true if all object data were removed; false if only a references were removed

Reimplemented from ilObject.

Definition at line 791 of file class.ilObjTest.php.

792 {
793 // always call parent delete function first!!
794 if (!parent::delete()) {
795 return false;
796 }
797
798 // delet meta data
799 $this->deleteMetaData();
800
801 //put here your module specific stuff
802 $this->deleteTest();
803
804 require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentImportFails.php';
805 $qsaImportFails = new ilAssQuestionSkillAssignmentImportFails($this->getId());
806 $qsaImportFails->deleteRegisteredImportFails();
807 require_once 'Modules/Test/classes/class.ilTestSkillLevelThresholdImportFails.php';
808 $sltImportFails = new ilTestSkillLevelThresholdImportFails($this->getId());
809 $sltImportFails->deleteRegisteredImportFails();
810
811 return true;
812 }
deleteTest()
Deletes the test and all related objects, files and database entries.
deleteMetaData()
delete meta data entry

References ilObject\deleteMetaData(), deleteTest(), and ilObject\getId().

+ Here is the call graph for this function:

◆ deleteDefaults()

ilObjTest::deleteDefaults (   $test_default_id)

Deletes the defaults for a test.

Parameters
integer$test_default_idThe database ID of the test defaults @access public

Definition at line 9677 of file class.ilObjTest.php.

9678 {
9679 global $DIC;
9680 $ilDB = $DIC['ilDB'];
9681 $affectedRows = $ilDB->manipulateF(
9682 "DELETE FROM tst_test_defaults WHERE test_defaults_id = %s",
9683 array('integer'),
9684 array($test_default_id)
9685 );
9686 }

References $DIC, and $ilDB.

◆ deleteTest()

ilObjTest::deleteTest ( )

Deletes the test and all related objects, files and database entries.

@access public

Definition at line 819 of file class.ilObjTest.php.

820 {
821 global $DIC;
822 $tree = $DIC['tree'];
823 $ilDB = $DIC['ilDB'];
824 $ilPluginAdmin = $DIC['ilPluginAdmin'];
825 $lng = $DIC['lng'];
826
827 require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
828 $participantData = new ilTestParticipantData($ilDB, $lng);
829 $participantData->load($this->getTestId());
830 $this->removeTestResults($participantData);
831
832 $affectedRows = $ilDB->manipulateF(
833 "DELETE FROM tst_mark WHERE test_fi = %s",
834 array('integer'),
835 array($this->getTestId())
836 );
837
838 $affectedRows = $ilDB->manipulateF(
839 "DELETE FROM tst_tests WHERE test_id = %s",
840 array('integer'),
841 array($this->getTestId())
842 );
843
844 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
845 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this);
846 $testQuestionSetConfigFactory->getQuestionSetConfig()->removeQuestionSetRelatedData();
847
848 // delete export files
849 include_once "./Services/Utilities/classes/class.ilUtil.php";
850 $tst_data_dir = ilUtil::getDataDir() . "/tst_data";
851 $directory = $tst_data_dir . "/tst_" . $this->getId();
852 if (is_dir($directory)) {
853 include_once "./Services/Utilities/classes/class.ilUtil.php";
854 ilUtil::delDir($directory);
855 }
856 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
857 $mobs = ilObjMediaObject::_getMobsOfObject("tst:html", $this->getId());
858 // remaining usages are not in text anymore -> delete them
859 // and media objects (note: delete method of ilObjMediaObject
860 // checks whether object is used in another context; if yes,
861 // the object is not deleted!)
862 foreach ($mobs as $mob) {
863 ilObjMediaObject::_removeUsage($mob, "tst:html", $this->getId());
864 if (ilObjMediaObject::_exists($mob)) {
865 $mob_obj = new ilObjMediaObject($mob);
866 $mob_obj->delete();
867 }
868 }
869 }
static _removeUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
Remove usage of mob in another container.
removeTestResults(ilTestParticipantData $participantData)

References $DIC, $ilDB, ilObject\$lng, $mobs, ilObject\$tree, ilObjMediaObject\_exists(), ilObjMediaObject\_getMobsOfObject(), ilObjMediaObject\_removeUsage(), ilUtil\delDir(), ilUtil\getDataDir(), ilObject\getId(), getTestId(), and removeTestResults().

Referenced by delete().

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

◆ deliverPDFfromFO()

ilObjTest::deliverPDFfromFO (   $fo,
  $title = null 
)

Delivers a PDF file from a XSL-FO string.

Parameters
string$foThe XSL-FO string @access public

Definition at line 10024 of file class.ilObjTest.php.

10025 {
10026 global $DIC;
10027 $ilLog = $DIC['ilLog'];
10028
10029 include_once "./Services/Utilities/classes/class.ilUtil.php";
10030 $fo_file = ilUtil::ilTempnam() . ".fo";
10031 $fp = fopen($fo_file, "w");
10032 fwrite($fp, $fo);
10033 fclose($fp);
10034
10035 include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
10036 try {
10037 $pdf_base64 = ilRpcClientFactory::factory('RPCTransformationHandler')->ilFO2PDF($fo);
10038 $filename = (strlen($title)) ? $title : $this->getTitle();
10039 ilUtil::deliverData($pdf_base64->scalar, ilUtil::getASCIIFilename($filename) . ".pdf", "application/pdf", false, true);
10040 return true;
10041 } catch (Exception $e) {
10042 $ilLog->write(__METHOD__ . ': ' . $e->getMessage());
10043 return false;
10044 }
10045 }
$filename
Definition: buildRTE.php:89
getTitle()
get object title @access public
static factory($a_package, $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
static ilTempnam($a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename

References $DIC, Vendor\Package\$e, $filename, ilObject\$title, ilUtil\deliverData(), ilRpcClientFactory\factory(), ilUtil\getASCIIFilename(), ilObject\getTitle(), and ilUtil\ilTempnam().

Referenced by deliverPDFfromHTML().

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

◆ deliverPDFfromHTML()

ilObjTest::deliverPDFfromHTML (   $content,
  $title = null 
)

Delivers a PDF file from XHTML.

Parameters
string$htmlThe XHTML string @access public

Definition at line 9987 of file class.ilObjTest.php.

9988 {
9989 $content = preg_replace("/href=\".*?\"/", "", $content);
9990 $printbody = new ilTemplate("tpl.il_as_tst_print_body.html", true, true, "Modules/Test");
9991 $printbody->setVariable("TITLE", ilUtil::prepareFormOutput($this->getTitle()));
9992 $printbody->setVariable("ADM_CONTENT", $content);
9993 $printbody->setCurrentBlock("css_file");
9994 $printbody->setVariable("CSS_FILE", ilUtil::getStyleSheetLocation("filesystem", "delos.css"));
9995 $printbody->parseCurrentBlock();
9996 $printoutput = $printbody->get();
9997 $html = str_replace("href=\"./", "href=\"" . ILIAS_HTTP_PATH . "/", $printoutput);
9998 $html = preg_replace("/<div id=\"dontprint\">.*?<\\/div>/ims", "", $html);
9999 if (extension_loaded("tidy")) {
10000 $config = array(
10001 "indent" => false,
10002 "output-xml" => true,
10003 "numeric-entities" => true
10004 );
10005 $tidy = new tidy();
10006 $tidy->parseString($html, $config, 'utf8');
10007 $tidy->cleanRepair();
10008 $html = tidy_get_output($tidy);
10009 $html = preg_replace("/^.*?(<html)/", "\\1", $html);
10010 } else {
10011 $html = str_replace("&nbsp;", "&#160;", $html);
10012 $html = str_replace("&otimes;", "X", $html);
10013 }
10014 $html = preg_replace("/src=\".\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $html);
10015 $this->deliverPDFfromFO($this->processPrintoutput2FO($html), $title);
10016 }
processPrintoutput2FO($print_output)
Convert a print output to XSL-FO.
deliverPDFfromFO($fo, $title=null)
Delivers a PDF file from a XSL-FO string.
special template class to simplify handling of ITX/PEAR
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68

References $config, ilObject\$title, deliverPDFfromFO(), ilUtil\getStyleSheetLocation(), ilObject\getTitle(), ilUtil\prepareFormOutput(), and processPrintoutput2FO().

+ Here is the call graph for this function:

◆ disinviteUser()

ilObjTest::disinviteUser (   $user_id)

Disinvites a user from a test.

Parameters
integer$user_idThe database id of the disinvited user @access public

Definition at line 7802 of file class.ilObjTest.php.

7803 {
7804 global $DIC;
7805 $ilDB = $DIC['ilDB'];
7806
7807 $affectedRows = $ilDB->manipulateF(
7808 "DELETE FROM tst_invited_user WHERE test_fi = %s AND user_fi = %s",
7809 array('integer', 'integer'),
7810 array($this->getTestId(), $user_id)
7811 );
7812 }

References $DIC, $ilDB, and getTestId().

+ Here is the call graph for this function:

◆ duplicateQuestionForTest()

ilObjTest::duplicateQuestionForTest (   $question_id)

Takes a question and creates a copy of the question for use in the test.

Parameters
integer$question_idThe database id of the question
Returns
integer The database id of the copied question @access public

Definition at line 3581 of file class.ilObjTest.php.

3582 {
3583 global $DIC;
3584 $ilUser = $DIC['ilUser'];
3585 $question = &ilObjTest::_instanciateQuestion($question_id);
3586 $duplicate_id = $question->duplicate(true, null, null, null, $this->getId());
3587
3588 return $duplicate_id;
3589 }
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.

References $DIC, $ilUser, _instanciateQuestion(), and ilObject\getId().

Referenced by insertQuestion().

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

◆ endingTimeReached()

ilObjTest::endingTimeReached ( )

Returns true if the ending time of a test is reached An ending time is not available for self assessment tests.

Returns
boolean true if the ending time is reached, otherwise false @access public

Definition at line 5560 of file class.ilObjTest.php.

5561 {
5562 if ($this->isEndingTimeEnabled() && $this->getEndingTime() != 0) {
5563 $now = time();
5564 if ($now > $this->getEndingTime()) {
5565 return true;
5566 }
5567 }
5568 return false;
5569 }

References getEndingTime(), and isEndingTimeEnabled().

Referenced by isExecutable().

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

◆ ensureParticipantsLastActivePassFinished()

static ilObjTest::ensureParticipantsLastActivePassFinished (   $testObjId,
  $userId,
  $a_force_new_run = false 
)
static

Definition at line 12138 of file class.ilObjTest.php.

12139 {
12140 global $DIC;
12141 $ilDB = $DIC['ilDB'];
12142 $lng = $DIC['lng'];
12143 $refinery = $DIC['refinery'];
12144 $ilPluginAdmin = $DIC['ilPluginAdmin'];
12145
12146 /* @var ilObjTest $testOBJ */
12147
12148 $testOBJ = ilObjectFactory::getInstanceByRefId($testObjId, false);
12149
12150 $activeId = $testOBJ->getActiveIdOfUser($userId);
12151
12152 require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
12153 $testSessionFactory = new ilTestSessionFactory($testOBJ);
12154
12155 require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
12156 $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $refinery, $ilPluginAdmin, $testOBJ);
12157
12158 $testSession = $testSessionFactory->getSession($activeId);
12159 $testSequence = $testSequenceFactory->getSequenceByActiveIdAndPass($activeId, $testSession->getPass());
12160 $testSequence->loadFromDb();
12161
12162 // begin-patch lok changed smeyer
12163 if ($a_force_new_run) {
12164 if ($testSequence->hasSequence()) {
12165 $testSession->increasePass();
12166 }
12167 $testSession->setLastSequence(0);
12168 $testSession->saveToDb();
12169 }
12170 // end-patch lok
12171 }
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id

References $DIC, $ilDB, ilObject\$lng, $testSequence, $testSession, and ilObjectFactory\getInstanceByRefId().

+ Here is the call graph for this function:

◆ evalResultsOverview()

& ilObjTest::evalResultsOverview ( )

Creates an associated array with the results of all participants of a test.

Returns
array An associated array containing the results @access public

Definition at line 5172 of file class.ilObjTest.php.

5173 {
5174 return $this->_evalResultsOverview($this->getTestId());
5175 }
& _evalResultsOverview($test_id)
Creates an associated array with the results of all participants of a test.

References _evalResultsOverview(), and getTestId().

+ Here is the call graph for this function:

◆ evalResultsOverviewOfParticipant()

& ilObjTest::evalResultsOverviewOfParticipant (   $active_id)

Creates an associated array with the results for a given participant of a test.

Parameters
integer$active_idThe active id of the participant
Returns
array An associated array containing the results @access public

Definition at line 5231 of file class.ilObjTest.php.

5232 {
5233 global $DIC;
5234 $ilDB = $DIC['ilDB'];
5235
5236 $result = $ilDB->queryF(
5237 "SELECT usr_data.usr_id, usr_data.firstname, usr_data.lastname, usr_data.title, usr_data.login, " .
5238 "tst_test_result.*, qpl_questions.original_id, qpl_questions.title questiontitle, " .
5239 "qpl_questions.points maxpoints " .
5240 "FROM tst_test_result, qpl_questions, tst_active " .
5241 "LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id " .
5242 "WHERE tst_active.active_id = tst_test_result.active_fi " .
5243 "AND qpl_questions.question_id = tst_test_result.question_fi " .
5244 "AND tst_active.test_fi = %s AND tst_active.active_id = %s" .
5245 "ORDER BY tst_active.active_id, tst_test_result.pass, tst_test_result.tstamp",
5246 array('integer', 'integer'),
5247 array($this->getTestId(), $active_id)
5248 );
5249 $overview = array();
5250 while ($row = $ilDB->fetchAssoc($result)) {
5251 if (!array_key_exists($row["active_fi"], $overview)) {
5252 $overview[$row["active_fi"]] = array();
5253 $overview[$row["active_fi"]]["firstname"] = $row["firstname"];
5254 $overview[$row["active_fi"]]["lastname"] = $row["lastname"];
5255 $overview[$row["active_fi"]]["title"] = $row["title"];
5256 $overview[$row["active_fi"]]["login"] = $row["login"];
5257 $overview[$row["active_fi"]]["usr_id"] = $row["usr_id"];
5258 $overview[$row["active_fi"]]["started"] = $row["started"];
5259 $overview[$row["active_fi"]]["finished"] = $row["finished"];
5260 }
5261 if (!array_key_exists($row["pass"], $overview[$row["active_fi"]])) {
5262 $overview[$row["active_fi"]][$row["pass"]] = array();
5263 $overview[$row["active_fi"]][$row["pass"]]["reached"] = 0;
5264 $overview[$row["active_fi"]][$row["pass"]]["maxpoints"] = $row["maxpoints"];
5265 }
5266 array_push($overview[$row["active_fi"]][$row["pass"]], $row);
5267 $overview[$row["active_fi"]][$row["pass"]]["reached"] += $row["points"];
5268 }
5269 return $overview;
5270 }

References $DIC, $ilDB, $result, and getTestId().

+ Here is the call graph for this function:

◆ evalStatistical()

& ilObjTest::evalStatistical (   $active_id)

Returns the statistical evaluation of the test for a specified user.

Returns
arrary The statistical evaluation array of the test @access public

Definition at line 4445 of file class.ilObjTest.php.

4446 {
4447 global $DIC;
4448 $ilDB = $DIC['ilDB'];
4449 // $ilBench = $DIC['ilBench'];
4450 $pass = ilObjTest::_getResultPass($active_id);
4451 $test_result = &$this->getTestResult($active_id, $pass);
4452 $result = $ilDB->queryF(
4453 "SELECT tst_times.* FROM tst_active, tst_times WHERE tst_active.active_id = %s AND tst_active.active_id = tst_times.active_fi",
4454 array('integer'),
4455 array($active_id)
4456 );
4457 $times = array();
4458 $first_visit = 0;
4459 $last_visit = 0;
4460 while ($row = $ilDB->fetchObject($result)) {
4461 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->started, $matches);
4462 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4463 if (!$first_visit) {
4464 $first_visit = $epoch_1;
4465 }
4466 if ($epoch_1 < $first_visit) {
4467 $first_visit = $epoch_1;
4468 }
4469 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->finished, $matches);
4470 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4471 if (!$last_visit) {
4472 $last_visit = $epoch_2;
4473 }
4474 if ($epoch_2 > $last_visit) {
4475 $last_visit = $epoch_2;
4476 }
4477 $times[$row->active_fi] += ($epoch_2 - $epoch_1);
4478 }
4479 $max_time = 0;
4480 foreach ($times as $key => $value) {
4481 $max_time += $value;
4482 }
4483 if ((!$test_result["test"]["total_reached_points"]) or (!$test_result["test"]["total_max_points"])) {
4484 $percentage = 0.0;
4485 } else {
4486 $percentage = ($test_result["test"]["total_reached_points"] / $test_result["test"]["total_max_points"]) * 100.0;
4487 if ($percentage < 0) {
4488 $percentage = 0.0;
4489 }
4490 }
4491 $mark_obj = $this->mark_schema->getMatchingMark($percentage);
4492 $first_date = getdate($first_visit);
4493 $last_date = getdate($last_visit);
4494 $qworkedthrough = 0;
4495 foreach ($test_result as $key => $value) {
4496 if (preg_match("/\d+/", $key)) {
4497 $qworkedthrough += $value["workedthrough"];
4498 }
4499 }
4500 if (!$qworkedthrough) {
4501 $atimeofwork = 0;
4502 } else {
4503 $atimeofwork = $max_time / $qworkedthrough;
4504 }
4505
4506 $obligationsAnswered = $test_result["test"]["obligations_answered"];
4507
4508 $result_mark = "";
4509 $passed = "";
4510
4511 if ($mark_obj) {
4512 $result_mark = $mark_obj->getShortName();
4513
4514 if ($mark_obj->getPassed() && $obligationsAnswered) {
4515 $passed = 1;
4516 } else {
4517 $passed = 0;
4518 }
4519 }
4520 $percent_worked_through = 0;
4521 if (count($this->questions)) {
4522 $percent_worked_through = $qworkedthrough / count($this->questions);
4523 }
4524 $result_array = array(
4525 "qworkedthrough" => $qworkedthrough,
4526 "qmax" => count($this->questions),
4527 "pworkedthrough" => $percent_worked_through,
4528 "timeofwork" => $max_time,
4529 "atimeofwork" => $atimeofwork,
4530 "firstvisit" => $first_date,
4531 "lastvisit" => $last_date,
4532 "resultspoints" => $test_result["test"]["total_reached_points"],
4533 "maxpoints" => $test_result["test"]["total_max_points"],
4534 "resultsmarks" => $result_mark,
4535 "passed" => $passed,
4536 "distancemedian" => "0"
4537 );
4538 foreach ($test_result as $key => $value) {
4539 if (preg_match("/\d+/", $key)) {
4540 $result_array[$key] = $value;
4541 }
4542 }
4543 return $result_array;
4544 }
static _getResultPass($active_id)
Retrieves the pass number that should be counted for a given user.
& getTestResult($active_id, $pass=null, $ordered_sequence=false, $considerHiddenQuestions=true, $considerOptionalQuestions=true)
Calculates the results of a test for a given user and returns an array with all test results.

References $DIC, $ilDB, $pass, $result, _getResultPass(), and getTestResult().

+ Here is the call graph for this function:

◆ evalTotalParticipantsArray()

& ilObjTest::evalTotalParticipantsArray (   $name_sort_order = "asc")

Returns all participants who started the test.

Returns
arrary The active user id's and names of the persons who started the test @access public

Definition at line 4663 of file class.ilObjTest.php.

4664 {
4665 global $DIC;
4666 $ilDB = $DIC['ilDB'];
4667 $result = $ilDB->queryF(
4668 "SELECT tst_active.active_id, usr_data.login, usr_data.firstname, usr_data.lastname, usr_data.title FROM tst_active LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id WHERE tst_active.test_fi = %s ORDER BY usr_data.lastname " . strtoupper($name_sort_order),
4669 array('integer'),
4670 array($this->getTestId())
4671 );
4672 $persons_array = array();
4673 while ($row = $ilDB->fetchAssoc($result)) {
4674 if ($this->getAnonymity()) {
4675 $persons_array[$row["active_id"]] = array("name" => $this->lng->txt("anonymous"));
4676 } else {
4677 if (strlen($row["firstname"] . $row["lastname"] . $row["title"]) == 0) {
4678 $persons_array[$row["active_id"]] = array("name" => $this->lng->txt("deleted_user"));
4679 } else {
4680 if ($row["user_fi"] == ANONYMOUS_USER_ID) {
4681 $persons_array[$row["active_id"]] = array("name" => $row["lastname"]);
4682 } else {
4683 $persons_array[$row["active_id"]] = array("name" => trim($row["lastname"] . ", " . $row["firstname"] . " " . $row["title"]), "login" => $row["login"]);
4684 }
4685 }
4686 }
4687 }
4688 return $persons_array;
4689 }

References $DIC, $ilDB, $result, ANONYMOUS_USER_ID, getAnonymity(), and getTestId().

Referenced by getTotalPointsPassedArray().

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

◆ evalTotalPersons()

ilObjTest::evalTotalPersons ( )

Returns the number of persons who started the test.

Returns
integer The number of persons who started the test @access public

Definition at line 4254 of file class.ilObjTest.php.

4255 {
4256 global $DIC;
4257 $ilDB = $DIC['ilDB'];
4258
4259 $result = $ilDB->queryF(
4260 "SELECT COUNT(active_id) total FROM tst_active WHERE test_fi = %s",
4261 array('integer'),
4262 array($this->getTestId())
4263 );
4264 $row = $ilDB->fetchAssoc($result);
4265 return $row["total"];
4266 }

References $DIC, $ilDB, $result, and getTestId().

Referenced by canEditMarks(), participantDataExist(), and saveToDb().

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

◆ evalTotalPersonsArray()

& ilObjTest::evalTotalPersonsArray (   $name_sort_order = "asc")

Returns all persons who started the test.

Returns
arrary The user id's and names of the persons who started the test @access public

Definition at line 4625 of file class.ilObjTest.php.

4626 {
4627 global $DIC;
4628 $ilDB = $DIC['ilDB'];
4629 $result = $ilDB->queryF(
4630 "SELECT tst_active.active_id, usr_data.firstname, usr_data.lastname, usr_data.title FROM tst_active LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id WHERE tst_active.test_fi = %s ORDER BY usr_data.lastname " . strtoupper($name_sort_order),
4631 array('integer'),
4632 array($this->getTestId())
4633 );
4634 $persons_array = array();
4635 while ($row = $ilDB->fetchAssoc($result)) {
4636 if ($this->getAccessFilteredParticipantList() && !$this->getAccessFilteredParticipantList()->isActiveIdInList($row["active_id"])) {
4637 continue;
4638 }
4639
4640 if ($this->getAnonymity()) {
4641 $persons_array[$row["active_id"]] = $this->lng->txt("anonymous");
4642 } else {
4643 if (strlen($row["firstname"] . $row["lastname"] . $row["title"]) == 0) {
4644 $persons_array[$row["active_id"]] = $this->lng->txt("deleted_user");
4645 } else {
4646 if ($row["user_fi"] == ANONYMOUS_USER_ID) {
4647 $persons_array[$row["active_id"]] = $row["lastname"];
4648 } else {
4649 $persons_array[$row["active_id"]] = trim($row["lastname"] . ", " . $row["firstname"] . " " . $row["title"]);
4650 }
4651 }
4652 }
4653 }
4654 return $persons_array;
4655 }
getAccessFilteredParticipantList()

References $DIC, $ilDB, $result, ANONYMOUS_USER_ID, getAccessFilteredParticipantList(), getAnonymity(), and getTestId().

+ Here is the call graph for this function:

◆ evalTotalStartedAverageTime()

ilObjTest::evalTotalStartedAverageTime (   $activeIdsFilter = null)

Returns the average processing time for all started tests.

Returns
integer The average processing time for all started tests @access public

Definition at line 5339 of file class.ilObjTest.php.

5340 {
5341 global $DIC; /* @var ILIAS\DI\Container $DIC */
5342
5343 $query = "SELECT tst_times.* FROM tst_active, tst_times WHERE tst_active.test_fi = %s AND tst_active.active_id = tst_times.active_fi";
5344
5345 if (is_array($activeIdsFilter) && count($activeIdsFilter)) {
5346 $query .= " AND " . $DIC->database()->in('active_id', $activeIdsFilter, false, 'integer');
5347 }
5348
5349 $result = $DIC->database()->queryF($query, array('integer'), array($this->getTestId()));
5350 $times = array();
5351 while ($row = $DIC->database()->fetchObject($result)) {
5352 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->started, $matches);
5353 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
5354 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->finished, $matches);
5355 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
5356 $times[$row->active_fi] += ($epoch_2 - $epoch_1);
5357 }
5358 $max_time = 0;
5359 $counter = 0;
5360 foreach ($times as $key => $value) {
5361 $max_time += $value;
5362 $counter++;
5363 }
5364 if ($counter) {
5365 $average_time = round($max_time / $counter);
5366 } else {
5367 $average_time = 0;
5368 }
5369 return $average_time;
5370 }

References $DIC, $query, $result, and getTestId().

Referenced by getAggregatedResultsData().

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

◆ exportFileItems()

ilObjTest::exportFileItems (   $target_dir,
$expLog 
)

export files of file itmes

Definition at line 6762 of file class.ilObjTest.php.

6763 {
6764 include_once "./Modules/File/classes/class.ilObjFile.php";
6765
6766 foreach ($this->file_ids as $file_id) {
6767 $expLog->write(date("[y-m-d H:i:s] ") . "File Item " . $file_id);
6768 $file_dir = $target_dir . '/objects/il_' . IL_INST_ID . '_file_' . $file_id;
6769 ilUtil::makeDir($file_dir);
6770 $file_obj = new ilObjFile($file_id, false);
6771 $source_file = $file_obj->getFile($file_obj->getVersion());
6772 if (!is_file($source_file)) {
6773 $source_file = $file_obj->getFile();
6774 }
6775 if (is_file($source_file)) {
6776 copy($source_file, $file_dir . '/' . $file_obj->getFileName());
6777 }
6778 unset($file_obj);
6779 }
6780 }
Class ilObjFile.

References IL_INST_ID, and ilUtil\makeDir().

Referenced by exportPagesXML().

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

◆ exportPagesXML()

ilObjTest::exportPagesXML ( $a_xml_writer,
  $a_inst,
  $a_target_dir,
$expLog 
)

export pages of test to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 6612 of file class.ilObjTest.php.

6613 {
6614 global $DIC;
6615 $ilBench = $DIC['ilBench'];
6616
6617 $this->mob_ids = array();
6618 $this->file_ids = array();
6619
6620 // MetaData
6621 $this->exportXMLMetaData($a_xml_writer);
6622
6623 // PageObjects
6624 $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Page Objects");
6625 $ilBench->start("ContentObjectExport", "exportPageObjects");
6626 $this->exportXMLPageObjects($a_xml_writer, $a_inst, $expLog);
6627 $ilBench->stop("ContentObjectExport", "exportPageObjects");
6628 $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Page Objects");
6629
6630 // MediaObjects
6631 $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Media Objects");
6632 $ilBench->start("ContentObjectExport", "exportMediaObjects");
6633 $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
6634 $ilBench->stop("ContentObjectExport", "exportMediaObjects");
6635 $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Media Objects");
6636
6637 // FileItems
6638 $expLog->write(date("[y-m-d H:i:s] ") . "Start Export File Items");
6639 $ilBench->start("ContentObjectExport", "exportFileItems");
6640 $this->exportFileItems($a_target_dir, $expLog);
6641 $ilBench->stop("ContentObjectExport", "exportFileItems");
6642 $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export File Items");
6643 }
exportXMLPageObjects(&$a_xml_writer, $a_inst, &$expLog)
export page objects to xml (see ilias_co.dtd)
exportFileItems($target_dir, &$expLog)
export files of file itmes
exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
export media objects to xml (see ilias_co.dtd)
exportXMLMetaData(&$a_xml_writer)
export content objects meta data to xml (see ilias_co.dtd)
global $ilBench
Definition: ilias.php:21

References $DIC, $ilBench, exportFileItems(), exportXMLMediaObjects(), exportXMLMetaData(), and exportXMLPageObjects().

+ Here is the call graph for this function:

◆ exportXMLMediaObjects()

ilObjTest::exportXMLMediaObjects ( $a_xml_writer,
  $a_inst,
  $a_target_dir,
$expLog 
)

export media objects to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 6743 of file class.ilObjTest.php.

6744 {
6745 include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
6746
6747 foreach ($this->mob_ids as $mob_id) {
6748 $expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
6749 if (ilObjMediaObject::_exists($mob_id)) {
6750 $media_obj = new ilObjMediaObject($mob_id);
6751 $media_obj->exportXML($a_xml_writer, $a_inst);
6752 $media_obj->exportFiles($a_target_dir);
6753 unset($media_obj);
6754 }
6755 }
6756 }

References ilObjMediaObject\_exists().

Referenced by exportPagesXML().

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

◆ exportXMLMetaData()

ilObjTest::exportXMLMetaData ( $a_xml_writer)

export content objects meta data to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 6651 of file class.ilObjTest.php.

6652 {
6653 include_once "./Services/MetaData/classes/class.ilMD2XML.php";
6654 $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
6655 $md2xml->setExportMode(true);
6656 $md2xml->startExport();
6657 $a_xml_writer->appendXML($md2xml->getXML());
6658 }

References ilObject\getId(), and ilObject\getType().

Referenced by exportPagesXML().

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

◆ exportXMLPageObjects()

ilObjTest::exportXMLPageObjects ( $a_xml_writer,
  $a_inst,
$expLog 
)

export page objects to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 6682 of file class.ilObjTest.php.

6683 {
6684 global $DIC;
6685 $ilBench = $DIC['ilBench'];
6686
6687 include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
6688
6689 foreach ($this->questions as $question_id) {
6690 $ilBench->start("ContentObjectExport", "exportPageObject");
6691 $expLog->write(date("[y-m-d H:i:s] ") . "Page Object " . $question_id);
6692
6693 $attrs = array();
6694 $a_xml_writer->xmlStartTag("PageObject", $attrs);
6695
6696
6697 // export xml to writer object
6698 $ilBench->start("ContentObjectExport", "exportPageObject_XML");
6699 include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
6700 $page_object = new ilAssQuestionPage($question_id);
6701 $page_object->buildDom();
6702 $page_object->insertInstIntoIDs($a_inst);
6703 $mob_ids = $page_object->collectMediaObjects(false);
6704 require_once 'Services/COPage/classes/class.ilPCFileList.php';
6705 $file_ids = ilPCFileList::collectFileItems($page_object, $page_object->getDomDoc());
6706 $xml = $page_object->getXMLFromDom(false, false, false, "", true);
6707 $xml = str_replace("&", "&amp;", $xml);
6708 $a_xml_writer->appendXML($xml);
6709 $page_object->freeDom();
6710 unset($page_object);
6711
6712 $ilBench->stop("ContentObjectExport", "exportPageObject_XML");
6713
6714 // collect media objects
6715 $ilBench->start("ContentObjectExport", "exportPageObject_CollectMedia");
6716 //$mob_ids = $page_obj->getMediaObjectIDs();
6717 foreach ($mob_ids as $mob_id) {
6718 $this->mob_ids[$mob_id] = $mob_id;
6719 }
6720 $ilBench->stop("ContentObjectExport", "exportPageObject_CollectMedia");
6721
6722 // collect all file items
6723 $ilBench->start("ContentObjectExport", "exportPageObject_CollectFileItems");
6724 //$file_ids = $page_obj->getFileItemIds();
6725 foreach ($file_ids as $file_id) {
6726 $this->file_ids[$file_id] = $file_id;
6727 }
6728 $ilBench->stop("ContentObjectExport", "exportPageObject_CollectFileItems");
6729
6730 $a_xml_writer->xmlEndTag("PageObject");
6731 //unset($page_obj);
6732
6733 $ilBench->stop("ContentObjectExport", "exportPageObject");
6734 }
6735 }
Question page object.
static collectFileItems($a_page, $a_domdoc)
Get all file items that are used within the page.
$xml
Definition: metadata.php:332

References $DIC, $ilBench, $xml, and ilPCFileList\collectFileItems().

Referenced by exportPagesXML().

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

◆ fromXML()

ilObjTest::fromXML ( ilQTIAssessment  $assessment)

Receives parameters from a QTI parser and creates a valid ILIAS test object.

Parameters
ilQTIAssessment$assessment

Definition at line 5662 of file class.ilObjTest.php.

5663 {
5664 unset($_SESSION["import_mob_xhtml"]);
5665
5666 $this->setDescription($assessment->getComment());
5667 $this->setTitle($assessment->getTitle());
5668
5669 $this->setIntroductionEnabled(false);
5670 foreach ($assessment->objectives as $objectives) {
5671 foreach ($objectives->materials as $material) {
5672 $intro = $this->QTIMaterialToString($material);
5673 $this->setIntroduction($intro);
5674 $this->setIntroductionEnabled(strlen($intro) > 0);
5675 }
5676 }
5677
5678 if (
5679 $assessment->getPresentationMaterial() &&
5680 $assessment->getPresentationMaterial()->getFlowMat(0) &&
5681 $assessment->getPresentationMaterial()->getFlowMat(0)->getMaterial(0)
5682 ) {
5683 $this->setFinalStatement($this->QTIMaterialToString($assessment->getPresentationMaterial()->getFlowMat(0)->getMaterial(0)));
5684 }
5685
5686 foreach ($assessment->assessmentcontrol as $assessmentcontrol) {
5687 switch ($assessmentcontrol->getSolutionswitch()) {
5688 case "Yes":
5690 break;
5691 default:
5693 break;
5694 }
5695 }
5696
5697 $this->setStartingTimeEnabled(false);
5698 $this->setEndingTimeEnabled(false);
5699 $this->setPasswordEnabled(false);
5700 $this->setLimitUsersEnabled(false);
5701
5702 foreach ($assessment->qtimetadata as $metadata) {
5703 switch ($metadata["label"]) {
5704 case "test_type":
5705 // for old tests with a test type
5706 $type = $metadata["entry"];
5707 switch ($type) {
5708 case 1:
5709 // assessment
5710 $this->setAnonymity(1);
5711 break;
5712 case 2:
5713 // self assessment
5714 break;
5715 case 4:
5716 // online exam
5717 $this->setFixedParticipants(1);
5719 $this->setShowSolutionPrintview(1);
5720 break;
5721 case 5:
5722 // varying random test
5723 break;
5724 }
5725 break;
5726 case "sequence_settings":
5727 $this->setSequenceSettings($metadata["entry"]);
5728 break;
5729 case "solution_details":
5730 $this->setShowSolutionDetails((int) $metadata["entry"]);
5731 break;
5732 case "print_bs_with_res":
5733 $this->setPrintBestSolutionWithResult((int) $metadata["entry"]);
5734 break;
5735 case "author":
5736 $this->setAuthor($metadata["entry"]);
5737 break;
5738 case "nr_of_tries":
5739 $this->setNrOfTries($metadata["entry"]);
5740 break;
5741 case 'block_after_passed':
5742 $this->setBlockPassesAfterPassedEnabled((bool) $metadata['entry']);
5743 break;
5744 case "pass_waiting":
5745 $this->setPassWaiting($metadata["entry"]);
5746 break;
5747 case "kiosk":
5748 $this->setKiosk($metadata["entry"]);
5749 break;
5750 case "showfinalstatement":
5751 $this->setShowFinalStatement($metadata["entry"]);
5752 break;
5753 case "showinfo":
5754 $this->setShowInfo($metadata["entry"]);
5755 break;
5756 case "forcejs":
5757 $this->setForceJS($metadata["entry"]);
5758 break;
5759 case "customstyle":
5760 $this->setCustomStyle($metadata["entry"]);
5761 break;
5762
5763 case "highscore_enabled":
5764 $this->setHighscoreEnabled($metadata["entry"]);
5765 break;
5766
5767 case "highscore_anon":
5768 $this->setHighscoreAnon($metadata["entry"]);
5769 break;
5770
5771 case "highscore_achieved_ts":
5772 $this->setHighscoreAchievedTS($metadata["entry"]);
5773 break;
5774
5775 case "highscore_score":
5776 $this->setHighscoreScore($metadata["entry"]);
5777 break;
5778
5779 case "highscore_percentage":
5780 $this->setHighscorePercentage($metadata["entry"]);
5781 break;
5782
5783 case "highscore_hints":
5784 $this->setHighscoreHints($metadata["entry"]);
5785 break;
5786
5787 case "highscore_wtime":
5788 $this->setHighscoreWTime($metadata["entry"]);
5789 break;
5790
5791 case "highscore_own_table":
5792 $this->setHighscoreOwnTable($metadata["entry"]);
5793 break;
5794
5795 case "highscore_top_table":
5796 $this->setHighscoreTopTable($metadata["entry"]);
5797 break;
5798
5799 case "highscore_top_num":
5800 $this->setHighscoreTopNum($metadata["entry"]);
5801 break;
5802
5803 case "hide_previous_results":
5804 if ($metadata["entry"] == 0) {
5805 $this->setUsePreviousAnswers(1);
5806 } else {
5807 $this->setUsePreviousAnswers(0);
5808 }
5809 break;
5810 case "use_previous_answers":
5811 $this->setUsePreviousAnswers($metadata["entry"]);
5812 break;
5813 case "answer_feedback":
5814 $this->setAnswerFeedback($metadata["entry"]);
5815 break;
5816 case "hide_title_points":
5817 $this->setTitleOutput($metadata["entry"]);
5818 break;
5819 case "title_output":
5820 $this->setTitleOutput($metadata["entry"]);
5821 break;
5822 case "question_set_type":
5823 $this->setQuestionSetType($metadata["entry"]);
5824 break;
5825 case "random_test":
5826 if ($metadata["entry"]) {
5827 $this->setQuestionSetType(self::QUESTION_SET_TYPE_RANDOM);
5828 } else {
5829 $this->setQuestionSetType(self::QUESTION_SET_TYPE_FIXED);
5830 }
5831 break;
5832 case "results_presentation":
5833 $this->setResultsPresentation($metadata["entry"]);
5834 break;
5835 case "reset_processing_time":
5836 $this->setResetProcessingTime($metadata["entry"]);
5837 break;
5838 case "instant_verification":
5839 $this->setInstantFeedbackSolution($metadata["entry"]);
5840 break;
5841 case "follow_qst_answer_fixation":
5842 $this->setFollowupQuestionAnswerFixationEnabled((bool) $metadata["entry"]);
5843 break;
5844 case "instant_feedback_answer_fixation":
5845 $this->setInstantFeedbackAnswerFixationEnabled((bool) $metadata["entry"]);
5846 break;
5847 case "force_instant_feedback":
5848 $this->setForceInstantFeedbackEnabled((bool) $metadata["entry"]);
5849 break;
5850 case "answer_feedback_points":
5851 $this->setAnswerFeedbackPoints($metadata["entry"]);
5852 break;
5853 case "anonymity":
5854 $this->setAnonymity($metadata["entry"]);
5855 break;
5856 case "use_pool":
5857 $this->setPoolUsage((int) $metadata["entry"]);
5858 break;
5859 case "show_cancel":
5860 $this->setShowCancel($metadata["entry"]);
5861 break;
5862 case "show_marker":
5863 $this->setShowMarker($metadata["entry"]);
5864 break;
5865 case "fixed_participants":
5866 $this->setFixedParticipants($metadata["entry"]);
5867 break;
5868 case "score_reporting":
5869 $this->setScoreReporting($metadata["entry"]);
5870 break;
5871 case "shuffle_questions":
5872 $this->setShuffleQuestions($metadata["entry"]);
5873 break;
5874 case "count_system":
5875 $this->setCountSystem($metadata["entry"]);
5876 break;
5877 case "mc_scoring":
5878 $this->setMCScoring($metadata["entry"]);
5879 break;
5880 case "mailnotification":
5881 $this->setMailNotification($metadata["entry"]);
5882 break;
5883 case "mailnottype":
5884 $this->setMailNotificationType($metadata["entry"]);
5885 break;
5886 case "exportsettings":
5887 $this->setExportSettings($metadata['entry']);
5888 break;
5889 case "score_cutting":
5890 $this->setScoreCutting($metadata["entry"]);
5891 break;
5892 case "password":
5893 $this->setPassword($metadata["entry"]);
5894 $this->setPasswordEnabled(strlen($metadata["entry"]) > 0);
5895 break;
5896 case "allowedUsers":
5897 $this->setAllowedUsers($metadata["entry"]);
5898 $this->setLimitUsersEnabled((int) $metadata["entry"] > 0);
5899 break;
5900 case "allowedUsersTimeGap":
5901 $this->setAllowedUsersTimeGap($metadata["entry"]);
5902 break;
5903 case "pass_scoring":
5904 $this->setPassScoring($metadata["entry"]);
5905 break;
5906 case 'pass_deletion_allowed':
5907 $this->setPassDeletionAllowed((int) $metadata['entry']);
5908 break;
5909 case "show_summary":
5910 $this->setListOfQuestionsSettings($metadata["entry"]);
5911 break;
5912 case "reporting_date":
5913 $iso8601period = $metadata["entry"];
5914 if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $iso8601period, $matches)) {
5915 $this->setReportingDate(sprintf("%02d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
5916 }
5917 break;
5918 case 'enable_processing_time':
5919 $this->setEnableProcessingTime($metadata['entry']);
5920 break;
5921 case "processing_time":
5922 $this->setProcessingTime($metadata['entry']);
5923 break;
5924 case "starting_time":
5925 $iso8601period = $metadata["entry"];
5926 if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $iso8601period, $matches)) {
5927 $date_time = new ilDateTime(sprintf("%02d-%02d-%02d %02d:%02d:%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]), IL_CAL_DATETIME);
5928 $this->setStartingTime($date_time->get(IL_CAL_UNIX));
5929 $this->setStartingTimeEnabled(true);
5930 }
5931 break;
5932 case "ending_time":
5933 $iso8601period = $metadata["entry"];
5934 if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $iso8601period, $matches)) {
5935 $date_time = new ilDateTime(sprintf("%02d-%02d-%02d %02d:%02d:%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]), IL_CAL_DATETIME);
5936 $this->setEndingTime($date_time->get(IL_CAL_UNIX));
5937 $this->setEndingTimeEnabled(true);
5938 }
5939 break;
5940 case "enable_examview":
5941 $this->setEnableExamview($metadata["entry"]);
5942 break;
5943 case 'show_examview_html':
5944 $this->setShowExamviewHtml($metadata['entry']);
5945 break;
5946 case 'show_examview_pdf':
5947 $this->setShowExamviewPdf($metadata['entry']);
5948 break;
5949 case 'redirection_mode':
5950 $this->setRedirectionMode($metadata['entry']);
5951 break;
5952 case 'redirection_url':
5953 $this->setRedirectionUrl($metadata['entry']);
5954 break;
5955 case 'examid_in_kiosk':
5956 case 'examid_in_test_pass':
5957 $this->setShowExamIdInTestPassEnabled($metadata['entry']);
5958 break;
5959 case 'show_exam_id':
5960 case 'examid_in_test_res':
5961 $this->setShowExamIdInTestResultsEnabled($metadata['entry']);
5962 break;
5963 case 'enable_archiving':
5964 $this->setEnableArchiving($metadata['entry']);
5965 break;
5966 case 'sign_submission':
5967 $this->setSignSubmission($metadata['entry']);
5968 break;
5969 case 'char_selector_availability':
5970 $this->setCharSelectorAvailability($metadata['entry']);
5971 break;
5972 case 'char_selector_definition':
5973 $this->setCharSelectorDefinition($metadata['entry']);
5974 break;
5975 case 'skill_service':
5976 $this->setSkillServiceEnabled((bool) $metadata['entry']);
5977 break;
5978 case 'result_tax_filters':
5979 $this->setResultFilterTaxIds(strlen($metadata['entry']) ? unserialize($metadata['entry']) : array());
5980 break;
5981 case 'show_grading_status':
5982 $this->setShowGradingStatusEnabled((bool) $metadata['entry']);
5983 break;
5984 case 'show_grading_mark':
5985 $this->setShowGradingMarkEnabled((bool) $metadata['entry']);
5986 break;
5987 case 'activation_limited':
5988 $this->setActivationLimited($metadata['entry']);
5989 break;
5990 case 'activation_start_time':
5991 $this->setActivationStartingTime($metadata['entry']);
5992 break;
5993 case 'activation_end_time':
5994 $this->setActivationEndingTime($metadata['entry']);
5995 break;
5996 case 'activation_visibility':
5997 $this->setActivationVisibility($metadata['entry']);
5998 break;
5999 case 'autosave':
6000 $this->setAutosave($metadata['entry']);
6001 break;
6002 case 'autosave_ival':
6003 $this->setAutosaveIval($metadata['entry']);
6004 break;
6005 case 'offer_question_hints':
6006 $this->setOfferingQuestionHintsEnabled($metadata['entry']);
6007 break;
6008 case 'instant_feedback_specific':
6009 $this->setSpecificAnswerFeedback($metadata['entry']);
6010 break;
6011 case 'obligations_enabled':
6012 $this->setObligationsEnabled($metadata['entry']);
6013 break;
6014 }
6015 if (preg_match("/mark_step_\d+/", $metadata["label"])) {
6016 $xmlmark = $metadata["entry"];
6017 preg_match("/<short>(.*?)<\/short>/", $xmlmark, $matches);
6018 $mark_short = $matches[1];
6019 preg_match("/<official>(.*?)<\/official>/", $xmlmark, $matches);
6020 $mark_official = $matches[1];
6021 preg_match("/<percentage>(.*?)<\/percentage>/", $xmlmark, $matches);
6022 $mark_percentage = $matches[1];
6023 preg_match("/<passed>(.*?)<\/passed>/", $xmlmark, $matches);
6024 $mark_passed = $matches[1];
6025 $this->mark_schema->addMarkStep($mark_short, $mark_official, $mark_percentage, $mark_passed);
6026 }
6027 }
6028 // handle the import of media objects in XHTML code
6029 if (is_array($_SESSION["import_mob_xhtml"])) {
6030 include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
6031 include_once "./Services/RTE/classes/class.ilRTE.php";
6032 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
6033 foreach ($_SESSION["import_mob_xhtml"] as $mob) {
6034 $importfile = ilObjTest::_getImportDirectory() . '/' . $_SESSION["tst_import_subdir"] . '/' . $mob["uri"];
6035 if (file_exists($importfile)) {
6036 $media_object = &ilObjMediaObject::_saveTempFileAsMediaObject(basename($importfile), $importfile, false);
6037 ilObjMediaObject::_saveUsage($media_object->getId(), "tst:html", $this->getId());
6038 $this->setIntroduction(ilRTE::_replaceMediaObjectImageSrc(str_replace("src=\"" . $mob["mob"] . "\"", "src=\"" . "il_" . IL_INST_ID . "_mob_" . $media_object->getId() . "\"", $this->getIntroduction()), 1));
6039 $this->setFinalStatement(ilRTE::_replaceMediaObjectImageSrc(str_replace("src=\"" . $mob["mob"] . "\"", "src=\"" . "il_" . IL_INST_ID . "_mob_" . $media_object->getId() . "\"", $this->getFinalStatement()), 1));
6040 } else {
6041 global $DIC;
6042 $ilLog = $DIC['ilLog'];
6043 $ilLog->write("Error: Could not open XHTML mob file for test introduction during test import. File $importfile does not exist!");
6044 }
6045 }
6046 $this->saveToDb();
6047 }
6048 }
static _saveUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
Save usage of mob within another container (e.g.
static _saveTempFileAsMediaObject($name, $tmp_name, $upload=true)
Create new media object and update page in db and return new media object.
QTIMaterialToString($a_material)
Reads an QTI material tag an creates a text string.
setShowSolutionPrintview($a_printview=1)
Sets if the the solution printview should be presented to the user or not.
setAuthor($author="")
Sets the authors name of the ilObjTest object.
static _getImportDirectory()
Get the import directory location of the test.
setTitle($a_title)
set object title
setDescription($a_desc)
set object description
getPresentationMaterial()
{ilQTIPresentationMaterial|null}

References $_SESSION, $DIC, $metadata, ilObject\$type, _getImportDirectory(), ilRTE\_replaceMediaObjectImageSrc(), ilObjMediaObject\_saveTempFileAsMediaObject(), ilObjMediaObject\_saveUsage(), ilQTIAssessment\getComment(), ilQTIAssessment\getPresentationMaterial(), ilQTIAssessment\getTitle(), IL_CAL_DATETIME, IL_CAL_UNIX, IL_INST_ID, QTIMaterialToString(), saveToDb(), setActivationEndingTime(), setActivationLimited(), setActivationStartingTime(), setActivationVisibility(), setAllowedUsers(), setAllowedUsersTimeGap(), setAnonymity(), setAnswerFeedback(), setAnswerFeedbackPoints(), setAuthor(), setAutosave(), setAutosaveIval(), setBlockPassesAfterPassedEnabled(), setCharSelectorAvailability(), setCharSelectorDefinition(), setCountSystem(), setCustomStyle(), ilObject\setDescription(), setEnableArchiving(), setEnableExamview(), setEnableProcessingTime(), setEndingTime(), setEndingTimeEnabled(), setExportSettings(), setFinalStatement(), setFixedParticipants(), setFollowupQuestionAnswerFixationEnabled(), setForceInstantFeedbackEnabled(), setForceJS(), setHighscoreAchievedTS(), setHighscoreAnon(), setHighscoreEnabled(), setHighscoreHints(), setHighscoreOwnTable(), setHighscorePercentage(), setHighscoreScore(), setHighscoreTopNum(), setHighscoreTopTable(), setHighscoreWTime(), setInstantFeedbackAnswerFixationEnabled(), setInstantFeedbackSolution(), setIntroduction(), setIntroductionEnabled(), setKiosk(), setLimitUsersEnabled(), setListOfQuestionsSettings(), setMailNotification(), setMailNotificationType(), setMCScoring(), setNrOfTries(), setObligationsEnabled(), setOfferingQuestionHintsEnabled(), setPassDeletionAllowed(), setPassScoring(), setPassWaiting(), setPassword(), setPasswordEnabled(), setPoolUsage(), setPrintBestSolutionWithResult(), setProcessingTime(), setQuestionSetType(), setRedirectionMode(), setRedirectionUrl(), setReportingDate(), setResetProcessingTime(), setResultFilterTaxIds(), setResultsPresentation(), setScoreCutting(), setScoreReporting(), setSequenceSettings(), setShowCancel(), setShowExamIdInTestPassEnabled(), setShowExamIdInTestResultsEnabled(), setShowExamviewHtml(), setShowExamviewPdf(), setShowFinalStatement(), setShowGradingMarkEnabled(), setShowGradingStatusEnabled(), setShowInfo(), setShowMarker(), setShowSolutionDetails(), setShowSolutionPrintview(), setShuffleQuestions(), setSignSubmission(), setSkillServiceEnabled(), setSpecificAnswerFeedback(), setStartingTime(), setStartingTimeEnabled(), ilObject\setTitle(), setTitleOutput(), and setUsePreviousAnswers().

+ Here is the call graph for this function:

◆ getAccessFilteredParticipantList()

ilObjTest::getAccessFilteredParticipantList ( )
Returns
ilTestParticipantList

Definition at line 4782 of file class.ilObjTest.php.

4783 {
4785 }

References $accessFilteredParticipantList.

Referenced by evalTotalPersonsArray().

+ Here is the caller graph for this function:

◆ getActivationEndingTime()

ilObjTest::getActivationEndingTime ( )

Definition at line 11607 of file class.ilObjTest.php.

11608 {
11609 return (strlen($this->activation_ending_time)) ? $this->activation_ending_time : null;
11610 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getActivationStartingTime()

ilObjTest::getActivationStartingTime ( )

Definition at line 11602 of file class.ilObjTest.php.

11603 {
11604 return (strlen($this->activation_starting_time)) ? $this->activation_starting_time : null;
11605 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getActivationVisibility()

ilObjTest::getActivationVisibility ( )

Definition at line 11069 of file class.ilObjTest.php.

11070 {
11072 }

References $activation_visibility.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getActiveIdOfUser()

ilObjTest::getActiveIdOfUser (   $user_id = "",
  $anonymous_id = "" 
)

Gets the active id of a given user.

Parameters
integer$user_idThe database id of the user
string$anonymous_idThe anonymous id if the test is an anonymized test
Returns
integer The active ID @access public

Definition at line 3943 of file class.ilObjTest.php.

3944 {
3945 global $DIC;
3946 $ilDB = $DIC['ilDB'];
3947 $ilUser = $DIC['ilUser'];
3948
3949 if (!$user_id) {
3950 $user_id = $ilUser->getId();
3951 }
3952 if (($GLOBALS['DIC']['ilUser']->getId() == ANONYMOUS_USER_ID) && (strlen($_SESSION["tst_access_code"][$this->getTestId()]))) {
3953 $result = $ilDB->queryF(
3954 "SELECT active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
3955 array('integer','integer','text'),
3956 array($user_id, $this->test_id, $_SESSION["tst_access_code"][$this->getTestId()])
3957 );
3958 } elseif (strlen($anonymous_id)) {
3959 $result = $ilDB->queryF(
3960 "SELECT active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
3961 array('integer','integer','text'),
3962 array($user_id, $this->test_id, $anonymous_id)
3963 );
3964 } else {
3965 if ($GLOBALS['DIC']['ilUser']->getId() == ANONYMOUS_USER_ID) {
3966 return null;
3967 }
3968 $result = $ilDB->queryF(
3969 "SELECT active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s",
3970 array('integer','integer'),
3971 array($user_id, $this->test_id)
3972 );
3973 }
3974 if ($result->numRows()) {
3975 $row = $ilDB->fetchAssoc($result);
3976 return $row["active_id"];
3977 } else {
3978 return 0;
3979 }
3980 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64

References $_SESSION, $DIC, $GLOBALS, $ilDB, $ilUser, $result, ANONYMOUS_USER_ID, ilObject\getId(), and getTestId().

Referenced by getAllQuestions(), getExistingQuestions(), isExecutable(), loadQuestions(), ilCourseObjectiveResult\resetTestForUser(), and setQuestionSetSolved().

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

◆ getActiveParticipantList()

ilObjTest::getActiveParticipantList ( )
Returns
ilTestParticipantList

Definition at line 7447 of file class.ilObjTest.php.

7448 {
7449 require_once 'Modules/Test/classes/class.ilTestParticipantList.php';
7450 $participantList = new ilTestParticipantList($this);
7451 $participantList->initializeFromDbRows($this->getTestParticipants());
7452
7453 return $participantList;
7454 }

References getTestParticipants().

+ Here is the call graph for this function:

◆ getAggregatedResultsData()

ilObjTest::getAggregatedResultsData ( )

Returns the aggregated test results.

@access public

Definition at line 10471 of file class.ilObjTest.php.

10472 {
10473 $data = &$this->getCompleteEvaluationData();
10474 $foundParticipants = &$data->getParticipants();
10475 $results = array("overview" => array(), "questions" => array());
10476 if (count($foundParticipants)) {
10477 $results["overview"][$this->lng->txt("tst_eval_total_persons")] = count($foundParticipants);
10478 $total_finished = $data->getTotalFinishedParticipants();
10479 $results["overview"][$this->lng->txt("tst_eval_total_finished")] = $total_finished;
10480 $average_time = $this->evalTotalStartedAverageTime($data->getParticipantIds());
10481 $diff_seconds = $average_time;
10482 $diff_hours = floor($diff_seconds / 3600);
10483 $diff_seconds -= $diff_hours * 3600;
10484 $diff_minutes = floor($diff_seconds / 60);
10485 $diff_seconds -= $diff_minutes * 60;
10486 $results["overview"][$this->lng->txt("tst_eval_total_finished_average_time")] = sprintf("%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds);
10487 $total_passed = 0;
10488 $total_passed_reached = 0;
10489 $total_passed_max = 0;
10490 $total_passed_time = 0;
10491 foreach ($foundParticipants as $userdata) {
10492 if ($userdata->getPassed()) {
10493 $total_passed++;
10494 $total_passed_reached += $userdata->getReached();
10495 $total_passed_max += $userdata->getMaxpoints();
10496 $total_passed_time += $userdata->getTimeOfWork();
10497 }
10498 }
10499 $average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
10500 $average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
10501 $average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
10502 $results["overview"][$this->lng->txt("tst_eval_total_passed")] = $total_passed;
10503 $results["overview"][$this->lng->txt("tst_eval_total_passed_average_points")] = sprintf("%2.2f", $average_passed_reached) . " " . strtolower($this->lng->txt("of")) . " " . sprintf("%2.2f", $average_passed_max);
10504 $average_time = $average_passed_time;
10505 $diff_seconds = $average_time;
10506 $diff_hours = floor($diff_seconds / 3600);
10507 $diff_seconds -= $diff_hours * 3600;
10508 $diff_minutes = floor($diff_seconds / 60);
10509 $diff_seconds -= $diff_minutes * 60;
10510 $results["overview"][$this->lng->txt("tst_eval_total_passed_average_time")] = sprintf("%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds);
10511 }
10512
10513 foreach ($data->getQuestionTitles() as $question_id => $question_title) {
10514 $answered = 0;
10515 $reached = 0;
10516 $max = 0;
10517 foreach ($foundParticipants as $userdata) {
10518 for ($i = 0; $i <= $userdata->getLastPass(); $i++) {
10519 if (is_object($userdata->getPass($i))) {
10520 $question = &$userdata->getPass($i)->getAnsweredQuestionByQuestionId($question_id);
10521 if (is_array($question)) {
10522 $answered++;
10523 $reached += $question["reached"];
10524 $max += $question["points"];
10525 }
10526 }
10527 }
10528 }
10529 $percent = $max ? $reached / $max * 100.0 : 0;
10530 $results["questions"][$question_id] = array(
10531 $question_title,
10532 sprintf("%.2f", $answered ? $reached / $answered : 0) . " " . strtolower($this->lng->txt("of")) . " " . sprintf("%.2f", $answered ? $max / $answered : 0),
10533 sprintf("%.2f", $percent) . "%",
10534 $answered,
10535 sprintf("%.2f", $answered ? $reached / $answered : 0),
10536 sprintf("%.2f", $answered ? $max / $answered : 0),
10537 $percent / 100.0
10538 );
10539 }
10540 return $results;
10541 }
evalTotalStartedAverageTime($activeIdsFilter=null)
Returns the average processing time for all started tests.
& getCompleteEvaluationData($withStatistics=true, $filterby="", $filtertext="")
$i
Definition: metadata.php:24
$results
$data
Definition: storeScorm.php:23

References $data, $i, $results, evalTotalStartedAverageTime(), and getCompleteEvaluationData().

+ Here is the call graph for this function:

◆ getAllowedUsers()

ilObjTest::getAllowedUsers ( )

Definition at line 9129 of file class.ilObjTest.php.

9130 {
9131 return ($this->allowedUsers) ? $this->allowedUsers : 0;
9132 }

Referenced by addDefaults(), checkMaximumAllowedUsers(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getAllowedUsersTimeGap()

ilObjTest::getAllowedUsersTimeGap ( )

Definition at line 9139 of file class.ilObjTest.php.

9140 {
9141 return ($this->allowedUsersTimeGap) ? $this->allowedUsersTimeGap : 0;
9142 }

Referenced by addDefaults(), checkMaximumAllowedUsers(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getAllQuestions()

& ilObjTest::getAllQuestions (   $pass = null)

Returns all questions of a test in test order.

Returns
array An array containing the id's as keys and the database row objects as values @access public

Definition at line 3902 of file class.ilObjTest.php.

3903 {
3904 global $DIC;
3905 $ilUser = $DIC['ilUser'];
3906 $ilDB = $DIC['ilDB'];
3907
3908 $result_array = array();
3909 if ($this->isRandomTest()) {
3910 $active_id = $this->getActiveIdOfUser($ilUser->getId());
3911 $this->loadQuestions($active_id, $pass);
3912 if (count($this->questions) == 0) {
3913 return $result_array;
3914 }
3915 if (is_null($pass)) {
3916 $pass = self::_getPass($active_id);
3917 }
3918 $result = $ilDB->queryF(
3919 "SELECT qpl_questions.* FROM qpl_questions, tst_test_rnd_qst WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id AND tst_test_rnd_qst.active_fi = %s AND tst_test_rnd_qst.pass = %s AND " . $ilDB->in('qpl_questions.question_id', $this->questions, false, 'integer'),
3920 array('integer','integer'),
3921 array($active_id, $pass)
3922 );
3923 } else {
3924 if (count($this->questions) == 0) {
3925 return $result_array;
3926 }
3927 $result = $ilDB->query("SELECT qpl_questions.* FROM qpl_questions, tst_test_question WHERE tst_test_question.question_fi = qpl_questions.question_id AND " . $ilDB->in('qpl_questions.question_id', $this->questions, false, 'integer'));
3928 }
3929 while ($row = $ilDB->fetchAssoc($result)) {
3930 $result_array[$row["question_id"]] = $row;
3931 }
3932 return $result_array;
3933 }
loadQuestions($active_id="", $pass=null)
Load the test question id's from the database.
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
getActiveIdOfUser($user_id="", $anonymous_id="")
Gets the active id of a given user.

References $DIC, $ilDB, $ilUser, $pass, $result, _getPass(), getActiveIdOfUser(), isRandomTest(), and loadQuestions().

+ Here is the call graph for this function:

◆ getAllRTEContent()

ilObjTest::getAllRTEContent ( )

Returns the content of all RTE enabled text areas in the test.

@access private

Definition at line 1197 of file class.ilObjTest.php.

1198 {
1199 $result = array();
1200 array_push($result, $this->getIntroduction());
1201 array_push($result, $this->getFinalStatement());
1202 return $result;
1203 }

References $result, getFinalStatement(), and getIntroduction().

Referenced by cleanupMediaobjectUsage().

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

◆ getAllTestResults()

ilObjTest::getAllTestResults (   $participants,
  $prepareForCSV = true 
)

returns all test results for all participants

Parameters
array$partipantsarray of user ids
booleanif true, the result will be prepared for csv output (see processCSVRow)
Returns
array of fields, see code for column titles

Definition at line 7966 of file class.ilObjTest.php.

7967 {
7968 $results = array();
7969 $row = array(
7970 "user_id" => $this->lng->txt("user_id"),
7971 "matriculation" => $this->lng->txt("matriculation"),
7972 "lastname" => $this->lng->txt("lastname"),
7973 "firstname" => $this->lng->txt("firstname"),
7974 "login" => $this->lng->txt("login"),
7975 "reached_points" => $this->lng->txt("tst_reached_points"),
7976 "max_points" => $this->lng->txt("tst_maximum_points"),
7977 "percent_value" => $this->lng->txt("tst_percent_solved"),
7978 "mark" => $this->lng->txt("tst_mark"),
7979 "ects" => $this->lng->txt("ects_grade"),
7980 "passed" => $this->lng->txt("tst_mark_passed"),
7981 );
7982 $results[] = $row;
7983 if (count($participants)) {
7984 if ($this->getECTSOutput()) {
7985 $passed_array = &$this->getTotalPointsPassedArray();
7986 }
7987 foreach ($participants as $active_id => $user_rec) {
7988 $mark = $ects_mark = '';
7989 $row = array();
7990 $reached_points = 0;
7991 $max_points = 0;
7992 foreach ($this->questions as $value) {
7993 $question = &ilObjTest::_instanciateQuestion($value);
7994 if (is_object($question)) {
7995 $max_points += $question->getMaximumPoints();
7996 $reached_points += $question->getReachedPoints($active_id);
7997 }
7998 }
7999 if ($max_points > 0) {
8000 $percentvalue = $reached_points / $max_points;
8001 if ($percentvalue < 0) {
8002 $percentvalue = 0.0;
8003 }
8004 } else {
8005 $percentvalue = 0;
8006 }
8007 $mark_obj = $this->mark_schema->getMatchingMark($percentvalue * 100);
8008 $passed = "";
8009 if ($mark_obj) {
8010 $mark = $mark_obj->getOfficialName();
8011 if ($this->getECTSOutput()) {
8012 $ects_mark = $this->getECTSGrade($passed_array, $reached_points, $max_points);
8013 }
8014 }
8015 if ($this->getAnonymity()) {
8016 $user_rec['firstname'] = "";
8017 $user_rec['lastname'] = $this->lng->txt("anonymous");
8018 }
8019 $row = array(
8020 "user_id" => $user_rec['usr_id'],
8021 "matriculation" => $user_rec['matriculation'],
8022 "lastname" => $user_rec['lastname'],
8023 "firstname" => $user_rec['firstname'],
8024 "login" => $user_rec['login'],
8025 "reached_points" => $reached_points,
8026 "max_points" => $max_points,
8027 "percent_value" => $percentvalue,
8028 "mark" => $mark,
8029 "ects" => $ects_mark,
8030 "passed" => $user_rec['passed'] ? '1' : '0',
8031 );
8032 $results[] = $prepareForCSV ? $this->processCSVRow($row, true) : $row;
8033 }
8034 }
8035 return $results;
8036 }
& getTotalPointsPassedArray()
Returns an array with the total points of all users who passed the test This array could be used for ...
& processCSVRow($row, $quoteAll=false, $separator=";")
Processes an array as a CSV row and converts the array values to correct CSV values.
getECTSGrade($passed_array, $reached_points, $max_points)
{Returns the ECTS grade for a number of reached points.string The ECTS grade short description}

References $results, _instanciateQuestion(), getAnonymity(), getECTSGrade(), getECTSOutput(), getTotalPointsPassedArray(), and processCSVRow().

+ Here is the call graph for this function:

◆ getAnonymity()

ilObjTest::getAnonymity ( )

Returns the anonymity status of the test.

Returns
integer The value for the anonymity status (0 = personalized, 1 = anonymized) @access public

Definition at line 9374 of file class.ilObjTest.php.

9375 {
9376 return ($this->anonymity) ? 1 : 0;
9377 }

Referenced by addDefaults(), buildName(), evalTotalParticipantsArray(), evalTotalPersonsArray(), getAllTestResults(), getDetailedTestResults(), getEvaluationAdditionalFields(), getInvitedUsers(), getParticipants(), getTestParticipants(), getUserData(), isHighscoreAnon(), saveToDb(), toXML(), and userLookupFullName().

+ Here is the caller graph for this function:

◆ getAnsweredQuestionCount()

ilObjTest::getAnsweredQuestionCount (   $active_id,
  $pass = null 
)

Retrieves the number of answered questions for a given user in a given test.

Parameters
integer$user_idThe user id
integer$test_idThe test id
integer$passThe pass of the test (optional)
Returns
integer The number of answered questions @access public

Definition at line 8196 of file class.ilObjTest.php.

8197 {
8198 if ($this->isDynamicTest()) {
8199 global $DIC;
8200 $tree = $DIC['tree'];
8201 $ilDB = $DIC['ilDB'];
8202 $lng = $DIC['lng'];
8203 $refinery = $DIC['refinery'];
8204 $ilPluginAdmin = $DIC['ilPluginAdmin'];
8205
8206 require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
8207 $testSessionFactory = new ilTestSessionFactory($this);
8208 $testSession = $testSessionFactory->getSession($active_id);
8209
8210 require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
8211 $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $refinery, $ilPluginAdmin, $this);
8212 $testSequence = $testSequenceFactory->getSequenceByTestSession($testSession);
8213
8214 require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
8215 $dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this);
8216 $dynamicQuestionSetConfig->loadFromDb();
8217
8218 $testSequence->loadFromDb($dynamicQuestionSetConfig);
8219 $testSequence->loadQuestions($dynamicQuestionSetConfig, new ilTestDynamicQuestionSetFilterSelection());
8220
8221 return $testSequence->getTrackedQuestionCount();
8222 }
8223
8224 if ($this->isRandomTest()) {
8225 $this->loadQuestions($active_id, $pass);
8226 }
8227 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
8228 $workedthrough = 0;
8229 foreach ($this->questions as $value) {
8230 if (assQuestion::_isWorkedThrough($active_id, $value, $pass)) {
8231 $workedthrough += 1;
8232 }
8233 }
8234 return $workedthrough;
8235 }
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 ...
isDynamicTest()
Returns the fact wether this test is a dynamic question set test or not.

References $DIC, $ilDB, ilObject\$lng, $pass, $testSequence, $testSession, ilObject\$tree, assQuestion\_isWorkedThrough(), isDynamicTest(), isRandomTest(), and loadQuestions().

+ Here is the call graph for this function:

◆ getAnswerFeedback()

ilObjTest::getAnswerFeedback ( )

Returns 1 if generic answer feedback is activated.

Deprecated:
Use getGenericAnswerFeedback instead.
Returns
integer The status of the answer specific feedback @access public
See also
$answer_feedback

Definition at line 2453 of file class.ilObjTest.php.

2454 {
2455 return ($this->answer_feedback) ? $this->answer_feedback : 0;
2456 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getAnswerFeedbackPoints()

ilObjTest::getAnswerFeedbackPoints ( )

Returns 1 if answer specific feedback as reached points is activated.

Returns
integer The status of the answer specific feedback as reached points @access public
See also
$answer_feedback_points

Definition at line 2476 of file class.ilObjTest.php.

2477 {
2478 return ($this->answer_feedback_points) ? $this->answer_feedback_points : 0;
2479 }

Referenced by addDefaults(), getInstantFeedbackOptionsAsArray(), isAnyInstantFeedbackOptionEnabled(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getAuthor()

ilObjTest::getAuthor ( )

Gets the authors name of the ilObjTest object.

Returns
string The string containing the name of the test author @access public
See also
$author

Definition at line 6994 of file class.ilObjTest.php.

6995 {
6996 $author = array();
6997 include_once "./Services/MetaData/classes/class.ilMD.php";
6998 $md = new ilMD($this->getId(), 0, $this->getType());
6999 $md_life = &$md->getLifecycle();
7000 if ($md_life) {
7001 $ids = &$md_life->getContributeIds();
7002 foreach ($ids as $id) {
7003 $md_cont = &$md_life->getContribute($id);
7004 if (strcmp($md_cont->getRole(), "Author") == 0) {
7005 $entids = &$md_cont->getEntityIds();
7006 foreach ($entids as $entid) {
7007 $md_ent = &$md_cont->getEntity($entid);
7008 array_push($author, $md_ent->getEntity());
7009 }
7010 }
7011 }
7012 }
7013 return join(",", $author);
7014 }

References $author, ilObject\$id, ilObject\getId(), and ilObject\getType().

Referenced by loadFromDb(), saveToDb(), and toXML().

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

◆ getAutosave()

ilObjTest::getAutosave ( )

Definition at line 11506 of file class.ilObjTest.php.

11507 {
11508 return $this->autosave;
11509 }

References $autosave.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getAutosaveIval()

ilObjTest::getAutosaveIval ( )

Definition at line 11516 of file class.ilObjTest.php.

11517 {
11518 return $this->autosave_ival;
11519 }

References $autosave_ival.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getAvailableQuestionpools()

& ilObjTest::getAvailableQuestionpools (   $use_object_id = false,
  $equal_points = false,
  $could_be_offline = false,
  $show_path = false,
  $with_questioncount = false,
  $permission = "read" 
)

Returns the available question pools for the active user.

Returns
array The available question pools @access public

Definition at line 5378 of file class.ilObjTest.php.

5379 {
5380 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
5381 return ilObjQuestionPool::_getAvailableQuestionpools($use_object_id, $equal_points, $could_be_offline, $show_path, $with_questioncount, $permission);
5382 }
static _getAvailableQuestionpools($use_object_id=false, $equal_points=false, $could_be_offline=false, $showPath=false, $with_questioncount=false, $permission="read", $usr_id="")
Returns the available question pools for the active user.

References ilObjQuestionPool\_getAvailableQuestionpools().

+ Here is the call graph for this function:

◆ getAvailableQuestions()

ilObjTest::getAvailableQuestions (   $arrFilter,
  $completeonly = 0 
)

Calculates the available questions for a test.

@access public

Definition at line 5576 of file class.ilObjTest.php.

5577 {
5578 global $DIC;
5579 $pluginAdmin = $DIC['ilPluginAdmin'];
5580 $lng = $DIC['lng'];
5581 $ilUser = $DIC['ilUser'];
5582 $ilDB = $DIC['ilDB'];
5583
5584 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
5585 $available_pools = array_keys(ilObjQuestionPool::_getAvailableQuestionpools($use_object_id = true, $equal_points = false, $could_be_offline = false, $showPath = false, $with_questioncount = false));
5586 $available = "";
5587 if (count($available_pools)) {
5588 $available = " AND " . $ilDB->in('qpl_questions.obj_fi', $available_pools, false, 'integer');
5589 } else {
5590 return array();
5591 }
5592 if ($completeonly) {
5593 $available .= " AND qpl_questions.complete = " . $ilDB->quote("1", 'text');
5594 }
5595
5596 $where = "";
5597 if (is_array($arrFilter)) {
5598 if (array_key_exists('title', $arrFilter) && strlen($arrFilter['title'])) {
5599 $where .= " AND " . $ilDB->like('qpl_questions.title', 'text', "%%" . $arrFilter['title'] . "%%");
5600 }
5601 if (array_key_exists('description', $arrFilter) && strlen($arrFilter['description'])) {
5602 $where .= " AND " . $ilDB->like('qpl_questions.description', 'text', "%%" . $arrFilter['description'] . "%%");
5603 }
5604 if (array_key_exists('author', $arrFilter) && strlen($arrFilter['author'])) {
5605 $where .= " AND " . $ilDB->like('qpl_questions.author', 'text', "%%" . $arrFilter['author'] . "%%");
5606 }
5607 if (array_key_exists('type', $arrFilter) && strlen($arrFilter['type'])) {
5608 $where .= " AND qpl_qst_type.type_tag = " . $ilDB->quote($arrFilter['type'], 'text');
5609 }
5610 if (array_key_exists('qpl', $arrFilter) && strlen($arrFilter['qpl'])) {
5611 $where .= " AND " . $ilDB->like('object_data.title', 'text', "%%" . $arrFilter['qpl'] . "%%");
5612 }
5613 }
5614
5615 $original_ids = &$this->getExistingQuestions();
5616 $original_clause = " qpl_questions.original_id IS NULL";
5617 if (count($original_ids)) {
5618 $original_clause = " qpl_questions.original_id IS NULL AND " . $ilDB->in('qpl_questions.question_id', $original_ids, true, 'integer');
5619 }
5620
5621 $query_result = $ilDB->query("
5622 SELECT qpl_questions.*, qpl_questions.tstamp,
5623 qpl_qst_type.type_tag, qpl_qst_type.plugin, qpl_qst_type.plugin_name,
5624 object_data.title parent_title
5625 FROM qpl_questions, qpl_qst_type, object_data
5626 WHERE $original_clause $available
5627 AND object_data.obj_id = qpl_questions.obj_fi
5628 AND qpl_questions.tstamp > 0
5629 AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id
5630 $where
5631 ");
5632 $rows = array();
5633 $types = $this->getQuestionTypeTranslations();
5634 if ($query_result->numRows()) {
5635 while ($row = $ilDB->fetchAssoc($query_result)) {
5637
5638 if (!$row['plugin']) {
5639 $row[ 'ttype' ] = $lng->txt($row[ "type_tag" ]);
5640
5641 $rows[] = $row;
5642 continue;
5643 }
5644
5645 if (!$pluginAdmin->isActive(IL_COMP_MODULE, 'TestQuestionPool', 'qst', $row['plugin_name'])) {
5646 continue;
5647 }
5648
5649 $pl = ilPlugin::getPluginObject(IL_COMP_MODULE, 'TestQuestionPool', 'qst', $row['plugin_name']);
5650 $row[ 'ttype' ] = $pl->getQuestionTypeTranslation();
5651
5652 $rows[] = $row;
5653 }
5654 }
5655 return $rows;
5656 }
const IL_COMP_MODULE
static completeMissingPluginName($questionTypeData)
& getExistingQuestions($pass=null)
Get the id's of the questions which are already part of the test.
static getPluginObject(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
$rows
Definition: xhr_table.php:10

References $DIC, $ilDB, $ilUser, ilObject\$lng, $rows, ilObjQuestionPool\_getAvailableQuestionpools(), ilAssQuestionType\completeMissingPluginName(), getExistingQuestions(), ilPlugin\getPluginObject(), and IL_COMP_MODULE.

+ Here is the call graph for this function:

◆ getCertificateVisibility()

ilObjTest::getCertificateVisibility ( )

Returns the visibility settings of the certificate.

Returns
integer The value for the visibility settings (0 = always, 1 = only passed, 2 = never) @access public

Definition at line 9352 of file class.ilObjTest.php.

9353 {
9354 return (strlen($this->certificate_visibility)) ? $this->certificate_visibility : 0;
9355 }

Referenced by canShowCertificate(), and saveToDb().

+ Here is the caller graph for this function:

◆ getCharSelectorAvailability()

ilObjTest::getCharSelectorAvailability ( )
Returns
int availability of the special character selector

Definition at line 11858 of file class.ilObjTest.php.

11859 {
11861 }

References $char_selector_availability.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getCharSelectorDefinition()

ilObjTest::getCharSelectorDefinition ( )
Returns
string definition of the special character selector

Definition at line 11874 of file class.ilObjTest.php.

11875 {
11877 }

References $char_selector_definition.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getCompleteEvaluationData()

& ilObjTest::getCompleteEvaluationData (   $withStatistics = true,
  $filterby = "",
  $filtertext = "" 
)

Definition at line 5153 of file class.ilObjTest.php.

5154 {
5155 include_once "./Modules/Test/classes/class.ilTestEvaluationData.php";
5156 include_once "./Modules/Test/classes/class.ilTestEvaluationPassData.php";
5157 include_once "./Modules/Test/classes/class.ilTestEvaluationUserData.php";
5158 $data = $this->getUnfilteredEvaluationData();
5159 if ($withStatistics) {
5160 $data->calculateStatistics();
5161 }
5162 $data->setFilter($filterby, $filtertext);
5163 return $data;
5164 }

References $data.

Referenced by getAggregatedResultsData().

+ Here is the caller graph for this function:

◆ getCompleteManualFeedback()

static ilObjTest::getCompleteManualFeedback ( int  $question_id)
static

Retrieves the manual feedback for a question in a test.

Parameters
integer$question_idQuestion ID
Returns
array The feedback text @access public

Definition at line 10107 of file class.ilObjTest.php.

10108 {
10109 global $DIC;
10110
10111 $ilDB = $DIC->database();
10112 $feedback = array();
10113 $result = $ilDB->queryF(
10114 "SELECT * FROM tst_manual_fb WHERE question_fi = %s",
10115 array('integer'),
10116 array($question_id)
10117 );
10118
10119 while ($row = $ilDB->fetchAssoc($result)) {
10120 $active = $row['active_fi'];
10121 $pass = $row['pass'];
10122 $question = $row['question_fi'];
10123
10124 $row['feedback'] = ilRTE::_replaceMediaObjectImageSrc($row['feedback'], 1);
10125
10126 $feedback[$active][$pass][$question] = $row;
10127 }
10128
10129 return $feedback;
10130 }

References $DIC, $ilDB, $pass, $result, and ilRTE\_replaceMediaObjectImageSrc().

+ Here is the call graph for this function:

◆ getCompleteWorkingTime()

ilObjTest::getCompleteWorkingTime (   $user_id)

Returns the complete working time in seconds a user worked on the test.

Returns
integer The working time in seconds @access public

Definition at line 4274 of file class.ilObjTest.php.

4275 {
4276 global $DIC;
4277 $ilDB = $DIC['ilDB'];
4278
4279 $result = $ilDB->queryF(
4280 "SELECT tst_times.* FROM tst_active, tst_times WHERE tst_active.test_fi = %s AND tst_active.active_id = tst_times.active_fi AND tst_active.user_fi = %s",
4281 array('integer','integer'),
4282 array($this->getTestId(), $user_id)
4283 );
4284 $time = 0;
4285 while ($row = $ilDB->fetchAssoc($result)) {
4286 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
4287 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4288 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4289 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4290 $time += ($epoch_2 - $epoch_1);
4291 }
4292 return $time;
4293 }

References $DIC, $ilDB, $result, and getTestId().

+ Here is the call graph for this function:

◆ getCompleteWorkingTimeOfParticipant()

ilObjTest::getCompleteWorkingTimeOfParticipant (   $active_id)

Returns the complete working time in seconds for a test participant.

Returns
integer The working time in seconds for the test participant @access public

Definition at line 4344 of file class.ilObjTest.php.

4345 {
4346 global $DIC;
4347 $ilDB = $DIC['ilDB'];
4348
4349 $result = $ilDB->queryF(
4350 "SELECT tst_times.* FROM tst_active, tst_times WHERE tst_active.test_fi = %s AND tst_active.active_id = tst_times.active_fi AND tst_active.active_id = %s ORDER BY tst_times.active_fi, tst_times.started",
4351 array('integer','integer'),
4352 array($this->getTestId(), $active_id)
4353 );
4354 $time = 0;
4355 while ($row = $ilDB->fetchAssoc($result)) {
4356 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
4357 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4358 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4359 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4360 $time += ($epoch_2 - $epoch_1);
4361 }
4362 return $time;
4363 }

References $DIC, $ilDB, $result, and getTestId().

+ Here is the call graph for this function:

◆ getCompleteWorkingTimeOfParticipants()

& ilObjTest::getCompleteWorkingTimeOfParticipants ( )

Returns the complete working time in seconds for all test participants.

Returns
array An array containing the working time in seconds for all test participants @access public

Definition at line 4301 of file class.ilObjTest.php.

4302 {
4303 return $this->_getCompleteWorkingTimeOfParticipants($this->getTestId());
4304 }
& _getCompleteWorkingTimeOfParticipants($test_id)
Returns the complete working time in seconds for all test participants.

References _getCompleteWorkingTimeOfParticipants(), and getTestId().

+ Here is the call graph for this function:

◆ getCountSystem()

ilObjTest::getCountSystem ( )

Gets the count system for the calculation of points.

Returns
integer The count system for the calculation of points @access public
See also
$count_system

Definition at line 2488 of file class.ilObjTest.php.

2489 {
2490 return ($this->count_system) ? $this->count_system : 0;
2491 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getCustomStyle()

ilObjTest::getCustomStyle ( )

Get the custom style.

Returns
mixed The custom style, NULL if empty @access public
See also
$_customStyle

Definition at line 2137 of file class.ilObjTest.php.

2138 {
2139 return (strlen($this->_customStyle)) ? $this->_customStyle : null;
2140 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getDataWebPath()

static ilObjTest::getDataWebPath ( string  $relative_path = '')
static

This is originally a fix for https://mantis.ilias.de/view.php?id=35707; in general, the handling of those pathes shold be improved or better, avoided entirely (e.g.

with the IRSS).

Definition at line 12320 of file class.ilObjTest.php.

12320 : string
12321 {
12322 $webdir = implode('/', [
12323 ILIAS_HTTP_PATH,
12325 CLIENT_ID,
12326 $relative_path
12327 ]);
12328 $parts = array_filter(explode('/', $webdir), function ($p) {
12329 return trim($p) != '' && trim($p) != '.';
12330 });
12331 return array_shift($parts) . '//' . implode('/', $parts) . '/';
12332 }
const CLIENT_ID
Definition: constants.php:39
const ILIAS_WEB_DIR
Definition: constants.php:43

References CLIENT_ID, and ILIAS_WEB_DIR.

Referenced by assQuestion\getFlashPathWeb(), getImagePathWeb(), assQuestion\getImagePathWeb(), assQuestion\getJavaPathWeb(), and assQuestion\getSuggestedSolutionPathWeb().

+ Here is the caller graph for this function:

◆ getDetailedTestResults()

ilObjTest::getDetailedTestResults (   $participants)

returns all test results for all participants

Parameters
array$partipantsarray of user ids
booleanif true, the result will be prepared for csv output (see processCSVRow)
Returns
array of fields, see code for column titles

Definition at line 10283 of file class.ilObjTest.php.

10284 {
10285 $results = array();
10286 if (count($participants)) {
10287 foreach ($participants as $active_id => $user_rec) {
10288 $row = array();
10289 $reached_points = 0;
10290 $max_points = 0;
10291 foreach ($this->questions as $value) {
10292 $question = &ilObjTest::_instanciateQuestion($value);
10293 if (is_object($question)) {
10294 $max_points += $question->getMaximumPoints();
10295 $reached_points += $question->getReachedPoints($active_id);
10296 if ($max_points > 0) {
10297 $percentvalue = $reached_points / $max_points;
10298 if ($percentvalue < 0) {
10299 $percentvalue = 0.0;
10300 }
10301 } else {
10302 $percentvalue = 0;
10303 }
10304 if ($this->getAnonymity()) {
10305 $user_rec['firstname'] = "";
10306 $user_rec['lastname'] = $this->lng->txt("anonymous");
10307 }
10308 $row = array(
10309 "user_id" => $user_rec['usr_id'],
10310 "matriculation" => $user_rec['matriculation'],
10311 "lastname" => $user_rec['lastname'],
10312 "firstname" => $user_rec['firstname'],
10313 "login" => $user_rec['login'],
10314 "question_id" => $question->getId(),
10315 "question_title" => $question->getTitle(),
10316 "reached_points" => $reached_points,
10317 "max_points" => $max_points,
10318 "passed" => $user_rec['passed'] ? '1' : '0',
10319 );
10320 $results[] = $row;
10321 }
10322 }
10323 }
10324 }
10325 return $results;
10326 }

References $results, _instanciateQuestion(), and getAnonymity().

+ Here is the call graph for this function:

◆ getECTSFX()

ilObjTest::getECTSFX ( )

{

Returns
float|null
}

Implements ilEctsGradesEnabled.

Definition at line 2233 of file class.ilObjTest.php.

2234 {
2235 return (strlen($this->ects_fx)) ? $this->ects_fx : null;
2236 }

Referenced by addDefaults(), and saveToDb().

+ Here is the caller graph for this function:

◆ getECTSGrade()

ilObjTest::getECTSGrade (   $passed_array,
  $reached_points,
  $max_points 
)

{Returns the ECTS grade for a number of reached points.

Parameters
array$passed_arrayAn array with the points of all users who passed the test
double$reached_pointsThe points reached in the test
double$max_pointsThe maximum number of points for the test
Returns
string The ECTS grade short description
}

Implements ilEctsGradesEnabled.

Definition at line 6814 of file class.ilObjTest.php.

6815 {
6816 return self::_getECTSGrade($passed_array, $reached_points, $max_points, $this->ects_grades["A"], $this->ects_grades["B"], $this->ects_grades["C"], $this->ects_grades["D"], $this->ects_grades["E"], $this->ects_fx);
6817 }
static _getECTSGrade($points_passed, $reached_points, $max_points, $a, $b, $c, $d, $e, $fx)
{Returns the ECTS grade for a number of reached points.string The ECTS grade short description}

References _getECTSGrade().

Referenced by getAllTestResults().

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

◆ getECTSGrades()

ilObjTest::getECTSGrades ( )

{

Returns
array
}

Implements ilEctsGradesEnabled.

Definition at line 2249 of file class.ilObjTest.php.

2250 {
2251 return $this->ects_grades;
2252 }

References $ects_grades.

Referenced by addDefaults().

+ Here is the caller graph for this function:

◆ getECTSOutput()

ilObjTest::getECTSOutput ( )

{

Returns
int|bool
}

Implements ilEctsGradesEnabled.

Definition at line 2217 of file class.ilObjTest.php.

2218 {
2219 return ($this->ects_output) ? 1 : 0;
2220 }

Referenced by addDefaults(), getAllTestResults(), and saveToDb().

+ Here is the caller graph for this function:

◆ getEnableArchiving()

ilObjTest::getEnableArchiving ( )
Returns
boolean

Definition at line 11734 of file class.ilObjTest.php.

11735 {
11737 }

References $enable_archiving.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getEnabledViewMode()

ilObjTest::getEnabledViewMode ( )

Definition at line 10724 of file class.ilObjTest.php.

10725 {
10726 return $this->enabled_view_mode;
10727 }

Referenced by saveToDb().

+ Here is the caller graph for this function:

◆ getEnableExamview()

ilObjTest::getEnableExamview ( )
Returns
boolean

Definition at line 11585 of file class.ilObjTest.php.

11586 {
11588 }

References $enable_examview.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getEnableProcessingTime()

ilObjTest::getEnableProcessingTime ( )

Returns the state of the processing time (enabled/disabled)

Returns
integer The processing time state (0 for disabled, 1 for enabled) @access public
See also
$processing_time

Definition at line 2970 of file class.ilObjTest.php.

2971 {
2972 return ($this->enable_processing_time) ? $this->enable_processing_time : 0;
2973 }

Referenced by addDefaults(), isExecutable(), isMaxProcessingTimeReached(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getEndingTime()

ilObjTest::getEndingTime ( )

Returns the ending time of the test.

Returns
string The ending time of the test @access public
See also
$ending_time

Definition at line 3050 of file class.ilObjTest.php.

3051 {
3052 return ($this->ending_time != 0) ? $this->ending_time : 0;
3053 }

Referenced by addDefaults(), endingTimeReached(), getSecondsUntilEndingTime(), isExecutable(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getEstimatedWorkingTime()

ilObjTest::getEstimatedWorkingTime ( )

Returns the estimated working time for the test calculated from the working time of the contained questions.

Returns
array An associative array containing the working time. array["h"] = hours, array["m"] = minutes, array["s"] = seconds @access public

Definition at line 5390 of file class.ilObjTest.php.

5391 {
5392 $time_in_seconds = 0;
5393 foreach ($this->questions as $question_id) {
5394 $question = &ilObjTest::_instanciateQuestion($question_id);
5395 $est_time = $question->getEstimatedWorkingTime();
5396 $time_in_seconds += $est_time["h"] * 3600 + $est_time["m"] * 60 + $est_time["s"];
5397 }
5398 $hours = (int) ($time_in_seconds / 3600) ;
5399 $time_in_seconds = $time_in_seconds - ($hours * 3600);
5400 $minutes = (int) ($time_in_seconds / 60);
5401 $time_in_seconds = $time_in_seconds - ($minutes * 60);
5402 $result = array("hh" => $hours, "mm" => $minutes, "ss" => $time_in_seconds);
5403 return $result;
5404 }

References $result, and _instanciateQuestion().

Referenced by getProcessingTimeAsArray().

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

◆ getEvaluationAdditionalFields()

ilObjTest::getEvaluationAdditionalFields ( )

Gets additional user fields that should be shown in the user evaluation.

Returns
array An array containing the database fields that should be shown in the evaluation

Definition at line 10587 of file class.ilObjTest.php.

10588 {
10589 include_once "./Modules/Test/classes/class.ilObjTestGUI.php";
10590 include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
10591 $table_gui = new ilEvaluationAllTableGUI(new ilObjTestGUI($this->getRefId()), 'outEvaluation', $this->getAnonymity());
10592 return $table_gui->getSelectedColumns();
10593 }
TableGUI class for evaluation of all users.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References getAnonymity(), and ilObject\getRefId().

+ Here is the call graph for this function:

◆ getExistingQuestions()

& ilObjTest::getExistingQuestions (   $pass = null)

Get the id's of the questions which are already part of the test.

Returns
array An array containing the already existing questions @access public

Definition at line 3750 of file class.ilObjTest.php.

3751 {
3752 global $DIC;
3753 $ilUser = $DIC['ilUser'];
3754 $ilDB = $DIC['ilDB'];
3755
3756 $existing_questions = array();
3757 $active_id = $this->getActiveIdOfUser($ilUser->getId());
3758 if ($this->isRandomTest()) {
3759 if (is_null($pass)) {
3760 $pass = 0;
3761 }
3762 $result = $ilDB->queryF(
3763 "SELECT qpl_questions.original_id FROM qpl_questions, tst_test_rnd_qst WHERE tst_test_rnd_qst.active_fi = %s AND tst_test_rnd_qst.question_fi = qpl_questions.question_id AND tst_test_rnd_qst.pass = %s",
3764 array('integer','integer'),
3765 array($active_id, $pass)
3766 );
3767 } else {
3768 $result = $ilDB->queryF(
3769 "SELECT qpl_questions.original_id FROM qpl_questions, tst_test_question WHERE tst_test_question.test_fi = %s AND tst_test_question.question_fi = qpl_questions.question_id",
3770 array('integer'),
3771 array($this->getTestId())
3772 );
3773 }
3774 while ($data = $ilDB->fetchObject($result)) {
3775 if ($data->original_id === null) {
3776 continue;
3777 }
3778
3779 array_push($existing_questions, $data->original_id);
3780 }
3781 return $existing_questions;
3782 }

References $data, $DIC, $ilDB, $ilUser, $pass, $result, getActiveIdOfUser(), getTestId(), and isRandomTest().

Referenced by getAvailableQuestions().

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

◆ getExportDirectory()

ilObjTest::getExportDirectory ( )

Get the location of the export directory for the test.

@access public

Definition at line 905 of file class.ilObjTest.php.

906 {
907 include_once "./Services/Utilities/classes/class.ilUtil.php";
908 $export_dir = ilUtil::getDataDir() . "/tst_data" . "/tst_" . $this->getId() . "/export";
909 return $export_dir;
910 }

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

+ Here is the call graph for this function:

◆ getExportSettings()

ilObjTest::getExportSettings ( )

Definition at line 10686 of file class.ilObjTest.php.

10687 {
10688 if ($this->exportsettings) {
10689 return $this->exportsettings;
10690 } else {
10691 return 0;
10692 }
10693 }

References $exportsettings.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getExportSettingsSingleChoiceShort()

ilObjTest::getExportSettingsSingleChoiceShort ( )

Definition at line 10704 of file class.ilObjTest.php.

10705 {
10706 if (($this->exportsettings & 1) > 0) {
10707 return true;
10708 } else {
10709 return false;
10710 }
10711 }

Referenced by setExportSettingsSingleChoiceShort().

+ Here is the caller graph for this function:

◆ getExtraTime()

ilObjTest::getExtraTime (   $active_id)

Definition at line 11652 of file class.ilObjTest.php.

11653 {
11654 global $DIC;
11655 $ilDB = $DIC['ilDB'];
11656
11657 $result = $ilDB->queryF(
11658 "SELECT additionaltime FROM tst_addtime WHERE active_fi = %s",
11659 array('integer'),
11660 array($active_id)
11661 );
11662 if ($result->numRows() > 0) {
11663 $row = $ilDB->fetchAssoc($result);
11664 return $row['additionaltime'];
11665 }
11666 return 0;
11667 }

References $DIC, $ilDB, and $result.

Referenced by getProcessingTimeInSeconds().

+ Here is the caller graph for this function:

◆ getFinalStatement()

ilObjTest::getFinalStatement ( )

Gets the final statement.

Returns
mixed The final statement, NULL if empty
See also
$_finalstatement

Definition at line 2161 of file class.ilObjTest.php.

2162 {
2163 return (strlen($this->_finalstatement)) ? $this->_finalstatement : null;
2164 }

Referenced by addDefaults(), getAllRTEContent(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getFixedParticipants()

ilObjTest::getFixedParticipants ( )

Returns the fixed participants status.

Returns
integer The value for the fixed participants status (0 = don't allow, 1 = allow) @access public

Definition at line 9461 of file class.ilObjTest.php.

9462 {
9463 return ($this->fixed_participants) ? 1 : 0;
9464 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getFixedQuestionSetTotalPoints()

ilObjTest::getFixedQuestionSetTotalPoints ( )
Returns
float

Definition at line 8545 of file class.ilObjTest.php.

8546 {
8547 $points = 0;
8548
8549 foreach ($this->getTestQuestions() as $questionData) {
8550 $points += $questionData['points'];
8551 }
8552
8553 return $points;
8554 }

References getTestQuestions().

+ Here is the call graph for this function:

◆ getFixedQuestionSetTotalWorkingTime()

ilObjTest::getFixedQuestionSetTotalWorkingTime ( )
Returns
string

Definition at line 8559 of file class.ilObjTest.php.

8560 {
8561 $totalWorkingTime = '00:00:00';
8562
8563 foreach ($this->getTestQuestions() as $questionData) {
8565 $totalWorkingTime,
8566 $questionData['working_time']
8567 );
8568 }
8569
8570 return $totalWorkingTime;
8571 }
static sumTimesInISO8601FormatH_i_s_Extended($time1, $time2)

References getTestQuestions(), and assQuestion\sumTimesInISO8601FormatH_i_s_Extended().

+ Here is the call graph for this function:

◆ getForceJS()

ilObjTest::getForceJS ( )

Gets whether JavaScript should be forced for tests.

Returns
integer 1 to force JavaScript, 0 otherwise @access public
See also
$_forcejs

Definition at line 2185 of file class.ilObjTest.php.

2186 {
2187 return ($this->_forcejs) ? 1 : 0;
2188 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getGenericAnswerFeedback()

ilObjTest::getGenericAnswerFeedback ( )

Returns 1 if generic answer feedback is to be shown.

Returns
integer 1, if answer specific feedback is to be shown. @access public

Definition at line 2464 of file class.ilObjTest.php.

2465 {
2466 return ($this->answer_feedback) ? $this->answer_feedback : 0;
2467 }

Referenced by getInstantFeedbackOptionsAsArray(), isAnyInstantFeedbackOptionEnabled(), and saveToDb().

+ Here is the caller graph for this function:

◆ getGroupData()

& ilObjTest::getGroupData (   $ids)

Definition at line 7734 of file class.ilObjTest.php.

7735 {
7736 if (!is_array($ids) || count($ids) == 0) {
7737 return array();
7738 }
7739 $result = array();
7740 foreach ($ids as $ref_id) {
7742 $result[$ref_id] = array("ref_id" => $ref_id, "title" => ilObject::_lookupTitle($obj_id), "description" => ilObject::_lookupDescription($obj_id));
7743 }
7744 return $result;
7745 }
static _lookupTitle($a_id)
lookup object title
static _lookupDescription($a_id)
lookup object description

References ilObject\$ref_id, $result, ilObject\_lookupDescription(), ilObject\_lookupObjId(), and ilObject\_lookupTitle().

+ Here is the call graph for this function:

◆ getHighscoreAchievedTS()

ilObjTest::getHighscoreAchievedTS ( )

Returns if date and time of the scores achievement should be displayed.

Returns
bool True, if column should be shown.

Definition at line 11164 of file class.ilObjTest.php.

11165 {
11166 return (bool) $this->_highscore_achieved_ts;
11167 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getHighscoreAnon()

ilObjTest::getHighscoreAnon ( )

Gets if the highscores should be anonymized per setting.

Note: This method will retrieve the setting as set by the user. If you want to figure out, if the highscore is to be shown anonymized or not, with consideration of the global anon switch you should

See also
isHighscoreAnon().
Returns
bool True, if setting is to anonymize highscores.

Definition at line 11127 of file class.ilObjTest.php.

11128 {
11129 return (bool) $this->_highscore_anon;
11130 }

Referenced by addDefaults(), isHighscoreAnon(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getHighscoreEnabled()

ilObjTest::getHighscoreEnabled ( )

Gets the setting which determines if the highscore feature is enabled.

Returns
bool True, if highscore is enabled.

Definition at line 11101 of file class.ilObjTest.php.

11102 {
11103 return (bool) $this->_highscore_enabled;
11104 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getHighscoreHints()

ilObjTest::getHighscoreHints ( )

Gets, if the column with the number of requested hints should be shown.

Returns
bool True, if the hints-column should be shown.

Definition at line 11224 of file class.ilObjTest.php.

11225 {
11226 return (bool) $this->_highscore_hints;
11227 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getHighscoreMode()

ilObjTest::getHighscoreMode ( )
Returns
int

Definition at line 11321 of file class.ilObjTest.php.

11322 {
11323 switch (true) {
11324 case $this->getHighscoreOwnTable() && $this->getHighscoreTopTable():
11325 return self::HIGHSCORE_SHOW_ALL_TABLES;
11326 break;
11327
11328 case $this->getHighscoreTopTable():
11329 return self::HIGHSCORE_SHOW_TOP_TABLE;
11330 break;
11331
11332 case $this->getHighscoreOwnTable():
11333 default:
11334 return self::HIGHSCORE_SHOW_OWN_TABLE;
11335 break;
11336 }
11337 }
const HIGHSCORE_SHOW_ALL_TABLES
const HIGHSCORE_SHOW_OWN_TABLE
const HIGHSCORE_SHOW_TOP_TABLE

References getHighscoreOwnTable(), getHighscoreTopTable(), HIGHSCORE_SHOW_ALL_TABLES, HIGHSCORE_SHOW_OWN_TABLE, and HIGHSCORE_SHOW_TOP_TABLE.

+ Here is the call graph for this function:

◆ getHighscoreOwnTable()

ilObjTest::getHighscoreOwnTable ( )

Gets if the own rankings table should be shown.

Returns
bool True, if the own rankings table should be shown.

Definition at line 11264 of file class.ilObjTest.php.

11265 {
11266 return (bool) $this->_highscore_own_table;
11267 }

Referenced by addDefaults(), getHighscoreMode(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getHighscorePercentage()

ilObjTest::getHighscorePercentage ( )

Gets if the percentage column should be shown.

Returns
bool True, if percentage column should be shown.

Definition at line 11204 of file class.ilObjTest.php.

11205 {
11206 return (bool) $this->_highscore_percentage;
11207 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getHighscoreScore()

ilObjTest::getHighscoreScore ( )

Gets if the score column should be shown.

Returns
bool True, if score column should be shown.

Definition at line 11184 of file class.ilObjTest.php.

11185 {
11186 return (bool) $this->_highscore_score;
11187 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getHighscoreTopNum()

ilObjTest::getHighscoreTopNum (   $a_retval = 10)

Gets the number of entries which are to be shown in the top-rankings table.

Default: 10 entries

Parameters
integer$a_retvalOptional return value if nothing is set, defaults to 10.
Returns
integer Number of entries to be shown in the top-rankings table.

Definition at line 11308 of file class.ilObjTest.php.

11309 {
11310 $retval = $a_retval;
11311 if ((int) $this->_highscore_top_num != 0) {
11312 $retval = $this->_highscore_top_num;
11313 }
11314
11315 return $retval;
11316 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getHighscoreTopTable()

ilObjTest::getHighscoreTopTable ( )

Gets, if the top-rankings table should be shown.

Returns
bool True, if top-rankings table should be shown.

Definition at line 11284 of file class.ilObjTest.php.

11285 {
11286 return (bool) $this->_highscore_top_table;
11287 }

Referenced by addDefaults(), getHighscoreMode(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getHighscoreWTime()

ilObjTest::getHighscoreWTime ( )

Gets if the column with the workingtime should be shown.

Returns
bool True, if the workingtime column should be shown.

Definition at line 11244 of file class.ilObjTest.php.

11245 {
11246 return (bool) $this->_highscore_wtime;
11247 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getHtmlQuestionContentPurifier()

ilObjTest::getHtmlQuestionContentPurifier ( )
protected

Definition at line 12310 of file class.ilObjTest.php.

12311 {
12312 return ilHtmlPurifierFactory::_getInstanceByType('qpl_usersolution');
12313 }
static _getInstanceByType(string $type)
Factory method for creating purifier instances.

References ilHtmlPurifierFactory\_getInstanceByType().

Referenced by setFinalStatement(), and setIntroduction().

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

◆ getImagePath()

ilObjTest::getImagePath ( )

Returns the image path for web accessable images of a test The image path is under the CLIENT_WEB_DIR in assessment/REFERENCE_ID_OF_TEST/images.

@access public

Definition at line 5412 of file class.ilObjTest.php.

5413 {
5414 return CLIENT_WEB_DIR . "/assessment/" . $this->getId() . "/images/";
5415 }
const CLIENT_WEB_DIR
Definition: constants.php:45

References CLIENT_WEB_DIR, and ilObject\getId().

+ Here is the call graph for this function:

◆ getImagePathWeb()

ilObjTest::getImagePathWeb ( )

Returns the web image path for web accessable images of a test The image path is under the web accessable data dir in assessment/REFERENCE_ID_OF_TEST/images.

@access public

Definition at line 5423 of file class.ilObjTest.php.

5424 {
5425 $relative_path = "/assessment/" . $this->getId() . "/images/";
5426 return self::getDataWebPath($relative_path);
5427 }
static getDataWebPath(string $relative_path='')
This is originally a fix for https://mantis.ilias.de/view.php?id=35707; in general,...

References getDataWebPath(), and ilObject\getId().

+ Here is the call graph for this function:

◆ getImportDirectory()

ilObjTest::getImportDirectory ( )

Definition at line 968 of file class.ilObjTest.php.

969 {
971 }

References _getImportDirectory().

+ Here is the call graph for this function:

◆ getImportMapping()

ilObjTest::getImportMapping ( )

get array of (two) new created questions for import id

Definition at line 6786 of file class.ilObjTest.php.

6787 {
6788 if (!is_array($this->import_mapping)) {
6789 return array();
6790 } else {
6791 return $this->import_mapping;
6792 }
6793 }

◆ getInstantFeedbackOptionsAsArray()

ilObjTest::getInstantFeedbackOptionsAsArray ( )

Definition at line 10797 of file class.ilObjTest.php.

10798 {
10799 $values = array();
10800
10801 if ($this->getSpecificAnswerFeedback()) {
10802 $values[] = 'instant_feedback_specific';
10803 }
10804 if ($this->getGenericAnswerFeedback()) {
10805 $values[] = 'instant_feedback_generic';
10806 }
10807 if ($this->getAnswerFeedbackPoints()) {
10808 $values[] = 'instant_feedback_points';
10809 }
10810 if ($this->getInstantFeedbackSolution()) {
10811 $values[] = 'instant_feedback_solution';
10812 }
10813
10814 return $values;
10815 }
getGenericAnswerFeedback()
Returns 1 if generic answer feedback is to be shown.

References getAnswerFeedbackPoints(), getGenericAnswerFeedback(), getInstantFeedbackSolution(), and getSpecificAnswerFeedback().

+ Here is the call graph for this function:

◆ getInstantFeedbackSolution()

ilObjTest::getInstantFeedbackSolution ( )

Returns 1 if the correct solution will be shown after answering a question.

Returns
integer The status of the solution instant feedback @access public
See also
$instant_verification

Definition at line 2440 of file class.ilObjTest.php.

2441 {
2442 return ($this->instant_verification) ? $this->instant_verification : 0;
2443 }

Referenced by addDefaults(), getInstantFeedbackOptionsAsArray(), isAnyInstantFeedbackOptionEnabled(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getIntroduction()

ilObjTest::getIntroduction ( )

Gets the introduction text of the ilObjTest object.

Returns
mixed The introduction text of the test, NULL if empty
See also
$introduction

Definition at line 2058 of file class.ilObjTest.php.

2059 {
2060 return (strlen($this->introduction)) ? $this->introduction : null;
2061 }

Referenced by addDefaults(), getAllRTEContent(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getInvitedParticipantList()

ilObjTest::getInvitedParticipantList ( )
Returns
ilTestParticipantList

Definition at line 7435 of file class.ilObjTest.php.

7436 {
7437 require_once 'Modules/Test/classes/class.ilTestParticipantList.php';
7438 $participantList = new ilTestParticipantList($this);
7439 $participantList->initializeFromDbRows($this->getInvitedUsers());
7440
7441 return $participantList;
7442 }
& getInvitedUsers($user_id="", $order="login, lastname, firstname")
Returns a list of all invited users in a test.

References getInvitedUsers().

+ Here is the call graph for this function:

◆ getInvitedUsers()

& ilObjTest::getInvitedUsers (   $user_id = "",
  $order = "login, lastname, firstname" 
)

Returns a list of all invited users in a test.

Returns
array array of invited users @access public

Definition at line 7462 of file class.ilObjTest.php.

7463 {
7464 global $DIC;
7465 $ilDB = $DIC['ilDB'];
7466
7467 $result_array = array();
7468
7469 if ($this->getAnonymity()) {
7470 if (is_numeric($user_id)) {
7471 $result = $ilDB->queryF(
7472 "SELECT tst_active.active_id, tst_active.tries, usr_id, %s login, %s lastname, %s firstname, tst_invited_user.clientip, " .
7473 "tst_active.submitted test_finished, matriculation, COALESCE(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass unfinished_passes FROM usr_data, tst_invited_user " .
7474 "LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
7475 "WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id AND usr_data.usr_id=%s " .
7476 "ORDER BY $order",
7477 array('text', 'text', 'text', 'integer', 'integer'),
7478 array("", $this->lng->txt("anonymous"), "", $this->getTestId(), $user_id)
7479 );
7480 } else {
7481 $result = $ilDB->queryF(
7482 "SELECT tst_active.active_id, usr_id, %s login, %s lastname, %s firstname, tst_invited_user.clientip, " .
7483 "tst_active.submitted test_finished, matriculation, COALESCE(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass unfinished_passes FROM usr_data, tst_invited_user " .
7484 "LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
7485 "WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id " .
7486 "ORDER BY $order",
7487 array('text', 'text', 'text', 'integer'),
7488 array("", $this->lng->txt("anonymous"), "", $this->getTestId())
7489 );
7490 }
7491 } else {
7492 if (is_numeric($user_id)) {
7493 $result = $ilDB->queryF(
7494 "SELECT tst_active.active_id, tst_active.tries, usr_id, login, lastname, firstname, tst_invited_user.clientip, " .
7495 "tst_active.submitted test_finished, matriculation, COALESCE(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass unfinished_passes FROM usr_data, tst_invited_user " .
7496 "LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
7497 "WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id AND usr_data.usr_id=%s " .
7498 "ORDER BY $order",
7499 array('integer', 'integer'),
7500 array($this->getTestId(), $user_id)
7501 );
7502 } else {
7503 $result = $ilDB->queryF(
7504 "SELECT tst_active.active_id, tst_active.tries, usr_id, login, lastname, firstname, tst_invited_user.clientip, " .
7505 "tst_active.submitted test_finished, matriculation, COALESCE(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass unfinished_passes FROM usr_data, tst_invited_user " .
7506 "LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
7507 "WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id " .
7508 "ORDER BY $order",
7509 array('integer'),
7510 array($this->getTestId())
7511 );
7512 }
7513 }
7514 $result_array = array();
7515 while ($row = $ilDB->fetchAssoc($result)) {
7516 $result_array[$row['usr_id']] = $row;
7517 }
7518 return $result_array;
7519 }

References $DIC, $ilDB, $result, getAnonymity(), and getTestId().

Referenced by getInvitedParticipantList().

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

◆ getJavaScriptOutput()

ilObjTest::getJavaScriptOutput ( )

Returns if Javascript should be chosen for drag & drop actions for the active user.

Returns
boolean TRUE if Javascript should be chosen, FALSE otherwise @access public

Definition at line 10247 of file class.ilObjTest.php.

10248 {
10249 return true;
10250
10251 // global $DIC;
10252// $ilUser = $DIC['ilUser'];
10253// if (strcmp($_GET["tst_javascript"], "0") == 0) return FALSE;
10254// if ($this->getForceJS()) return TRUE;
10255// $assessmentSetting = new ilSetting("assessment");
10256// return ($ilUser->getPref("tst_javascript") === FALSE) ? $assessmentSetting->get("use_javascript") : $ilUser->getPref("tst_javascript");
10257 }

◆ getKiosk()

ilObjTest::getKiosk ( )

Returns the kiosk mode.

Returns
integer Kiosk mode @access public
See also
$_kiosk

Definition at line 2668 of file class.ilObjTest.php.

2669 {
2670 return ($this->_kiosk) ? $this->_kiosk : 0;
2671 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getKioskMode()

ilObjTest::getKioskMode ( )

Returns the kiosk mode.

Returns
boolean Kiosk mode @access public
See also
$_kiosk

Definition at line 2693 of file class.ilObjTest.php.

2694 {
2695 if (($this->_kiosk & 1) > 0) {
2696 return true;
2697 } else {
2698 return false;
2699 }
2700 }

Referenced by setKioskMode().

+ Here is the caller graph for this function:

◆ getListOfQuestions()

ilObjTest::getListOfQuestions ( )

Returns if the list of questions should be presented to the user or not.

Returns
boolean TRUE if the list of questions should be presented, FALSE otherwise @access public

Definition at line 8684 of file class.ilObjTest.php.

8685 {
8686 if (($this->show_summary & 1) > 0) {
8687 return true;
8688 } else {
8689 return false;
8690 }
8691 }

Referenced by setListOfQuestionsDescription(), setListOfQuestionsEnd(), and setListOfQuestionsStart().

+ Here is the caller graph for this function:

◆ getListOfQuestionsDescription()

ilObjTest::getListOfQuestionsDescription ( )

Returns TRUE if the list of questions should be presented with the question descriptions.

Returns
boolean TRUE if the list of questions is shown with the question descriptions, FALSE otherwise @access public

Definition at line 8780 of file class.ilObjTest.php.

8781 {
8782 if (($this->show_summary & 8) > 0) {
8783 return true;
8784 } else {
8785 return false;
8786 }
8787 }

Referenced by setListOfQuestionsDescription().

+ Here is the caller graph for this function:

◆ getListOfQuestionsEnd()

ilObjTest::getListOfQuestionsEnd ( )

Returns if the list of questions should be presented as the last page of the test.

Returns
boolean TRUE if the list of questions is shown as last page of the test, FALSE otherwise @access public

Definition at line 8747 of file class.ilObjTest.php.

8748 {
8749 if (($this->show_summary & 4) > 0) {
8750 return true;
8751 } else {
8752 return false;
8753 }
8754 }

Referenced by setListOfQuestionsEnd().

+ Here is the caller graph for this function:

◆ getListOfQuestionsSettings()

ilObjTest::getListOfQuestionsSettings ( )

Returns the settings for the list of questions options in the test properties This could contain one of the following values: 0 = No list of questions offered 1 = A list of questions is offered 3 = A list of questions is offered and the list of questions is shown as first page of the test 5 = A list of questions is offered and the list of questions is shown as last page of the test 7 = A list of questions is offered and the list of questions is shown as first and last page of the test.

Returns
integer TRUE if the list of questions should be presented, FALSE otherwise @access public

Definition at line 8656 of file class.ilObjTest.php.

8657 {
8658 return ($this->show_summary) ? $this->show_summary : 0;
8659 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getListOfQuestionsStart()

ilObjTest::getListOfQuestionsStart ( )

Returns if the list of questions should be presented as the first page of the test.

Returns
boolean TRUE if the list of questions is shown as first page of the test, FALSE otherwise @access public

Definition at line 8714 of file class.ilObjTest.php.

8715 {
8716 if (($this->show_summary & 2) > 0) {
8717 return true;
8718 } else {
8719 return false;
8720 }
8721 }

Referenced by setListOfQuestionsStart().

+ Here is the caller graph for this function:

◆ getMailNotification()

ilObjTest::getMailNotification ( )

Get mail notification settings.

Definition at line 10557 of file class.ilObjTest.php.

10558 {
10560 }

References $mailnotification.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getMailNotificationType()

ilObjTest::getMailNotificationType ( )

Definition at line 10668 of file class.ilObjTest.php.

10669 {
10670 if ($this->mailnottype == 1) {
10671 return $this->mailnottype;
10672 } else {
10673 return 0;
10674 }
10675 }

References $mailnottype.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getManualFeedback()

static ilObjTest::getManualFeedback (   $active_id,
  $question_id,
  $pass 
)
static

Retrieves the feedback comment for a question in a test if it is finalized.

Parameters
integer$active_idActive ID of the user
integer$question_idQuestion ID
integer$passPass number
Returns
string The feedback text @access public

Definition at line 10056 of file class.ilObjTest.php.

10057 {
10058 $feedback = "";
10059 $row = self::getSingleManualFeedback($active_id, $question_id, $pass);
10060
10061 if (count($row) > 0 && ($row['finalized_evaluation'] || \ilTestService::isManScoringDone($active_id))) {
10062 $feedback = $row['feedback'];
10063 }
10064
10065 return $feedback;
10066 }
static getSingleManualFeedback($active_id, $question_id, $pass)
Retrieves the manual feedback for a question in a test.
static isManScoringDone($activeId)
reads the flag wether manscoring is done for the given test active or not from the global settings (s...

References $pass, getSingleManualFeedback(), and ilTestService\isManScoringDone().

Referenced by assClozeTestGUI\getAnswerFeedbackOutput(), and assQuestionGUI\getGenericFeedbackOutput().

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

◆ getMarkSchema()

ilObjTest::getMarkSchema ( )

{

Returns
ASS_MarkSchema
}

Implements ilMarkSchemaAware.

Definition at line 6875 of file class.ilObjTest.php.

6876 {
6877 return $this->mark_schema;
6878 }

References $mark_schema.

◆ getMarkSchemaForeignId()

ilObjTest::getMarkSchemaForeignId ( )

{

Returns
int
}

Implements ilMarkSchemaAware.

Definition at line 6883 of file class.ilObjTest.php.

6884 {
6885 return $this->getTestId();
6886 }

References getTestId().

+ Here is the call graph for this function:

◆ getMCScoring()

ilObjTest::getMCScoring ( )

Gets the scoring type for multiple choice questions.

Returns
integer The scoring type for multiple choice questions @access public
See also
$mc_scoring

Definition at line 2523 of file class.ilObjTest.php.

2524 {
2525 return ($this->mc_scoring) ? $this->mc_scoring : 0;
2526 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getNrOfResultsForPass()

ilObjTest::getNrOfResultsForPass (   $active_id,
  $pass 
)

Calculates the number of user results for a specific test pass.

@access private

Deprecated:
: still in use?

Definition at line 1807 of file class.ilObjTest.php.

1808 {
1809 global $DIC;
1810 $ilDB = $DIC['ilDB'];
1811
1812 $result = $ilDB->queryF(
1813 "SELECT test_result_id FROM tst_test_result WHERE active_fi = %s AND pass = %s",
1814 array('integer','integer'),
1815 array($active_id, $pass)
1816 );
1817 return $result->numRows();
1818 }

References $DIC, $ilDB, $pass, and $result.

Referenced by getStartTestLabel().

+ Here is the caller graph for this function:

◆ getNrOfTries()

ilObjTest::getNrOfTries ( )

Returns the nr of tries for the test.

Returns
integer The maximum number of tries @access public
See also
$nr_of_tries

Definition at line 2640 of file class.ilObjTest.php.

2641 {
2642 return ($this->nr_of_tries) ? $this->nr_of_tries : 0;
2643 }

Referenced by addDefaults(), getStartTestLabel(), hasNrOfTriesRestriction(), isExecutable(), isNrOfTriesReached(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getOldOnlineStatus()

ilObjTest::getOldOnlineStatus ( )
Returns
null

Definition at line 11021 of file class.ilObjTest.php.

11022 {
11024 }

References $oldOnlineStatus.

Referenced by saveToDb().

+ Here is the caller graph for this function:

◆ getParticipants()

& ilObjTest::getParticipants ( )

Returns all persons who started the test.

Returns
array The active ids, names and logins of the persons who started the test

Definition at line 4580 of file class.ilObjTest.php.

4581 {
4582 global $DIC;
4583 $ilDB = $DIC['ilDB'];
4584 $result = $ilDB->queryF(
4585 "SELECT tst_active.active_id, usr_data.usr_id, usr_data.firstname, usr_data.lastname, usr_data.title, usr_data.login FROM tst_active LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id WHERE tst_active.test_fi = %s ORDER BY usr_data.lastname ASC",
4586 array('integer'),
4587 array($this->getTestId())
4588 );
4589 $persons_array = array();
4590 while ($row = $ilDB->fetchAssoc($result)) {
4591 $name = $this->lng->txt("anonymous");
4592 $fullname = $this->lng->txt("anonymous");
4593 $login = "";
4594 if (!$this->getAnonymity()) {
4595 if (strlen($row["firstname"] . $row["lastname"] . $row["title"]) == 0) {
4596 $name = $this->lng->txt("deleted_user");
4597 $fullname = $this->lng->txt("deleted_user");
4598 $login = $this->lng->txt("unknown");
4599 } else {
4600 $login = $row["login"];
4601 if ($row["user_fi"] == ANONYMOUS_USER_ID) {
4602 $name = $this->lng->txt("anonymous");
4603 $fullname = $this->lng->txt("anonymous");
4604 } else {
4605 $name = trim($row["lastname"] . ", " . $row["firstname"] . " " . $row["title"]);
4606 $fullname = trim($row["title"] . " " . $row["firstname"] . " " . $row["lastname"]);
4607 }
4608 }
4609 }
4610 $persons_array[$row["active_id"]] = array(
4611 "name" => $name,
4612 "fullname" => $fullname,
4613 "login" => $login
4614 );
4615 }
4616 return $persons_array;
4617 }
$login
Definition: cron.php:13

References $DIC, $ilDB, $login, $name, $result, ANONYMOUS_USER_ID, getAnonymity(), and getTestId().

+ Here is the call graph for this function:

◆ getPassed()

ilObjTest::getPassed (   $active_id)

Definition at line 10362 of file class.ilObjTest.php.

10363 {
10364 global $DIC;
10365 $ilDB = $DIC['ilDB'];
10366
10367 $result = $ilDB->queryF(
10368 "SELECT passed FROM tst_result_cache WHERE active_fi = %s",
10369 array('integer'),
10370 array($active_id)
10371 );
10372 if ($result->numRows()) {
10373 $row = $ilDB->fetchAssoc($result);
10374 return $row['passed'];
10375 } else {
10376 $counted_pass = ilObjTest::_getResultPass($active_id);
10377 $result_array = &$this->getTestResult($active_id, $counted_pass);
10378 return $result_array["test"]["passed"];
10379 }
10380 }

References $DIC, $ilDB, $result, _getResultPass(), and getTestResult().

Referenced by canShowCertificate().

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

◆ getPassScoring()

ilObjTest::getPassScoring ( )

Gets the pass scoring type.

Returns
integer The pass scoring type @access public
See also
$pass_scoring

Definition at line 2547 of file class.ilObjTest.php.

2548 {
2549 return ($this->pass_scoring) ? $this->pass_scoring : 0;
2550 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getPassWaiting()

ilObjTest::getPassWaiting ( )
Returns
string

Definition at line 3281 of file class.ilObjTest.php.

3282 {
3283 return $this->pass_waiting;
3284 }

References $pass_waiting.

Referenced by addDefaults(), isExecutable(), isPassWaitingEnabled(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getPassword()

ilObjTest::getPassword ( )

Returns the password for test access.

Returns
striong Password for test access @access public
See also
$password

Definition at line 3218 of file class.ilObjTest.php.

3219 {
3220 return (strlen($this->password)) ? $this->password : null;
3221 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getPoolQuestionChangeListeners()

static ilObjTest::getPoolQuestionChangeListeners ( ilDBInterface  $db,
  $poolObjId 
)
static

Definition at line 12000 of file class.ilObjTest.php.

12001 {
12002 require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
12003
12004 $questionChangeListeners = array(
12006 );
12007
12008 return $questionChangeListeners;
12009 }
static getPoolQuestionChangeListener(ilDBInterface $db, $poolObjId)

References ilObject\$db, and ilObjTestDynamicQuestionSetConfig\getPoolQuestionChangeListener().

Referenced by ilObjQuestionPool\addQuestionChangeListeners().

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

◆ getPoolUsage()

ilObjTest::getPoolUsage ( )

Definition at line 10852 of file class.ilObjTest.php.

10853 {
10854 return (boolean) $this->poolUsage;
10855 }

References $poolUsage.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getProcessingTime()

ilObjTest::getProcessingTime ( )

Returns the processing time for the test.

Returns
string The processing time for the test @access public
See also
$processing_time

Definition at line 2888 of file class.ilObjTest.php.

2889 {
2890 return (strlen($this->processing_time)) ? $this->processing_time : null;
2891 }

Referenced by addDefaults(), getProcessingTimeInSeconds(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getProcessingTimeAsArray()

ilObjTest::getProcessingTimeAsArray ( )

Returns the processing time for the test.

Returns
string The processing time for the test
See also
$processing_time

Definition at line 2899 of file class.ilObjTest.php.

2900 {
2901 if (strlen($this->processing_time)) {
2902 if (preg_match("/(\d{2}):(\d{2}):(\d{2})/is", $this->processing_time, $matches)) {
2903 if ((int) $matches[1] + (int) $matches[2] + (int) $matches[3] == 0) {
2904 return $this->getEstimatedWorkingTime();
2905 } else {
2906 return array(
2907 'hh' => $matches[1],
2908 'mm' => $matches[2],
2909 'ss' => $matches[3],
2910 );
2911 }
2912 }
2913 }
2914 return $this->getEstimatedWorkingTime();
2915 }
getEstimatedWorkingTime()
Returns the estimated working time for the test calculated from the working time of the contained que...

References getEstimatedWorkingTime().

+ Here is the call graph for this function:

◆ getProcessingTimeAsMinutes()

ilObjTest::getProcessingTimeAsMinutes ( )

Definition at line 2917 of file class.ilObjTest.php.

2918 {
2919 if (strlen($this->processing_time)) {
2920 if (preg_match("/(\d{2}):(\d{2}):(\d{2})/is", $this->processing_time, $matches)) {
2921 return ($matches[1] * 60) + $matches[2];
2922 }
2923 }
2924
2926 }
const DEFAULT_PROCESSING_TIME_MINUTES

References DEFAULT_PROCESSING_TIME_MINUTES.

◆ getProcessingTimeInSeconds()

ilObjTest::getProcessingTimeInSeconds (   $active_id = "")

Returns the processing time for the test in seconds.

Returns
integer The processing time for the test in seconds @access public
See also
$processing_time

Definition at line 2935 of file class.ilObjTest.php.

2936 {
2937 if (preg_match("/(\d{2}):(\d{2}):(\d{2})/", $this->getProcessingTime(), $matches)) {
2938 $extratime = $this->getExtraTime($active_id) * 60;
2939 return ($matches[1] * 3600) + ($matches[2] * 60) + $matches[3] + $extratime;
2940 } else {
2941 return 0;
2942 }
2943 }
getExtraTime($active_id)

References getExtraTime(), and getProcessingTime().

Referenced by isMaxProcessingTimeReached().

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

◆ getQuestionCount()

ilObjTest::getQuestionCount ( )

Returns the number of questions in the test.

Returns
integer The number of questions @access public

Definition at line 7237 of file class.ilObjTest.php.

7238 {
7239 $num = 0;
7240
7241 if ($this->isRandomTest()) {
7242 global $DIC;
7243 $tree = $DIC['tree'];
7244 $ilDB = $DIC['ilDB'];
7245 $ilPluginAdmin = $DIC['ilPluginAdmin'];
7246
7247 $questionSetConfig = new ilTestRandomQuestionSetConfig(
7248 $tree,
7249 $ilDB,
7250 $ilPluginAdmin,
7251 $this
7252 );
7253
7254 $questionSetConfig->loadFromDb();
7255
7256 if ($questionSetConfig->isQuestionAmountConfigurationModePerPool()) {
7257 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
7258 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetBuilderWithAmountPerPool.php';
7259 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
7260
7261 $sourcePoolDefinitionList = new ilTestRandomQuestionSetSourcePoolDefinitionList(
7262 $ilDB,
7263 $this,
7265 );
7266
7267 $sourcePoolDefinitionList->loadDefinitions();
7268
7269 $num = $sourcePoolDefinitionList->getQuestionAmount();
7270 } else {
7271 $num = $questionSetConfig->getQuestionAmountPerTest();
7272 }
7273 } else {
7274 $num = count($this->questions);
7275 }
7276
7277 return $num;
7278 }

References $DIC, $ilDB, ilObject\$tree, and isRandomTest().

Referenced by getQuestionsOfPass(), and getQuestionsOfTest().

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

◆ getQuestionDataset()

ilObjTest::getQuestionDataset (   $question_id)

Returns the dataset for a given question id.

Parameters
integer$question_idThe database id of the question
Returns
object Question dataset @access public
See also
$questions

Definition at line 3730 of file class.ilObjTest.php.

3731 {
3732 global $DIC;
3733 $ilDB = $DIC['ilDB'];
3734
3735 $result = $ilDB->queryF(
3736 "SELECT qpl_questions.*, qpl_qst_type.type_tag FROM qpl_questions, qpl_qst_type WHERE qpl_questions.question_id = %s AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id",
3737 array('integer'),
3738 array($question_id)
3739 );
3740 $row = $ilDB->fetchObject($result);
3741 return $row;
3742 }

References $DIC, $ilDB, and $result.

◆ getQuestions()

ilObjTest::getQuestions ( )

Definition at line 11003 of file class.ilObjTest.php.

11004 {
11005 return $this->questions;
11006 }

References $questions.

◆ getQuestionSetType()

ilObjTest::getQuestionSetType ( )

getter for question set type

Returns
string $questionSetType

Definition at line 11895 of file class.ilObjTest.php.

11896 {
11898 }

References $questionSetType.

Referenced by addDefaults(), getQuestionTitle(), getQuestionTitles(), getQuestionTitlesAndIndexes(), isDynamicTest(), isFixedTest(), isRandomTest(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getQuestionSetTypeTranslation()

ilObjTest::getQuestionSetTypeTranslation ( ilLanguage  $lng,
  $questionSetType 
)

Definition at line 11967 of file class.ilObjTest.php.

11968 {
11969 switch ($questionSetType) {
11971 return $lng->txt('tst_question_set_type_fixed');
11972
11974 return $lng->txt('tst_question_set_type_random');
11975
11977 return $lng->txt('tst_question_set_type_dynamic');
11978 }
11979
11980 throw new ilTestException('invalid question set type value given: ' . $questionSetType);
11981 }

References ilObject\$lng, $questionSetType, QUESTION_SET_TYPE_DYNAMIC, QUESTION_SET_TYPE_FIXED, and QUESTION_SET_TYPE_RANDOM.

◆ getQuestionsOfPass()

& ilObjTest::getQuestionsOfPass (   $active_id,
  $pass 
)

Retrieves all the assigned questions for a test participant in a given test pass.

Returns
array An associated array containing the questions @access public

Definition at line 4738 of file class.ilObjTest.php.

4739 {
4740 global $DIC;
4741 $ilDB = $DIC['ilDB'];
4742 if ($this->isRandomTest()) {
4743 $ilDB->setLimit($this->getQuestionCount(), 0);
4744 $result = $ilDB->queryF(
4745 "SELECT tst_test_rnd_qst.sequence, tst_test_rnd_qst.question_fi, " .
4746 "qpl_questions.points " .
4747 "FROM tst_test_rnd_qst, qpl_questions " .
4748 "WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id " .
4749 "AND tst_test_rnd_qst.active_fi = %s AND tst_test_rnd_qst.pass = %s " .
4750 "ORDER BY tst_test_rnd_qst.sequence",
4751 array('integer', 'integer'),
4752 array($active_id, $pass)
4753 );
4754 } else {
4755 $result = $ilDB->queryF(
4756 "SELECT tst_test_question.sequence, tst_test_question.question_fi, " .
4757 "qpl_questions.points " .
4758 "FROM tst_test_question, tst_active, qpl_questions " .
4759 "WHERE tst_test_question.question_fi = qpl_questions.question_id " .
4760 "AND tst_active.active_id = %s AND tst_active.test_fi = tst_test_question.test_fi",
4761 array('integer'),
4762 array($active_id)
4763 );
4764 }
4765 $qpass = array();
4766 if ($result->numRows()) {
4767 while ($row = $ilDB->fetchAssoc($result)) {
4768 array_push($qpass, $row);
4769 }
4770 }
4771 return $qpass;
4772 }
getQuestionCount()
Returns the number of questions in the test.

References $DIC, $ilDB, $pass, $result, getQuestionCount(), and isRandomTest().

+ Here is the call graph for this function:

◆ getQuestionsOfTest()

& ilObjTest::getQuestionsOfTest (   $active_id)

Retrieves all the assigned questions for all test passes of a test participant.

Returns
array An associated array containing the questions @access public

Definition at line 4697 of file class.ilObjTest.php.

4698 {
4699 global $DIC;
4700 $ilDB = $DIC['ilDB'];
4701 if ($this->isRandomTest()) {
4702 $ilDB->setLimit($this->getQuestionCount(), 0);
4703 $result = $ilDB->queryF(
4704 "SELECT tst_test_rnd_qst.sequence, tst_test_rnd_qst.question_fi, " .
4705 "tst_test_rnd_qst.pass, qpl_questions.points " .
4706 "FROM tst_test_rnd_qst, qpl_questions " .
4707 "WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id " .
4708 "AND tst_test_rnd_qst.active_fi = %s ORDER BY tst_test_rnd_qst.sequence",
4709 array('integer'),
4710 array($active_id)
4711 );
4712 } else {
4713 $result = $ilDB->queryF(
4714 "SELECT tst_test_question.sequence, tst_test_question.question_fi, " .
4715 "qpl_questions.points " .
4716 "FROM tst_test_question, tst_active, qpl_questions " .
4717 "WHERE tst_test_question.question_fi = qpl_questions.question_id " .
4718 "AND tst_active.active_id = %s AND tst_active.test_fi = tst_test_question.test_fi",
4719 array('integer'),
4720 array($active_id)
4721 );
4722 }
4723 $qtest = array();
4724 if ($result->numRows()) {
4725 while ($row = $ilDB->fetchAssoc($result)) {
4726 array_push($qtest, $row);
4727 }
4728 }
4729 return $qtest;
4730 }

References $DIC, $ilDB, $result, getQuestionCount(), and isRandomTest().

+ Here is the call graph for this function:

◆ getQuestiontext()

ilObjTest::getQuestiontext (   $question_id)

Returns the question text for a given question.

Parameters
integer$question_idThe question id
Returns
string The question text @access public

Definition at line 7412 of file class.ilObjTest.php.

7413 {
7414 global $DIC;
7415 $ilDB = $DIC['ilDB'];
7416
7417 $res = "";
7418 if ($question_id) {
7419 $result = $ilDB->queryF(
7420 "SELECT question_text FROM qpl_questions WHERE question_id = %s",
7421 array('integer'),
7422 array($question_id)
7423 );
7424 if ($result->numRows() == 1) {
7425 $row = $ilDB->fetchAssoc($result);
7426 $res = $row["question_text"];
7427 }
7428 }
7429 return $res;
7430 }

References $DIC, $ilDB, $res, and $result.

◆ getQuestionTitle()

ilObjTest::getQuestionTitle (   $title,
  $nr = null 
)

Returns the title of a test question and checks if the title output is allowed.

If not, the localized text "question" will be returned.

Parameters
string$titleThe original title of the question
integer$nrThe number of the question in the sequence
Returns
string The title for the question title output @access public

Definition at line 3705 of file class.ilObjTest.php.

3706 {
3707 if ($this->getTitleOutput() == 2) {
3708 if ($this->getQuestionSetType() == self::QUESTION_SET_TYPE_DYNAMIC) {
3709 // avoid legacy setting combination: ctm without question titles
3710 return $title;
3711 } elseif (isset($nr)) {
3712 return $this->lng->txt("ass_question") . ' ' . $nr;
3713 } else {
3714 return $this->lng->txt("ass_question");
3715 }
3716 } else {
3717 return $title;
3718 }
3719 }

References ilObject\$title, getQuestionSetType(), and getTitleOutput().

+ Here is the call graph for this function:

◆ getQuestionTitles()

& ilObjTest::getQuestionTitles ( )

Returns the titles of the test questions in question sequence.

Returns
array The question titles @access public
See also
$questions

Definition at line 3652 of file class.ilObjTest.php.

3653 {
3654 $titles = array();
3655 if ($this->getQuestionSetType() == self::QUESTION_SET_TYPE_FIXED) {
3656 global $DIC;
3657 $ilDB = $DIC['ilDB'];
3658 $result = $ilDB->queryF(
3659 "SELECT qpl_questions.title FROM tst_test_question, qpl_questions WHERE tst_test_question.test_fi = %s AND tst_test_question.question_fi = qpl_questions.question_id ORDER BY tst_test_question.sequence",
3660 array('integer'),
3661 array($this->getTestId())
3662 );
3663 while ($row = $ilDB->fetchAssoc($result)) {
3664 array_push($titles, $row["title"]);
3665 }
3666 }
3667 return $titles;
3668 }

References $DIC, $ilDB, $result, getQuestionSetType(), and getTestId().

+ Here is the call graph for this function:

◆ getQuestionTitlesAndIndexes()

& ilObjTest::getQuestionTitlesAndIndexes ( )

Returns the titles of the test questions in question sequence.

Returns
array The question titles @access public
See also
$questions

Definition at line 3677 of file class.ilObjTest.php.

3678 {
3679 $titles = array();
3680 if ($this->getQuestionSetType() == self::QUESTION_SET_TYPE_FIXED) {
3681 global $DIC;
3682 $ilDB = $DIC['ilDB'];
3683 $result = $ilDB->queryF(
3684 "SELECT qpl_questions.title, qpl_questions.question_id FROM tst_test_question, qpl_questions WHERE tst_test_question.test_fi = %s AND tst_test_question.question_fi = qpl_questions.question_id ORDER BY tst_test_question.sequence",
3685 array('integer'),
3686 array($this->getTestId())
3687 );
3688 while ($row = $ilDB->fetchAssoc($result)) {
3689 $titles[$row['question_id']] = $row["title"];
3690 }
3691 }
3692 return $titles;
3693 }

References $DIC, $ilDB, $result, getQuestionSetType(), and getTestId().

Referenced by hasQuestionsWithoutQuestionpool().

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

◆ getQuestionType()

ilObjTest::getQuestionType (   $question_id)

Returns the question type of a question with a given id.

Parameters
integer$question_idThe database id of the question
Returns
string The question type string @access private

Definition at line 3791 of file class.ilObjTest.php.

3792 {
3793 global $DIC;
3794 $ilDB = $DIC['ilDB'];
3795
3796 if ($question_id < 1) {
3797 return -1;
3798 }
3799 $result = $ilDB->queryF(
3800 "SELECT type_tag FROM qpl_questions, qpl_qst_type WHERE qpl_questions.question_id = %s AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id",
3801 array('integer'),
3802 array($question_id)
3803 );
3804 if ($result->numRows() == 1) {
3805 $data = $ilDB->fetchObject($result);
3806 return $data->type_tag;
3807 } else {
3808 return "";
3809 }
3810 }

References $data, $DIC, $ilDB, and $result.

Referenced by createQuestionGUI().

+ Here is the caller graph for this function:

◆ getRedirectionMode()

ilObjTest::getRedirectionMode ( )

Definition at line 3099 of file class.ilObjTest.php.

3100 {
3102 }

References $redirection_mode.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getRedirectionUrl()

ilObjTest::getRedirectionUrl ( )

Definition at line 3107 of file class.ilObjTest.php.

3108 {
3110 }

References $redirection_url.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getReportingDate()

ilObjTest::getReportingDate ( )

Gets the reporting date of the ilObjTest object.

Returns
string The reporting date of the test of an empty string (=FALSE) if no reporting date is set @access public
See also
$reporting_date

Definition at line 2628 of file class.ilObjTest.php.

2629 {
2630 return (strlen($this->reporting_date)) ? $this->reporting_date : null;
2631 }

Referenced by addDefaults(), canEditMarks(), canShowEctsGrades(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getResetProcessingTime()

ilObjTest::getResetProcessingTime ( )

Returns wheather the processing time should be reset or not.

Returns
integer 0 for no reset, 1 for a reset @access public
See also
$reset_processing_time

Definition at line 2982 of file class.ilObjTest.php.

2983 {
2984 return ($this->reset_processing_time) ? $this->reset_processing_time : 0;
2985 }

Referenced by addDefaults(), getStartingTimeOfUser(), isExecutable(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getResultFilterTaxIds()

ilObjTest::getResultFilterTaxIds ( )

Definition at line 12050 of file class.ilObjTest.php.

12051 {
12053 }

References $resultFilterTaxIds.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getResultsForActiveId()

ilObjTest::getResultsForActiveId (   $active_id)

Definition at line 10625 of file class.ilObjTest.php.

10626 {
10627 global $DIC;
10628 $ilDB = $DIC['ilDB'];
10629
10630 $query = "
10631 SELECT *
10632 FROM tst_result_cache
10633 WHERE active_fi = %s
10634 ";
10635
10636 $result = $ilDB->queryF(
10637 $query,
10638 array('integer'),
10639 array($active_id)
10640 );
10641
10642 $row = $ilDB->fetchAssoc($result);
10643
10644 if (!$result->numRows()
10645 || $row['pass'] !== ilObjTest::_getResultPass($active_id)) {
10646 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
10647
10649
10650 $query = "
10651 SELECT *
10652 FROM tst_result_cache
10653 WHERE active_fi = %s
10654 ";
10655
10656 $result = $ilDB->queryF(
10657 $query,
10658 array('integer'),
10659 array($active_id)
10660 );
10661
10662 $row = $ilDB->fetchAssoc($result);
10663 }
10664
10665 return $row;
10666 }
static _updateTestResultCache($active_id, ilAssQuestionProcessLocker $processLocker=null)
@TODO Move this to a proper place.

References $DIC, $ilDB, $query, $result, _getResultPass(), and assQuestion\_updateTestResultCache().

Referenced by getTestResult().

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

◆ getResultsPresentation()

ilObjTest::getResultsPresentation ( )

Returns the combined results presentation value.

Returns
integer The combined results presentation value @access public

Definition at line 8813 of file class.ilObjTest.php.

8814 {
8815 return ($this->results_presentation) ? $this->results_presentation : 0;
8816 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getRoleData()

& ilObjTest::getRoleData (   $ids)

Definition at line 7747 of file class.ilObjTest.php.

7748 {
7749 if (!is_array($ids) || count($ids) == 0) {
7750 return array();
7751 }
7752 $result = array();
7753 foreach ($ids as $obj_id) {
7754 $result[$obj_id] = array("obj_id" => $obj_id, "title" => ilObject::_lookupTitle($obj_id), "description" => ilObject::_lookupDescription($obj_id));
7755 }
7756 return $result;
7757 }

References $result, ilObject\_lookupDescription(), and ilObject\_lookupTitle().

+ Here is the call graph for this function:

◆ getScoreCutting()

ilObjTest::getScoreCutting ( )

Determines if the score of a question should be cut at 0 points or the score of the whole test.

Returns
integer The score cutting type. 0 for question cutting, 1 for test cutting @access public
See also
$score_cutting

Definition at line 2535 of file class.ilObjTest.php.

2536 {
2537 return ($this->score_cutting) ? $this->score_cutting : 0;
2538 }

Referenced by addDefaults(), getTestResult(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getScoreReporting()

ilObjTest::getScoreReporting ( )

Gets the score reporting of the ilObjTest object.

Returns
integer The score reporting of the test @access public
See also
$score_reporting

Definition at line 2411 of file class.ilObjTest.php.

2412 {
2413 return ($this->score_reporting) ? $this->score_reporting : 0;
2414 }

Referenced by addDefaults(), isScoreReportingEnabled(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getSecondsUntilEndingTime()

ilObjTest::getSecondsUntilEndingTime ( )

Returns the seconds left from the actual time until the ending time.

Returns
integer The seconds left until the ending time is reached @access public
See also
$ending_time

Definition at line 2952 of file class.ilObjTest.php.

2953 {
2954 if ($this->getEndingTime() != 0) {
2955 $ending = $this->getEndingTime();
2956 $now = time();
2957 return $ending - $now;
2958 } else {
2959 return 0;
2960 }
2961 }

References getEndingTime().

+ Here is the call graph for this function:

◆ getSequenceSettings()

ilObjTest::getSequenceSettings ( )

SEQUENCE SETTING = POSTPONING ENABLED !!

Returns
integer The POSTPONING ENABLED status

Definition at line 2267 of file class.ilObjTest.php.

2268 {
2269 return ($this->sequence_settings) ? $this->sequence_settings : 0;
2270 }

Referenced by addDefaults(), isPostponingEnabled(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getShowCancel()

ilObjTest::getShowCancel ( )

Returns wheather the cancel test button is shown or not.

Returns
integer The value for the show cancel status (0 = don't show, 1 = show) @access public

Definition at line 9403 of file class.ilObjTest.php.

9404 {
9405 return ($this->show_cancel) ? 1 : 0;
9406 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getShowExamviewHtml()

ilObjTest::getShowExamviewHtml ( )
Returns
boolean

Definition at line 11553 of file class.ilObjTest.php.

11554 {
11556 }

References $show_examview_html.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getShowExamviewPdf()

ilObjTest::getShowExamviewPdf ( )
Returns
boolean

Definition at line 11569 of file class.ilObjTest.php.

11570 {
11572 }

References $show_examview_pdf.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getShowFinalStatement()

ilObjTest::getShowFinalStatement ( )

Returns whether the final statement should be shown or not.

Returns
integer 0 if false, 1 if true @access public
See also
$_showfinalstatement

Definition at line 2197 of file class.ilObjTest.php.

2198 {
2199 return ($this->_showfinalstatement) ? 1 : 0;
2200 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getShowInfo()

ilObjTest::getShowInfo ( )

Gets whether the complete information page is shown or the required data only.

Returns
integer 1 for the complete information, 0 otherwise @access public
See also
$_showinfo

Definition at line 2173 of file class.ilObjTest.php.

2174 {
2175 return ($this->_showinfo) ? 1 : 0;
2176 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getShowKioskModeParticipant()

ilObjTest::getShowKioskModeParticipant ( )

Returns the status of the kiosk mode participant.

Returns
boolean Kiosk mode participant @access public
See also
$_kiosk

Definition at line 2760 of file class.ilObjTest.php.

2761 {
2762 if (($this->_kiosk & 4) > 0) {
2763 return true;
2764 } else {
2765 return false;
2766 }
2767 }

Referenced by setShowKioskModeParticipant().

+ Here is the caller graph for this function:

◆ getShowKioskModeTitle()

ilObjTest::getShowKioskModeTitle ( )

Returns the status of the kiosk mode title.

Returns
boolean Kiosk mode title @access public
See also
$_kiosk

Definition at line 2727 of file class.ilObjTest.php.

2728 {
2729 if (($this->_kiosk & 2) > 0) {
2730 return true;
2731 } else {
2732 return false;
2733 }
2734 }

Referenced by setShowKioskModeTitle().

+ Here is the caller graph for this function:

◆ getShowMarker()

ilObjTest::getShowMarker ( )

Returns wheather the marker button is shown or not.

Returns
integer The value for the marker status (0 = don't show, 1 = show) @access public

Definition at line 9432 of file class.ilObjTest.php.

9433 {
9434 return ($this->show_marker) ? 1 : 0;
9435 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getShowPassDetails()

ilObjTest::getShowPassDetails ( )

Returns if the pass details should be shown when a test is not finished.

Returns
boolean TRUE if the pass details should be shown, FALSE otherwise @access public

Definition at line 8824 of file class.ilObjTest.php.

8825 {
8826 if (($this->results_presentation & 1) > 0) {
8827 return true;
8828 } else {
8829 return false;
8830 }
8831 }

Referenced by setShowPassDetails().

+ Here is the caller graph for this function:

◆ getShowSolutionAnswersOnly()

ilObjTest::getShowSolutionAnswersOnly ( )

Returns if the full solution (including ILIAS content) should be presented to the solution or not.

Returns
boolean TRUE if the full solution should be presented in the solution output, FALSE otherwise @access public

Definition at line 8884 of file class.ilObjTest.php.

8885 {
8886 if (($this->results_presentation & 16) > 0) {
8887 return true;
8888 } else {
8889 return false;
8890 }
8891 }

Referenced by setShowSolutionAnswersOnly().

+ Here is the caller graph for this function:

◆ getShowSolutionDetails()

ilObjTest::getShowSolutionDetails ( )

Returns if the solution details should be presented to the user or not.

Returns
boolean TRUE if the solution details should be presented, FALSE otherwise @access public

Definition at line 8839 of file class.ilObjTest.php.

8840 {
8841 if (($this->results_presentation & 2) > 0) {
8842 return true;
8843 } else {
8844 return false;
8845 }
8846 }

Referenced by setShowSolutionDetails(), and toXML().

+ Here is the caller graph for this function:

◆ getShowSolutionFeedback()

ilObjTest::getShowSolutionFeedback ( )

Returns if the feedback should be presented to the solution or not.

Returns
boolean TRUE if the feedback should be presented in the solution, FALSE otherwise @access public

Definition at line 8869 of file class.ilObjTest.php.

8870 {
8871 if (($this->results_presentation & 8) > 0) {
8872 return true;
8873 } else {
8874 return false;
8875 }
8876 }

Referenced by setShowSolutionFeedback().

+ Here is the caller graph for this function:

◆ getShowSolutionListComparison()

ilObjTest::getShowSolutionListComparison ( )
Returns
boolean TRUE if the results should be compared with the correct results in the list of answers, FALSE otherwise @access public

Definition at line 8925 of file class.ilObjTest.php.

8926 {
8927 if (($this->results_presentation & 128) > 0) {
8928 return true;
8929 } else {
8930 return false;
8931 }
8932 }

Referenced by setShowSolutionListComparison().

+ Here is the caller graph for this function:

◆ getShowSolutionPrintview()

ilObjTest::getShowSolutionPrintview ( )

Returns if the solution printview should be presented to the user or not.

Returns
boolean TRUE if the solution printview should be presented, FALSE otherwise @access public

Definition at line 8854 of file class.ilObjTest.php.

8855 {
8856 if (($this->results_presentation & 4) > 0) {
8857 return true;
8858 } else {
8859 return false;
8860 }
8861 }

Referenced by canShowSolutionPrintview(), and setShowSolutionPrintview().

+ Here is the caller graph for this function:

◆ getShowSolutionSignature()

ilObjTest::getShowSolutionSignature ( )

Returns if the signature field should be shown in the test results.

Returns
boolean TRUE if the signature field should be shown, FALSE otherwise @access public

Definition at line 8899 of file class.ilObjTest.php.

8900 {
8901 if (($this->results_presentation & 32) > 0) {
8902 return true;
8903 } else {
8904 return false;
8905 }
8906 }

Referenced by setShowSolutionSignature().

+ Here is the caller graph for this function:

◆ getShowSolutionSuggested()

ilObjTest::getShowSolutionSuggested ( )
Returns
boolean TRUE if the suggested solutions should be shown, FALSE otherwise @access public

Definition at line 8912 of file class.ilObjTest.php.

8913 {
8914 if (($this->results_presentation & 64) > 0) {
8915 return true;
8916 } else {
8917 return false;
8918 }
8919 }

Referenced by setShowSolutionSuggested().

+ Here is the caller graph for this function:

◆ getShuffleQuestions()

ilObjTest::getShuffleQuestions ( )

Returns the status of the shuffle_questions variable.

Returns
integer 0 if the test questions are not shuffled, 1 if the test questions are shuffled @access public

Definition at line 8628 of file class.ilObjTest.php.

8629 {
8630 return ($this->shuffle_questions) ? 1 : 0;
8631 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getSignSubmission()

ilObjTest::getSignSubmission ( )
Returns
boolean

Definition at line 11842 of file class.ilObjTest.php.

11843 {
11845 }

References $sign_submission.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getSingleManualFeedback()

static ilObjTest::getSingleManualFeedback (   $active_id,
  $question_id,
  $pass 
)
static

Retrieves the manual feedback for a question in a test.

Parameters
integer$active_idActive ID of the user
integer$question_idQuestion ID
integer$passPass number
Returns
array The feedback text @access public

Definition at line 10077 of file class.ilObjTest.php.

10078 {
10079 global $DIC;
10080
10081 $ilDB = $DIC->database();
10082 $row = array();
10083 $result = $ilDB->queryF(
10084 "SELECT * FROM tst_manual_fb WHERE active_fi = %s AND question_fi = %s AND pass = %s",
10085 array('integer', 'integer', 'integer'),
10086 array($active_id, $question_id, $pass)
10087 );
10088
10089 if ($result->numRows() === 1) {
10090 $row = $ilDB->fetchAssoc($result);
10091 $row['feedback'] = ilRTE::_replaceMediaObjectImageSrc($row['feedback'], 1);
10092 } else {
10093 $DIC->logger()->root()->warning("WARNING: Multiple feedback entries on tst_manual_fb for " .
10094 "active_fi = $active_id , question_fi = $question_id and pass = $pass");
10095 }
10096
10097 return $row;
10098 }

References $DIC, $ilDB, $pass, $result, and ilRTE\_replaceMediaObjectImageSrc().

Referenced by getManualFeedback(), ilTestScoringByQuestionsGUI\saveManScoringByQuestion(), and saveManualFeedback().

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

◆ getSpecificAnswerFeedback()

ilObjTest::getSpecificAnswerFeedback ( )

Definition at line 11376 of file class.ilObjTest.php.

11377 {
11378 switch ($this->specific_answer_feedback) {
11379 case 1:
11380 return 1;
11381 default:
11382 return 0;
11383 }
11384 }

Referenced by addDefaults(), getInstantFeedbackOptionsAsArray(), isAnyInstantFeedbackOptionEnabled(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getStartingTime()

ilObjTest::getStartingTime ( )

Returns the starting time of the test.

Returns
string The starting time of the test @access public
See also
$starting_time

Definition at line 3010 of file class.ilObjTest.php.

3011 {
3012 return ($this->starting_time != 0) ? $this->starting_time : 0;
3013 }

Referenced by addDefaults(), isExecutable(), saveToDb(), startingTimeReached(), and toXML().

+ Here is the caller graph for this function:

◆ getStartingTimeOfParticipants()

ilObjTest::getStartingTimeOfParticipants ( )

Note, this function should only be used if absolutely necessary, since it perform joins on tables that tend to grow huge and returns vast amount of data.

If possible, use getStartingTimeOfUser($active_id) instead

Returns
array

Definition at line 11618 of file class.ilObjTest.php.

11619 {
11620 global $DIC;
11621 $ilDB = $DIC['ilDB'];
11622
11623 $times = array();
11624 $result = $ilDB->queryF(
11625 "SELECT tst_times.active_fi, tst_times.started FROM tst_times, tst_active WHERE tst_times.active_fi = tst_active.active_id AND tst_active.test_fi = %s ORDER BY tst_times.tstamp DESC",
11626 array('integer'),
11627 array($this->getTestId())
11628 );
11629 while ($row = $ilDB->fetchAssoc($result)) {
11630 $times[$row['active_fi']] = $row['started'];
11631 }
11632 return $times;
11633 }

References $DIC, $ilDB, $result, and getTestId().

+ Here is the call graph for this function:

◆ getStartingTimeOfUser()

ilObjTest::getStartingTimeOfUser (   $active_id,
  $pass = null 
)

Returns the unix timestamp of the time a user started a test.

Parameters
integer$active_idThe active id of the user
Returns
mixed The unix timestamp if the user started the test, FALSE otherwise @access public

Definition at line 8411 of file class.ilObjTest.php.

8412 {
8413 global $DIC;
8414 $ilDB = $DIC['ilDB'];
8415
8416 if ($active_id < 1) {
8417 return false;
8418 }
8419 if ($pass === null) {
8420 $pass = ($this->getResetProcessingTime()) ? self::_getPass($active_id) : 0;
8421 }
8422 $result = $ilDB->queryF(
8423 "SELECT tst_times.started FROM tst_times WHERE tst_times.active_fi = %s AND tst_times.pass = %s ORDER BY tst_times.started",
8424 array('integer', 'integer'),
8425 array($active_id, $pass)
8426 );
8427 if ($result->numRows()) {
8428 $row = $ilDB->fetchAssoc($result);
8429 if (preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches)) {
8430 return mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
8431 } else {
8432 return time();
8433 }
8434 } else {
8435 return time();
8436 }
8437 }

References $DIC, $ilDB, $pass, $result, and getResetProcessingTime().

Referenced by isExecutable().

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

◆ getStartTestLabel()

ilObjTest::getStartTestLabel (   $active_id)

Returns the "Start the Test" label for the Info page.

Parameters
int$active_idThe active id of the current user
Returns
string The "Start the Test" label @access public

Definition at line 9596 of file class.ilObjTest.php.

9597 {
9598 if ($this->getNrOfTries() == 1) {
9599 return $this->lng->txt("tst_start_test");
9600 }
9601 $active_pass = self::_getPass($active_id);
9602 $res = $this->getNrOfResultsForPass($active_id, $active_pass);
9603 if ($res == 0) {
9604 if ($active_pass == 0) {
9605 return $this->lng->txt("tst_start_test");
9606 } else {
9607 return $this->lng->txt("tst_start_new_test_pass");
9608 }
9609 } else {
9610 return $this->lng->txt("tst_resume_test");
9611 }
9612 }
getNrOfResultsForPass($active_id, $pass)
Calculates the number of user results for a specific test pass.

References $res, _getPass(), getNrOfResultsForPass(), and getNrOfTries().

+ Here is the call graph for this function:

◆ getTemplate()

ilObjTest::getTemplate ( )

Definition at line 10739 of file class.ilObjTest.php.

10740 {
10741 return $this->template_id;
10742 }

References $template_id.

Referenced by saveToDb().

+ Here is the caller graph for this function:

◆ getTestDefaults()

& ilObjTest::getTestDefaults (   $test_defaults_id)

Returns the test defaults for a given id.

Parameters
integer$test_defaults_idThe database id of a test defaults dataset
Returns
array An array containing the test defaults @access public

Definition at line 9648 of file class.ilObjTest.php.

9649 {
9650 return self::_getTestDefaults($test_defaults_id);
9651 }
static _getTestDefaults($test_defaults_id)

References _getTestDefaults().

+ Here is the call graph for this function:

◆ getTestId()

ilObjTest::getTestId ( )

Gets the database id of the additional test data.

Returns
integer The database id of the additional test data @access public
See also
$test_id

Definition at line 2209 of file class.ilObjTest.php.

2210 {
2211 return $this->test_id;
2212 }

References $test_id.

Referenced by addExtraTime(), checkMaximumAllowedUsers(), ilObjTestDynamicQuestionSetConfig\cloneQuestionSetRelatedData(), ilTestRandomQuestionSetConfig\cloneQuestionSetRelatedData(), deleteTest(), disinviteUser(), evalResultsOverview(), evalResultsOverviewOfParticipant(), evalTotalParticipantsArray(), evalTotalPersons(), evalTotalPersonsArray(), evalTotalStartedAverageTime(), getActiveIdOfUser(), getCompleteWorkingTime(), getCompleteWorkingTimeOfParticipant(), getCompleteWorkingTimeOfParticipants(), getExistingQuestions(), getInvitedUsers(), getMarkSchemaForeignId(), getParticipants(), getQuestionTitles(), getQuestionTitlesAndIndexes(), getStartingTimeOfParticipants(), getTestParticipants(), getTestQuestions(), getTimeExtensionsOfParticipants(), getVisitTimeOfParticipant(), hasSingleChoiceQuestions(), ilTestImporter\importSkillLevelThresholds(), insertQuestion(), inviteUser(), isActiveTestSubmitted(), isNewRandomTest(), isSingleChoiceTest(), isSingleChoiceTestWithoutShuffle(), loadFromDb(), moveQuestionAfter(), moveQuestionAfterOLD(), questionMoveDown(), questionMoveUp(), randomSelectQuestions(), removeTestResultsByActiveIds(), removeTestResultsByUserIds(), removeTestResultsFromSoapLpAdministration(), saveCertificateVisibility(), saveCompleteStatus(), saveQuestionsToDb(), saveToDb(), setClientIP(), and toXML().

+ Here is the caller graph for this function:

◆ getTestObjIdsWithActiveForUserId()

static ilObjTest::getTestObjIdsWithActiveForUserId (   $userId)
static

Definition at line 12011 of file class.ilObjTest.php.

12012 {
12013 global $DIC;
12014 $ilDB = $DIC['ilDB'];
12015
12016 $query = "
12017 SELECT obj_fi
12018 FROM tst_active
12019 INNER JOIN tst_tests
12020 ON test_id = test_fi
12021 WHERE user_fi = %s
12022 ";
12023
12024 $res = $ilDB->queryF($query, array('integer'), array($userId));
12025
12026 $objIds = array();
12027
12028 while ($row = $ilDB->fetchAssoc($res)) {
12029 $objIds[] = (int) $row['obj_fi'];
12030 }
12031
12032 return $objIds;
12033 }

References $DIC, $ilDB, $query, and $res.

◆ getTestParticipants()

& ilObjTest::getTestParticipants ( )

Returns a list of all participants in a test.

Returns
array The user id's of the participants @access public

Definition at line 7527 of file class.ilObjTest.php.

7528 {
7529 global $DIC;
7530 $ilDB = $DIC['ilDB'];
7531
7532 if ($this->getAnonymity()) {
7533 $query = "
7534 SELECT tst_active.active_id,
7535 tst_active.tries,
7536 tst_active.user_fi usr_id,
7537 %s login,
7538 %s lastname,
7539 %s firstname,
7540 tst_active.submitted test_finished,
7541 usr_data.matriculation,
7542 usr_data.active,
7543 tst_active.lastindex,
7544 COALESCE(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass unfinished_passes
7545 FROM tst_active
7546 LEFT JOIN usr_data
7547 ON tst_active.user_fi = usr_data.usr_id
7548 WHERE tst_active.test_fi = %s
7549 ORDER BY usr_data.lastname
7550 ";
7551 $result = $ilDB->queryF(
7552 $query,
7553 array('text', 'text', 'text', 'integer'),
7554 array("", $this->lng->txt("anonymous"), "", $this->getTestId())
7555 );
7556 } else {
7557 $query = "
7558 SELECT tst_active.active_id,
7559 tst_active.tries,
7560 tst_active.user_fi usr_id,
7561 usr_data.login,
7562 usr_data.lastname,
7563 usr_data.firstname,
7564 tst_active.submitted test_finished,
7565 usr_data.matriculation,
7566 usr_data.active,
7567 tst_active.lastindex,
7568 COALESCE(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass unfinished_passes
7569 FROM tst_active
7570 LEFT JOIN usr_data
7571 ON tst_active.user_fi = usr_data.usr_id
7572 WHERE tst_active.test_fi = %s
7573 ORDER BY usr_data.lastname
7574 ";
7575 $result = $ilDB->queryF(
7576 $query,
7577 array('integer'),
7578 array($this->getTestId())
7579 );
7580 }
7581 $data = array();
7582 while ($row = $ilDB->fetchAssoc($result)) {
7583 $data[$row['active_id']] = $row;
7584 }
7585 foreach ($data as $index => $participant) {
7586 if (strlen(trim($participant["firstname"] . $participant["lastname"])) == 0) {
7587 $data[$index]["lastname"] = $this->lng->txt("deleted_user");
7588 }
7589 }
7590 return $data;
7591 }
$index
Definition: metadata.php:128

References $data, $DIC, $ilDB, $index, $query, $result, getAnonymity(), and getTestId().

Referenced by buildStatisticsAccessFilteredParticipantList(), getActiveParticipantList(), getTestParticipantsForManualScoring(), and sendAdvancedNotification().

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

◆ getTestParticipantsForManualScoring()

ilObjTest::getTestParticipantsForManualScoring (   $filter = null)

Definition at line 7593 of file class.ilObjTest.php.

7594 {
7595 global $DIC;
7596 $ilDB = $DIC['ilDB'];
7597
7598 include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
7600 if (count($scoring) == 0) {
7601 return array();
7602 }
7603
7604 $participants = &$this->getTestParticipants();
7605 $filtered_participants = array();
7606 foreach ($participants as $active_id => $participant) {
7607 $qstType_IN_manScoreableQstTypes = $ilDB->in('qpl_questions.question_type_fi', $scoring, false, 'integer');
7608
7609 $queryString = "
7610 SELECT tst_test_result.manual
7611
7612 FROM tst_test_result
7613
7614 INNER JOIN qpl_questions
7615 ON tst_test_result.question_fi = qpl_questions.question_id
7616
7617 WHERE tst_test_result.active_fi = %s
7618 AND $qstType_IN_manScoreableQstTypes
7619 ";
7620
7621 $result = $ilDB->queryF(
7622 $queryString,
7623 array("integer"),
7624 array($active_id)
7625 );
7626
7627 $count = $result->numRows();
7628
7629 if ($count > 0) {
7630 switch ($filter) {
7631 case 1: // only active users
7632 if ($participant->active) {
7633 $filtered_participants[$active_id] = $participant;
7634 }
7635 break;
7636 case 2: // only inactive users
7637 if (!$participant->active) {
7638 $filtered_participants[$active_id] = $participant;
7639 }
7640 break;
7641 case 3: // all users
7642 $filtered_participants[$active_id] = $participant;
7643 break;
7644 case 4:
7645 // already scored participants
7646 //$found = 0;
7647 //while ($row = $ilDB->fetchAssoc($result))
7648 //{
7649 // if ($row["manual"]) $found++;
7650 //}
7651 //if ($found == $count)
7652 //{
7653 //$filtered_participants[$active_id] = $participant;
7654 //}
7655 //else
7656 //{
7657 $assessmentSetting = new ilSetting("assessment");
7658 $manscoring_done = $assessmentSetting->get("manscoring_done_" . $active_id);
7659 if ($manscoring_done) {
7660 $filtered_participants[$active_id] = $participant;
7661 }
7662 //}
7663 break;
7664 case 5:
7665 // unscored participants
7666 //$found = 0;
7667 //while ($row = $ilDB->fetchAssoc($result))
7668 //{
7669 // if ($row["manual"]) $found++;
7670 //}
7671 //if ($found == 0)
7672 //{
7673 $assessmentSetting = new ilSetting("assessment");
7674 $manscoring_done = $assessmentSetting->get("manscoring_done_" . $active_id);
7675 if (!$manscoring_done) {
7676 $filtered_participants[$active_id] = $participant;
7677 }
7678 //}
7679 break;
7680 case 6:
7681 // partially scored participants
7682 $found = 0;
7683 while ($row = $ilDB->fetchAssoc($result)) {
7684 if ($row["manual"]) {
7685 $found++;
7686 }
7687 }
7688 if (($found > 0) && ($found < $count)) {
7689 $filtered_participants[$active_id] = $participant;
7690 }
7691 break;
7692 default:
7693 $filtered_participants[$active_id] = $participant;
7694 break;
7695 }
7696 }
7697 }
7698 return $filtered_participants;
7699 }
static _getManualScoring()
Retrieve the manual scoring settings.

References $DIC, $ilDB, $result, ilObjAssessmentFolder\_getManualScoring(), and getTestParticipants().

+ Here is the call graph for this function:

◆ getTestQuestions()

& ilObjTest::getTestQuestions ( )

Definition at line 8462 of file class.ilObjTest.php.

8463 {
8464 global $DIC;
8465 $ilDB = $DIC['ilDB'];
8466
8467 $tags_trafo = $this->refinery->string()->stripTags();
8468
8469 $query = "
8470 SELECT questions.*,
8471 questtypes.type_tag,
8472 tstquest.sequence,
8473 tstquest.obligatory,
8474 origquest.obj_fi orig_obj_fi
8475
8476 FROM qpl_questions questions
8477
8478 INNER JOIN qpl_qst_type questtypes
8479 ON questtypes.question_type_id = questions.question_type_fi
8480
8481 INNER JOIN tst_test_question tstquest
8482 ON tstquest.question_fi = questions.question_id
8483
8484 LEFT JOIN qpl_questions origquest
8485 ON origquest.question_id = questions.original_id
8486
8487 WHERE tstquest.test_fi = %s
8488
8489 ORDER BY tstquest.sequence
8490 ";
8491
8492 $query_result = $ilDB->queryF(
8493 $query,
8494 array('integer'),
8495 array($this->getTestId())
8496 );
8497
8498 $questions = array();
8499
8500 while ($row = $ilDB->fetchAssoc($query_result)) {
8501 $row['title'] = $tags_trafo->transform($row['title']);
8502 $row['description'] = $tags_trafo->transform($row['description'] !== '' && $row['description'] !== null ? $row['description'] : '&nbsp;');
8503 $row['author'] = $tags_trafo->transform($row['author']);
8504 $row['obligationPossible'] = self::isQuestionObligationPossible($row['question_id']);
8505
8506 $questions[] = $row;
8507 }
8508
8509 return $questions;
8510 }
static isQuestionObligationPossible($questionId)
checks wether the obligation for question with given id is possible or not

References $DIC, $ilDB, $query, $questions, getTestId(), and isQuestionObligationPossible().

Referenced by getFixedQuestionSetTotalPoints(), getFixedQuestionSetTotalWorkingTime(), and isTestQuestion().

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

◆ getTestResult()

& ilObjTest::getTestResult (   $active_id,
  $pass = null,
  $ordered_sequence = false,
  $considerHiddenQuestions = true,
  $considerOptionalQuestions = true 
)

Calculates the results of a test for a given user and returns an array with all test results.

Returns
array An array containing the test results for the given user @access public

Definition at line 4039 of file class.ilObjTest.php.

4040 {
4041 global $DIC;
4042 $tree = $DIC['tree'];
4043 $ilDB = $DIC['ilDB'];
4044 $lng = $DIC['lng'];
4045 $refinery = $DIC['refinery'];
4046 $ilPluginAdmin = $DIC['ilPluginAdmin'];
4047
4048 $results = $this->getResultsForActiveId($active_id);
4049
4050 if ($pass === null) {
4051 $pass = $results['pass'];
4052 }
4053
4054 require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
4055 $testSessionFactory = new ilTestSessionFactory($this);
4056 $testSession = $testSessionFactory->getSession($active_id);
4057
4058 require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
4059 $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $refinery, $ilPluginAdmin, $this);
4060 $testSequence = $testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
4061
4062 if ($this->isDynamicTest()) {
4063 require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
4064 $dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this);
4065 $dynamicQuestionSetConfig->loadFromDb();
4066
4067 $testSequence->loadFromDb($dynamicQuestionSetConfig);
4068 $testSequence->loadQuestions($dynamicQuestionSetConfig, new ilTestDynamicQuestionSetFilterSelection());
4069
4070 $sequence = $testSequence->getUserSequenceQuestions();
4071 } else {
4072 $testSequence->setConsiderHiddenQuestionsEnabled($considerHiddenQuestions);
4073 $testSequence->setConsiderOptionalQuestionsEnabled($considerOptionalQuestions);
4074
4075 $testSequence->loadFromDb();
4076 $testSequence->loadQuestions();
4077
4078 if ($ordered_sequence) {
4079 $sequence = $testSequence->getOrderedSequenceQuestions();
4080 } else {
4081 $sequence = $testSequence->getUserSequenceQuestions();
4082 }
4083 }
4084
4085 $arrResults = [];
4086
4087 $query = "
4088 SELECT tst_test_result.question_fi,
4089 tst_test_result.points reached,
4090 tst_test_result.hint_count requested_hints,
4091 tst_test_result.hint_points hint_points,
4092 tst_test_result.answered answered
4093
4094 FROM tst_test_result
4095
4096 LEFT JOIN tst_solutions
4097 ON tst_solutions.active_fi = tst_test_result.active_fi
4098 AND tst_solutions.question_fi = tst_test_result.question_fi
4099
4100 WHERE tst_test_result.active_fi = %s
4101 AND tst_test_result.pass = %s
4102 ";
4103
4104 $solutionresult = $ilDB->queryF(
4105 $query,
4106 array('integer', 'integer'),
4107 array($active_id, $pass)
4108 );
4109
4110 while ($row = $ilDB->fetchAssoc($solutionresult)) {
4111 $arrResults[ $row['question_fi'] ] = $row;
4112 }
4113
4114 $numWorkedThrough = count($arrResults);
4115
4116 require_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
4117
4118 $IN_question_ids = $ilDB->in('qpl_questions.question_id', $sequence, false, 'integer');
4119
4120 $query = "
4121 SELECT qpl_questions.*,
4122 qpl_qst_type.type_tag,
4123 qpl_sol_sug.question_fi has_sug_sol
4124
4125 FROM qpl_qst_type,
4126 qpl_questions
4127
4128 LEFT JOIN qpl_sol_sug
4129 ON qpl_sol_sug.question_fi = qpl_questions.question_id
4130
4131 WHERE qpl_qst_type.question_type_id = qpl_questions.question_type_fi
4132 AND $IN_question_ids
4133 ";
4134
4135 $result = $ilDB->query($query);
4136
4137 $unordered = [];
4138
4139 $key = 1;
4140
4141 $obligationsAnswered = true;
4142
4143 while ($row = $ilDB->fetchAssoc($result)) {
4144 $percentvalue = (
4145 $row['points'] ? $arrResults[ $row['question_id'] ]['reached'] / $row['points'] : 0
4146 );
4147
4148 if ($percentvalue < 0) {
4149 $percentvalue = 0.0;
4150 }
4151
4152 $data = array(
4153 "nr" => "$key",
4154 "title" => ilUtil::prepareFormOutput($row['title']),
4155 "max" => round($row['points'], 2),
4156 "reached" => round($arrResults[$row['question_id']]['reached'], 2),
4157 'requested_hints' => $arrResults[$row['question_id']]['requested_hints'],
4158 'hint_points' => $arrResults[$row['question_id']]['hint_points'],
4159 "percent" => sprintf("%2.2f ", ($percentvalue) * 100) . "%",
4160 "solution" => ($row['has_sug_sol']) ? assQuestion::_getSuggestedSolutionOutput($row['question_id']) : '',
4161 "type" => $row["type_tag"],
4162 "qid" => $row['question_id'],
4163 "original_id" => $row["original_id"],
4164 "workedthrough" => isset($arrResults[$row['question_id']]) ? 1 : 0,
4165 'answered' => $arrResults[$row['question_id']]['answered']
4166 );
4167
4168 if (!$arrResults[ $row['question_id'] ]['answered']) {
4169 $obligationsAnswered = false;
4170 }
4171
4172 $unordered[ $row['question_id'] ] = $data;
4173
4174 $key++;
4175 }
4176
4177 $numQuestionsTotal = count($unordered);
4178
4179 $pass_max = 0;
4180 $pass_reached = 0;
4181 $pass_requested_hints = 0;
4182 $pass_hint_points = 0;
4183 $key = 1;
4184
4185 $found = [];
4186
4187 foreach ($sequence as $qid) {
4188 // building pass point sums based on prepared data
4189 // for question that exists in users qst sequence
4190 $pass_max += round($unordered[$qid]['max'], 2);
4191 $pass_reached += round($unordered[$qid]['reached'], 2);
4192 $pass_requested_hints += $unordered[$qid]['requested_hints'];
4193 $pass_hint_points += $unordered[$qid]['hint_points'];
4194
4195 // pickup prepared data for question
4196 // that exists in users qst sequence
4197 $unordered[$qid]['nr'] = $key;
4198 array_push($found, $unordered[$qid]);
4199
4200 // increment key counter
4201 $key++;
4202 }
4203
4204 $unordered = null;
4205
4206 if ($this->getScoreCutting() == 1) {
4207 if ($results['reached_points'] < 0) {
4208 $results['reached_points'] = 0;
4209 }
4210
4211 if ($pass_reached < 0) {
4212 $pass_reached = 0;
4213 }
4214 }
4215
4216 $found['pass']['total_max_points'] = $pass_max;
4217 $found['pass']['total_reached_points'] = $pass_reached;
4218 $found['pass']['total_requested_hints'] = $pass_requested_hints;
4219 $found['pass']['total_hint_points'] = $pass_hint_points;
4220 $found['pass']['percent'] = ($pass_max > 0) ? $pass_reached / $pass_max : 0;
4221 $found['pass']['obligationsAnswered'] = $obligationsAnswered;
4222 $found['pass']['num_workedthrough'] = $numWorkedThrough;
4223 $found['pass']['num_questions_total'] = $numQuestionsTotal;
4224
4225 $found["test"]["total_max_points"] = $results['max_points'];
4226 $found["test"]["total_reached_points"] = $results['reached_points'];
4227 $found["test"]["total_requested_hints"] = $results['hint_count'];
4228 $found["test"]["total_hint_points"] = $results['hint_points'];
4229 $found["test"]["result_pass"] = $results['pass'];
4230 $found['test']['result_tstamp'] = $results['tstamp'];
4231 $found['test']['obligations_answered'] = $results['obligations_answered'];
4232
4233 if ((!$found['pass']['total_reached_points']) or (!$found['pass']['total_max_points'])) {
4234 $percentage = 0.0;
4235 } else {
4236 $percentage = ($found['pass']['total_reached_points'] / $found['pass']['total_max_points']) * 100.0;
4237
4238 if ($percentage < 0) {
4239 $percentage = 0.0;
4240 }
4241 }
4242
4243 $found["test"]["passed"] = $results['passed'];
4244
4245 return $found;
4246 }
static _getSuggestedSolutionOutput($question_id)
Returns the output of the suggested solution.
getResultsForActiveId($active_id)

References $data, $DIC, $ilDB, ilObject\$lng, $pass, $query, $result, $results, $testSequence, $testSession, ilObject\$tree, assQuestion\_getSuggestedSolutionOutput(), getResultsForActiveId(), getScoreCutting(), isDynamicTest(), and ilUtil\prepareFormOutput().

Referenced by evalStatistical(), getPassed(), getTotalPointsPassedArray(), and ilTestSequence\hideCorrectAnsweredQuestions().

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

◆ getTextAnswer()

ilObjTest::getTextAnswer (   $active_id,
  $question_id,
  $pass = null 
)

Returns the text answer of a given user for a given question.

Parameters
integer$user_idThe user id
integer$question_idThe question id
Returns
string The answer text @access public

Definition at line 7381 of file class.ilObjTest.php.

7382 {
7383 global $DIC;
7384 $ilDB = $DIC['ilDB'];
7385
7386 $res = "";
7387 if (($active_id) && ($question_id)) {
7388 if (is_null($pass)) {
7389 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
7390 $pass = assQuestion::_getSolutionMaxPass($question_id, $active_id);
7391 }
7392 $result = $ilDB->queryF(
7393 "SELECT value1 FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
7394 array('integer', 'integer', 'integer'),
7395 array($active_id, $question_id, $pass)
7396 );
7397 if ($result->numRows() == 1) {
7398 $row = $ilDB->fetchAssoc($result);
7399 $res = $row["value1"];
7400 }
7401 }
7402 return $res;
7403 }
static _getSolutionMaxPass($question_id, $active_id)
Returns the maximum pass a users question solution.

References $DIC, $ilDB, $pass, $res, $result, and assQuestion\_getSolutionMaxPass().

+ Here is the call graph for this function:

◆ getTimeExtensionsOfParticipants()

ilObjTest::getTimeExtensionsOfParticipants ( )

Definition at line 11635 of file class.ilObjTest.php.

11636 {
11637 global $DIC;
11638 $ilDB = $DIC['ilDB'];
11639
11640 $times = array();
11641 $result = $ilDB->queryF(
11642 "SELECT tst_addtime.active_fi, tst_addtime.additionaltime FROM tst_addtime, tst_active WHERE tst_addtime.active_fi = tst_active.active_id AND tst_active.test_fi = %s",
11643 array('integer'),
11644 array($this->getTestId())
11645 );
11646 while ($row = $ilDB->fetchAssoc($result)) {
11647 $times[$row['active_fi']] = $row['additionaltime'];
11648 }
11649 return $times;
11650 }

References $DIC, $ilDB, $result, and getTestId().

+ Here is the call graph for this function:

◆ getTitleFilenameCompliant()

ilObjTest::getTitleFilenameCompliant ( )

returns the object title prepared to be used as a filename

Returns
string

Definition at line 719 of file class.ilObjTest.php.

720 {
721 require_once 'Services/Utilities/classes/class.ilUtil.php';
722 return ilUtil::getASCIIFilename($this->getTitle());
723 }

References ilUtil\getASCIIFilename(), and ilObject\getTitle().

+ Here is the call graph for this function:

◆ getTitleOutput()

ilObjTest::getTitleOutput ( )

Returns the value of the title_output status.

Returns
integer 0 for full title, 1 for title without points, 2 for no title @access public
See also
$title_output

Definition at line 2805 of file class.ilObjTest.php.

2806 {
2807 return ($this->title_output) ? $this->title_output : 0;
2808 }

Referenced by addDefaults(), getQuestionTitle(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getTmpCopyWizardCopyId()

ilObjTest::getTmpCopyWizardCopyId ( )
Returns
int

Definition at line 728 of file class.ilObjTest.php.

729 {
731 }

References $tmpCopyWizardCopyId.

Referenced by ilTestFixedQuestionSetConfig\cloneQuestionSetRelatedData(), and ilTestRandomQuestionSetConfig\registerClonedSourcePoolDefinitionIdMapping().

+ Here is the caller graph for this function:

◆ getTotalPointsPassedArray()

& ilObjTest::getTotalPointsPassedArray ( )

Returns an array with the total points of all users who passed the test This array could be used for statistics.

Returns
array The total point values @access public

Definition at line 4553 of file class.ilObjTest.php.

4554 {
4555 $totalpoints_array = array();
4556 $all_users = &$this->evalTotalParticipantsArray();
4557 foreach ($all_users as $active_id => $user_name) {
4558 $test_result = &$this->getTestResult($active_id);
4559 $reached = $test_result["test"]["total_reached_points"];
4560 $total = $test_result["test"]["total_max_points"];
4561 $percentage = $total != 0 ? $reached / $total : 0;
4562 $mark = $this->mark_schema->getMatchingMark($percentage * 100.0);
4563
4564 $obligationsAnswered = $test_result["test"]["obligations_answered"];
4565
4566 if ($mark) {
4567 if ($mark->getPassed() && $obligationsAnswered) {
4568 array_push($totalpoints_array, $test_result["test"]["total_reached_points"]);
4569 }
4570 }
4571 }
4572 return $totalpoints_array;
4573 }
& evalTotalParticipantsArray($name_sort_order="asc")
Returns all participants who started the test.

References $total, evalTotalParticipantsArray(), and getTestResult().

Referenced by getAllTestResults().

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

◆ getUsePreviousAnswers()

ilObjTest::getUsePreviousAnswers ( )

Returns if the previous answers should be shown for a learner.

Returns
integer 1 if the previous answers should be shown, 0 otherwise @access public
See also
$use_previous_answers

Definition at line 2793 of file class.ilObjTest.php.

2794 {
2795 return ($this->use_previous_answers) ? $this->use_previous_answers : 0;
2796 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ getUserData()

& ilObjTest::getUserData (   $ids)

Returns a data of all users specified by id list.

Parameters
$usr_idskommaseparated list of ids
Returns
array The user data "usr_id, login, lastname, firstname, clientip" of the users with id as key @access public

Definition at line 7708 of file class.ilObjTest.php.

7709 {
7710 global $DIC;
7711 $ilDB = $DIC['ilDB'];
7712
7713 if (!is_array($ids) || count($ids) == 0) {
7714 return array();
7715 }
7716
7717 if ($this->getAnonymity()) {
7718 $result = $ilDB->queryF(
7719 "SELECT usr_id, %s login, %s lastname, %s firstname, client_ip clientip FROM usr_data WHERE " . $ilDB->in('usr_id', $ids, false, 'integer') . " ORDER BY login",
7720 array('text', 'text', 'text'),
7721 array("", $this->lng->txt("anonymous"), "")
7722 );
7723 } else {
7724 $result = $ilDB->query("SELECT usr_id, login, lastname, firstname, client_ip clientip FROM usr_data WHERE " . $ilDB->in('usr_id', $ids, false, 'integer') . " ORDER BY login");
7725 }
7726
7727 $result_array = array();
7728 while ($row = $ilDB->fetchAssoc($result)) {
7729 $result_array[$row["usr_id"]] = $row;
7730 }
7731 return $result_array;
7732 }

References $DIC, $ilDB, $result, and getAnonymity().

+ Here is the call graph for this function:

◆ getVisitTimeOfParticipant()

ilObjTest::getVisitTimeOfParticipant (   $active_id)

Returns the first and last visit of a participant.

Parameters
integer$active_idThe active ID of the participant
Returns
array The first and last visit of a participant @access public

Definition at line 4399 of file class.ilObjTest.php.

4400 {
4401 return ilObjTest::_getVisitTimeOfParticipant($this->getTestId(), $active_id);
4402 }
_getVisitTimeOfParticipant($test_id, $active_id)
Returns the first and last visit of a participant.

References _getVisitTimeOfParticipant(), and getTestId().

+ Here is the call graph for this function:

◆ getWorkedQuestions()

& ilObjTest::getWorkedQuestions (   $active_id,
  $pass = null 
)

Gets the id's of all questions a user already worked through.

Returns
array The question id's of the questions already worked through @access public

Definition at line 3856 of file class.ilObjTest.php.

3857 {
3858 global $DIC;
3859 $ilUser = $DIC['ilUser'];
3860 $ilDB = $DIC['ilDB'];
3861
3862 if (is_null($pass)) {
3863 $result = $ilDB->queryF(
3864 "SELECT question_fi FROM tst_solutions WHERE active_fi = %s AND pass = %s GROUP BY question_fi",
3865 array('integer','integer'),
3866 array($active_id, 0)
3867 );
3868 } else {
3869 $result = $ilDB->queryF(
3870 "SELECT question_fi FROM tst_solutions WHERE active_fi = %s AND pass = %s GROUP BY question_fi",
3871 array('integer','integer'),
3872 array($active_id, $pass)
3873 );
3874 }
3875 $result_array = array();
3876 while ($row = $ilDB->fetchAssoc($result)) {
3877 array_push($result_array, $row["question_fi"]);
3878 }
3879 return $result_array;
3880 }

References $DIC, $ilDB, $ilUser, $pass, and $result.

◆ getXMLZip()

ilObjTest::getXMLZip ( )

Get zipped xml file for test.

Reimplemented from ilObject.

Definition at line 10546 of file class.ilObjTest.php.

10547 {
10548 require_once 'Modules/Test/classes/class.ilTestExportFactory.php';
10549 $expFactory = new ilTestExportFactory($this);
10550 $test_exp = $expFactory->getExporter('xml');
10551 return $test_exp->buildExportFile();
10552 }

◆ hasAnyTestResult()

ilObjTest::hasAnyTestResult ( ilTestSession  $testSession)

Definition at line 8391 of file class.ilObjTest.php.

8392 {
8393 global $DIC; /* @var ILIAS\DI\Container $DIC */
8394
8395 require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
8396 $passSelector = new ilTestPassesSelector($DIC->database(), $this);
8397
8398 $passSelector->setActiveId($testSession->getActiveId());
8399 $passSelector->setLastFinishedPass($testSession->getLastFinishedPass());
8400
8401 return $passSelector->hasExistingPasses();
8402 }

References $DIC, and $testSession.

◆ hasNrOfTriesRestriction()

ilObjTest::hasNrOfTriesRestriction ( )

returns if the numbers of tries have to be checked

Definition at line 7941 of file class.ilObjTest.php.

7942 {
7943 return $this->getNrOfTries() != 0;
7944 }

References getNrOfTries().

Referenced by isExecutable().

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

◆ hasObligations()

static ilObjTest::hasObligations (   $test_id)
static

returns the fact wether the test with given test id contains questions markes as obligatory or not

@global ilDBInterface $ilDB

Parameters
integer$test_id
Returns
boolean $hasObligations

Definition at line 11485 of file class.ilObjTest.php.

11486 {
11487 global $DIC;
11488 $ilDB = $DIC['ilDB'];
11489
11490 $rset = $ilDB->queryF(
11491 'SELECT count(*) cnt FROM tst_test_question WHERE test_fi = %s AND obligatory = 1',
11492 array('integer'),
11493 array($test_id)
11494 );
11495
11496 $row = $ilDB->fetchAssoc($rset);
11497
11498 return (bool) $row['cnt'] > 0;
11499 }

References $DIC, $ilDB, and $test_id.

Referenced by allObligationsAnswered().

+ Here is the caller graph for this function:

◆ hasQuestionsWithoutQuestionpool()

ilObjTest::hasQuestionsWithoutQuestionpool ( )

Definition at line 10949 of file class.ilObjTest.php.

10950 {
10951 global $DIC;
10952 $ilDB = $DIC['ilDB'];
10953
10955
10956 $IN_questions = $ilDB->in('q1.question_id', array_keys($questions), false, 'integer');
10957
10958 $query = "
10959 SELECT count(q1.question_id) cnt
10960
10961 FROM qpl_questions q1
10962
10963 INNER JOIN qpl_questions q2
10964 ON q2.question_id = q1.original_id
10965
10966 WHERE $IN_questions
10967 AND q1.obj_fi = q2.obj_fi
10968 ";
10969
10970 $rset = $ilDB->query($query);
10971
10972 $row = $ilDB->fetchAssoc($rset);
10973
10974 return $row['cnt'] > 0;
10975 }
& getQuestionTitlesAndIndexes()
Returns the titles of the test questions in question sequence.

References $DIC, $ilDB, $query, $questions, and getQuestionTitlesAndIndexes().

+ Here is the call graph for this function:

◆ hasRandomQuestionsForPass()

ilObjTest::hasRandomQuestionsForPass (   $active_id,
  $pass 
)

Checkes wheather a random test has already created questions for a given pass or not.

@access private

Parameters
$active_idActive id of the test
$passPass of the test
Returns
boolean TRUE if the test already contains questions, FALSE otherwise
Deprecated:
: still in use?

Definition at line 1830 of file class.ilObjTest.php.

1831 {
1832 global $DIC;
1833 $ilDB = $DIC['ilDB'];
1834 $result = $ilDB->queryF(
1835 "SELECT test_random_question_id FROM tst_test_rnd_qst WHERE active_fi = %s AND pass = %s",
1836 array('integer','integer'),
1837 array($active_id, $pass)
1838 );
1839 return ($result->numRows() > 0) ? true : false;
1840 }
return true
Flag indicating whether or not HTTP headers will be sent when outputting captcha image/audio.

References $DIC, $ilDB, $pass, $result, and true.

◆ hasSingleChoiceQuestions()

ilObjTest::hasSingleChoiceQuestions ( )

Returns TRUE if the test contains single choice results.

Returns
boolean @access public

Definition at line 1010 of file class.ilObjTest.php.

1011 {
1012 global $DIC;
1013 $ilDB = $DIC['ilDB'];
1014
1015 $result = $ilDB->queryF(
1016 "SELECT DISTINCT(qpl_qst_type.type_tag) foundtypes FROM qpl_questions, tst_test_result, qpl_qst_type, tst_active WHERE tst_test_result.question_fi = qpl_questions.question_id AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id AND tst_test_result.active_fi = tst_active.active_id AND tst_active.test_fi = %s",
1017 array('integer'),
1018 array($this->getTestId())
1019 );
1020 $hasSC = false;
1021 while ($row = $ilDB->fetchAssoc($result)) {
1022 if (strcmp($row['foundtypes'], 'assSingleChoice') == 0) {
1023 $hasSC = true;
1024 }
1025 }
1026 return $hasSC;
1027 }

References $DIC, $ilDB, $result, and getTestId().

Referenced by isSingleChoiceTestWithoutShuffle().

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

◆ insertManualFeedback()

ilObjTest::insertManualFeedback (   $active_id,
  $question_id,
  $pass,
  $feedback,
  $finalized,
  $feedback_old 
)
private

Inserts a manual feedback into the DB.

Parameters
integer$active_idActive ID of the user
integer$question_idQuestion ID
integer$passPass number
string$feedbackThe feedback text
array$feedback_oldThe feedback before update
boolean$finalizedIn Feedback is final

Definition at line 10177 of file class.ilObjTest.php.

10178 {
10179 global $DIC;
10180
10181 $ilDB = $DIC->database();
10182 $ilUser = $DIC->user();
10183 $next_id = $ilDB->nextId('tst_manual_fb');
10184 $user = $ilUser->getId();
10185 $finalized_time = time();
10186
10187 $update_default = [
10188 'manual_feedback_id' => [ 'integer', $next_id],
10189 'active_fi' => [ 'integer', $active_id],
10190 'question_fi' => [ 'integer', $question_id],
10191 'pass' => [ 'integer', $pass],
10192 'feedback' => [ 'clob', ilRTE::_replaceMediaObjectImageSrc($feedback, 0)],
10193 'tstamp' => [ 'integer', time()]
10194 ];
10195
10196 if ($feedback_old['finalized_evaluation'] == 1) {
10197 $user = $feedback_old['finalized_by_usr_id'];
10198 $finalized_time = $feedback_old['finalized_tstamp'];
10199 }
10200
10201 if ($finalized === false) {
10202 $update_default['finalized_evaluation'] = ['integer', 0];
10203 $update_default['finalized_by_usr_id'] = ['integer', 0];
10204 $update_default['finalized_tstamp'] = ['integer', 0];
10205 } elseif ($finalized === true) {
10206 $update_default['finalized_evaluation'] = ['integer', 1];
10207 $update_default['finalized_by_usr_id'] = ['integer', $user];
10208 $update_default['finalized_tstamp'] = ['integer', $finalized_time];
10209 }
10210
10211 $ilDB->insert('tst_manual_fb', $update_default);
10212 }

References $DIC, $ilDB, $ilUser, $pass, and ilRTE\_replaceMediaObjectImageSrc().

Referenced by saveManualFeedback().

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

◆ insertQuestion()

ilObjTest::insertQuestion ( ilTestQuestionSetConfig  $testQuestionSetConfig,
  $question_id,
  $linkOnly = false 
)

Insert a question in the list of questions.

Parameters
ilTestQuestionSetConfig$testQuestionSetConfig
integer$question_idThe database id of the inserted question
boolean$linkOnly
Returns
integer $duplicate_id

Definition at line 3599 of file class.ilObjTest.php.

3600 {
3601 global $DIC;
3602 $ilDB = $DIC['ilDB'];
3603 if ($linkOnly) {
3604 $duplicate_id = $question_id;
3605 } else {
3606 $duplicate_id = $this->duplicateQuestionForTest($question_id);
3607 }
3608
3609 // get maximum sequence index in test
3610 $result = $ilDB->queryF(
3611 "SELECT MAX(sequence) seq FROM tst_test_question WHERE test_fi=%s",
3612 array('integer'),
3613 array($this->getTestId())
3614 );
3615 $sequence = 1;
3616
3617 if ($result->numRows() == 1) {
3618 $data = $ilDB->fetchObject($result);
3619 $sequence = $data->seq + 1;
3620 }
3621
3622 $next_id = $ilDB->nextId('tst_test_question');
3623 $affectedRows = $ilDB->manipulateF(
3624 "INSERT INTO tst_test_question (test_question_id, test_fi, question_fi, sequence, tstamp) VALUES (%s, %s, %s, %s, %s)",
3625 array('integer', 'integer','integer','integer','integer'),
3626 array($next_id, $this->getTestId(), $duplicate_id, $sequence, time())
3627 );
3628 if ($affectedRows == 1) {
3629 include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3631 $this->logAction($this->lng->txtlng("assessment", "log_question_added", ilObjAssessmentFolder::_getLogLanguage()) . ": " . $sequence, $duplicate_id);
3632 }
3633 }
3634 // remove test_active entries, because test has changed
3635 $affectedRows = $ilDB->manipulateF(
3636 "DELETE FROM tst_active WHERE test_fi = %s",
3637 array('integer'),
3638 array($this->getTestId())
3639 );
3640 $this->loadQuestions();
3641 $this->saveCompleteStatus($testQuestionSetConfig);
3642 return $duplicate_id;
3643 }
saveCompleteStatus(ilTestQuestionSetConfig $testQuestionSetConfig)
Checks if the test is complete and saves the status in the database.
duplicateQuestionForTest($question_id)
Takes a question and creates a copy of the question for use in the test.

References $data, $DIC, $ilDB, $result, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), duplicateQuestionForTest(), getTestId(), loadQuestions(), logAction(), and saveCompleteStatus().

+ Here is the call graph for this function:

◆ inviteGroup()

ilObjTest::inviteGroup (   $group_id)

Invites all users of a group to a test.

Parameters
integer$group_idThe database id of the invited group @access public

Definition at line 7766 of file class.ilObjTest.php.

7767 {
7768 include_once "./Modules/Group/classes/class.ilObjGroup.php";
7769 $group = new ilObjGroup($group_id);
7770 $members = $group->getGroupMemberIds();
7771 include_once './Services/User/classes/class.ilObjUser.php';
7772 foreach ($members as $user_id) {
7773 $this->inviteUser($user_id, ilObjUser::_lookupClientIP($user_id));
7774 }
7775 }
Class ilObjGroup.
inviteUser($user_id, $client_ip="")
Invites a user to a test.
static _lookupClientIP($a_user_id)
Lookup client ip.

References ilObjUser\_lookupClientIP(), and inviteUser().

+ Here is the call graph for this function:

◆ inviteRole()

ilObjTest::inviteRole (   $role_id)

Invites all users of a role to a test.

Parameters
integer$group_idThe database id of the invited group @access public

Definition at line 7783 of file class.ilObjTest.php.

7784 {
7785 global $DIC;
7786 $rbacreview = $DIC['rbacreview'];
7787 $members = $rbacreview->assignedUsers($role_id);
7788 include_once './Services/User/classes/class.ilObjUser.php';
7789 foreach ($members as $user_id) {
7790 $this->inviteUser($user_id, ilObjUser::_lookupClientIP($user_id));
7791 }
7792 }

References $DIC, ilObject\$rbacreview, ilObjUser\_lookupClientIP(), and inviteUser().

+ Here is the call graph for this function:

◆ inviteUser()

ilObjTest::inviteUser (   $user_id,
  $client_ip = "" 
)

Invites a user to a test.

Parameters
integer$user_idThe database id of the invited user @access public

Definition at line 7820 of file class.ilObjTest.php.

7821 {
7822 global $DIC;
7823 $ilDB = $DIC['ilDB'];
7824
7825 $affectedRows = $ilDB->manipulateF(
7826 "DELETE FROM tst_invited_user WHERE test_fi = %s AND user_fi = %s",
7827 array('integer', 'integer'),
7828 array($this->getTestId(), $user_id)
7829 );
7830 $affectedRows = $ilDB->manipulateF(
7831 "INSERT INTO tst_invited_user (test_fi, user_fi, clientip, tstamp) VALUES (%s, %s, %s, %s)",
7832 array('integer', 'integer', 'text', 'integer'),
7833 array($this->getTestId(), $user_id, (strlen($client_ip)) ? $client_ip : null, time())
7834 );
7835 }

References $DIC, $ilDB, and getTestId().

Referenced by inviteGroup(), and inviteRole().

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

◆ isActivationLimited()

ilObjTest::isActivationLimited ( )

Definition at line 11074 of file class.ilObjTest.php.

11075 {
11076 return (bool) $this->activation_limited;
11077 }

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ isActiveTestSubmitted()

ilObjTest::isActiveTestSubmitted (   $user_id = null)

returns if the active for user_id has been submitted

Definition at line 7920 of file class.ilObjTest.php.

7921 {
7922 global $DIC;
7923 $ilUser = $DIC['ilUser'];
7924 $ilDB = $DIC['ilDB'];
7925
7926 if (!is_numeric($user_id)) {
7927 $user_id = $ilUser->getId();
7928 }
7929
7930 $result = $ilDB->queryF(
7931 "SELECT submitted FROM tst_active WHERE test_fi=%s AND user_fi=%s AND submitted=%s",
7932 array('integer', 'integer', 'integer'),
7933 array($this->getTestId(), $user_id, 1)
7934 );
7935 return $result->numRows() == 1;
7936 }

References $DIC, $ilDB, $ilUser, $result, and getTestId().

+ Here is the call graph for this function:

◆ isAnyInstantFeedbackOptionEnabled()

ilObjTest::isAnyInstantFeedbackOptionEnabled ( )

Definition at line 10789 of file class.ilObjTest.php.

10790 {
10791 return (
10794 );
10795 }

References getAnswerFeedbackPoints(), getGenericAnswerFeedback(), getInstantFeedbackSolution(), and getSpecificAnswerFeedback().

+ Here is the call graph for this function:

◆ isBestSolutionPrintedWithResult()

ilObjTest::isBestSolutionPrintedWithResult ( )

Definition at line 11039 of file class.ilObjTest.php.

11040 {
11042 }
$print_best_solution_with_result

References $print_best_solution_with_result.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ isBlockPassesAfterPassedEnabled()

ilObjTest::isBlockPassesAfterPassedEnabled ( )
Returns
bool

Definition at line 2648 of file class.ilObjTest.php.

2649 {
2651 }
$blockPassesAfterPassedEnabled

References $blockPassesAfterPassedEnabled.

Referenced by addDefaults(), isExecutable(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ isComplete()

ilObjTest::isComplete ( ilTestQuestionSetConfig  $testQuestionSetConfig)
final

Returns true, if a test is complete for use and can be set online.

Parameters
ilTestQuestionSetConfig$testQuestionSetConfig
Returns
boolean

Definition at line 1102 of file class.ilObjTest.php.

1103 {
1104 if (!count($this->mark_schema->mark_steps)) {
1105 return false;
1106 }
1107
1108 if (!$testQuestionSetConfig->isQuestionSetConfigured()) {
1109 return false;
1110 }
1111
1112 return true;
1113 }

References ilTestQuestionSetConfig\isQuestionSetConfigured().

Referenced by saveCompleteStatus(), and saveToDb().

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

◆ isDynamicTest()

ilObjTest::isDynamicTest ( )

Returns the fact wether this test is a dynamic question set test or not.

Returns
boolean $isDynamicTest

Definition at line 11950 of file class.ilObjTest.php.

11951 {
11953 }

References getQuestionSetType(), and QUESTION_SET_TYPE_DYNAMIC.

Referenced by getAnsweredQuestionCount(), getTestResult(), and removeTestResultsByActiveIds().

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

◆ isEndingTimeEnabled()

ilObjTest::isEndingTimeEnabled ( )
Returns
boolean

Definition at line 3030 of file class.ilObjTest.php.

3031 {
3033 }

References $ending_time_enabled.

Referenced by addDefaults(), endingTimeReached(), and saveToDb().

+ Here is the caller graph for this function:

◆ isExecutable()

ilObjTest::isExecutable (   $testSession,
  $user_id,
  $allowPassIncrease = false 
)

Checks if the test is executable by the given user.

Parameters
ilTestSession|ilTestSessionDynamicQuestionSet
integer$user_idThe user id
Returns
array Result array @access public

Definition at line 8293 of file class.ilObjTest.php.

8294 {
8295 $result = array(
8296 "executable" => true,
8297 "errormessage" => ""
8298 );
8299 if (!$this->startingTimeReached()) {
8300 $result["executable"] = false;
8301 $result["errormessage"] = sprintf($this->lng->txt("detail_starting_time_not_reached"), ilDatePresentation::formatDate(new ilDateTime($this->getStartingTime(), IL_CAL_UNIX)));
8302 return $result;
8303 }
8304 if ($this->endingTimeReached()) {
8305 $result["executable"] = false;
8306 $result["errormessage"] = sprintf($this->lng->txt("detail_ending_time_reached"), ilDatePresentation::formatDate(new ilDateTime($this->getEndingTime(), IL_CAL_UNIX)));
8307 return $result;
8308 }
8309
8310 $active_id = $this->getActiveIdOfUser($user_id);
8311
8312 if ($this->getEnableProcessingTime()) {
8313 if ($active_id > 0) {
8314 $starting_time = $this->getStartingTimeOfUser($active_id);
8315 if ($starting_time !== false) {
8316 if ($this->isMaxProcessingTimeReached($starting_time, $active_id)) {
8317 if ($allowPassIncrease && $this->getResetProcessingTime() && (($this->getNrOfTries() == 0) || ($this->getNrOfTries() > (self::_getPass($active_id) + 1)))) {
8318 // a test pass was quitted because the maximum processing time was reached, but the time
8319 // will be resetted for future passes, so if there are more passes allowed, the participant may
8320 // start the test again.
8321 // This code block is only called when $allowPassIncrease is TRUE which only happens when
8322 // the test info page is opened. Otherwise this will lead to unexpected results!
8323 $testSession->increasePass();
8324 $testSession->setLastSequence(0);
8325 $testSession->saveToDb();
8326 } else {
8327 $result["executable"] = false;
8328 $result["errormessage"] = $this->lng->txt("detail_max_processing_time_reached");
8329 }
8330 return $result;
8331 }
8332 }
8333 }
8334 }
8335 global $DIC;
8336 require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
8337 $testPassesSelector = new ilTestPassesSelector($DIC['ilDB'], $this);
8338 $testPassesSelector->setActiveId($active_id);
8339 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
8340
8341 if ($this->hasNrOfTriesRestriction() && ($active_id > 0)) {
8342 $closedPasses = $testPassesSelector->getClosedPasses();
8343
8344 if (count($closedPasses) >= $this->getNrOfTries()) {
8345 $result["executable"] = false;
8346 $result["errormessage"] = $this->lng->txt("maximum_nr_of_tries_reached");
8347 return $result;
8348 }
8349
8350 if ($this->isBlockPassesAfterPassedEnabled() && !$testPassesSelector->openPassExists()) {
8351 if (ilObjTestAccess::_isPassed($user_id, $this->getId())) {
8352 $result['executable'] = false;
8353 $result['errormessage'] = $this->lng->txt("tst_addit_passes_blocked_after_passed_msg");
8354 return $result;
8355 }
8356 }
8357 }
8358 if ($this->isPassWaitingEnabled() && $testPassesSelector->getLastFinishedPass() !== null) {
8359 $lastPass = $testPassesSelector->getLastFinishedPassTimestamp();
8360 if ($lastPass && strlen($this->getPassWaiting())) {
8361 $pass_waiting_string = $this->getPassWaiting();
8362 $time_values = explode(":", $pass_waiting_string);
8363 $next_pass_allowed = strtotime('+ ' . $time_values[0] . ' Months + ' . $time_values[1] . ' Days + ' . $time_values[2] . ' Hours' . $time_values[3] . ' Minutes', $lastPass);
8364
8365 if (time() < $next_pass_allowed) {
8366 $date = ilDatePresentation::formatDate(new ilDateTime($next_pass_allowed, IL_CAL_UNIX));
8367
8368 $result["executable"] = false;
8369 $result["errormessage"] = sprintf($this->lng->txt('wait_for_next_pass_hint_msg'), $date);
8370 return $result;
8371 }
8372 }
8373 }
8374 return $result;
8375 }
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static _isPassed($user_id, $a_obj_id)
Returns TRUE if the user with the user id $user_id passed the test with the object id $a_obj_id.
endingTimeReached()
Returns true if the ending time of a test is reached An ending time is not available for self assessm...
getStartingTimeOfUser($active_id, $pass=null)
Returns the unix timestamp of the time a user started a test.
startingTimeReached()
Returns true if the starting time of a test is reached A starting time is not available for self asse...
isMaxProcessingTimeReached($starting_time, $active_id)
Returns whether the maximum processing time for a test is reached or not.
hasNrOfTriesRestriction()
returns if the numbers of tries have to be checked

References $DIC, $result, $starting_time, $testSession, ilObjTestAccess\_isPassed(), endingTimeReached(), ilDatePresentation\formatDate(), getActiveIdOfUser(), getEnableProcessingTime(), getEndingTime(), ilObject\getId(), getNrOfTries(), getPassWaiting(), getResetProcessingTime(), getStartingTime(), getStartingTimeOfUser(), hasNrOfTriesRestriction(), IL_CAL_UNIX, isBlockPassesAfterPassedEnabled(), isMaxProcessingTimeReached(), isPassWaitingEnabled(), and startingTimeReached().

+ Here is the call graph for this function:

◆ isFixedTest()

ilObjTest::isFixedTest ( )

Returns the fact wether this test is a fixed question set test or not.

Returns
boolean $isFixedTest

Definition at line 11930 of file class.ilObjTest.php.

11931 {
11933 }

References getQuestionSetType(), and QUESTION_SET_TYPE_FIXED.

+ Here is the call graph for this function:

◆ isFollowupQuestionAnswerFixationEnabled()

ilObjTest::isFollowupQuestionAnswerFixationEnabled ( )

Definition at line 12107 of file class.ilObjTest.php.

12108 {
12110 }
$followupQuestionAnswerFixationEnabled

References $followupQuestionAnswerFixationEnabled.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ isForceInstantFeedbackEnabled()

ilObjTest::isForceInstantFeedbackEnabled ( )
Returns
boolean

Definition at line 12125 of file class.ilObjTest.php.

12126 {
12128 }

References $forceInstantFeedbackEnabled.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ isHighscoreAnon()

ilObjTest::isHighscoreAnon ( )

Gets if the highscores should be displayed anonymized.

Note: This method considers the global anonymity switch. If you need access to the users setting,

See also
getHighscoreAnon()
Returns
boolean True, if output is anonymized.

Definition at line 11140 of file class.ilObjTest.php.

11141 {
11142 if ($this->getAnonymity() == 1) {
11143 return true;
11144 } else {
11145 return (bool) $this->getHighscoreAnon();
11146 }
11147 }

References getAnonymity(), and getHighscoreAnon().

+ Here is the call graph for this function:

◆ isHTML()

ilObjTest::isHTML (   $a_text)

Checks if a given string contains HTML or not.

Parameters
string$a_textText which should be checked
Returns
boolean @access public

Definition at line 9233 of file class.ilObjTest.php.

9234 {
9235 if (preg_match("/<[^>]*?>/", $a_text)) {
9236 return true;
9237 } else {
9238 return false;
9239 }
9240 }

Referenced by addQTIMaterial().

+ Here is the caller graph for this function:

◆ isInstantFeedbackAnswerFixationEnabled()

ilObjTest::isInstantFeedbackAnswerFixationEnabled ( )

Definition at line 12117 of file class.ilObjTest.php.

12118 {
12120 }
$instantFeedbackAnswerFixationEnabled

References $instantFeedbackAnswerFixationEnabled.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ isIntroductionEnabled()

ilObjTest::isIntroductionEnabled ( )
Returns
boolean

Definition at line 2039 of file class.ilObjTest.php.

2040 {
2042 }

References $introductionEnabled.

Referenced by addDefaults(), and saveToDb().

+ Here is the caller graph for this function:

◆ isLimitUsersEnabled()

ilObjTest::isLimitUsersEnabled ( )
Returns
boolean

Definition at line 9116 of file class.ilObjTest.php.

9117 {
9119 }

References $limitUsersEnabled.

Referenced by addDefaults(), and saveToDb().

+ Here is the caller graph for this function:

◆ isMaxProcessingTimeReached()

ilObjTest::isMaxProcessingTimeReached (   $starting_time,
  $active_id 
)

Returns whether the maximum processing time for a test is reached or not.

Parameters
long$starting_timeThe unix timestamp of the starting time of the test
Returns
boolean TRUE if the maxium processing time is reached, FALSE if the maximum processing time is not reached or no maximum processing time is given @access public

Definition at line 8447 of file class.ilObjTest.php.

8448 {
8449 if ($this->getEnableProcessingTime()) {
8450 $processing_time = $this->getProcessingTimeInSeconds($active_id);
8451 $now = time();
8452 if ($now > ($starting_time + $processing_time)) {
8453 return true;
8454 } else {
8455 return false;
8456 }
8457 } else {
8458 return false;
8459 }
8460 }
getProcessingTimeInSeconds($active_id="")
Returns the processing time for the test in seconds.

References $processing_time, $starting_time, getEnableProcessingTime(), and getProcessingTimeInSeconds().

Referenced by isExecutable().

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

◆ isNewRandomTest()

ilObjTest::isNewRandomTest ( )
protected

Checks wheather the test is a new random test (using tst_rnd_cpy) or an old one.

Deprecated:
--> old school random test

Definition at line 1692 of file class.ilObjTest.php.

1693 {
1694 global $DIC;
1695 $ilDB = $DIC['ilDB'];
1696 $result = $ilDB->queryF(
1697 'SELECT copy_id FROM tst_rnd_cpy WHERE tst_fi = %s',
1698 array('integer'),
1699 array($this->getTestId())
1700 );
1701 return $result->numRows() > 0;
1702 }

References $DIC, $ilDB, $result, and getTestId().

+ Here is the call graph for this function:

◆ isNrOfTriesReached()

ilObjTest::isNrOfTriesReached (   $tries)

returns if number of tries are reached

Deprecated:
: tries field differs per situation, outside a pass it's the number of tries, inside a pass it's the current pass number.

Definition at line 7952 of file class.ilObjTest.php.

7953 {
7954 return $tries >= (int) $this->getNrOfTries();
7955 }

References getNrOfTries().

+ Here is the call graph for this function:

◆ isOfferingQuestionHintsEnabled()

ilObjTest::isOfferingQuestionHintsEnabled ( )

returns the fact wether offering hints is enabled or not

Returns
boolean

Definition at line 11049 of file class.ilObjTest.php.

11050 {
11052 }

References $offeringQuestionHintsEnabled.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ isOnline()

ilObjTest::isOnline ( )

Definition at line 11008 of file class.ilObjTest.php.

11009 {
11010 return $this->online;
11011 }

◆ isParticipantsLastPassActive()

static ilObjTest::isParticipantsLastPassActive (   $testRefId,
  $userId 
)
static

Definition at line 12173 of file class.ilObjTest.php.

12174 {
12175 global $DIC;
12176 $ilDB = $DIC['ilDB'];
12177 $lng = $DIC['lng'];
12178 $refinery = $DIC['refinery'];
12179 $ilPluginAdmin = $DIC['ilPluginAdmin'];
12180
12181 /* @var ilObjTest $testOBJ */
12182
12183 $testOBJ = ilObjectFactory::getInstanceByRefId($testRefId, false);
12184
12185
12186 $activeId = $testOBJ->getActiveIdOfUser($userId);
12187
12188 require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
12189 $testSessionFactory = new ilTestSessionFactory($testOBJ);
12190 // Added temporarily bugfix smeyer
12191 $testSessionFactory->reset();
12192
12193 require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
12194 $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $refinery, $ilPluginAdmin, $testOBJ);
12195
12196 $testSession = $testSessionFactory->getSession($activeId);
12197 $testSequence = $testSequenceFactory->getSequenceByActiveIdAndPass($activeId, $testSession->getPass());
12198 $testSequence->loadFromDb();
12199
12200 return $testSequence->hasSequence();
12201 }

References $DIC, $ilDB, ilObject\$lng, $testSequence, $testSession, and ilObjectFactory\getInstanceByRefId().

Referenced by ilLOUtils\hasActiveRun(), and ilContainerObjectiveGUI\updateResult().

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

◆ isPassDeletionAllowed()

ilObjTest::isPassDeletionAllowed ( )

getter for the test setting passDeletionAllowed

Returns
integer

Definition at line 11526 of file class.ilObjTest.php.

11527 {
11529 }

References $passDeletionAllowed.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ isPassWaitingEnabled()

ilObjTest::isPassWaitingEnabled ( )
Returns
bool

Definition at line 3296 of file class.ilObjTest.php.

3297 {
3298 if (array_sum(explode(':', $this->getPassWaiting())) > 0) {
3299 return true;
3300 }
3301 return false;
3302 }

References getPassWaiting().

Referenced by isExecutable().

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

◆ isPasswordEnabled()

ilObjTest::isPasswordEnabled ( )
Returns
boolean

Definition at line 3198 of file class.ilObjTest.php.

3199 {
3201 }

References $passwordEnabled.

Referenced by addDefaults(), and saveToDb().

+ Here is the caller graph for this function:

◆ isPluginActive()

ilObjTest::isPluginActive (   $a_pname)

Checks wheather or not a question plugin with a given name is active.

Parameters
string$a_pnameThe plugin name @access public

Definition at line 10351 of file class.ilObjTest.php.

10352 {
10353 global $DIC;
10354 $ilPluginAdmin = $DIC['ilPluginAdmin'];
10355 if ($ilPluginAdmin->isActive(IL_COMP_MODULE, "TestQuestionPool", "qst", $a_pname)) {
10356 return true;
10357 } else {
10358 return false;
10359 }
10360 }

References $DIC, and IL_COMP_MODULE.

◆ isPostponingEnabled()

ilObjTest::isPostponingEnabled ( )
Returns
bool $postponingEnabled

Definition at line 2285 of file class.ilObjTest.php.

2286 {
2287 return (bool) $this->getSequenceSettings();
2288 }

References getSequenceSettings().

+ Here is the call graph for this function:

◆ isPreviousSolutionReuseEnabled()

ilObjTest::isPreviousSolutionReuseEnabled (   $activeId)

Definition at line 2836 of file class.ilObjTest.php.

2837 {
2838 // checks if allowed in general and if enabled by participant
2839 return self::_getUsePreviousAnswers($activeId, true);
2840 }
static _getUsePreviousAnswers($active_id, $user_active_user_setting=false)
Returns if the previous results should be hidden for a learner.

References _getUsePreviousAnswers().

+ Here is the call graph for this function:

◆ isQuestionObligationPossible()

static ilObjTest::isQuestionObligationPossible (   $questionId)
static

checks wether the obligation for question with given id is possible or not

Parameters
integer$questionId
Returns
boolean $obligationPossible

Definition at line 11412 of file class.ilObjTest.php.

11413 {
11414 require_once('Modules/TestQuestionPool/classes/class.assQuestion.php');
11415
11416 $classConcreteQuestion = assQuestion::_getQuestionType($questionId);
11417
11418 assQuestion::_includeClass($classConcreteQuestion, 0);
11419
11420 // static binder is not at work yet (in PHP < 5.3)
11421 //$obligationPossible = $classConcreteQuestion::isObligationPossible();
11422 $obligationPossible = call_user_func(array($classConcreteQuestion, 'isObligationPossible'), $questionId);
11423
11424 return $obligationPossible;
11425 }
static _getQuestionType($question_id)
Returns the question type of a question with a given id.

References assQuestion\_getQuestionType(), and assQuestion\_includeClass().

Referenced by getTestQuestions(), and ilObjTestGUI\saveOrderAndObligationsObject().

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

◆ isQuestionObligatory()

static ilObjTest::isQuestionObligatory (   $question_id)
static

checks wether the question with given id is marked as obligatory or not

Parameters
integer$questionId
Returns
boolean $obligatory

Definition at line 11433 of file class.ilObjTest.php.

11434 {
11435 global $DIC;
11436 $ilDB = $DIC['ilDB'];
11437
11438 $rset = $ilDB->queryF('SELECT obligatory FROM tst_test_question WHERE question_fi = %s', array('integer'), array($question_id));
11439
11440 if ($row = $ilDB->fetchAssoc($rset)) {
11441 return (bool) $row['obligatory'];
11442 }
11443
11444 return false;
11445 }

References $DIC, and $ilDB.

Referenced by assQuestion\calculateResultsFromSolution(), ilTestSequence\getSequenceSummary(), ilTestSequenceDynamicQuestionSet\getSequenceSummary(), ilTestOutputGUI\showQuestionCmd(), and ilTestPlayerDynamicQuestionSetGUI\showQuestionCmd().

+ Here is the caller graph for this function:

◆ isRandomTest()

ilObjTest::isRandomTest ( )

Returns the fact wether this test is a random questions test or not.

Returns
boolean $isRandomTest

Definition at line 11940 of file class.ilObjTest.php.

11941 {
11943 }

References getQuestionSetType(), and QUESTION_SET_TYPE_RANDOM.

Referenced by createTestSequence(), getAllQuestions(), getAnsweredQuestionCount(), getExistingQuestions(), getQuestionCount(), getQuestionsOfPass(), getQuestionsOfTest(), loadQuestions(), and removeTestResultsByActiveIds().

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

◆ isScoreReportingEnabled()

ilObjTest::isScoreReportingEnabled ( )

Definition at line 2416 of file class.ilObjTest.php.

2417 {
2418 switch ($this->getScoreReporting()) {
2423
2424 return true;
2425
2427 default:
2428
2429 return false;
2430 }
2431 }
const SCORE_REPORTING_IMMIDIATLY
const SCORE_REPORTING_AFTER_PASSED
const SCORE_REPORTING_DATE
const SCORE_REPORTING_DISABLED

References getScoreReporting(), SCORE_REPORTING_AFTER_PASSED, SCORE_REPORTING_DATE, SCORE_REPORTING_DISABLED, SCORE_REPORTING_FINISHED, and SCORE_REPORTING_IMMIDIATLY.

+ Here is the call graph for this function:

◆ isShowExamIdInTestPassEnabled()

ilObjTest::isShowExamIdInTestPassEnabled ( )

Definition at line 11810 of file class.ilObjTest.php.

11811 {
11813 }
$show_exam_id_in_test_pass_enabled

References $show_exam_id_in_test_pass_enabled.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ isShowExamIdInTestResultsEnabled()

ilObjTest::isShowExamIdInTestResultsEnabled ( )
Returns
boolean

Definition at line 11826 of file class.ilObjTest.php.

11827 {
11829 }
$show_exam_id_in_test_results_enabled

References $show_exam_id_in_test_results_enabled.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ isShowGradingMarkEnabled()

ilObjTest::isShowGradingMarkEnabled ( )

Definition at line 12097 of file class.ilObjTest.php.

12098 {
12100 }

References $showGradingMarkEnabled.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ isShowGradingStatusEnabled()

ilObjTest::isShowGradingStatusEnabled ( )

Definition at line 12086 of file class.ilObjTest.php.

12087 {
12089 }

References $showGradingStatusEnabled.

Referenced by addDefaults(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ isSingleChoiceTest()

ilObjTest::isSingleChoiceTest ( )

Returns TRUE if the test contains single choice results only.

Returns
boolean @access public

Definition at line 1035 of file class.ilObjTest.php.

1036 {
1037 global $DIC;
1038 $ilDB = $DIC['ilDB'];
1039
1040 $result = $ilDB->queryF(
1041 "SELECT DISTINCT(qpl_qst_type.type_tag) foundtypes FROM qpl_questions, tst_test_result, qpl_qst_type, tst_active WHERE tst_test_result.question_fi = qpl_questions.question_id AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id AND tst_test_result.active_fi = tst_active.active_id AND tst_active.test_fi = %s",
1042 array('integer'),
1043 array($this->getTestId())
1044 );
1045 if ($result->numRows() == 1) {
1046 $row = $ilDB->fetchAssoc($result);
1047 if (strcmp($row['foundtypes'], 'assSingleChoice') == 0) {
1048 return true;
1049 } else {
1050 return false;
1051 }
1052 }
1053 return false;
1054 }

References $DIC, $ilDB, $result, and getTestId().

+ Here is the call graph for this function:

◆ isSingleChoiceTestWithoutShuffle()

ilObjTest::isSingleChoiceTestWithoutShuffle ( )

Returns TRUE if the test contains single choice results and no shuffle only.

Returns
boolean @access public

Definition at line 1062 of file class.ilObjTest.php.

1063 {
1064 global $DIC;
1065 $ilDB = $DIC['ilDB'];
1066
1067 if (!$this->hasSingleChoiceQuestions()) {
1068 return false;
1069 }
1070
1071 $result = $ilDB->queryF(
1072 "
1073 SELECT DISTINCT(qpl_qst_sc.shuffle) foundshuffles
1074 FROM qpl_questions,
1075 qpl_qst_sc,
1076 tst_test_result,
1077 qpl_qst_type,
1078 tst_active
1079 WHERE tst_test_result.question_fi = qpl_questions.question_id
1080 AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id
1081 AND tst_test_result.active_fi = tst_active.active_id
1082 AND qpl_questions.question_id = qpl_qst_sc.question_fi
1083 AND tst_active.test_fi = %s
1084 AND qpl_qst_type.type_tag = %s
1085 ",
1086 array('integer', 'text'),
1087 array($this->getTestId(), 'assSingleChoice')
1088 );
1089 if ($result->numRows() == 1) {
1090 $row = $ilDB->fetchAssoc($result);
1091 return ($row['foundshuffles'] == 0);
1092 }
1093 return false;
1094 }
hasSingleChoiceQuestions()
Returns TRUE if the test contains single choice results.

References $DIC, $ilDB, $result, getTestId(), and hasSingleChoiceQuestions().

+ Here is the call graph for this function:

◆ isSkillManagementGloballyActivated()

static ilObjTest::isSkillManagementGloballyActivated ( )
static

Definition at line 12070 of file class.ilObjTest.php.

12071 {
12072 if (self::$isSkillManagementGloballyActivated === null) {
12073 $skmgSet = new ilSkillManagementSettings();
12074
12075 self::$isSkillManagementGloballyActivated = $skmgSet->isActivated();
12076 }
12077
12079 }
static $isSkillManagementGloballyActivated

References $isSkillManagementGloballyActivated.

Referenced by ilObjTestSettingsGeneralGUI\buildForm(), ilTestSkillAdministrationGUI\isAccessDenied(), ilObjTestSettingsGeneralGUI\isSkillServiceSettingToBeAdjusted(), ilObjTestSettingsGeneralGUI\performSaveForm(), and ilTestTabsManager\setupTabsGuiConfig().

+ Here is the caller graph for this function:

◆ isSkillServiceEnabled()

ilObjTest::isSkillServiceEnabled ( )

Definition at line 12040 of file class.ilObjTest.php.

12041 {
12043 }

References $skillServiceEnabled.

Referenced by addDefaults(), isSkillServiceToBeConsidered(), saveToDb(), and toXML().

+ Here is the caller graph for this function:

◆ isSkillServiceToBeConsidered()

ilObjTest::isSkillServiceToBeConsidered ( )

Definition at line 12055 of file class.ilObjTest.php.

12056 {
12057 if (!$this->isSkillServiceEnabled()) {
12058 return false;
12059 }
12060
12061 if (!self::isSkillManagementGloballyActivated()) {
12062 return false;
12063 }
12064
12065 return true;
12066 }

References isSkillServiceEnabled().

+ Here is the call graph for this function:

◆ isStartingTimeEnabled()

ilObjTest::isStartingTimeEnabled ( )
Returns
boolean

Definition at line 2990 of file class.ilObjTest.php.

2991 {
2993 }

References $starting_time_enabled.

Referenced by addDefaults(), saveToDb(), and startingTimeReached().

+ Here is the caller graph for this function:

◆ isTestFinalBroken()

ilObjTest::isTestFinalBroken ( )
Returns
boolean

Definition at line 12206 of file class.ilObjTest.php.

12207 {
12209 }

References $testFinalBroken.

Referenced by saveToDb().

+ Here is the caller graph for this function:

◆ isTestFinished()

ilObjTest::isTestFinished (   $active_id)

returns if the active for user_id has been submitted

Definition at line 7904 of file class.ilObjTest.php.

7905 {
7906 global $DIC;
7907 $ilDB = $DIC['ilDB'];
7908
7909 $result = $ilDB->queryF(
7910 "SELECT submitted FROM tst_active WHERE active_id=%s AND submitted=%s",
7911 array('integer', 'integer'),
7912 array($active_id, 1)
7913 );
7914 return $result->numRows() == 1;
7915 }

References $DIC, $ilDB, and $result.

Referenced by isTestFinishedToViewResults().

+ Here is the caller graph for this function:

◆ isTestFinishedToViewResults()

ilObjTest::isTestFinishedToViewResults (   $active_id,
  $currentpass 
)

Returns true if an active user completed a test pass and did not start a new pass.

Parameters
integer$active_idThe active id of the user
integer$currentpassThe current test pass of the user
Returns
boolean true if an active user completed a test pass and did not start a new pass, false otherwise @access public

Definition at line 3890 of file class.ilObjTest.php.

3891 {
3892 $num = ilObjTest::lookupPassResultsUpdateTimestamp($active_id, $currentpass);
3893 return ((($currentpass > 0) && ($num == 0)) || $this->isTestFinished($active_id)) ? true : false;
3894 }
isTestFinished($active_id)
returns if the active for user_id has been submitted
static lookupPassResultsUpdateTimestamp($active_id, $pass)

References isTestFinished(), lookupPassResultsUpdateTimestamp(), and true.

+ Here is the call graph for this function:

◆ isTestQuestion()

ilObjTest::isTestQuestion (   $questionId)
Parameters
int$questionId
Returns
bool

Definition at line 8516 of file class.ilObjTest.php.

8517 {
8518 foreach ($this->getTestQuestions() as $questionData) {
8519 if ($questionData['question_id'] != $questionId) {
8520 continue;
8521 }
8522
8523 return true;
8524 }
8525
8526 return false;
8527 }

References getTestQuestions().

+ Here is the call graph for this function:

◆ loadFromDb()

ilObjTest::loadFromDb ( )

Loads a ilObjTest object from a database.

Definition at line 1845 of file class.ilObjTest.php.

1846 {
1847 global $DIC;
1848 $ilDB = $DIC['ilDB'];
1849
1850 $result = $ilDB->queryF(
1851 "SELECT * FROM tst_tests WHERE obj_fi = %s",
1852 array('integer'),
1853 array($this->getId())
1854 );
1855 if ($result->numRows() == 1) {
1856 $data = $ilDB->fetchObject($result);
1857 $this->setTestId($data->test_id);
1858 if (strlen($this->getAuthor()) == 0) {
1859 $this->saveAuthorToMetadata($data->author);
1860 }
1861 $this->setAuthor($data->author);
1862 include_once("./Services/RTE/classes/class.ilRTE.php");
1863 $this->setIntroductionEnabled($data->intro_enabled);
1865 $this->setShowInfo($data->showinfo);
1867 $this->setForceJS($data->forcejs);
1868 $this->setCustomStyle($data->customstyle);
1869 $this->setShowFinalStatement($data->showfinalstatement);
1870 $this->setSequenceSettings($data->sequence_settings);
1871 $this->setScoreReporting($data->score_reporting);
1872 $this->setInstantFeedbackSolution($data->instant_verification);
1873 $this->setAnswerFeedbackPoints($data->answer_feedback_points);
1874 $this->setAnswerFeedback($data->answer_feedback);
1875 $this->setAnonymity($data->anonymity);
1876 $this->setShowCancel($data->show_cancel);
1877 $this->setShowMarker($data->show_marker);
1878 $this->setFixedParticipants($data->fixed_participants);
1879 $this->setNrOfTries($data->nr_of_tries);
1880 $this->setBlockPassesAfterPassedEnabled((bool) $data->block_after_passed);
1881 $this->setKiosk($data->kiosk);
1882 $this->setUsePreviousAnswers($data->use_previous_answers);
1883 $this->setRedirectionMode($data->redirection_mode);
1884 $this->setRedirectionUrl($data->redirection_url);
1885 $this->setTitleOutput($data->title_output);
1886 $this->setProcessingTime($data->processing_time);
1887 $this->setEnableProcessingTime($data->enable_processing_time);
1888 $this->setResetProcessingTime($data->reset_processing_time);
1889 $this->setReportingDate($data->reporting_date);
1890 $this->setShuffleQuestions($data->shuffle_questions);
1891 $this->setResultsPresentation($data->results_presentation);
1892 $this->setStartingTimeEnabled($data->starting_time_enabled);
1893 $this->setStartingTime($data->starting_time);
1894 $this->setEndingTimeEnabled($data->ending_time_enabled);
1895 $this->setEndingTime($data->ending_time);
1896 $this->setListOfQuestionsSettings($data->show_summary);
1897 $this->setECTSOutput($data->ects_output);
1898 $this->setECTSGrades(
1899 array(
1900 "A" => $data->ects_a,
1901 "B" => $data->ects_b,
1902 "C" => $data->ects_c,
1903 "D" => $data->ects_d,
1904 "E" => $data->ects_e
1905 )
1906 );
1907 $this->setECTSFX($data->ects_fx);
1908 $this->mark_schema->flush();
1909 $this->mark_schema->loadFromDb($this->getTestId());
1910 $this->setCountSystem($data->count_system);
1911 $this->setMCScoring($data->mc_scoring);
1912 $this->setMailNotification($data->mailnotification);
1913 $this->setMailNotificationType($data->mailnottype);
1914 $this->setExportSettings($data->exportsettings);
1915 $this->setScoreCutting($data->score_cutting);
1916 $this->setPasswordEnabled($data->password_enabled);
1917 $this->setPassword($data->password);
1918 $this->setLimitUsersEnabled($data->limit_users_enabled);
1919 $this->setAllowedUsers($data->allowedusers);
1920 $this->setAllowedUsersTimeGap($data->alloweduserstimegap);
1921 $this->setPassScoring($data->pass_scoring);
1922 $this->setObligationsEnabled($data->obligations_enabled);
1923 $this->setOfferingQuestionHintsEnabled($data->offer_question_hints);
1924 $this->setCertificateVisibility($data->certificate_visibility);
1925 $this->setEnabledViewMode($data->enabled_view_mode);
1926 $this->setTemplate($data->template_id);
1927 $this->setPoolUsage($data->pool_usage);
1928 $this->setPrintBestSolutionWithResult((bool) $data->print_bs_with_res);
1929 $this->setHighscoreEnabled((bool) $data->highscore_enabled);
1930 $this->setHighscoreAnon((bool) $data->highscore_anon);
1931 $this->setHighscoreAchievedTS((bool) $data->highscore_achieved_ts);
1932 $this->setHighscoreScore((bool) $data->highscore_score);
1933 $this->setHighscorePercentage((bool) $data->highscore_percentage);
1934 $this->setHighscoreHints((bool) $data->highscore_hints);
1935 $this->setHighscoreWTime((bool) $data->highscore_wtime);
1936 $this->setHighscoreOwnTable((bool) $data->highscore_own_table);
1937 $this->setHighscoreTopTable((bool) $data->highscore_top_table);
1938 $this->setHighscoreTopNum((int) $data->highscore_top_num);
1939 $this->setOldOnlineStatus((bool) !$this->getOfflineStatus());
1940 $this->setSpecificAnswerFeedback((int) $data->specific_feedback);
1941 $this->setAutosave((bool) $data->autosave);
1942 $this->setAutosaveIval((int) $data->autosave_ival);
1943 $this->setPassDeletionAllowed($data->pass_deletion_allowed);
1944 $this->setEnableExamview((bool) $data->enable_examview);
1945 $this->setShowExamviewHtml((bool) $data->show_examview_html);
1946 $this->setShowExamviewPdf((bool) $data->show_examview_pdf);
1947 $this->setEnableArchiving((bool) $data->enable_archiving);
1948 $this->setShowExamIdInTestPassEnabled((bool) $data->examid_in_test_pass);
1949 $this->setShowExamIdInTestResultsEnabled((bool) $data->examid_in_test_res);
1950 $this->setSignSubmission((bool) $data->sign_submission);
1951 $this->setQuestionSetType($data->question_set_type);
1952 $this->setCharSelectorAvailability((int) $data->char_selector_availability);
1953 $this->setCharSelectorDefinition($data->char_selector_definition);
1954 $this->setSkillServiceEnabled((bool) $data->skill_service);
1955 $this->setResultFilterTaxIds(strlen($data->result_tax_filters) ? unserialize($data->result_tax_filters) : array());
1956 $this->setShowGradingStatusEnabled((bool) $data->show_grading_status);
1957 $this->setShowGradingMarkEnabled((bool) $data->show_grading_mark);
1958 $this->setFollowupQuestionAnswerFixationEnabled((bool) $data->follow_qst_answer_fixation);
1959 $this->setInstantFeedbackAnswerFixationEnabled((bool) $data->inst_fb_answer_fixation);
1960 $this->setForceInstantFeedbackEnabled((bool) $data->force_inst_fb);
1961 $this->setTestFinalBroken((bool) $data->broken);
1962 $this->setPassWaiting($data->pass_waiting);
1963 $this->loadQuestions();
1964 }
1965
1966 // moved activation to ilObjectActivation
1967 if ($this->ref_id) {
1968 include_once "./Services/Object/classes/class.ilObjectActivation.php";
1969 $activation = ilObjectActivation::getItem($this->ref_id);
1970 switch ($activation["timing_type"]) {
1972 $this->setActivationLimited(true);
1973 $this->setActivationStartingTime($activation["timing_start"]);
1974 $this->setActivationEndingTime($activation["timing_end"]);
1975 $this->setActivationVisibility($activation["visible"]);
1976 break;
1977
1978 default:
1979 $this->setActivationLimited(false);
1980 break;
1981 }
1982 }
1983 }
setTestId($a_id)
Sets the test ID.
setTemplate($template_id)
setOldOnlineStatus($oldOnlineStatus)
getAuthor()
Gets the authors name of the ilObjTest object.
setCertificateVisibility($a_value)
Sets the visibility settings of the certificate.
setTestFinalBroken($testFinalBroken)
setEnabledViewMode($mode)
static getItem($a_ref_id)
Get item data.
getOfflineStatus()
Get offline status.

References $data, $DIC, $ilDB, $result, ilRTE\_replaceMediaObjectImageSrc(), getAuthor(), ilObject\getId(), ilObjectActivation\getItem(), ilObject\getOfflineStatus(), getTestId(), loadQuestions(), saveAuthorToMetadata(), setActivationEndingTime(), setActivationLimited(), setActivationStartingTime(), setActivationVisibility(), setAllowedUsers(), setAllowedUsersTimeGap(), setAnonymity(), setAnswerFeedback(), setAnswerFeedbackPoints(), setAuthor(), setAutosave(), setAutosaveIval(), setBlockPassesAfterPassedEnabled(), setCertificateVisibility(), setCharSelectorAvailability(), setCharSelectorDefinition(), setCountSystem(), setCustomStyle(), setECTSFX(), setECTSGrades(), setECTSOutput(), setEnableArchiving(), setEnabledViewMode(), setEnableExamview(), setEnableProcessingTime(), setEndingTime(), setEndingTimeEnabled(), setExportSettings(), setFinalStatement(), setFixedParticipants(), setFollowupQuestionAnswerFixationEnabled(), setForceInstantFeedbackEnabled(), setForceJS(), setHighscoreAchievedTS(), setHighscoreAnon(), setHighscoreEnabled(), setHighscoreHints(), setHighscoreOwnTable(), setHighscorePercentage(), setHighscoreScore(), setHighscoreTopNum(), setHighscoreTopTable(), setHighscoreWTime(), setInstantFeedbackAnswerFixationEnabled(), setInstantFeedbackSolution(), setIntroduction(), setIntroductionEnabled(), setKiosk(), setLimitUsersEnabled(), setListOfQuestionsSettings(), setMailNotification(), setMailNotificationType(), setMCScoring(), setNrOfTries(), setObligationsEnabled(), setOfferingQuestionHintsEnabled(), setOldOnlineStatus(), setPassDeletionAllowed(), setPassScoring(), setPassWaiting(), setPassword(), setPasswordEnabled(), setPoolUsage(), setPrintBestSolutionWithResult(), setProcessingTime(), setQuestionSetType(), setRedirectionMode(), setRedirectionUrl(), setReportingDate(), setResetProcessingTime(), setResultFilterTaxIds(), setResultsPresentation(), setScoreCutting(), setScoreReporting(), setSequenceSettings(), setShowCancel(), setShowExamIdInTestPassEnabled(), setShowExamIdInTestResultsEnabled(), setShowExamviewHtml(), setShowExamviewPdf(), setShowFinalStatement(), setShowGradingMarkEnabled(), setShowGradingStatusEnabled(), setShowInfo(), setShowMarker(), setShuffleQuestions(), setSignSubmission(), setSkillServiceEnabled(), setSpecificAnswerFeedback(), setStartingTime(), setStartingTimeEnabled(), setTemplate(), setTestFinalBroken(), setTestId(), setTitleOutput(), setUsePreviousAnswers(), and ilObjectActivation\TIMINGS_ACTIVATION.

Referenced by read().

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

◆ loadQuestions()

ilObjTest::loadQuestions (   $active_id = "",
  $pass = null 
)

Load the test question id's from the database.

Parameters
integer$user_idThe user id of the test user (necessary for random tests) @access public

Definition at line 1991 of file class.ilObjTest.php.

1992 {
1993 global $DIC;
1994 $ilUser = $DIC['ilUser'];
1995 $ilDB = $DIC['ilDB'];
1996
1997 $tags_trafo = $this->refinery->string()->stripTags();
1998
1999 $this->questions = array();
2000 if ($this->isRandomTest()) {
2001 if (strcmp($active_id, "") == 0) {
2002 $active_id = $this->getActiveIdOfUser($ilUser->getId());
2003 }
2004 if (is_null($pass)) {
2005 $pass = self::_getPass($active_id);
2006 }
2007 $result = $ilDB->queryF(
2008 "SELECT tst_test_rnd_qst.* FROM tst_test_rnd_qst, qpl_questions WHERE tst_test_rnd_qst.active_fi = %s AND qpl_questions.question_id = tst_test_rnd_qst.question_fi AND tst_test_rnd_qst.pass = %s ORDER BY sequence",
2009 array('integer', 'integer'),
2010 array($active_id, $pass)
2011 );
2012 // The following is a fix for random tests prior to ILIAS 3.8. If someone started a random test in ILIAS < 3.8, there
2013 // is only one test pass (pass = 0) in tst_test_rnd_qst while with ILIAS 3.8 there are questions for every test pass.
2014 // To prevent problems with tests started in an older version and continued in ILIAS 3.8, the first pass should be taken if
2015 // no questions are present for a newer pass.
2016 if ($result->numRows() == 0) {
2017 $result = $ilDB->queryF(
2018 "SELECT tst_test_rnd_qst.* FROM tst_test_rnd_qst, qpl_questions WHERE tst_test_rnd_qst.active_fi = %s AND qpl_questions.question_id = tst_test_rnd_qst.question_fi AND tst_test_rnd_qst.pass = 0 ORDER BY sequence",
2019 array('integer'),
2020 array($active_id)
2021 );
2022 }
2023 } else {
2024 $result = $ilDB->queryF(
2025 "SELECT tst_test_question.* FROM tst_test_question, qpl_questions WHERE tst_test_question.test_fi = %s AND qpl_questions.question_id = tst_test_question.question_fi ORDER BY sequence",
2026 array('integer'),
2027 array($this->test_id)
2028 );
2029 }
2030 $index = 1;
2031 while ($data = $ilDB->fetchAssoc($result)) {
2032 $this->questions[$index++] = $data["question_fi"];
2033 }
2034 }

References $data, $DIC, $ilDB, $ilUser, $index, $pass, $result, _getPass(), getActiveIdOfUser(), and isRandomTest().

Referenced by getAllQuestions(), getAnsweredQuestionCount(), insertQuestion(), loadFromDb(), questionMoveDown(), questionMoveUp(), reindexFixedQuestionOrdering(), and setQuestionOrderAndObligations().

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

◆ logAction()

ilObjTest::logAction (   $logtext = "",
  $question_id = "" 
)

Logs an action into the Test&Assessment log.

Parameters
string$logtextThe log text
integer$question_idIf given, saves the question id to the database @access public

Definition at line 7287 of file class.ilObjTest.php.

7288 {
7289 global $DIC;
7290 $ilUser = $DIC['ilUser'];
7291
7292 $original_id = "";
7293 if (strcmp($question_id, "") != 0) {
7294 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
7295 $original_id = assQuestion::_getOriginalId($question_id);
7296 }
7297 include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
7298 ilObjAssessmentFolder::_addLog($ilUser->getId(), $this->getId(), $logtext, $question_id, $original_id, true, $this->getRefId());
7299 }
static _getOriginalId($question_id)
Returns the original id of a question.
static _addLog($user_id, $object_id, $logtext, $question_id="", $original_id="", $test_only=false, $test_ref_id=null)
Add an assessment log entry.

References $DIC, $ilUser, ilObjAssessmentFolder\_addLog(), and assQuestion\_getOriginalId().

Referenced by addExtraTime(), checkMaximumAllowedUsers(), insertQuestion(), logManualFeedback(), questionMoveDown(), questionMoveUp(), removeQuestion(), removeTestResultsByActiveIds(), saveQuestionsToDb(), and saveToDb().

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

◆ logManualFeedback()

ilObjTest::logManualFeedback (   $active_id,
  $question_id,
  $feedback 
)
private

Creates a log for the manual feedback.

Parameters
integer$active_idActive ID of the user
integer$question_idQuestion ID
string$feedbackThe feedback text

Definition at line 10221 of file class.ilObjTest.php.

10222 {
10223 global $DIC;
10224
10225 $ilUser = $DIC->user();
10226 $lng = $DIC->language();
10227 $username = ilObjTestAccess::_getParticipantData($active_id);
10228
10229 $this->logAction(
10230 sprintf(
10231 $lng->txtlng('assessment', 'log_manual_feedback', ilObjAssessmentFolder::_getLogLanguage()),
10232 $ilUser->getFullname() . ' (' . $ilUser->getLogin() . ')',
10233 $username,
10234 assQuestion::_getQuestionTitle($question_id),
10235 $feedback
10236 )
10237 );
10238 }
static _getQuestionTitle($question_id)
Returns the question title of a question with a given id.
static _getParticipantData($active_id)
Retrieves a participant name from active id.

References $DIC, $ilUser, ilObject\$lng, ilObjAssessmentFolder\_getLogLanguage(), ilObjTestAccess\_getParticipantData(), assQuestion\_getQuestionTitle(), and logAction().

Referenced by saveManualFeedback().

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

◆ lookupExamId()

static ilObjTest::lookupExamId (   $active_id,
  $pass 
)
static
Parameters
$active_id
$pass
Returns
array

Definition at line 11763 of file class.ilObjTest.php.

11764 {
11765 global $DIC;
11766 $ilDB = $DIC['ilDB'];
11767
11768 $exam_id_query = 'SELECT exam_id FROM tst_pass_result WHERE active_fi = %s AND pass = %s';
11769 $exam_id_result = $ilDB->queryF($exam_id_query, array( 'integer', 'integer' ), array( $active_id, $pass ));
11770 if ($ilDB->numRows($exam_id_result) == 1) {
11771 $exam_id_row = $ilDB->fetchAssoc($exam_id_result);
11772
11773 if ($exam_id_row['exam_id'] != null) {
11774 return $exam_id_row['exam_id'];
11775 }
11776 }
11777
11778 return null;
11779 }

References $DIC, $ilDB, and $pass.

Referenced by ilTestServiceGUI\getResultsOfUserOutput(), ilTestPlayerAbstractGUI\outQuestionSummaryCmd(), ilTestEvaluationGUI\outUserListOfAnswerPasses(), ilTestEvaluationGUI\outUserPassDetails(), ilTestServiceGUI\populateExamId(), ilTestPlayerAbstractGUI\prepareTestPage(), and ilTestSubmissionReviewGUI\show().

+ Here is the caller graph for this function:

◆ lookupLastTestPassAccess()

static ilObjTest::lookupLastTestPassAccess (   $activeId,
  $passIndex 
)
static

Definition at line 9202 of file class.ilObjTest.php.

9203 {
9204 global $DIC; /* @var \ILIAS\DI\Container $DIC */
9205
9206 $query = "
9207 SELECT MAX(tst_times.tstamp) as last_pass_access
9208 FROM tst_times
9209 WHERE active_fi = %s
9210 AND pass = %s
9211 ";
9212
9213 $res = $DIC->database()->queryF(
9214 $query,
9215 array('integer', 'integer'),
9216 array($activeId, $passIndex)
9217 );
9218
9219 while ($row = $DIC->database()->fetchAssoc($res)) {
9220 return $row['last_pass_access'];
9221 }
9222
9223 return null;
9224 }

References $DIC, $query, and $res.

Referenced by ilTestServiceGUI\getPassOverviewTableData(), ilTestServiceGUI\getResultsOfUserOutput(), ilTestParticipantList\getScoringsTableRows(), ilTestEvaluationGUI\outParticipantsPassDetails(), and ilTestEvaluationGUI\outUserPassDetails().

+ Here is the caller graph for this function:

◆ lookupPassResultsUpdateTimestamp()

static ilObjTest::lookupPassResultsUpdateTimestamp (   $active_id,
  $pass 
)
static
Parameters
int$active_id
int$pass
Returns
int

Definition at line 8243 of file class.ilObjTest.php.

8244 {
8245 global $DIC;
8246 $ilDB = $DIC['ilDB'];
8247
8248 if (is_null($pass)) {
8249 $pass = 0;
8250 }
8251
8252 $query = "
8253 SELECT tst_pass_result.tstamp pass_res_tstamp,
8254 tst_test_result.tstamp quest_res_tstamp
8255
8256 FROM tst_pass_result
8257
8258 LEFT JOIN tst_test_result
8259 ON tst_test_result.active_fi = tst_pass_result.active_fi
8260 AND tst_test_result.pass = tst_pass_result.pass
8261
8262 WHERE tst_pass_result.active_fi = %s
8263 AND tst_pass_result.pass = %s
8264
8265 ORDER BY tst_test_result.tstamp DESC
8266 ";
8267
8268 $result = $ilDB->queryF(
8269 $query,
8270 array('integer', 'integer'),
8271 array($active_id, $pass)
8272 );
8273
8274 while ($row = $ilDB->fetchAssoc($result)) {
8275 if ($row['qres_tstamp']) {
8276 return $row['quest_res_tstamp'];
8277 }
8278
8279 return $row['pass_res_tstamp'];
8280 }
8281
8282 return 0;
8283 }

References $DIC, $ilDB, $pass, $query, and $result.

Referenced by ilTestEvaluationGUI\detailedEvaluation(), ilTestExport\exportToCSV(), ilTestExport\exportToExcel(), ilTestService\getPassOverviewData(), and isTestFinishedToViewResults().

+ Here is the caller graph for this function:

◆ lookupQuestionSetType()

static ilObjTest::lookupQuestionSetType (   $objId)
static

lookup-er for question set type

@global ilDBInterface $ilDB

Parameters
integer$objId
Returns
string $questionSetType

Definition at line 11907 of file class.ilObjTest.php.

11908 {
11909 global $DIC;
11910 $ilDB = $DIC['ilDB'];
11911
11912 $query = "SELECT question_set_type FROM tst_tests WHERE obj_fi = %s";
11913
11914 $res = $ilDB->queryF($query, array('integer'), array($objId));
11915
11916 $questionSetType = null;
11917
11918 while ($row = $ilDB->fetchAssoc($res)) {
11919 $questionSetType = $row['question_set_type'];
11920 }
11921
11922 return $questionSetType;
11923 }
$objId
Definition: xapitoken.php:39

References $DIC, $ilDB, $objId, $query, $questionSetType, and $res.

Referenced by _lookupRandomTest().

+ Here is the caller graph for this function:

◆ lookupQuestionSetTypeByActiveId()

static ilObjTest::lookupQuestionSetTypeByActiveId (   $active_id)
static

returns the question set type of test relating to passed active id

Parameters
integer$activeId
Returns
string $questionSetType

Definition at line 9513 of file class.ilObjTest.php.

9514 {
9515 global $DIC;
9516 $ilDB = $DIC['ilDB'];
9517
9518 $query = "
9519 SELECT tst_tests.question_set_type
9520 FROM tst_active
9521 INNER JOIN tst_tests
9522 ON tst_active.test_fi = tst_tests.test_id
9523 WHERE tst_active.active_id = %s
9524 ";
9525
9526 $res = $ilDB->queryF($query, array('integer'), array($active_id));
9527
9528 while ($row = $ilDB->fetchAssoc($res)) {
9529 return $row['question_set_type'];
9530 }
9531
9532 return null;
9533 }

References $DIC, $ilDB, $query, and $res.

Referenced by _getQuestionCountAndPointsForPassOfParticipant().

+ Here is the caller graph for this function:

◆ modifyExportIdentifier()

ilObjTest::modifyExportIdentifier (   $a_tag,
  $a_param,
  $a_value 
)

Returns the installation id for a given identifier.

@access private

Definition at line 6665 of file class.ilObjTest.php.

6666 {
6667 if ($a_tag == "Identifier" && $a_param == "Entry") {
6668 include_once "./Services/Utilities/classes/class.ilUtil.php";
6669 $a_value = ilUtil::insertInstIntoID($a_value);
6670 }
6671
6672 return $a_value;
6673 }
static insertInstIntoID($a_value)
inserts installation id into ILIAS id

References ilUtil\insertInstIntoID().

+ Here is the call graph for this function:

◆ moveQuestionAfter()

ilObjTest::moveQuestionAfter (   $question_to_move,
  $question_before 
)

Definition at line 10917 of file class.ilObjTest.php.

10918 {
10919 global $DIC;
10920 $ilDB = $DIC['ilDB'];
10921 //var_dump(func_get_args());
10922 if ($question_before) {
10923 $query = 'SELECT sequence, test_fi FROM tst_test_question WHERE question_fi = %s';
10924 $types = array('integer');
10925 $values = array($question_before);
10926 $rset = $ilDB->queryF($query, $types, $values);
10927 }
10928
10929 if (!$question_before || ($rset && !($row = $ilDB->fetchAssoc($rset)))) {
10930 $row = array(
10931 'sequence' => 0,
10932 'test_fi' => $this->getTestId(),
10933 );
10934 }
10935
10936 $update = 'UPDATE tst_test_question SET sequence = sequence + 1 WHERE sequence > %s AND test_fi = %s';
10937 $types = array('integer', 'integer');
10938 $values = array($row['sequence'], $row['test_fi']);
10939 $ilDB->manipulateF($update, $types, $values);
10940
10941 $update = 'UPDATE tst_test_question SET sequence = %s WHERE question_fi = %s';
10942 $types = array('integer', 'integer');
10943 $values = array($row['sequence'] + 1, $question_to_move);
10944 $ilDB->manipulateF($update, $types, $values);
10945
10947 }
reindexFixedQuestionOrdering()

References $DIC, $ilDB, $query, getTestId(), and reindexFixedQuestionOrdering().

+ Here is the call graph for this function:

◆ moveQuestionAfterOLD()

ilObjTest::moveQuestionAfterOLD (   $previous_question_id,
  $new_question_id 
)

Definition at line 10744 of file class.ilObjTest.php.

10745 {
10746 $new_array = array();
10747 $position = 1;
10748
10749 $query = 'SELECT question_fi FROM tst_test_question WHERE test_fi = %s';
10750 $types = array('integer');
10751 $values = array($this->getTestId());
10752
10753 $new_question_id += 1;
10754
10755 global $DIC;
10756 $ilDB = $DIC['ilDB'];
10757 $inserted = false;
10758 $res = $ilDB->queryF($query, $types, $values);
10759 while ($row = $ilDB->fetchAssoc($res)) {
10760 $qid = $row['question_fi'];
10761
10762 if ($qid == $new_question_id) {
10763 continue;
10764 } elseif ($qid == $previous_question_id) {
10765 $new_array[$position++] = $qid;
10766 $new_array[$position++] = $new_question_id;
10767 $inserted = true;
10768 } else {
10769 $new_array[$position++] = $qid;
10770 }
10771 }
10772
10773 $update_query = 'UPDATE tst_test_question SET sequence = %s WHERE test_fi = %s AND question_fi = %s';
10774 $update_types = array('integer', 'integer', 'integer');
10775
10776 foreach ($new_array as $position => $qid) {
10777 $ilDB->manipulateF(
10778 $update_query,
10779 $update_types,
10780 $vals = array(
10781 $position,
10782 $this->getTestId(),
10783 $qid
10784 )
10785 );
10786 }
10787 }

References $DIC, $ilDB, $query, $res, and getTestId().

+ Here is the call graph for this function:

◆ moveQuestions()

ilObjTest::moveQuestions (   $move_questions,
  $target_index,
  $insert_mode 
)

Move questions to another position.

Parameters
array$move_questionsAn array with the question id's of the questions to move
integer$target_indexThe question id of the target position
integer$insert_mode0, if insert before the target position, 1 if insert after the target position @access public

Definition at line 5503 of file class.ilObjTest.php.

5504 {
5505 $this->questions = array_values($this->questions);
5506 $array_pos = array_search($target_index, $this->questions);
5507 if ($insert_mode == 0) {
5508 $part1 = array_slice($this->questions, 0, $array_pos);
5509 $part2 = array_slice($this->questions, $array_pos);
5510 } elseif ($insert_mode == 1) {
5511 $part1 = array_slice($this->questions, 0, $array_pos + 1);
5512 $part2 = array_slice($this->questions, $array_pos + 1);
5513 }
5514 foreach ($move_questions as $question_id) {
5515 if (!(array_search($question_id, $part1) === false)) {
5516 unset($part1[array_search($question_id, $part1)]);
5517 }
5518 if (!(array_search($question_id, $part2) === false)) {
5519 unset($part2[array_search($question_id, $part2)]);
5520 }
5521 }
5522 $part1 = array_values($part1);
5523 $part2 = array_values($part2);
5524 $new_array = array_values(array_merge($part1, $move_questions, $part2));
5525 $this->questions = array();
5526 $counter = 1;
5527 foreach ($new_array as $question_id) {
5528 $this->questions[$counter] = $question_id;
5529 $counter++;
5530 }
5531 $this->saveQuestionsToDb();
5532 }
saveQuestionsToDb()
Saves the test questions to the database.

References saveQuestionsToDb().

+ Here is the call graph for this function:

◆ participantDataExist()

ilObjTest::participantDataExist ( )

Definition at line 11983 of file class.ilObjTest.php.

11984 {
11985 if ($this->participantDataExist === null) {
11986 $this->participantDataExist = (bool) $this->evalTotalPersons();
11987 }
11988
11990 }
$participantDataExist
holds the fact wether participant data exists or not DO NOT USE TIS PROPERTY DRIRECTLY ALWAYS USE ilO...

References $participantDataExist, evalTotalPersons(), and participantDataExist().

Referenced by participantDataExist().

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

◆ pcArrayShuffle()

ilObjTest::pcArrayShuffle (   $array)

Shuffles the values of a given array.

Parameters
array$arrayAn array which should be shuffled @access public

Definition at line 4021 of file class.ilObjTest.php.

4022 {
4023 $keys = array_keys($array);
4024 shuffle($keys);
4025 $result = array();
4026 foreach ($keys as $key) {
4027 $result[$key] = $array[$key];
4028 }
4029 return $result;
4030 }
$keys
Definition: metadata.php:187

References $keys, and $result.

◆ prepareTextareaOutput()

ilObjTest::prepareTextareaOutput (   $txt_output,
  $prepare_for_latex_output = false,
  $omitNl2BrWhenTextArea = false 
)

Prepares a string for a text area output in tests.

Parameters
string$txt_outputString which should be prepared for output @access public

Definition at line 9322 of file class.ilObjTest.php.

9323 {
9324 include_once "./Services/Utilities/classes/class.ilUtil.php";
9325 return ilUtil::prepareTextareaOutput($txt_output, $prepare_for_latex_output, $omitNl2BrWhenTextArea);
9326 }
static prepareTextareaOutput($txt_output, $prepare_for_latex_output=false, $omitNl2BrWhenTextArea=false)
Prepares a string for a text area output where latex code may be in it If the text is HTML-free,...

References ilUtil\prepareTextareaOutput().

+ Here is the call graph for this function:

◆ processCSVRow()

& ilObjTest::processCSVRow (   $row,
  $quoteAll = false,
  $separator = ";" 
)

Processes an array as a CSV row and converts the array values to correct CSV values.

The "converted" array is returned

Parameters
array$rowThe array containing the values for a CSV row
string$quoteAllIndicates to quote every value (=TRUE) or only values containing quotes and separators (=FALSE, default)
string$separatorThe value separator in the CSV row (used for quoting) (; = default)
Returns
array The converted array ready for CSV use @access public

Definition at line 8048 of file class.ilObjTest.php.

8049 {
8050 $resultarray = array();
8051 foreach ($row as $rowindex => $entry) {
8052 $surround = false;
8053 if ($quoteAll) {
8054 $surround = true;
8055 }
8056 if (strpos($entry, "\"") !== false) {
8057 $entry = str_replace("\"", "\"\"", $entry);
8058 $surround = true;
8059 }
8060 if (strpos($entry, $separator) !== false) {
8061 $surround = true;
8062 }
8063 // replace all CR LF with LF (for Excel for Windows compatibility
8064 $entry = str_replace(chr(13) . chr(10), chr(10), $entry);
8065
8066 if ($surround) {
8067 $entry = "\"" . $entry . "\"";
8068 }
8069
8070 $resultarray[$rowindex] = $entry;
8071 }
8072 return $resultarray;
8073 }

Referenced by getAllTestResults().

+ Here is the caller graph for this function:

◆ processPrintoutput2FO()

ilObjTest::processPrintoutput2FO (   $print_output)

Convert a print output to XSL-FO.

Parameters
string$print_outputThe print output
Returns
string XSL-FO code @access public

Definition at line 9945 of file class.ilObjTest.php.

9946 {
9947 if (extension_loaded("tidy")) {
9948 $config = array(
9949 "indent" => false,
9950 "output-xml" => true,
9951 "numeric-entities" => true
9952 );
9953 $tidy = new tidy();
9954 $tidy->parseString($print_output, $config, 'utf8');
9955 $tidy->cleanRepair();
9956 $print_output = tidy_get_output($tidy);
9957 $print_output = preg_replace("/^.*?(<html)/", "\\1", $print_output);
9958 } else {
9959 $print_output = str_replace("&nbsp;", "&#160;", $print_output);
9960 $print_output = str_replace("&otimes;", "X", $print_output);
9961 }
9962 $xsl = file_get_contents("./Modules/Test/xml/question2fo.xsl");
9963
9964 // additional font support
9965 global $DIC;
9966 $xsl = str_replace(
9967 'font-family="Helvetica, unifont"',
9968 'font-family="' . $DIC['ilSetting']->get('rpc_pdf_font', 'Helvetica, unifont') . '"',
9969 $xsl
9970 );
9971
9972 $args = array( '/_xml' => $print_output, '/_xsl' => $xsl );
9973 $xh = xslt_create();
9974 $params = array();
9975 $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", null, $args, $params);
9976 xslt_error($xh);
9977 xslt_free($xh);
9978 return $output;
9979 }
xslt_error(&$proc)
xslt_free(&$proc)
xslt_create()

References $config, $DIC, xslt_create(), xslt_error(), and xslt_free().

Referenced by deliverPDFfromHTML().

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

◆ QTIMaterialToString()

ilObjTest::QTIMaterialToString (   $a_material)

Reads an QTI material tag an creates a text string.

Parameters
string$a_materialQTI material tag
Returns
string text or xhtml string @access public

Definition at line 9249 of file class.ilObjTest.php.

9250 {
9251 $result = "";
9252 for ($i = 0; $i < $a_material->getMaterialCount(); $i++) {
9253 $material = $a_material->getMaterial($i);
9254 if (strcmp($material["type"], "mattext") == 0) {
9255 $result .= $material["material"]->getContent();
9256 }
9257 if (strcmp($material["type"], "matimage") == 0) {
9258 $matimage = $material["material"];
9259 if (preg_match("/(il_([0-9]+)_mob_([0-9]+))/", $matimage->getLabel(), $matches)) {
9260 // import an mediaobject which was inserted using tiny mce
9261 if (!is_array($_SESSION["import_mob_xhtml"])) {
9262 $_SESSION["import_mob_xhtml"] = array();
9263 }
9264 array_push($_SESSION["import_mob_xhtml"], array("mob" => $matimage->getLabel(), "uri" => $matimage->getUri()));
9265 }
9266 }
9267 }
9268 global $DIC;
9269 $ilLog = $DIC['ilLog'];
9270 $ilLog->write(print_r($_SESSION["import_mob_xhtml"], true));
9271 return $result;
9272 }

References $_SESSION, $DIC, $i, and $result.

Referenced by fromXML().

+ Here is the caller graph for this function:

◆ questionMoveDown()

ilObjTest::questionMoveDown (   $question_id)

Moves a question down in order.

Parameters
integer$question_idThe database id of the question to be moved down @access public
See also
$test_id

Definition at line 3534 of file class.ilObjTest.php.

3535 {
3536 global $DIC;
3537 $ilDB = $DIC['ilDB'];
3538
3539 // Move a question down in sequence
3540 $result = $ilDB->queryF(
3541 "SELECT * FROM tst_test_question WHERE test_fi=%s AND question_fi=%s",
3542 array('integer','integer'),
3543 array($this->getTestId(), $question_id)
3544 );
3545 $data = $ilDB->fetchObject($result);
3546 $result = $ilDB->queryF(
3547 "SELECT * FROM tst_test_question WHERE test_fi=%s AND sequence=%s",
3548 array('integer','integer'),
3549 array($this->getTestId(), $data->sequence + 1)
3550 );
3551 if ($result->numRows() == 1) {
3552 // OK, it's not the last question, so move it down
3553 $data_next = $ilDB->fetchObject($result);
3554 // change next dataset
3555 $affectedRows = $ilDB->manipulateF(
3556 "UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
3557 array('integer','integer'),
3558 array($data->sequence, $data_next->test_question_id)
3559 );
3560 // move actual dataset down
3561 $affectedRows = $ilDB->manipulateF(
3562 "UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
3563 array('integer','integer'),
3564 array($data->sequence + 1, $data->test_question_id)
3565 );
3566 include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3568 $this->logAction($this->lng->txtlng("assessment", "log_question_position_changed", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($data->sequence) . " => " . ($data->sequence + 1), $question_id);
3569 }
3570 }
3571 $this->loadQuestions();
3572 }

References $data, $DIC, $ilDB, $result, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), getTestId(), loadQuestions(), and logAction().

+ Here is the call graph for this function:

◆ questionMoveUp()

ilObjTest::questionMoveUp (   $question_id)

Moves a question up in order.

Parameters
integer$question_idThe database id of the question to be moved up @access public
See also
$test_id

Definition at line 3487 of file class.ilObjTest.php.

3488 {
3489 global $DIC;
3490 $ilDB = $DIC['ilDB'];
3491
3492 // Move a question up in sequence
3493 $result = $ilDB->queryF(
3494 "SELECT * FROM tst_test_question WHERE test_fi=%s AND question_fi=%s",
3495 array('integer', 'integer'),
3496 array($this->getTestId(), $question_id)
3497 );
3498 $data = $ilDB->fetchObject($result);
3499 if ($data->sequence > 1) {
3500 // OK, it's not the top question, so move it up
3501 $result = $ilDB->queryF(
3502 "SELECT * FROM tst_test_question WHERE test_fi=%s AND sequence=%s",
3503 array('integer','integer'),
3504 array($this->getTestId(), $data->sequence - 1)
3505 );
3506 $data_previous = $ilDB->fetchObject($result);
3507 // change previous dataset
3508 $affectedRows = $ilDB->manipulateF(
3509 "UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
3510 array('integer','integer'),
3511 array($data->sequence, $data_previous->test_question_id)
3512 );
3513 // move actual dataset up
3514 $affectedRows = $ilDB->manipulateF(
3515 "UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
3516 array('integer','integer'),
3517 array($data->sequence - 1, $data->test_question_id)
3518 );
3519 include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3521 $this->logAction($this->lng->txtlng("assessment", "log_question_position_changed", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($data->sequence) . " => " . ($data->sequence - 1), $question_id);
3522 }
3523 }
3524 $this->loadQuestions();
3525 }

References $data, $DIC, $ilDB, $result, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), getTestId(), loadQuestions(), and logAction().

+ Here is the call graph for this function:

◆ randomSelectQuestions()

ilObjTest::randomSelectQuestions (   $nr_of_questions,
  $questionpool,
  $use_obj_id = 0,
  $qpls = "",
  $pass = null 
)

Returns a random selection of questions.

Parameters
integer$nr_of_questionsNumber of questions to return
integer$questionpoolID of questionpool to choose the questions from (0 = all available questionpools)
boolean$user_obj_idUse the object id instead of the reference id when set to true
array$qplsAn array of questionpool id's if the random questions should only be chose from the contained questionpools
Returns
array A random selection of questions @access public
Deprecated:
--> old school random test

Definition at line 1716 of file class.ilObjTest.php.

1717 {
1718 global $DIC;
1719 $rbacsystem = $DIC['rbacsystem'];
1720 $ilDB = $DIC['ilDB'];
1721
1722 // retrieve object id instead of ref id if necessary
1723 if (($questionpool != 0) && (!$use_obj_id)) {
1724 $questionpool = ilObject::_lookupObjId($questionpool);
1725 }
1726
1727 // get original ids of all existing questions in the test
1728 $result = $ilDB->queryF(
1729 "SELECT qpl_questions.original_id FROM qpl_questions, tst_test_question WHERE qpl_questions.question_id = tst_test_question.question_fi AND qpl_questions.tstamp > 0 AND tst_test_question.test_fi = %s",
1730 array("integer"),
1731 array($this->getTestId())
1732 );
1733 $original_ids = array();
1734 $paramtypes = array();
1735 $paramvalues = array();
1736 while ($row = $ilDB->fetchAssoc($result)) {
1737 array_push($original_ids, $row['original_id']);
1738 }
1739
1740 $available = "";
1741 // get a list of all available questionpools
1742 if (($questionpool == 0) && (!is_array($qpls))) {
1743 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
1744 $available_pools = array_keys(ilObjQuestionPool::_getAvailableQuestionpools($use_object_id = true, $equal_points = false, $could_be_offline = false, $showPath = false, $with_questioncount = false, "read", ilObject::_lookupOwner($this->getId())));
1745 if (count($available_pools)) {
1746 $available = " AND " . $ilDB->in('obj_fi', $available_pools, false, 'integer');
1747 } else {
1748 return array();
1749 }
1750 }
1751
1752 $constraint_qpls = "";
1753 $result_array = array();
1754 if ($questionpool == 0) {
1755 if (is_array($qpls)) {
1756 if (count($qpls) > 0) {
1757 $constraint_qpls = " AND " . $ilDB->in('obj_fi', $qpls, false, 'integer');
1758 }
1759 }
1760 }
1761
1762 $original_clause = "";
1763 if (count($original_ids)) {
1764 $original_clause = " AND " . $ilDB->in('question_id', $original_ids, true, 'integer');
1765 }
1766
1767 if ($questionpool == 0) {
1768 $result = $ilDB->queryF(
1769 "SELECT question_id FROM qpl_questions WHERE original_id IS NULL $available $constraint_qpls AND owner > %s AND complete = %s $original_clause",
1770 array('integer', 'text'),
1771 array(0, "1")
1772 );
1773 } else {
1774 $result = $ilDB->queryF(
1775 "SELECT question_id FROM qpl_questions WHERE original_id IS NULL AND obj_fi = %s AND owner > %s AND complete = %s $original_clause",
1776 array('integer','integer', 'text'),
1777 array($questionpool, 0, "1")
1778 );
1779 }
1780 $found_ids = array();
1781 while ($row = $ilDB->fetchAssoc($result)) {
1782 array_push($found_ids, $row['question_id']);
1783 }
1784 $nr_of_questions = ($nr_of_questions > count($found_ids)) ? count($found_ids) : $nr_of_questions;
1785 if ($nr_of_questions == 0) {
1786 return array();
1787 }
1788 $rand_keys = array_rand($found_ids, $nr_of_questions);
1789 $result = array();
1790 if (is_array($rand_keys)) {
1791 foreach ($rand_keys as $key) {
1792 $result[$found_ids[$key]] = $found_ids[$key];
1793 }
1794 } else {
1795 $result[$found_ids[$rand_keys]] = $found_ids[$rand_keys];
1796 }
1797 return $result;
1798 }
static _lookupOwner($a_id)
lookup object owner

References $DIC, $ilDB, $result, ilObjQuestionPool\_getAvailableQuestionpools(), ilObject\_lookupObjId(), ilObject\_lookupOwner(), ilObject\getId(), and getTestId().

+ Here is the call graph for this function:

◆ read()

ilObjTest::read ( )

read object data from db into object

Parameters
boolean@access public

Reimplemented from ilObject.

Definition at line 778 of file class.ilObjTest.php.

779 {
780 parent::read();
781 $this->loadFromDb();
782 }
loadFromDb()
Loads a ilObjTest object from a database.

References loadFromDb().

+ Here is the call graph for this function:

◆ recalculateScores()

ilObjTest::recalculateScores (   $preserve_manscoring = false)

Definition at line 11992 of file class.ilObjTest.php.

11993 {
11994 require_once 'class.ilTestScoring.php';
11995 $scoring = new ilTestScoring($this);
11996 $scoring->setPreserveManualScores($preserve_manscoring);
11997 $scoring->recalculateSolutions();
11998 }
Class ilTestScoring.

◆ reindexFixedQuestionOrdering()

ilObjTest::reindexFixedQuestionOrdering ( )
Returns
ilTestReindexedSequencePositionMap

Definition at line 10865 of file class.ilObjTest.php.

10866 {
10867 global $DIC;
10868 $tree = $DIC['tree'];
10869 $db = $DIC['ilDB'];
10870 $pluginAdmin = $DIC['ilPluginAdmin'];
10871
10872 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
10873 $qscFactory = new ilTestQuestionSetConfigFactory($tree, $db, $pluginAdmin, $this);
10874 $questionSetConfig = $qscFactory->getQuestionSetConfig();
10875
10876 /* @var ilTestFixedQuestionSetConfig $questionSetConfig */
10877 $reindexedSequencePositionMap = $questionSetConfig->reindexQuestionOrdering();
10878
10879 $this->loadQuestions();
10880
10881 return $reindexedSequencePositionMap;
10882 }

References ilObject\$db, $DIC, ilObject\$tree, and loadQuestions().

Referenced by moveQuestionAfter(), and removeQuestions().

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

◆ removeQuestion()

ilObjTest::removeQuestion (   $question_id)

Removes a question from the test object.

Parameters
integer$question_idThe database id of the question to be removed @access public
See also
$test_id

Definition at line 3354 of file class.ilObjTest.php.

3355 {
3356 $question = &ilObjTest::_instanciateQuestion($question_id);
3357 include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3359 $this->logAction($this->lng->txtlng("assessment", "log_question_removed", ilObjAssessmentFolder::_getLogLanguage()), $question_id);
3360 }
3361 $question->delete($question_id);
3362 }

References ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), _instanciateQuestion(), and logAction().

Referenced by removeQuestions().

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

◆ removeQuestionFromSequences()

ilObjTest::removeQuestionFromSequences (   $questionId,
  $activeIds,
ilTestReindexedSequencePositionMap  $reindexedSequencePositionMap 
)
Parameters
int$questionId
array$activeIds
ilTestReindexedSequencePositionMap$reindexedSequencePositionMap

Definition at line 3309 of file class.ilObjTest.php.

3310 {
3311 global $DIC; /* @var ILIAS\DI\Container $DIC */
3312
3313 $testSequenceFactory = new ilTestSequenceFactory(
3314 $DIC->database(),
3315 $DIC->language(),
3316 $DIC['refinery'],
3317 $DIC['ilPluginAdmin'],
3318 $this
3319 );
3320
3321 foreach ($activeIds as $activeId) {
3322 $passSelector = new ilTestPassesSelector($DIC->database(), $this);
3323 $passSelector->setActiveId($activeId);
3324
3325 foreach ($passSelector->getExistingPasses() as $pass) {
3326 $testSequence = $testSequenceFactory->getSequenceByActiveIdAndPass($activeId, $pass);
3327 $testSequence->loadFromDb();
3328
3329 $testSequence->removeQuestion($questionId, $reindexedSequencePositionMap);
3330 $testSequence->saveToDb();
3331 }
3332 }
3333 }

References $DIC, $pass, and $testSequence.

◆ removeQuestions()

ilObjTest::removeQuestions (   $removeQuestionIds)
Parameters
array$removeQuestionIds

Definition at line 3338 of file class.ilObjTest.php.

3339 {
3340 foreach ($removeQuestionIds as $value) {
3341 $this->removeQuestion($value);
3342 }
3343
3345 }
removeQuestion($question_id)
Removes a question from the test object.

References reindexFixedQuestionOrdering(), and removeQuestion().

+ Here is the call graph for this function:

◆ removeTestActives()

ilObjTest::removeTestActives (   $activeIds)

Definition at line 3471 of file class.ilObjTest.php.

3472 {
3473 global $DIC;
3474 $ilDB = $DIC['ilDB'];
3475
3476 $IN_activeIds = $ilDB->in('active_id', $activeIds, false, 'integer');
3477 $ilDB->manipulate("DELETE FROM tst_active WHERE $IN_activeIds");
3478 }

References $DIC, and $ilDB.

Referenced by removeTestResults(), removeTestResultsFromSoapLpAdministration(), and ilCourseObjectiveResult\resetTestForUser().

+ Here is the caller graph for this function:

◆ removeTestResults()

ilObjTest::removeTestResults ( ilTestParticipantData  $participantData)

Definition at line 3388 of file class.ilObjTest.php.

3389 {
3390 if (count($participantData->getAnonymousActiveIds())) {
3391 $this->removeTestResultsByActiveIds($participantData->getAnonymousActiveIds());
3392 }
3393
3394 if (count($participantData->getUserIds())) {
3395 /* @var ilTestLP $testLP */
3396 require_once 'Services/Object/classes/class.ilObjectLP.php';
3397 $testLP = ilObjectLP::getInstance($this->getId());
3398 $testLP->setTestObject($this);
3399 $testLP->resetLPDataForUserIds($participantData->getUserIds(), false);
3400 }
3401
3402 if (count($participantData->getActiveIds())) {
3403 $this->removeTestActives($participantData->getActiveIds());
3404 }
3405 }
removeTestResultsByActiveIds($activeIds)
removeTestActives($activeIds)
static getInstance($a_obj_id)

References ilTestParticipantData\getActiveIds(), ilTestParticipantData\getAnonymousActiveIds(), ilObject\getId(), ilObjectLP\getInstance(), ilTestParticipantData\getUserIds(), removeTestActives(), and removeTestResultsByActiveIds().

Referenced by deleteTest().

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

◆ removeTestResultsByActiveIds()

ilObjTest::removeTestResultsByActiveIds (   $activeIds)

Definition at line 3430 of file class.ilObjTest.php.

3431 {
3432 global $DIC;
3433 $ilDB = $DIC['ilDB'];
3434
3435 $IN_activeIds = $ilDB->in('active_fi', $activeIds, false, 'integer');
3436
3437 $ilDB->manipulate("DELETE FROM tst_solutions WHERE $IN_activeIds");
3438 $ilDB->manipulate("DELETE FROM tst_qst_solved WHERE $IN_activeIds");
3439 $ilDB->manipulate("DELETE FROM tst_test_result WHERE $IN_activeIds");
3440 $ilDB->manipulate("DELETE FROM tst_pass_result WHERE $IN_activeIds");
3441 $ilDB->manipulate("DELETE FROM tst_result_cache WHERE $IN_activeIds");
3442 $ilDB->manipulate("DELETE FROM tst_sequence WHERE $IN_activeIds");
3443 $ilDB->manipulate("DELETE FROM tst_times WHERE $IN_activeIds");
3444
3445 if ($this->isRandomTest()) {
3446 $ilDB->manipulate("DELETE FROM tst_test_rnd_qst WHERE $IN_activeIds");
3447 } elseif ($this->isDynamicTest()) {
3448 $ilDB->manipulate("DELETE FROM tst_seq_qst_tracking WHERE $IN_activeIds");
3449 $ilDB->manipulate("DELETE FROM tst_seq_qst_answstatus WHERE $IN_activeIds");
3450 $ilDB->manipulate("DELETE FROM tst_seq_qst_postponed WHERE $IN_activeIds");
3451 $ilDB->manipulate("DELETE FROM tst_seq_qst_checked WHERE $IN_activeIds");
3452 }
3453
3454 include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3455
3456 foreach ($activeIds as $active_id) {
3457 // remove file uploads
3458 if (@is_dir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId() . "/$active_id")) {
3459 ilUtil::delDir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId() . "/$active_id");
3460 }
3461
3463 $this->logAction(sprintf($this->lng->txtlng("assessment", "log_selected_user_data_removed", ilObjAssessmentFolder::_getLogLanguage()), $this->userLookupFullName($this->_getUserIdFromActiveId($active_id))));
3464 }
3465 }
3466
3467 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
3469 }
static deleteRequestsByActiveIds($activeIds)
Deletes all hint requests relating to a testactive included in given active ids.

References $DIC, $ilDB, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), CLIENT_WEB_DIR, ilUtil\delDir(), ilAssQuestionHintTracking\deleteRequestsByActiveIds(), getTestId(), isDynamicTest(), isRandomTest(), and logAction().

Referenced by removeTestResults(), and removeTestResultsByUserIds().

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

◆ removeTestResultsByUserIds()

ilObjTest::removeTestResultsByUserIds (   $userIds)

Definition at line 3407 of file class.ilObjTest.php.

3408 {
3409 global $DIC;
3410 $ilDB = $DIC['ilDB'];
3411 $lng = $DIC['lng'];
3412
3413 require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
3414 $participantData = new ilTestParticipantData($ilDB, $lng);
3415 $participantData->setUserIdsFilter($userIds);
3416 $participantData->load($this->getTestId());
3417
3418 $IN_userIds = $ilDB->in('usr_id', $participantData->getUserIds(), false, 'integer');
3419 $ilDB->manipulateF(
3420 "DELETE FROM usr_pref WHERE $IN_userIds AND keyword = %s",
3421 array('text'),
3422 array("tst_password_" . $this->getTestId())
3423 );
3424
3425 if (count($participantData->getActiveIds())) {
3426 $this->removeTestResultsByActiveIds($participantData->getActiveIds());
3427 }
3428 }

References $DIC, $ilDB, ilObject\$lng, getTestId(), and removeTestResultsByActiveIds().

Referenced by removeTestResultsFromSoapLpAdministration().

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

◆ removeTestResultsFromSoapLpAdministration()

ilObjTest::removeTestResultsFromSoapLpAdministration (   $userIds)

this method should only be used from non refactored soap context i think

Parameters
$userIds

Definition at line 3372 of file class.ilObjTest.php.

3373 {
3374 $this->removeTestResultsByUserIds($userIds);
3375
3376 global $DIC;
3377 $ilDB = $DIC['ilDB'];
3378 $lng = $DIC['lng'];
3379
3380 require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
3381 $participantData = new ilTestParticipantData($ilDB, $lng);
3382 $participantData->setUserIdsFilter($userIds);
3383 $participantData->load($this->getTestId());
3384
3385 $this->removeTestActives($participantData->getActiveIds());
3386 }
removeTestResultsByUserIds($userIds)

References $DIC, $ilDB, ilObject\$lng, getTestId(), removeTestActives(), and removeTestResultsByUserIds().

+ Here is the call graph for this function:

◆ saveAuthorToMetadata()

ilObjTest::saveAuthorToMetadata (   $a_author = "")

Saves an authors name into the lifecycle metadata if no lifecycle metadata exists This will only be called for conversion of "old" tests where the author hasn't been stored in the lifecycle metadata.

Parameters
string$a_authorA string containing the name of the test author @access private
See also
$author

Definition at line 6954 of file class.ilObjTest.php.

6955 {
6956 $md = new ilMD($this->getId(), 0, $this->getType());
6957 $md_life = &$md->getLifecycle();
6958 if (!$md_life) {
6959 if (strlen($a_author) == 0) {
6960 global $DIC;
6961 $ilUser = $DIC['ilUser'];
6962 $a_author = $ilUser->getFullname();
6963 }
6964
6965 $md_life = &$md->addLifecycle();
6966 $md_life->save();
6967 $con = &$md_life->addContribute();
6968 $con->setRole("Author");
6969 $con->save();
6970 $ent = &$con->addEntity();
6971 $ent->setEntity($a_author);
6972 $ent->save();
6973 }
6974 }

References $DIC, $ilUser, ilObject\getId(), and ilObject\getType().

Referenced by createMetaData(), and loadFromDb().

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

◆ saveCertificateVisibility()

ilObjTest::saveCertificateVisibility (   $a_value)

Saves the visibility settings of the certificate.

Parameters
integer$a_valueThe value for the visibility settings (0 = always, 1 = only passed, 2 = never) @access private

Definition at line 9334 of file class.ilObjTest.php.

9335 {
9336 global $DIC;
9337 $ilDB = $DIC['ilDB'];
9338
9339 $affectedRows = $ilDB->manipulateF(
9340 "UPDATE tst_tests SET certificate_visibility = %s, tstamp = %s WHERE test_id = %s",
9341 array('text', 'integer', 'integer'),
9342 array($a_value, time(), $this->getTestId())
9343 );
9344 }

References $DIC, $ilDB, and getTestId().

+ Here is the call graph for this function:

◆ saveCompleteStatus()

ilObjTest::saveCompleteStatus ( ilTestQuestionSetConfig  $testQuestionSetConfig)

Checks if the test is complete and saves the status in the database.

Parameters
ilTestQuestionSetConfig$testQuestionSetConfig

Definition at line 1174 of file class.ilObjTest.php.

1175 {
1176 global $DIC;
1177 $ilDB = $DIC['ilDB'];
1178
1179 $complete = 0;
1180 if ($this->isComplete($testQuestionSetConfig)) {
1181 $complete = 1;
1182 }
1183 if ($this->getTestId() > 0) {
1184 $ilDB->manipulateF(
1185 "UPDATE tst_tests SET complete = %s WHERE test_id = %s",
1186 array('text', 'integer'),
1187 array($complete, $this->test_id)
1188 );
1189 }
1190 }
isComplete(ilTestQuestionSetConfig $testQuestionSetConfig)
Returns true, if a test is complete for use and can be set online.

References $DIC, $ilDB, getTestId(), and isComplete().

Referenced by insertQuestion().

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

◆ saveManualFeedback()

ilObjTest::saveManualFeedback (   $active_id,
  $question_id,
  $pass,
  $feedback,
  $finalized = false,
  $is_single_feedback = false 
)

Saves the manual feedback for a question in a test.

Parameters
integer$active_idActive ID of the user
integer$question_idQuestion ID
integer$passPass number
string$feedbackThe feedback text
boolean$finalizedIn Feedback is final
boolean$is_single_feedback
Returns
boolean TRUE if the operation succeeds, FALSE otherwise @access public

Definition at line 10143 of file class.ilObjTest.php.

10144 {
10145 global $DIC;
10146
10147 $feedback_old = $this->getSingleManualFeedback($active_id, $question_id, $pass);
10148
10149 $finalized_record = (int) $feedback_old['finalized_evaluation'];
10150 if ($finalized_record === 0 || ($is_single_feedback && $finalized_record === 1)) {
10151 $DIC->database()->manipulateF(
10152 "DELETE FROM tst_manual_fb WHERE active_fi = %s AND question_fi = %s AND pass = %s",
10153 array('integer', 'integer', 'integer'),
10154 array($active_id, $question_id, $pass)
10155 );
10156
10157 $this->insertManualFeedback($active_id, $question_id, $pass, $feedback, $finalized, $feedback_old);
10158
10160 $this->logManualFeedback($active_id, $question_id, $feedback);
10161 }
10162 }
10163
10164 return true;
10165 }
insertManualFeedback($active_id, $question_id, $pass, $feedback, $finalized, $feedback_old)
Inserts a manual feedback into the DB.
logManualFeedback($active_id, $question_id, $feedback)
Creates a log for the manual feedback.

References $DIC, $pass, ilObjAssessmentFolder\_enabledAssessmentLogging(), getSingleManualFeedback(), insertManualFeedback(), and logManualFeedback().

+ Here is the call graph for this function:

◆ saveQuestionsToDb()

ilObjTest::saveQuestionsToDb ( )

Saves the test questions to the database.

@access public

See also
$questions

Definition at line 1606 of file class.ilObjTest.php.

1607 {
1608 global $DIC;
1609 $ilDB = $DIC['ilDB'];
1610
1611 $oldquestions = array();
1612 include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
1614 $result = $ilDB->queryF(
1615 "SELECT question_fi FROM tst_test_question WHERE test_fi = %s ORDER BY sequence",
1616 array('integer'),
1617 array($this->getTestId())
1618 );
1619 if ($result->numRows() > 0) {
1620 while ($row = $ilDB->fetchAssoc($result)) {
1621 array_push($oldquestions, $row["question_fi"]);
1622 }
1623 }
1624 }
1625 // workaround for lost obligations
1626 // this method is called if a question is removed
1627 $currentQuestionsObligationsQuery = 'SELECT question_fi, obligatory FROM tst_test_question WHERE test_fi = %s';
1628 $rset = $ilDB->queryF($currentQuestionsObligationsQuery, array('integer'), array($this->getTestId()));
1629 while ($row = $ilDB->fetchAssoc($rset)) {
1630 $obligatoryQuestionState[$row['question_fi']] = $row['obligatory'];
1631 }
1632 // delete existing category relations
1633 $affectedRows = $ilDB->manipulateF(
1634 "DELETE FROM tst_test_question WHERE test_fi = %s",
1635 array('integer'),
1636 array($this->getTestId())
1637 );
1638 // create new category relations
1639 foreach ($this->questions as $key => $value) {
1640 // workaround for import witout obligations information
1641 if (!isset($obligatoryQuestionState[$value]) || is_null($obligatoryQuestionState[$value])) {
1642 $obligatoryQuestionState[$value] = 0;
1643 }
1644
1645 // insert question
1646 $next_id = $ilDB->nextId('tst_test_question');
1647 $ilDB->insert('tst_test_question', array(
1648 'test_question_id' => array('integer', $next_id),
1649 'test_fi' => array('integer', $this->getTestId()),
1650 'question_fi' => array('integer', $value),
1651 'sequence' => array('integer', $key),
1652 'obligatory' => array('integer', $obligatoryQuestionState[$value]),
1653 'tstamp' => array('integer', time())
1654 ));
1655 }
1656 include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
1658 $result = $ilDB->queryF(
1659 "SELECT question_fi FROM tst_test_question WHERE test_fi = %s ORDER BY sequence",
1660 array('integer'),
1661 array($this->getTestId())
1662 );
1663 $newquestions = array();
1664 if ($result->numRows() > 0) {
1665 while ($row = $ilDB->fetchAssoc($result)) {
1666 array_push($newquestions, $row["question_fi"]);
1667 }
1668 }
1669 foreach ($oldquestions as $index => $question_id) {
1670 if (strcmp($newquestions[$index], $question_id) != 0) {
1671 $pos = array_search($question_id, $newquestions);
1672 if ($pos === false) {
1673 $this->logAction($this->lng->txtlng("assessment", "log_question_removed", ilObjAssessmentFolder::_getLogLanguage()), $question_id);
1674 } else {
1675 $this->logAction($this->lng->txtlng("assessment", "log_question_position_changed", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($index + 1) . " => " . ($pos + 1), $question_id);
1676 }
1677 }
1678 }
1679 foreach ($newquestions as $index => $question_id) {
1680 if (array_search($question_id, $oldquestions) === false) {
1681 $this->logAction($this->lng->txtlng("assessment", "log_question_added", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($index + 1), $question_id);
1682 }
1683 }
1684 }
1685 }

References $DIC, $ilDB, $index, $result, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), getTestId(), and logAction().

Referenced by moveQuestions(), and saveToDb().

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

◆ saveToDb()

ilObjTest::saveToDb (   $properties_only = false)

Saves a ilObjTest object to a database.

Parameters
bool$properties_only

Definition at line 1229 of file class.ilObjTest.php.

1230 {
1231 global $DIC;
1232 $tree = $DIC['tree'];
1233 $ilDB = $DIC['ilDB'];
1234 $ilPluginAdmin = $DIC['ilPluginAdmin'];
1235
1236 // moved online_status to ilObjectActivation (see below)
1237
1238 // cleanup RTE images
1239 $this->cleanupMediaobjectUsage();
1240
1241 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
1242 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this);
1243 $testQuestionSetConfig = $testQuestionSetConfigFactory->getQuestionSetConfig();
1244
1245 include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
1246 if ($this->test_id == -1) {
1247 // Create new dataset
1248 $next_id = $ilDB->nextId('tst_tests');
1249
1250 $ilDB->insert('tst_tests', array(
1251 'test_id' => array('integer', $next_id),
1252 'obj_fi' => array('integer', $this->getId()),
1253 'author' => array('text', $this->getAuthor()),
1254 'intro_enabled' => array('integer', (int) $this->isIntroductionEnabled()),
1255 'introduction' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getIntroduction(), 0)),
1256 'finalstatement' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getFinalStatement(), 0)),
1257 'showinfo' => array('integer', $this->getShowInfo()),
1258 'forcejs' => array('integer', $this->getForceJS()),
1259 'customstyle' => array('text', $this->getCustomStyle()),
1260 'showfinalstatement' => array('integer', $this->getShowFinalStatement()),
1261 'sequence_settings' => array('integer', $this->getSequenceSettings()),
1262 'score_reporting' => array('integer', $this->getScoreReporting()),
1263 'instant_verification' => array('text', $this->getInstantFeedbackSolution()),
1264 'answer_feedback_points' => array('text', $this->getAnswerFeedbackPoints()),
1265 'answer_feedback' => array('text', $this->getAnswerFeedback()),
1266 'anonymity' => array('text', $this->getAnonymity()),
1267 'show_cancel' => array('text', $this->getShowCancel()),
1268 'show_marker' => array('integer', $this->getShowMarker()),
1269 'fixed_participants' => array('text', $this->getFixedParticipants()),
1270 'nr_of_tries' => array('integer', $this->getNrOfTries()),
1271 'block_after_passed' => array('integer', (int) $this->isBlockPassesAfterPassedEnabled()),
1272 'kiosk' => array('integer', $this->getKiosk()),
1273 'use_previous_answers' => array('text', $this->getUsePreviousAnswers()),
1274 'title_output' => array('text', $this->getTitleOutput()),
1275 'processing_time' => array('text', $this->getProcessingTime()),
1276 'enable_processing_time' => array('text', $this->getEnableProcessingTime()),
1277 'reset_processing_time' => array('integer', $this->getResetProcessingTime()),
1278 'reporting_date' => array('text', $this->getReportingDate()),
1279 'starting_time_enabled' => array('integer', $this->isStartingTimeEnabled()),
1280 'starting_time' => array('integer', $this->getStartingTime()),
1281 'ending_time_enabled' => array('integer', $this->isEndingTimeEnabled()),
1282 'ending_time' => array('integer', $this->getEndingTime()),
1283 'complete' => array('text', $this->isComplete($testQuestionSetConfig)),
1284 'ects_output' => array('text', $this->getECTSOutput()),
1285 'ects_a' => array('float', strlen($this->ects_grades["A"]) ? $this->ects_grades["A"] : null),
1286 'ects_b' => array('float', strlen($this->ects_grades["B"]) ? $this->ects_grades["B"] : null),
1287 'ects_c' => array('float', strlen($this->ects_grades["C"]) ? $this->ects_grades["C"] : null),
1288 'ects_d' => array('float', strlen($this->ects_grades["D"]) ? $this->ects_grades["D"] : null),
1289 'ects_e' => array('float', strlen($this->ects_grades["E"]) ? $this->ects_grades["E"] : null),
1290 'ects_fx' => array('float', $this->getECTSFX()),
1291 'count_system' => array('text', $this->getCountSystem()),
1292 'mc_scoring' => array('text', $this->getMCScoring()),
1293 'score_cutting' => array('text', $this->getScoreCutting()),
1294 'pass_scoring' => array('text', $this->getPassScoring()),
1295 'shuffle_questions' => array('text', $this->getShuffleQuestions()),
1296 'results_presentation' => array('integer', $this->getResultsPresentation()),
1297 'show_summary' => array('integer', $this->getListOfQuestionsSettings()),
1298 'password_enabled' => array('integer', (int) $this->isPasswordEnabled()),
1299 'password' => array('text', $this->getPassword()),
1300 'limit_users_enabled' => array('integer', (int) $this->isLimitUsersEnabled()),
1301 'allowedusers' => array('integer', $this->getAllowedUsers()),
1302 'alloweduserstimegap' => array('integer', $this->getAllowedUsersTimeGap()),
1303 'mailnottype' => array('integer', $this->getMailNotificationType()),
1304 'exportsettings' => array('integer', $this->getExportSettings()),
1305 'certificate_visibility' => array('text', $this->getCertificateVisibility()),
1306 'mailnotification' => array('integer', $this->getMailNotification()),
1307 'created' => array('integer', time()),
1308 'tstamp' => array('integer', time()),
1309 'enabled_view_mode' => array('text', $this->getEnabledViewMode()),
1310 'template_id' => array('integer', $this->getTemplate()),
1311 'pool_usage' => array('integer', $this->getPoolUsage()),
1312 'print_bs_with_res' => array('integer', (int) $this->isBestSolutionPrintedWithResult()),
1313 'obligations_enabled' => array('integer', (int) $this->areObligationsEnabled()),
1314 'offer_question_hints' => array('integer', (int) $this->isOfferingQuestionHintsEnabled()),
1315 'highscore_enabled' => array('integer', (int) $this->getHighscoreEnabled()),
1316 'highscore_anon' => array('integer', (int) $this->getHighscoreAnon()),
1317 'highscore_achieved_ts' => array('integer', (int) $this->getHighscoreAchievedTS()),
1318 'highscore_score' => array('integer', (int) $this->getHighscoreScore()),
1319 'highscore_percentage' => array('integer', (int) $this->getHighscorePercentage()),
1320 'highscore_hints' => array('integer', (int) $this->getHighscoreHints()),
1321 'highscore_wtime' => array('integer', (int) $this->getHighscoreWTime()),
1322 'highscore_own_table' => array('integer', (int) $this->getHighscoreOwnTable()),
1323 'highscore_top_table' => array('integer', (int) $this->getHighscoreTopTable()),
1324 'highscore_top_num' => array('integer', (int) $this->getHighscoreTopNum()),
1325 'specific_feedback' => array('integer', (int) $this->getSpecificAnswerFeedback()),
1326 'autosave' => array('integer', (int) $this->getAutosave()),
1327 'autosave_ival' => array('integer', (int) $this->getAutosaveIval()),
1328 'pass_deletion_allowed' => array('integer', (int) $this->isPassDeletionAllowed()),
1329 'enable_examview' => array('integer', (int) $this->getEnableExamview()),
1330 'show_examview_html' => array('integer', (int) $this->getShowExamviewHtml()),
1331 'show_examview_pdf' => array('integer', (int) $this->getShowExamviewPdf()),
1332 'redirection_mode' => array('integer', (int) $this->getRedirectionMode()),
1333 'redirection_url' => array('text', (string) $this->getRedirectionUrl()),
1334 'enable_archiving' => array('integer', (int) $this->getEnableArchiving()),
1335 'examid_in_test_pass' => array('integer', (int) $this->isShowExamIdInTestPassEnabled()),
1336 'examid_in_test_res' => array('integer', (int) $this->isShowExamIdInTestResultsEnabled()),
1337 'sign_submission' => array('integer', (int) $this->getSignSubmission()),
1338 'question_set_type' => array('text', $this->getQuestionSetType()),
1339 'char_selector_availability' => array('integer', (int) $this->getCharSelectorAvailability()),
1340 'char_selector_definition' => array('text', (string) $this->getCharSelectorDefinition()),
1341 'skill_service' => array('integer', (int) $this->isSkillServiceEnabled()),
1342 'result_tax_filters' => array('text', serialize((array) $this->getResultFilterTaxIds())),
1343 'show_grading_status' => array('integer', (int) $this->isShowGradingStatusEnabled()),
1344 'show_grading_mark' => array('integer', (int) $this->isShowGradingMarkEnabled()),
1345 'follow_qst_answer_fixation' => array('integer', (int) $this->isFollowupQuestionAnswerFixationEnabled()),
1346 'inst_fb_answer_fixation' => array('integer', (int) $this->isInstantFeedbackAnswerFixationEnabled()),
1347 'force_inst_fb' => array('integer', (int) $this->isForceInstantFeedbackEnabled()),
1348 'broken' => array('integer', (int) $this->isTestFinalBroken()),
1349 'pass_waiting' => array('text', (string) $this->getPassWaiting())
1350 ));
1351
1352 $this->test_id = $next_id;
1353
1355 $this->logAction($this->lng->txtlng("assessment", "log_create_new_test", ilObjAssessmentFolder::_getLogLanguage()));
1356 }
1357 } else {
1358 // Modify existing dataset
1359 $oldrow = array();
1361 $result = $ilDB->queryF(
1362 "SELECT * FROM tst_tests WHERE test_id = %s",
1363 array('integer'),
1364 array($this->test_id)
1365 );
1366 if ($result->numRows() == 1) {
1367 $oldrow = $ilDB->fetchAssoc($result);
1368 }
1369 }
1370
1371 $ilDB->update(
1372 'tst_tests',
1373 array(
1374 'author' => array('text', $this->getAuthor()),
1375 'intro_enabled' => array('integer', (int) $this->isIntroductionEnabled()),
1376 'introduction' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getIntroduction(), 0)),
1377 'finalstatement' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getFinalStatement(), 0)),
1378 'showinfo' => array('integer', $this->getShowInfo()),
1379 'forcejs' => array('integer', $this->getForceJS()),
1380 'customstyle' => array('text', $this->getCustomStyle()),
1381 'showfinalstatement' => array('integer', $this->getShowFinalStatement()),
1382 'sequence_settings' => array('integer', $this->getSequenceSettings()),
1383 'score_reporting' => array('integer', $this->getScoreReporting()),
1384 'instant_verification' => array('text', $this->getInstantFeedbackSolution()),
1385 'answer_feedback_points' => array('text', $this->getAnswerFeedbackPoints()),
1386 'answer_feedback' => array('text', $this->getGenericAnswerFeedback()),
1387 'anonymity' => array('text', $this->getAnonymity()),
1388 'show_cancel' => array('text', $this->getShowCancel()),
1389 'show_marker' => array('integer', $this->getShowMarker()),
1390 'fixed_participants' => array('text', $this->getFixedParticipants()),
1391 'nr_of_tries' => array('integer', $this->getNrOfTries()),
1392 'block_after_passed' => array('integer', (int) $this->isBlockPassesAfterPassedEnabled()),
1393 'kiosk' => array('integer', $this->getKiosk()),
1394 'use_previous_answers' => array('text', $this->getUsePreviousAnswers()),
1395 'title_output' => array('text', $this->getTitleOutput()),
1396 'processing_time' => array('text', $this->getProcessingTime()),
1397 'enable_processing_time' => array('text', $this->getEnableProcessingTime()),
1398 'reset_processing_time' => array('integer', $this->getResetProcessingTime()),
1399 'reporting_date' => array('text', $this->getReportingDate()),
1400 'starting_time_enabled' => array('integer', $this->isStartingTimeEnabled()),
1401 'starting_time' => array('integer', $this->getStartingTime()),
1402 'ending_time_enabled' => array('integer', $this->isEndingTimeEnabled()),
1403 'ending_time' => array('integer', $this->getEndingTime()),
1404 'complete' => array('text', $this->isComplete($testQuestionSetConfig)),
1405 'ects_output' => array('text', $this->getECTSOutput()),
1406 'ects_a' => array('float', strlen($this->ects_grades["A"]) ? $this->ects_grades["A"] : null),
1407 'ects_b' => array('float', strlen($this->ects_grades["B"]) ? $this->ects_grades["B"] : null),
1408 'ects_c' => array('float', strlen($this->ects_grades["C"]) ? $this->ects_grades["C"] : null),
1409 'ects_d' => array('float', strlen($this->ects_grades["D"]) ? $this->ects_grades["D"] : null),
1410 'ects_e' => array('float', strlen($this->ects_grades["E"]) ? $this->ects_grades["E"] : null),
1411 'ects_fx' => array('float', $this->getECTSFX()),
1412 'count_system' => array('text', $this->getCountSystem()),
1413 'mc_scoring' => array('text', $this->getMCScoring()),
1414 'score_cutting' => array('text', $this->getScoreCutting()),
1415 'pass_scoring' => array('text', $this->getPassScoring()),
1416 'shuffle_questions' => array('text', $this->getShuffleQuestions()),
1417 'results_presentation' => array('integer', $this->getResultsPresentation()),
1418 'show_summary' => array('integer', $this->getListOfQuestionsSettings()),
1419 'password_enabled' => array('integer', (int) $this->isPasswordEnabled()),
1420 'password' => array('text', $this->getPassword()),
1421 'limit_users_enabled' => array('integer', (int) $this->isLimitUsersEnabled()),
1422 'allowedusers' => array('integer', $this->getAllowedUsers()),
1423 'alloweduserstimegap' => array('integer', $this->getAllowedUsersTimeGap()),
1424 'mailnottype' => array('integer', $this->getMailNotificationType()),
1425 'exportsettings' => array('integer', $this->getExportSettings()),
1426 'certificate_visibility' => array('text', $this->getCertificateVisibility()),
1427 'mailnotification' => array('integer', $this->getMailNotification()),
1428 'tstamp' => array('integer', time()),
1429 'enabled_view_mode' => array('text', $this->getEnabledViewMode()),
1430 'template_id' => array('integer', $this->getTemplate()),
1431 'pool_usage' => array('integer', $this->getPoolUsage()),
1432 'print_bs_with_res' => array('integer', (int) $this->isBestSolutionPrintedWithResult()),
1433 'obligations_enabled' => array('integer', (int) $this->areObligationsEnabled()),
1434 'offer_question_hints' => array('integer', (int) $this->isOfferingQuestionHintsEnabled()),
1435 'highscore_enabled' => array('integer', (int) $this->getHighscoreEnabled()),
1436 'highscore_anon' => array('integer', (int) $this->getHighscoreAnon()),
1437 'highscore_achieved_ts' => array('integer', (int) $this->getHighscoreAchievedTS()),
1438 'highscore_score' => array('integer', (int) $this->getHighscoreScore()),
1439 'highscore_percentage' => array('integer', (int) $this->getHighscorePercentage()),
1440 'highscore_hints' => array('integer', (int) $this->getHighscoreHints()),
1441 'highscore_wtime' => array('integer', (int) $this->getHighscoreWTime()),
1442 'highscore_own_table' => array('integer', (int) $this->getHighscoreOwnTable()),
1443 'highscore_top_table' => array('integer', (int) $this->getHighscoreTopTable()),
1444 'highscore_top_num' => array('integer', (int) $this->getHighscoreTopNum()),
1445 'specific_feedback' => array('integer', (int) $this->getSpecificAnswerFeedback()),
1446 'autosave' => array('integer', (int) $this->getAutosave()),
1447 'autosave_ival' => array('integer', (int) $this->getAutosaveIval()),
1448 'pass_deletion_allowed' => array('integer', (int) $this->isPassDeletionAllowed()),
1449 'enable_examview' => array('integer', (int) $this->getEnableExamview()),
1450 'show_examview_html' => array('integer', (int) $this->getShowExamviewHtml()),
1451 'show_examview_pdf' => array('integer', (int) $this->getShowExamviewPdf()),
1452 'redirection_mode' => array('integer', (int) $this->getRedirectionMode()),
1453 'redirection_url' => array('text', (string) $this->getRedirectionUrl()),
1454 'enable_archiving' => array('integer', (int) $this->getEnableArchiving()),
1455 'examid_in_test_pass' => array('integer', (int) $this->isShowExamIdInTestPassEnabled()),
1456 'examid_in_test_res' => array('integer', (int) $this->isShowExamIdInTestResultsEnabled()),
1457 'sign_submission' => array('integer', (int) $this->getSignSubmission()),
1458 'question_set_type' => array('text', $this->getQuestionSetType()),
1459 'char_selector_availability' => array('integer', (int) $this->getCharSelectorAvailability()),
1460 'char_selector_definition' => array('text', (string) $this->getCharSelectorDefinition()),
1461 'skill_service' => array('integer', (int) $this->isSkillServiceEnabled()),
1462 'result_tax_filters' => array('text', serialize((array) $this->getResultFilterTaxIds())),
1463 'show_grading_status' => array('integer', (int) $this->isShowGradingStatusEnabled()),
1464 'show_grading_mark' => array('integer', (int) $this->isShowGradingMarkEnabled()),
1465 'follow_qst_answer_fixation' => array('integer', (int) $this->isFollowupQuestionAnswerFixationEnabled()),
1466 'inst_fb_answer_fixation' => array('integer', (int) $this->isInstantFeedbackAnswerFixationEnabled()),
1467 'force_inst_fb' => array('integer', (int) $this->isForceInstantFeedbackEnabled()),
1468 'broken' => array('integer', (int) $this->isTestFinalBroken()),
1469 'pass_waiting' => array('text', (string) $this->getPassWaiting())
1470 ),
1471 array(
1472 'test_id' => array('integer', (int) $this->getTestId())
1473 )
1474 );
1475
1476 include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
1478 $logresult = $ilDB->queryF(
1479 "SELECT * FROM tst_tests WHERE test_id = %s",
1480 array('integer'),
1481 array($this->getTestId())
1482 );
1483 $newrow = array();
1484 if ($logresult->numRows() == 1) {
1485 $newrow = $ilDB->fetchAssoc($logresult);
1486 }
1487 $changed_fields = array();
1488 foreach ($oldrow as $key => $value) {
1489 if (strcmp($oldrow[$key], $newrow[$key]) != 0) {
1490 array_push($changed_fields, "$key: " . $oldrow[$key] . " => " . $newrow[$key]);
1491 }
1492 }
1493 $changes = join(", ", $changed_fields);
1494 if (count($changed_fields) > 0) {
1495 $this->logAction($this->lng->txtlng("assessment", "log_modified_test", ilObjAssessmentFolder::_getLogLanguage()) . " [" . $changes . "]");
1496 }
1497 }
1498 if ($this->evalTotalPersons() > 0) {
1499 // reset the finished status of participants if the nr of test passes did change
1500 if ($this->getNrOfTries() > 0) {
1501 // set all unfinished tests with nr of passes >= allowed passes finished
1502 $aresult = $ilDB->queryF(
1503 "SELECT active_id FROM tst_active WHERE test_fi = %s AND tries >= %s AND submitted = %s",
1504 array('integer', 'integer', 'integer'),
1505 array($this->getTestId(), $this->getNrOfTries(), 0)
1506 );
1507 while ($row = $ilDB->fetchAssoc($aresult)) {
1508 $ilDB->manipulateF(
1509 "UPDATE tst_active SET submitted = %s, submittimestamp = %s WHERE active_id = %s",
1510 array('integer', 'timestamp', 'integer'),
1511 array(1, date('Y-m-d H:i:s'), $row["active_id"])
1512 );
1513 }
1514
1515 // set all finished tests with nr of passes < allowed passes not finished
1516 $aresult = $ilDB->queryF(
1517 "SELECT active_id FROM tst_active WHERE test_fi = %s AND tries < %s AND submitted = %s",
1518 array('integer', 'integer', 'integer'),
1519 array($this->getTestId(), $this->getNrOfTries() - 1, 1)
1520 );
1521 while ($row = $ilDB->fetchAssoc($aresult)) {
1522 $ilDB->manipulateF(
1523 "UPDATE tst_active SET submitted = %s, submittimestamp = %s WHERE active_id = %s",
1524 array('integer', 'timestamp', 'integer'),
1525 array(0, null, $row["active_id"])
1526 );
1527 }
1528 } else {
1529 // set all finished tests with nr of passes >= allowed passes not finished
1530 $aresult = $ilDB->queryF(
1531 "SELECT active_id FROM tst_active WHERE test_fi = %s AND submitted = %s",
1532 array('integer', 'integer'),
1533 array($this->getTestId(), 1)
1534 );
1535 while ($row = $ilDB->fetchAssoc($aresult)) {
1536 $ilDB->manipulateF(
1537 "UPDATE tst_active SET submitted = %s, submittimestamp = %s WHERE active_id = %s",
1538 array('integer', 'timestamp', 'integer'),
1539 array(0, null, $row["active_id"])
1540 );
1541 }
1542 }
1543 }
1544 }
1545
1546 // news item creation/update/deletion
1547 include_once 'Services/News/classes/class.ilNewsItem.php';
1548 if (!$this->getOldOnlineStatus() && !$this->getOfflineStatus()) {
1549 global $DIC;
1550 $ilUser = $DIC['ilUser'];
1551 $newsItem = new ilNewsItem();
1552 $newsItem->setContext($this->getId(), 'tst');
1553 $newsItem->setPriority(NEWS_NOTICE);
1554 $newsItem->setTitle('new_test_online');
1555 $newsItem->setContentIsLangVar(true);
1556 $newsItem->setContent('');
1557 $newsItem->setUserId($ilUser->getId());
1558 $newsItem->setVisibility(NEWS_USERS);
1559 $newsItem->create();
1560 } elseif ($this->getOldOnlineStatus() && !$this->getOfflineStatus()) {
1561 ilNewsItem::deleteNewsOfContext($this->getId(), 'tst');
1562 } elseif (!$this->getOfflineStatus()) {
1563 $newsId = ilNewsItem::getFirstNewsIdForContext($this->getId(), 'tst');
1564 if ($newsId > 0) {
1565 $newsItem = new ilNewsItem($newsId);
1566 $newsItem->setTitle('new_test_online');
1567 $newsItem->setContentIsLangVar(true);
1568 $newsItem->setContent('');
1569 $newsItem->update();
1570 }
1571 }
1572
1573 // moved activation to ilObjectActivation
1574 if ($this->ref_id) {
1575 include_once "./Services/Object/classes/class.ilObjectActivation.php";
1576 ilObjectActivation::getItem($this->ref_id);
1577
1578 $item = new ilObjectActivation;
1579 if (!$this->isActivationLimited()) {
1581 } else {
1582 $item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);
1583 $item->setTimingStart($this->getActivationStartingTime());
1584 $item->setTimingEnd($this->getActivationEndingTime());
1585 $item->toggleVisible($this->getActivationVisibility());
1586 }
1587
1588 $item->update($this->ref_id);
1589 }
1590
1591 if (!$properties_only) {
1592 if ($this->getQuestionSetType() == self::QUESTION_SET_TYPE_FIXED) {
1593 $this->saveQuestionsToDb();
1594 }
1595
1596 $this->mark_schema->saveToDb($this->test_id);
1597 }
1598 }
const NEWS_USERS
const NEWS_NOTICE
static deleteNewsOfContext( $a_context_obj_id, $a_context_obj_type, $a_context_sub_obj_id=0, $a_context_sub_obj_type="")
Delete all news of a context.
static getFirstNewsIdForContext( $a_context_obj_id, $a_context_obj_type, $a_context_sub_obj_id="", $a_context_sub_obj_type="")
Get first new id of news set related to a certain context.
cleanupMediaobjectUsage()
Cleans up the media objects for all text fields in a test which are using an RTE field.
Class ilObjectActivation.
setTimingType($a_type)
Set timing type.

References $DIC, $ilDB, $ilUser, $result, ilObject\$tree, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilRTE\_replaceMediaObjectImageSrc(), areObligationsEnabled(), cleanupMediaobjectUsage(), ilNewsItem\deleteNewsOfContext(), evalTotalPersons(), getActivationEndingTime(), getActivationStartingTime(), getActivationVisibility(), getAllowedUsers(), getAllowedUsersTimeGap(), getAnonymity(), getAnswerFeedback(), getAnswerFeedbackPoints(), getAuthor(), getAutosave(), getAutosaveIval(), getCertificateVisibility(), getCharSelectorAvailability(), getCharSelectorDefinition(), getCountSystem(), getCustomStyle(), getECTSFX(), getECTSOutput(), getEnableArchiving(), getEnabledViewMode(), getEnableExamview(), getEnableProcessingTime(), getEndingTime(), getExportSettings(), getFinalStatement(), ilNewsItem\getFirstNewsIdForContext(), getFixedParticipants(), getForceJS(), getGenericAnswerFeedback(), getHighscoreAchievedTS(), getHighscoreAnon(), getHighscoreEnabled(), getHighscoreHints(), getHighscoreOwnTable(), getHighscorePercentage(), getHighscoreScore(), getHighscoreTopNum(), getHighscoreTopTable(), getHighscoreWTime(), ilObject\getId(), getInstantFeedbackSolution(), getIntroduction(), ilObjectActivation\getItem(), getKiosk(), getListOfQuestionsSettings(), getMailNotification(), getMailNotificationType(), getMCScoring(), getNrOfTries(), ilObject\getOfflineStatus(), getOldOnlineStatus(), getPassScoring(), getPassWaiting(), getPassword(), getPoolUsage(), getProcessingTime(), getQuestionSetType(), getRedirectionMode(), getRedirectionUrl(), getReportingDate(), getResetProcessingTime(), getResultFilterTaxIds(), getResultsPresentation(), getScoreCutting(), getScoreReporting(), getSequenceSettings(), getShowCancel(), getShowExamviewHtml(), getShowExamviewPdf(), getShowFinalStatement(), getShowInfo(), getShowMarker(), getShuffleQuestions(), getSignSubmission(), getSpecificAnswerFeedback(), getStartingTime(), getTemplate(), getTestId(), getTitleOutput(), getUsePreviousAnswers(), isActivationLimited(), isBestSolutionPrintedWithResult(), isBlockPassesAfterPassedEnabled(), isComplete(), isEndingTimeEnabled(), isFollowupQuestionAnswerFixationEnabled(), isForceInstantFeedbackEnabled(), isInstantFeedbackAnswerFixationEnabled(), isIntroductionEnabled(), isLimitUsersEnabled(), isOfferingQuestionHintsEnabled(), isPassDeletionAllowed(), isPasswordEnabled(), isShowExamIdInTestPassEnabled(), isShowExamIdInTestResultsEnabled(), isShowGradingMarkEnabled(), isShowGradingStatusEnabled(), isSkillServiceEnabled(), isStartingTimeEnabled(), isTestFinalBroken(), logAction(), NEWS_NOTICE, NEWS_USERS, saveQuestionsToDb(), ilObjectActivation\setTimingType(), ilObjectActivation\TIMINGS_ACTIVATION, and ilObjectActivation\TIMINGS_DEACTIVATED.

Referenced by applyDefaults(), and fromXML().

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

◆ sendAdvancedNotification()

ilObjTest::sendAdvancedNotification (   $active_id)

Definition at line 10595 of file class.ilObjTest.php.

10596 {
10597 include_once "./Modules/Test/classes/class.ilTestMailNotification.php";
10598
10599 $mail = new ilTestMailNotification();
10600 $owner_id = $this->getOwner();
10601 $usr_data = $this->userLookupFullName(ilObjTest::_getUserIdFromActiveId($active_id));
10602
10603 $participantList = new ilTestParticipantList($this);
10604 $participantList->initializeFromDbRows($this->getTestParticipants());
10605
10606 require_once 'Modules/Test/classes/class.ilTestExportFactory.php';
10607 $expFactory = new ilTestExportFactory($this);
10608 $exportObj = $expFactory->getExporter('results');
10609 $exportObj->setForcedAccessFilteredParticipantList($participantList);
10610 $file = $exportObj->exportToExcel($deliver = false, 'active_id', $active_id, $passedonly = false);
10611 include_once "./Services/Mail/classes/class.ilFileDataMail.php";
10613 $fd->copyAttachmentFile($file, "result_" . $active_id . ".xls");
10614 $file_names[] = "result_" . $active_id . ".xls";
10615
10616 $mail->sendAdvancedNotification($owner_id, $this->getTitle(), $usr_data, $file_names);
10617
10618 if (count($file_names)) {
10619 $fd->unlinkFiles($file_names);
10620 unset($fd);
10621 @unlink($file);
10622 }
10623 }
Class ilFileDataMail.
static _getUserIdFromActiveId($active_id)
userLookupFullName($user_id, $overwrite_anonymity=false, $sorted_order=false, $suffix="")
Returns the full name of a test user according to the anonymity status.
getOwner()
get object owner
Class ilTestMailNotification.

References _getUserIdFromActiveId(), ANONYMOUS_USER_ID, ilObject\getOwner(), getTestParticipants(), ilObject\getTitle(), and userLookupFullName().

+ Here is the call graph for this function:

◆ sendSimpleNotification()

ilObjTest::sendSimpleNotification (   $active_id)

Definition at line 10572 of file class.ilObjTest.php.

10573 {
10574 include_once "./Modules/Test/classes/class.ilTestMailNotification.php";
10575
10576 $mail = new ilTestMailNotification();
10577 $owner_id = $this->getOwner();
10578 $usr_data = $this->userLookupFullName(ilObjTest::_getUserIdFromActiveId($active_id));
10579 $mail->sendSimpleNotification($owner_id, $this->getTitle(), $usr_data);
10580 }

References _getUserIdFromActiveId(), ilObject\getOwner(), ilObject\getTitle(), and userLookupFullName().

+ Here is the call graph for this function:

◆ setAccessFilteredParticipantList()

ilObjTest::setAccessFilteredParticipantList (   $accessFilteredParticipantList)
Parameters
ilTestParticipantList$accessFilteredParticipantList

Definition at line 4790 of file class.ilObjTest.php.

4791 {
4792 $this->accessFilteredParticipantList = $accessFilteredParticipantList;
4793 }

References $accessFilteredParticipantList.

◆ setActivationEndingTime()

ilObjTest::setActivationEndingTime (   $ending_time = null)

Definition at line 11597 of file class.ilObjTest.php.

11598 {
11599 $this->activation_ending_time = $ending_time;
11600 }

References $ending_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setActivationLimited()

ilObjTest::setActivationLimited (   $a_value)

Definition at line 11079 of file class.ilObjTest.php.

11080 {
11081 $this->activation_limited = (bool) $a_value;
11082 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setActivationStartingTime()

ilObjTest::setActivationStartingTime (   $starting_time = null)

Definition at line 11592 of file class.ilObjTest.php.

11593 {
11594 $this->activation_starting_time = $starting_time;
11595 }

References $starting_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setActivationVisibility()

ilObjTest::setActivationVisibility (   $a_value)

Definition at line 11064 of file class.ilObjTest.php.

11065 {
11066 $this->activation_visibility = (bool) $a_value;
11067 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setAllowedUsers()

ilObjTest::setAllowedUsers (   $a_allowed_users)

Definition at line 9134 of file class.ilObjTest.php.

9135 {
9136 $this->allowedUsers = $a_allowed_users;
9137 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setAllowedUsersTimeGap()

ilObjTest::setAllowedUsersTimeGap (   $a_allowed_users_time_gap)

Definition at line 9144 of file class.ilObjTest.php.

9145 {
9146 $this->allowedUsersTimeGap = $a_allowed_users_time_gap;
9147 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setAnonymity()

ilObjTest::setAnonymity (   $a_value = 0)

Sets the anonymity status of the test.

Parameters
integer$a_valueThe value for the anonymity status (0 = personalized, 1 = anonymized) @access public

Definition at line 9385 of file class.ilObjTest.php.

9386 {
9387 switch ($a_value) {
9388 case 1:
9389 $this->anonymity = 1;
9390 break;
9391 default:
9392 $this->anonymity = 0;
9393 break;
9394 }
9395 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setAnswerFeedback()

ilObjTest::setAnswerFeedback (   $answer_feedback = 0)

Sets the generic feedback for the test @deprecate Use setGenericAnswerFeedback instead.

Parameters
integer$answer_feedbackIf 1, answer specific feedback will be shown after answering a question @access public
See also
$answer_feedback

Definition at line 2336 of file class.ilObjTest.php.

2337 {
2338 switch ($answer_feedback) {
2339 case 1:
2340 $this->answer_feedback = 1;
2341 break;
2342 default:
2343 $this->answer_feedback = 0;
2344 break;
2345 }
2346 }

References $answer_feedback.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setAnswerFeedbackPoints()

ilObjTest::setAnswerFeedbackPoints (   $answer_feedback_points = 0)

Sets the answer specific feedback of reached points for the test.

Parameters
integer$answer_feedback_pointsIf 1, answer specific feedback will show the reached points after answering a question @access public
See also
$answer_feedback_points

Definition at line 2372 of file class.ilObjTest.php.

2373 {
2374 switch ($answer_feedback_points) {
2375 case 1:
2376 $this->answer_feedback_points = 1;
2377 break;
2378 default:
2379 $this->answer_feedback_points = 0;
2380 break;
2381 }
2382 }

References $answer_feedback_points.

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setInstantFeedbackOptionsByArray().

+ Here is the caller graph for this function:

◆ setAuthor()

ilObjTest::setAuthor (   $author = "")

Sets the authors name of the ilObjTest object.

Parameters
string$authorA string containing the name of the test author @access public
See also
$author

Definition at line 6940 of file class.ilObjTest.php.

6941 {
6942 $this->author = $author;
6943 }

References $author.

Referenced by fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setAutosave()

ilObjTest::setAutosave (   $autosave)

Definition at line 11501 of file class.ilObjTest.php.

11502 {
11503 $this->autosave = $autosave;
11504 }

References $autosave.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setAutosaveIval()

ilObjTest::setAutosaveIval (   $autosave_ival)

Definition at line 11511 of file class.ilObjTest.php.

11512 {
11513 $this->autosave_ival = $autosave_ival;
11514 }

References $autosave_ival.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setBlockPassesAfterPassedEnabled()

ilObjTest::setBlockPassesAfterPassedEnabled (   $blockPassesAfterPassedEnabled)
Parameters
bool$blockPassesAfterPassedEnabled

Definition at line 2656 of file class.ilObjTest.php.

2657 {
2658 $this->blockPassesAfterPassedEnabled = $blockPassesAfterPassedEnabled;
2659 }

References $blockPassesAfterPassedEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setCertificateVisibility()

ilObjTest::setCertificateVisibility (   $a_value)

Sets the visibility settings of the certificate.

Parameters
integer$a_valueThe value for the visibility settings (0 = always, 1 = only passed, 2 = never) @access public

Definition at line 9363 of file class.ilObjTest.php.

9364 {
9365 $this->certificate_visibility = $a_value;
9366 }

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setCharSelectorAvailability()

ilObjTest::setCharSelectorAvailability (   $availability)
Parameters
intavailability of the special character selector

Definition at line 11850 of file class.ilObjTest.php.

11851 {
11852 $this->char_selector_availability = (int) $availability;
11853 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setCharSelectorDefinition()

ilObjTest::setCharSelectorDefinition (   $definition = '')
Parameters
stringdefinition of the special character selector

Definition at line 11866 of file class.ilObjTest.php.

11867 {
11868 $this->char_selector_definition = $definition;
11869 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setClientIP()

ilObjTest::setClientIP (   $user_id,
  $client_ip 
)

Definition at line 7838 of file class.ilObjTest.php.

7839 {
7840 global $DIC;
7841 $ilDB = $DIC['ilDB'];
7842
7843 $affectedRows = $ilDB->manipulateF(
7844 "UPDATE tst_invited_user SET clientip = %s, tstamp = %s WHERE test_fi=%s and user_fi=%s",
7845 array('text', 'integer', 'integer', 'integer'),
7846 array((strlen($client_ip)) ? $client_ip : null, time(), $this->getTestId(), $user_id)
7847 );
7848 }

References $DIC, $ilDB, and getTestId().

+ Here is the call graph for this function:

◆ setCountSystem()

ilObjTest::setCountSystem (   $a_count_system = COUNT_PARTIAL_SOLUTIONS)

Sets the count system for the calculation of points.

Parameters
integer$a_count_systemThe count system for the calculation of points. @access public
See also
$count_system

Definition at line 3190 of file class.ilObjTest.php.

3191 {
3192 $this->count_system = $a_count_system;
3193 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setCustomStyle()

ilObjTest::setCustomStyle (   $a_customStyle = null)

Set the custom style.

Parameters
string$a_customStyleThe custom style @access public
See also
$_customStyle

Definition at line 2125 of file class.ilObjTest.php.

2126 {
2127 $this->_customStyle = $a_customStyle;
2128 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setECTSFX()

ilObjTest::setECTSFX (   $a_ects_fx)

{

Parameters
float | null$ects_fx
}

Implements ilEctsGradesEnabled.

Definition at line 2241 of file class.ilObjTest.php.

2242 {
2243 $this->ects_fx = $a_ects_fx;
2244 }

Referenced by applyDefaults(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setECTSGrades()

ilObjTest::setECTSGrades ( array  $a_ects_grades)

{

Parameters
array$grades
}

Implements ilEctsGradesEnabled.

Definition at line 2257 of file class.ilObjTest.php.

2258 {
2259 $this->ects_grades = $a_ects_grades;
2260 }

Referenced by applyDefaults(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setECTSOutput()

ilObjTest::setECTSOutput (   $a_ects_output)

{

Parameters
int | bool$status
}

Implements ilEctsGradesEnabled.

Definition at line 2225 of file class.ilObjTest.php.

2226 {
2227 $this->ects_output = $a_ects_output ? 1 : 0;
2228 }

Referenced by applyDefaults(), loadFromDb(), and setReportingDate().

+ Here is the caller graph for this function:

◆ setEnableArchiving()

ilObjTest::setEnableArchiving (   $enable_archiving)
Parameters
boolean$enable_archiving
Returns
$this

Definition at line 11725 of file class.ilObjTest.php.

11726 {
11727 $this->enable_archiving = $enable_archiving;
11728 return $this;
11729 }

References $enable_archiving.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setEnabledViewMode()

ilObjTest::setEnabledViewMode (   $mode)

Definition at line 10729 of file class.ilObjTest.php.

10730 {
10731 $this->enabled_view_mode = $mode;
10732 }

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setEnableExamview()

ilObjTest::setEnableExamview (   $enable_examview)
Parameters
boolean$enable_examview

Definition at line 11577 of file class.ilObjTest.php.

11578 {
11579 $this->enable_examview = $enable_examview;
11580 }

References $enable_examview.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setEnableProcessingTime()

ilObjTest::setEnableProcessingTime (   $enable = 0)

Sets the processing time enabled or disabled.

Parameters
integer$enable0 to disable the processing time, 1 to enable the processing time @access public
See also
$processing_time

Definition at line 3158 of file class.ilObjTest.php.

3159 {
3160 if ($enable) {
3161 $this->enable_processing_time = "1";
3162 } else {
3163 $this->enable_processing_time = "0";
3164 }
3165 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setEndingTime()

ilObjTest::setEndingTime (   $ending_time = null)

Sets the ending time in database timestamp format for the test.

Parameters
string$ending_timeThe ending time for the test. Empty string for no ending time. @access public
See also
$ending_time

Definition at line 3062 of file class.ilObjTest.php.

3063 {
3064 $this->ending_time = $ending_time;
3065 }

References $ending_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setEndingTimeEnabled()

ilObjTest::setEndingTimeEnabled (   $ending_time_enabled)
Parameters
boolean$ending_time_enabled

Definition at line 3038 of file class.ilObjTest.php.

3039 {
3040 $this->ending_time_enabled = $ending_time_enabled;
3041 }

References $ending_time_enabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setExportSettings()

ilObjTest::setExportSettings (   $a_settings)

Definition at line 10695 of file class.ilObjTest.php.

10696 {
10697 if ($a_settings) {
10698 $this->exportsettings = $a_settings;
10699 } else {
10700 $this->exportsettings = 0;
10701 }
10702 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setExportSettingsSingleChoiceShort()

ilObjTest::setExportSettingsSingleChoiceShort (   $a_settings)

Definition at line 10713 of file class.ilObjTest.php.

10714 {
10715 if ($a_settings) {
10716 $this->exportsettings = $this->exportsettings | 1;
10717 } else {
10719 $this->exportsettings = $this->exportsettings ^ 1;
10720 }
10721 }
10722 }
getExportSettingsSingleChoiceShort()

References getExportSettingsSingleChoiceShort().

+ Here is the call graph for this function:

◆ setFinalStatement()

ilObjTest::setFinalStatement (   $a_statement = "")

Sets the final statement text of the ilObjTest object.

Parameters
string$a_statementA final statement @access public
See also
$_finalstatement

Definition at line 2086 of file class.ilObjTest.php.

2087 {
2088 if (is_null($a_statement)) {
2089 $a_statement = '';
2090 }
2091 $this->_finalstatement = $this->getHtmlQuestionContentPurifier()->purify($a_statement);
2092 }
getHtmlQuestionContentPurifier()

References getHtmlQuestionContentPurifier().

Referenced by applyDefaults(), fromXML(), and loadFromDb().

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

◆ setFixedParticipants()

ilObjTest::setFixedParticipants (   $a_value = 1)

Sets the fixed participants status.

Parameters
integer$a_valueThe value for the fixed participants status (0 = don't allow, 1 = allow) @access public

Definition at line 9472 of file class.ilObjTest.php.

9473 {
9474 switch ($a_value) {
9475 case 1:
9476 $this->fixed_participants = 1;
9477 break;
9478 default:
9479 $this->fixed_participants = 0;
9480 break;
9481 }
9482 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setFollowupQuestionAnswerFixationEnabled()

ilObjTest::setFollowupQuestionAnswerFixationEnabled (   $followupQuestionAnswerFixationEnabled)

Definition at line 12102 of file class.ilObjTest.php.

12103 {
12104 $this->followupQuestionAnswerFixationEnabled = $followupQuestionAnswerFixationEnabled;
12105 }

References $followupQuestionAnswerFixationEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setForceInstantFeedbackEnabled()

ilObjTest::setForceInstantFeedbackEnabled (   $forceInstantFeedbackEnabled)
Parameters
boolean$forceInstantFeedbackEnabled

Definition at line 12133 of file class.ilObjTest.php.

12134 {
12135 $this->forceInstantFeedbackEnabled = $forceInstantFeedbackEnabled;
12136 }

References $forceInstantFeedbackEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setForceJS()

ilObjTest::setForceJS (   $a_js = 1)

Set whether JavaScript should be forced for tests.

Parameters
integer$a_js1 to force JavaScript, 0 otherwise @access public
See also
$_forcejs

Definition at line 2113 of file class.ilObjTest.php.

2114 {
2115 $this->_forcejs = ($a_js) ? 1 : 0;
2116 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setGenericAnswerFeedback()

ilObjTest::setGenericAnswerFeedback (   $generic_answer_feedback = 0)

Sets if the generic feedback is to be shown in the test.

Parameters
int$generic_answer_feedback

Definition at line 2353 of file class.ilObjTest.php.

2354 {
2355 switch ($generic_answer_feedback) {
2356 case 1:
2357 $this->answer_feedback = 1;
2358 break;
2359 default:
2360 $this->answer_feedback = 0;
2361 break;
2362 }
2363 }

Referenced by setInstantFeedbackOptionsByArray().

+ Here is the caller graph for this function:

◆ setHighscoreAchievedTS()

ilObjTest::setHighscoreAchievedTS (   $a_achieved_ts)

Sets if the date and time of the scores achievement should be displayed.

Parameters
bool$a_achieved_ts

Definition at line 11154 of file class.ilObjTest.php.

11155 {
11156 $this->_highscore_achieved_ts = (bool) $a_achieved_ts;
11157 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setHighscoreAnon()

ilObjTest::setHighscoreAnon (   $a_anon)

Sets if the highscores should be anonymized.

Note: This setting will be overriden, if the test is globally anonymized.

Parameters
bool$a_anon

Definition at line 11113 of file class.ilObjTest.php.

11114 {
11115 $this->_highscore_anon = (bool) $a_anon;
11116 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setHighscoreEnabled()

ilObjTest::setHighscoreEnabled (   $a_enabled)

Sets if the highscore feature should be enabled.

Parameters
bool$a_enabled

Definition at line 11091 of file class.ilObjTest.php.

11092 {
11093 $this->_highscore_enabled = (bool) $a_enabled;
11094 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setHighscoreHints()

ilObjTest::setHighscoreHints (   $a_hints)

Sets if the number of requested hints should be shown.

Parameters
bool$a_hints

Definition at line 11214 of file class.ilObjTest.php.

11215 {
11216 $this->_highscore_hints = (bool) $a_hints;
11217 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setHighscoreMode()

ilObjTest::setHighscoreMode (   $mode)
Parameters
$modeint

Definition at line 11342 of file class.ilObjTest.php.

11343 {
11344 switch ($mode) {
11346 $this->setHighscoreTopTable(1);
11347 $this->setHighscoreOwnTable(1);
11348 break;
11349
11351 $this->setHighscoreTopTable(1);
11352 $this->setHighscoreOwnTable(0);
11353 break;
11354
11356 default:
11357 $this->setHighscoreTopTable(0);
11358 $this->setHighscoreOwnTable(1);
11359 break;
11360 }
11361 }

References HIGHSCORE_SHOW_ALL_TABLES, HIGHSCORE_SHOW_OWN_TABLE, HIGHSCORE_SHOW_TOP_TABLE, setHighscoreOwnTable(), and setHighscoreTopTable().

+ Here is the call graph for this function:

◆ setHighscoreOwnTable()

ilObjTest::setHighscoreOwnTable (   $a_own_table)

Sets if the table with the own ranking should be shown.

Parameters
bool$a_own_tableTrue, if table with own ranking should be shown.

Definition at line 11254 of file class.ilObjTest.php.

11255 {
11256 $this->_highscore_own_table = (bool) $a_own_table;
11257 }

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setHighscoreMode().

+ Here is the caller graph for this function:

◆ setHighscorePercentage()

ilObjTest::setHighscorePercentage (   $a_percentage)

Sets if the percentages of the scores pass should be shown.

Parameters
bool$a_percentage

Definition at line 11194 of file class.ilObjTest.php.

11195 {
11196 $this->_highscore_percentage = (bool) $a_percentage;
11197 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setHighscoreScore()

ilObjTest::setHighscoreScore (   $a_score)

Sets if the actual score should be displayed.

Parameters
bool$a_score

Definition at line 11174 of file class.ilObjTest.php.

11175 {
11176 $this->_highscore_score = (bool) $a_score;
11177 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setHighscoreTopNum()

ilObjTest::setHighscoreTopNum (   $a_top_num)

Sets the number of entries which are to be shown in the top-rankings table.

Parameters
integer$a_top_numNumber of entries in the top-rankings table.

Definition at line 11295 of file class.ilObjTest.php.

11296 {
11297 $this->_highscore_top_num = (int) $a_top_num;
11298 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setHighscoreTopTable()

ilObjTest::setHighscoreTopTable (   $a_top_table)

Sets if the top-rankings table should be shown.

Parameters
bool$a_top_table

Definition at line 11274 of file class.ilObjTest.php.

11275 {
11276 $this->_highscore_top_table = (bool) $a_top_table;
11277 }

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setHighscoreMode().

+ Here is the caller graph for this function:

◆ setHighscoreWTime()

ilObjTest::setHighscoreWTime (   $a_wtime)

Sets if the workingtime of the scores should be shown.

Parameters
bool$a_wtime

Definition at line 11234 of file class.ilObjTest.php.

11235 {
11236 $this->_highscore_wtime = (bool) $a_wtime;
11237 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setInstantFeedbackAnswerFixationEnabled()

ilObjTest::setInstantFeedbackAnswerFixationEnabled (   $instantFeedbackAnswerFixationEnabled)

Definition at line 12112 of file class.ilObjTest.php.

12113 {
12114 $this->instantFeedbackAnswerFixationEnabled = $instantFeedbackAnswerFixationEnabled;
12115 }

References $instantFeedbackAnswerFixationEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setInstantFeedbackOptionsByArray()

ilObjTest::setInstantFeedbackOptionsByArray (   $options)

Definition at line 10817 of file class.ilObjTest.php.

10818 {
10819 if (is_array($options)) {
10820 $this->setGenericAnswerFeedback(in_array('instant_feedback_generic', $options) ? 1 : 0);
10821 $this->setSpecificAnswerFeedback(in_array('instant_feedback_specific', $options) ? 1 : 0);
10822 $this->setAnswerFeedbackPoints(in_array('instant_feedback_points', $options) ? 1 : 0);
10823 $this->setInstantFeedbackSolution(in_array('instant_feedback_solution', $options) ? 1 : 0);
10824 } else {
10825 $this->setGenericAnswerFeedback(0);
10826 $this->setSpecificAnswerFeedback(0);
10827 $this->setAnswerFeedbackPoints(0);
10829 }
10830 }
setGenericAnswerFeedback($generic_answer_feedback=0)
Sets if the generic feedback is to be shown in the test.

References setAnswerFeedbackPoints(), setGenericAnswerFeedback(), setInstantFeedbackSolution(), and setSpecificAnswerFeedback().

+ Here is the call graph for this function:

◆ setInstantFeedbackSolution()

ilObjTest::setInstantFeedbackSolution (   $instant_feedback = 0)

Sets the instant feedback for the solution.

Parameters
integer$instant_feedbackIf 1, the solution will be shown after answering a question @access public
See also
$instant_verification

Definition at line 2317 of file class.ilObjTest.php.

2318 {
2319 switch ($instant_feedback) {
2320 case 1:
2321 $this->instant_verification = 1;
2322 break;
2323 default:
2324 $this->instant_verification = 0;
2325 break;
2326 }
2327 }

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setInstantFeedbackOptionsByArray().

+ Here is the caller graph for this function:

◆ setIntroduction()

ilObjTest::setIntroduction (   $introduction = "")

Sets the introduction text of the ilObjTest object.

Parameters
string$introductionAn introduction string for the test @access public
See also
$introduction

Definition at line 2070 of file class.ilObjTest.php.

2071 {
2072 if (is_null($introduction)) {
2073 $introduction = '';
2074 }
2075 $this->introduction = $this->getHtmlQuestionContentPurifier()->purify($introduction);
2076 }

References $introduction, and getHtmlQuestionContentPurifier().

Referenced by applyDefaults(), fromXML(), and loadFromDb().

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

◆ setIntroductionEnabled()

ilObjTest::setIntroductionEnabled (   $introductionEnabled)
Parameters
boolean$introductionEnabled

Definition at line 2047 of file class.ilObjTest.php.

2048 {
2049 $this->introductionEnabled = $introductionEnabled;
2050 }

References $introductionEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setKiosk()

ilObjTest::setKiosk (   $kiosk = 0)

Sets the kiosk mode for the test.

Parameters
integer$kioskThe value for the kiosk mode. @access public
See also
$_kiosk

Definition at line 2681 of file class.ilObjTest.php.

2682 {
2683 $this->_kiosk = $kiosk;
2684 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setKioskMode()

ilObjTest::setKioskMode (   $a_kiosk = false)

Sets the kiosk mode for the test.

Parameters
boolean$kioskThe value for the kiosk mode @access public
See also
$_kiosk

Definition at line 2709 of file class.ilObjTest.php.

2710 {
2711 if ($a_kiosk) {
2712 $this->_kiosk = $this->_kiosk | 1;
2713 } else {
2714 if ($this->getKioskMode()) {
2715 $this->_kiosk = $this->_kiosk ^ 1;
2716 }
2717 }
2718 }
getKioskMode()
Returns the kiosk mode.

References getKioskMode().

+ Here is the call graph for this function:

◆ setLimitUsersEnabled()

ilObjTest::setLimitUsersEnabled (   $limitUsersEnabled)
Parameters
boolean$limitUsersEnabled

Definition at line 9124 of file class.ilObjTest.php.

9125 {
9126 $this->limitUsersEnabled = $limitUsersEnabled;
9127 }

References $limitUsersEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setListOfQuestions()

ilObjTest::setListOfQuestions (   $a_value = true)

Sets if the the list of questions should be presented to the user or not.

Parameters
boolean$a_valueTRUE if the list of questions should be presented, FALSE otherwise @access public

Definition at line 8699 of file class.ilObjTest.php.

8700 {
8701 if ($a_value) {
8702 $this->show_summary = 1;
8703 } else {
8704 $this->show_summary = 0;
8705 }
8706 }

◆ setListOfQuestionsDescription()

ilObjTest::setListOfQuestionsDescription (   $a_value = true)

Sets the show_summary attribute to TRUE if the list of questions should be presented with the question descriptions.

Parameters
boolean$a_valueTRUE if the list of questions should be shown with question descriptions, FALSE otherwise @access public

Definition at line 8795 of file class.ilObjTest.php.

8796 {
8797 if ($a_value && $this->getListOfQuestions()) {
8798 $this->show_summary = $this->show_summary | 8;
8799 }
8800 if (!$a_value && $this->getListOfQuestions()) {
8801 if ($this->getListOfQuestionsDescription()) {
8802 $this->show_summary = $this->show_summary ^ 8;
8803 }
8804 }
8805 }
getListOfQuestions()
Returns if the list of questions should be presented to the user or not.
getListOfQuestionsDescription()
Returns TRUE if the list of questions should be presented with the question descriptions.

References getListOfQuestions(), and getListOfQuestionsDescription().

+ Here is the call graph for this function:

◆ setListOfQuestionsEnd()

ilObjTest::setListOfQuestionsEnd (   $a_value = true)

Sets if the the list of questions as the end page of the test.

Parameters
boolean$a_valueTRUE if the list of questions should be the end page, FALSE otherwise @access public

Definition at line 8762 of file class.ilObjTest.php.

8763 {
8764 if ($a_value && $this->getListOfQuestions()) {
8765 $this->show_summary = $this->show_summary | 4;
8766 }
8767 if (!$a_value && $this->getListOfQuestions()) {
8768 if ($this->getListOfQuestionsEnd()) {
8769 $this->show_summary = $this->show_summary ^ 4;
8770 }
8771 }
8772 }
getListOfQuestionsEnd()
Returns if the list of questions should be presented as the last page of the test.

References getListOfQuestions(), and getListOfQuestionsEnd().

+ Here is the call graph for this function:

◆ setListOfQuestionsSettings()

ilObjTest::setListOfQuestionsSettings (   $a_value = 0)

Sets the settings for the list of questions options in the test properties This could contain one of the following values: 0 = No list of questions offered 1 = A list of questions is offered 3 = A list of questions is offered and the list of questions is shown as first page of the test 5 = A list of questions is offered and the list of questions is shown as last page of the test 7 = A list of questions is offered and the list of questions is shown as first and last page of the test.

Parameters
integer$a_value0, 1, 3, 5 or 7 @access public

Definition at line 8673 of file class.ilObjTest.php.

8674 {
8675 $this->show_summary = $a_value;
8676 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setListOfQuestionsStart()

ilObjTest::setListOfQuestionsStart (   $a_value = true)

Sets if the the list of questions as the start page of the test.

Parameters
boolean$a_valueTRUE if the list of questions should be the start page, FALSE otherwise @access public

Definition at line 8729 of file class.ilObjTest.php.

8730 {
8731 if ($a_value && $this->getListOfQuestions()) {
8732 $this->show_summary = $this->show_summary | 2;
8733 }
8734 if (!$a_value && $this->getListOfQuestions()) {
8735 if ($this->getListOfQuestionsStart()) {
8736 $this->show_summary = $this->show_summary ^ 2;
8737 }
8738 }
8739 }
getListOfQuestionsStart()
Returns if the list of questions should be presented as the first page of the test.

References getListOfQuestions(), and getListOfQuestionsStart().

+ Here is the call graph for this function:

◆ setMailNotification()

ilObjTest::setMailNotification (   $a_notification)

Set mail notification settings.

Parameters
$a_notificationMail notification setting

Definition at line 10567 of file class.ilObjTest.php.

10568 {
10569 $this->mailnotification = $a_notification;
10570 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setMailNotificationType()

ilObjTest::setMailNotificationType (   $a_type)

Definition at line 10677 of file class.ilObjTest.php.

10678 {
10679 if ($a_type == 1) {
10680 $this->mailnottype = 1;
10681 } else {
10682 $this->mailnottype = 0;
10683 }
10684 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setMCScoring()

ilObjTest::setMCScoring (   $a_mc_scoring = SCORE_ZERO_POINTS_WHEN_UNANSWERED)

Sets the multiple choice scoring.

Parameters
integer$a_mc_scoringThe scoring for multiple choice questions @access public
See also
$mc_scoring

Definition at line 3254 of file class.ilObjTest.php.

3255 {
3256 $this->mc_scoring = $a_mc_scoring;
3257 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setNrOfTries()

ilObjTest::setNrOfTries (   $nr_of_tries = 0)

Sets the nr of tries for the test.

Parameters
integer$nr_of_triesThe maximum number of tries for the test. 0 for infinite tries. @access public
See also
$nr_of_tries

Definition at line 3074 of file class.ilObjTest.php.

3075 {
3076 $this->nr_of_tries = $nr_of_tries;
3077 }

References $nr_of_tries.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setObligationsEnabled()

ilObjTest::setObligationsEnabled (   $obligationsEnabled = true)

sets obligations enabled/disabled

Parameters
boolean$obligationsEnabled

Definition at line 11391 of file class.ilObjTest.php.

11392 {
11393 $this->obligationsEnabled = (bool) $obligationsEnabled;
11394 }

References $obligationsEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setOfferingQuestionHintsEnabled()

ilObjTest::setOfferingQuestionHintsEnabled (   $offeringQuestionHintsEnabled)

sets offering question hints enabled/disabled

Parameters
boolean$offeringQuestionHintsEnabled

Definition at line 11059 of file class.ilObjTest.php.

11060 {
11061 $this->offeringQuestionHintsEnabled = (bool) $offeringQuestionHintsEnabled;
11062 }

References $offeringQuestionHintsEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setOldOnlineStatus()

ilObjTest::setOldOnlineStatus (   $oldOnlineStatus)
Parameters
null$oldOnlineStatus

Definition at line 11029 of file class.ilObjTest.php.

11030 {
11031 $this->oldOnlineStatus = $oldOnlineStatus;
11032 }

References $oldOnlineStatus.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setOnline()

ilObjTest::setOnline (   $a_online = true)

Definition at line 11013 of file class.ilObjTest.php.

11014 {
11015 $this->online = (bool) $a_online;
11016 }

Referenced by ilTestImporter\importQuestionSkillAssignments().

+ Here is the caller graph for this function:

◆ setPassDeletionAllowed()

ilObjTest::setPassDeletionAllowed (   $passDeletionAllowed)

setter for the test setting passDeletionAllowed

Returns
integer

Definition at line 11536 of file class.ilObjTest.php.

11537 {
11538 $this->passDeletionAllowed = (bool) $passDeletionAllowed;
11539 }

References $passDeletionAllowed.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setPassScoring()

ilObjTest::setPassScoring (   $a_pass_scoring = SCORE_LAST_PASS)

Sets the pass scoring.

Parameters
integer$a_pass_scoringThe pass scoring type @access public
See also
$pass_scoring

Definition at line 3266 of file class.ilObjTest.php.

3267 {
3268 switch ($a_pass_scoring) {
3269 case SCORE_BEST_PASS:
3270 $this->pass_scoring = SCORE_BEST_PASS;
3271 break;
3272 default:
3273 $this->pass_scoring = SCORE_LAST_PASS;
3274 break;
3275 }
3276 }

References SCORE_BEST_PASS, and SCORE_LAST_PASS.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setPassWaiting()

ilObjTest::setPassWaiting (   $pass_waiting)
Parameters
string$pass_waitingmm:ddd:hh:ii:ss

Definition at line 3289 of file class.ilObjTest.php.

3290 {
3291 $this->pass_waiting = $pass_waiting;
3292 }

References $pass_waiting.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setPassword()

ilObjTest::setPassword (   $a_password = null)

Sets the password for test access.

Parameters
string$a_passwordThe password for test access @access public
See also
$password

Definition at line 3230 of file class.ilObjTest.php.

3231 {
3232 $this->password = $a_password;
3233 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setPasswordEnabled()

ilObjTest::setPasswordEnabled (   $passwordEnabled)
Parameters
boolean$passwordEnabled

Definition at line 3206 of file class.ilObjTest.php.

3207 {
3208 $this->passwordEnabled = $passwordEnabled;
3209 }

References $passwordEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setPoolUsage()

ilObjTest::setPoolUsage (   $usage)

Definition at line 10857 of file class.ilObjTest.php.

10858 {
10859 $this->poolUsage = (boolean) $usage;
10860 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setPostponingEnabled()

ilObjTest::setPostponingEnabled (   $postponingEnabled)
Parameters
bool$postponingEnabled

Definition at line 2293 of file class.ilObjTest.php.

2294 {
2295 $this->setSequenceSettings((int) $postponingEnabled);
2296 }

References setSequenceSettings().

+ Here is the call graph for this function:

◆ setPrintBestSolutionWithResult()

ilObjTest::setPrintBestSolutionWithResult (   $status)

Definition at line 11034 of file class.ilObjTest.php.

11035 {
11036 $this->print_best_solution_with_result = (bool) $status;
11037 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setProcessingTime()

ilObjTest::setProcessingTime (   $processing_time = "00:00:00")

Sets the processing time for the test.

Parameters
string$processing_timeThe maximum processing time for the test given in hh:mm:ss @access public
See also
$processing_time

Definition at line 3141 of file class.ilObjTest.php.

3141 :00:00")
3142 {
3143 $this->processing_time = $processing_time;
3144 }

References $processing_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setProcessingTimeByMinutes()

ilObjTest::setProcessingTimeByMinutes (   $minutes)

Definition at line 3146 of file class.ilObjTest.php.

3147 {
3148 $this->processing_time = sprintf("%02d:%02d:00", floor($minutes / 60), $minutes % 60);
3149 }

◆ setQuestionOrderAndObligations()

ilObjTest::setQuestionOrderAndObligations (   $orders,
  $obligations 
)

Definition at line 10884 of file class.ilObjTest.php.

10885 {
10886 global $DIC;
10887 $ilDB = $DIC['ilDB'];
10888
10889 asort($orders);
10890
10891 $i = 0;
10892
10893 foreach ($orders as $id => $position) {
10894 $i++;
10895
10896 $obligatory = (
10897 isset($obligations[$id]) && $obligations[$id] ? 1 : 0
10898 );
10899
10900 $query = "
10901 UPDATE tst_test_question
10902 SET sequence = %s,
10903 obligatory = %s
10904 WHERE question_fi = %s
10905 ";
10906
10907 $ilDB->manipulateF(
10908 $query,
10909 array('integer', 'integer', 'integer'),
10910 array($i, $obligatory, $id)
10911 );
10912 }
10913
10914 $this->loadQuestions();
10915 }

References $DIC, $i, ilObject\$id, $ilDB, $query, and loadQuestions().

+ Here is the call graph for this function:

◆ setQuestionSetSolved()

ilObjTest::setQuestionSetSolved (   $value,
  $question_id,
  $user_id 
)

sets question solved state to value for given user_id

Definition at line 7883 of file class.ilObjTest.php.

7884 {
7885 global $DIC;
7886 $ilDB = $DIC['ilDB'];
7887
7888 $active_id = $this->getActiveIdOfUser($user_id);
7889 $affectedRows = $ilDB->manipulateF(
7890 "DELETE FROM tst_qst_solved WHERE active_fi = %s AND question_fi = %s",
7891 array('integer', 'integer'),
7892 array($active_id, $question_id)
7893 );
7894 $affectedRows = $ilDB->manipulateF(
7895 "INSERT INTO tst_qst_solved (solved, question_fi, active_fi) VALUES (%s, %s, %s)",
7896 array('integer', 'integer', 'integer'),
7897 array($value, $question_id, $active_id)
7898 );
7899 }

References $DIC, $ilDB, and getActiveIdOfUser().

+ Here is the call graph for this function:

◆ setQuestionSetType()

ilObjTest::setQuestionSetType (   $questionSetType)

setter for question set type

Parameters
string$questionSetType

Definition at line 11885 of file class.ilObjTest.php.

11886 {
11887 $this->questionSetType = $questionSetType;
11888 }

References $questionSetType.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setRedirectionMode()

ilObjTest::setRedirectionMode (   $redirection_mode = 0)

Definition at line 3095 of file class.ilObjTest.php.

3096 {
3097 $this->redirection_mode = $redirection_mode;
3098 }

References $redirection_mode.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setRedirectionUrl()

ilObjTest::setRedirectionUrl (   $redirection_url = null)

Definition at line 3103 of file class.ilObjTest.php.

3104 {
3105 $this->redirection_url = $redirection_url;
3106 }

References $redirection_url.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setReportingDate()

ilObjTest::setReportingDate (   $reporting_date)

Sets the reporting date of the ilObjTest object.

Parameters
timestamp$reporting_dateThe date and time the score reporting is available

Definition at line 2388 of file class.ilObjTest.php.

2389 {
2390 if (!$reporting_date) {
2391 $this->reporting_date = '';
2392 $this->setECTSOutput(false);
2393 } else {
2394 $this->reporting_date = $reporting_date;
2395 }
2396 }

References $reporting_date, and setECTSOutput().

Referenced by applyDefaults(), fromXML(), and loadFromDb().

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

◆ setResetProcessingTime()

ilObjTest::setResetProcessingTime (   $reset = 0)

Sets wheather the processing time should be reset or not.

Parameters
integer$reset1 to reset the processing time, 0 otherwise @access public
See also
$processing_time

Definition at line 3174 of file class.ilObjTest.php.

3175 {
3176 if ($reset) {
3177 $this->reset_processing_time = 1;
3178 } else {
3179 $this->reset_processing_time = 0;
3180 }
3181 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setResultFilterTaxIds()

ilObjTest::setResultFilterTaxIds (   $resultFilterTaxIds)

Definition at line 12045 of file class.ilObjTest.php.

12046 {
12047 $this->resultFilterTaxIds = $resultFilterTaxIds;
12048 }

References $resultFilterTaxIds.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setResultsPresentation()

ilObjTest::setResultsPresentation (   $a_results_presentation = 3)

Sets the combined results presentation value.

Parameters
integer$a_results_presentationThe combined results presentation value @access public

Definition at line 8940 of file class.ilObjTest.php.

8941 {
8942 $this->results_presentation = $a_results_presentation;
8943 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setResultsPresentationOptionsByArray()

ilObjTest::setResultsPresentationOptionsByArray (   $options)

Definition at line 10832 of file class.ilObjTest.php.

10833 {
10834 $setter = array(
10835 'pass_details' => 'setShowPassDetails',
10836 'solution_details' => 'setShowSolutionDetails',
10837 'solution_printview' => 'setShowSolutionPrintview',
10838 'solution_feedback' => 'setShowSolutionFeedback',
10839 'solution_answers_only' => 'setShowSolutionAnswersOnly',
10840 'solution_signature' => 'setShowSolutionSignature',
10841 'solution_suggested' => 'setShowSolutionSuggested',
10842 );
10843 foreach ($setter as $key => $setter) {
10844 if (in_array($key, $options)) {
10845 $this->$setter(1);
10846 } else {
10847 $this->$setter(0);
10848 }
10849 }
10850 }

◆ setScoreCutting()

ilObjTest::setScoreCutting (   $a_score_cutting = SCORE_CUT_QUESTION)

Sets the type of score cutting.

Parameters
integer$a_score_cuttingThe type of score cutting. 0 for cut questions, 1 for cut tests @access public
See also
$score_cutting

Definition at line 3242 of file class.ilObjTest.php.

3243 {
3244 $this->score_cutting = $a_score_cutting;
3245 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setScoreReporting()

ilObjTest::setScoreReporting (   $score_reporting = 0)

Sets the score reporting of the ilObjTest object.

Parameters
integer$score_reportingThe score reporting @access public
See also
$score_reporting

Definition at line 2305 of file class.ilObjTest.php.

2306 {
2307 $this->score_reporting = $score_reporting;
2308 }

References $score_reporting.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setSequenceSettings()

ilObjTest::setSequenceSettings (   $sequence_settings = 0)

SEQUENCE SETTING = POSTPONING ENABLED !!

Parameters
integer$sequence_settingsThe POSTPONING ENABLED status

Definition at line 2277 of file class.ilObjTest.php.

2278 {
2279 $this->sequence_settings = $sequence_settings;
2280 }

References $sequence_settings.

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setPostponingEnabled().

+ Here is the caller graph for this function:

◆ setShowCancel()

ilObjTest::setShowCancel (   $a_value = 1)

Sets the cancel test button status.

Parameters
integer$a_valueThe value for the cancel test status (0 = don't show, 1 = show) @access public

Definition at line 9414 of file class.ilObjTest.php.

9415 {
9416 switch ($a_value) {
9417 case 1:
9418 $this->show_cancel = 1;
9419 break;
9420 default:
9421 $this->show_cancel = 0;
9422 break;
9423 }
9424 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowExamIdInTestPassEnabled()

ilObjTest::setShowExamIdInTestPassEnabled (   $show_exam_id_in_test_pass_enabled)

Definition at line 11805 of file class.ilObjTest.php.

11806 {
11807 $this->show_exam_id_in_test_pass_enabled = $show_exam_id_in_test_pass_enabled;
11808 }

References $show_exam_id_in_test_pass_enabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowExamIdInTestResultsEnabled()

ilObjTest::setShowExamIdInTestResultsEnabled (   $show_exam_id_in_test_results_enabled)
Parameters
boolean$show_exam_id

Definition at line 11818 of file class.ilObjTest.php.

11819 {
11820 $this->show_exam_id_in_test_results_enabled = $show_exam_id_in_test_results_enabled;
11821 }

References $show_exam_id_in_test_results_enabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowExamviewHtml()

ilObjTest::setShowExamviewHtml (   $show_examview_html)
Parameters
boolean$show_examview_html

Definition at line 11545 of file class.ilObjTest.php.

11546 {
11547 $this->show_examview_html = $show_examview_html;
11548 }

References $show_examview_html.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowExamviewPdf()

ilObjTest::setShowExamviewPdf (   $show_examview_pdf)
Parameters
boolean$show_examview_pdf

Definition at line 11561 of file class.ilObjTest.php.

11562 {
11563 $this->show_examview_pdf = $show_examview_pdf;
11564 }

References $show_examview_pdf.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowFinalStatement()

ilObjTest::setShowFinalStatement (   $show = 0)

Sets whether the final statement should be shown or not.

Parameters
integer$show1 if TRUE or 0 if FALSE @access public
See also
$_finalstatement

Definition at line 2150 of file class.ilObjTest.php.

2151 {
2152 $this->_showfinalstatement = ($show) ? 1 : 0;
2153 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowGradingMarkEnabled()

ilObjTest::setShowGradingMarkEnabled (   $showGradingMarkEnabled)

Definition at line 12091 of file class.ilObjTest.php.

12092 {
12093 $this->showGradingMarkEnabled = $showGradingMarkEnabled;
12094 }

References $showGradingMarkEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowGradingStatusEnabled()

ilObjTest::setShowGradingStatusEnabled (   $showGradingStatusEnabled)

Definition at line 12081 of file class.ilObjTest.php.

12082 {
12083 $this->showGradingStatusEnabled = $showGradingStatusEnabled;
12084 }

References $showGradingStatusEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowInfo()

ilObjTest::setShowInfo (   $a_info = 1)

Set whether the complete information page is shown or the required data only.

Parameters
integer$a_info1 for the complete information, 0 otherwise @access public
See also
$_showinfo

Definition at line 2101 of file class.ilObjTest.php.

2102 {
2103 $this->_showinfo = ($a_info) ? 1 : 0;
2104 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowKioskModeParticipant()

ilObjTest::setShowKioskModeParticipant (   $a_participant = false)

Set to true, if the participant's name should be shown in kiosk mode.

Parameters
boolean$a_titleTRUE if the participant's name should be shown in kiosk mode, FALSE otherwise @access public

Definition at line 2775 of file class.ilObjTest.php.

2776 {
2777 if ($a_participant) {
2778 $this->_kiosk = $this->_kiosk | 4;
2779 } else {
2780 if ($this->getShowKioskModeParticipant()) {
2781 $this->_kiosk = $this->_kiosk ^ 4;
2782 }
2783 }
2784 }
getShowKioskModeParticipant()
Returns the status of the kiosk mode participant.

References getShowKioskModeParticipant().

+ Here is the call graph for this function:

◆ setShowKioskModeTitle()

ilObjTest::setShowKioskModeTitle (   $a_title = false)

Set to true, if the full test title should be shown in kiosk mode.

Parameters
boolean$a_titleTRUE if the test title should be shown in kiosk mode, FALSE otherwise @access public

Definition at line 2742 of file class.ilObjTest.php.

2743 {
2744 if ($a_title) {
2745 $this->_kiosk = $this->_kiosk | 2;
2746 } else {
2747 if ($this->getShowKioskModeTitle()) {
2748 $this->_kiosk = $this->_kiosk ^ 2;
2749 }
2750 }
2751 }
getShowKioskModeTitle()
Returns the status of the kiosk mode title.

References getShowKioskModeTitle().

+ Here is the call graph for this function:

◆ setShowMarker()

ilObjTest::setShowMarker (   $a_value = 1)

Sets the marker button status.

Parameters
integer$a_valueThe value for the marker status (0 = don't show, 1 = show) @access public

Definition at line 9443 of file class.ilObjTest.php.

9444 {
9445 switch ($a_value) {
9446 case 1:
9447 $this->show_marker = 1;
9448 break;
9449 default:
9450 $this->show_marker = 0;
9451 break;
9452 }
9453 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowPassDetails()

ilObjTest::setShowPassDetails (   $a_details = 1)

Sets if the pass details should be shown when a test is not finished.

Sets if the pass details should be shown when a test is not finished

Parameters
boolean$a_detailsTRUE if the pass details should be shown, FALSE otherwise @access public

Definition at line 8953 of file class.ilObjTest.php.

8954 {
8955 if ($a_details) {
8956 $this->results_presentation = $this->results_presentation | 1;
8957 } else {
8958 if ($this->getShowPassDetails()) {
8959 $this->results_presentation = $this->results_presentation ^ 1;
8960 }
8961 }
8962 }
getShowPassDetails()
Returns if the pass details should be shown when a test is not finished.

References getShowPassDetails().

Referenced by __construct().

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

◆ setShowSolutionAnswersOnly()

ilObjTest::setShowSolutionAnswersOnly (   $a_full = true)

Set to true, if the full solution (including the ILIAS content pages) should be shown in the solution output.

Parameters
boolean$a_fullTRUE if the full solution should be shown in the solution output, FALSE otherwise @access public

Definition at line 9032 of file class.ilObjTest.php.

9033 {
9034 if ($a_full) {
9035 $this->results_presentation = $this->results_presentation | 16;
9036 } else {
9037 if ($this->getShowSolutionAnswersOnly()) {
9038 $this->results_presentation = $this->results_presentation ^ 16;
9039 }
9040 }
9041 }
getShowSolutionAnswersOnly()
Returns if the full solution (including ILIAS content) should be presented to the solution or not.

References getShowSolutionAnswersOnly().

Referenced by __construct().

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

◆ setShowSolutionDetails()

ilObjTest::setShowSolutionDetails (   $a_details = 1)

Sets if the the solution details should be presented to the user or not.

Parameters
integer$a_details1 if the solution details should be presented, 0 otherwise @access public

Definition at line 8970 of file class.ilObjTest.php.

8971 {
8972 if ($a_details) {
8973 $this->results_presentation = $this->results_presentation | 2;
8974 } else {
8975 if ($this->getShowSolutionDetails()) {
8976 $this->results_presentation = $this->results_presentation ^ 2;
8977 }
8978 }
8979 }
getShowSolutionDetails()
Returns if the solution details should be presented to the user or not.

References getShowSolutionDetails().

Referenced by __construct(), and fromXML().

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

◆ setShowSolutionFeedback()

ilObjTest::setShowSolutionFeedback (   $a_feedback = true)

Sets if the the feedback should be presented to the user in the solution or not.

Parameters
boolean$a_feedbackTRUE if the feedback should be presented in the solution, FALSE otherwise @access public

Definition at line 9015 of file class.ilObjTest.php.

9016 {
9017 if ($a_feedback) {
9018 $this->results_presentation = $this->results_presentation | 8;
9019 } else {
9020 if ($this->getShowSolutionFeedback()) {
9021 $this->results_presentation = $this->results_presentation ^ 8;
9022 }
9023 }
9024 }
getShowSolutionFeedback()
Returns if the feedback should be presented to the solution or not.

References getShowSolutionFeedback().

+ Here is the call graph for this function:

◆ setShowSolutionListComparison()

ilObjTest::setShowSolutionListComparison (   $a_comparison = false)

Set to TRUE, if the list of answers should be shown prior to finish the test.

Parameters
boolean$a_comparisonTRUE if the list of answers should be shown prior to finish the test, FALSE otherwise

Definition at line 9082 of file class.ilObjTest.php.

9083 {
9084 if ($a_comparison) {
9085 $this->results_presentation = $this->results_presentation | 128;
9086 } else {
9087 if ($this->getShowSolutionListComparison()) {
9088 $this->results_presentation = $this->results_presentation ^ 128;
9089 }
9090 }
9091 }
getShowSolutionListComparison()

References getShowSolutionListComparison().

+ Here is the call graph for this function:

◆ setShowSolutionPrintview()

ilObjTest::setShowSolutionPrintview (   $a_printview = 1)

Sets if the the solution printview should be presented to the user or not.

Parameters
boolean$a_detailsTRUE if the solution printview should be presented, FALSE otherwise @access public

Definition at line 8998 of file class.ilObjTest.php.

8999 {
9000 if ($a_printview) {
9001 $this->results_presentation = $this->results_presentation | 4;
9002 } else {
9003 if ($this->getShowSolutionPrintview()) {
9004 $this->results_presentation = $this->results_presentation ^ 4;
9005 }
9006 }
9007 }

References getShowSolutionPrintview().

Referenced by fromXML().

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

◆ setShowSolutionSignature()

ilObjTest::setShowSolutionSignature (   $a_signature = false)

Set to TRUE, if the signature field should be shown in the solution.

Parameters
boolean$a_signatureTRUE if the signature field should be shown, FALSE otherwise @access public

Definition at line 9049 of file class.ilObjTest.php.

9050 {
9051 if ($a_signature) {
9052 $this->results_presentation = $this->results_presentation | 32;
9053 } else {
9054 if ($this->getShowSolutionSignature()) {
9055 $this->results_presentation = $this->results_presentation ^ 32;
9056 }
9057 }
9058 }
getShowSolutionSignature()
Returns if the signature field should be shown in the test results.

References getShowSolutionSignature().

Referenced by __construct().

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

◆ setShowSolutionSuggested()

ilObjTest::setShowSolutionSuggested (   $a_solution = false)

Set to TRUE, if the suggested solution should be shown in the solution.

Parameters
boolean$a_solutionTRUE if the suggested solution should be shown, FALSE otherwise @access public

Definition at line 9066 of file class.ilObjTest.php.

9067 {
9068 if ($a_solution) {
9069 $this->results_presentation = $this->results_presentation | 64;
9070 } else {
9071 if ($this->getShowSolutionSuggested()) {
9072 $this->results_presentation = $this->results_presentation ^ 64;
9073 }
9074 }
9075 }

References getShowSolutionSuggested().

+ Here is the call graph for this function:

◆ setShuffleQuestions()

ilObjTest::setShuffleQuestions (   $a_shuffle)

Sets the status of the shuffle_questions variable.

Parameters
boolean$a_shuffle0 if the test questions are not shuffled, 1 if the test questions are shuffled @access public

Definition at line 8639 of file class.ilObjTest.php.

8640 {
8641 $this->shuffle_questions = ($a_shuffle) ? 1 : 0;
8642 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setSignSubmission()

ilObjTest::setSignSubmission (   $sign_submission)
Parameters
boolean$sign_submission

Definition at line 11834 of file class.ilObjTest.php.

11835 {
11836 $this->sign_submission = $sign_submission;
11837 }

References $sign_submission.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setSkillServiceEnabled()

ilObjTest::setSkillServiceEnabled (   $skillServiceEnabled)

Definition at line 12035 of file class.ilObjTest.php.

12036 {
12037 $this->skillServiceEnabled = $skillServiceEnabled;
12038 }

References $skillServiceEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setSpecificAnswerFeedback()

ilObjTest::setSpecificAnswerFeedback (   $specific_answer_feedback)

Definition at line 11364 of file class.ilObjTest.php.

11365 {
11366 switch ($specific_answer_feedback) {
11367 case 1:
11368 $this->specific_answer_feedback = 1;
11369 break;
11370 default:
11371 $this->specific_answer_feedback = 0;
11372 break;
11373 }
11374 }

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setInstantFeedbackOptionsByArray().

+ Here is the caller graph for this function:

◆ setStartingTime()

ilObjTest::setStartingTime (   $starting_time = null)

Sets the starting time in database timestamp format for the test.

Parameters
string$starting_timeThe starting time for the test. Empty string for no starting time. @access public
See also
$starting_time

Definition at line 3022 of file class.ilObjTest.php.

3023 {
3024 $this->starting_time = $starting_time;
3025 }

References $starting_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setStartingTimeEnabled()

ilObjTest::setStartingTimeEnabled (   $starting_time_enabled)
Parameters
boolean$starting_time_enabled

Definition at line 2998 of file class.ilObjTest.php.

2999 {
3000 $this->starting_time_enabled = $starting_time_enabled;
3001 }

References $starting_time_enabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setTemplate()

ilObjTest::setTemplate (   $template_id)

Definition at line 10734 of file class.ilObjTest.php.

10735 {
10736 $this->template_id = (int) $template_id;
10737 }

References $template_id.

Referenced by ilLOEditorGUI\applySettingsTemplate(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setTestFinalBroken()

ilObjTest::setTestFinalBroken (   $testFinalBroken)
Parameters
boolean$testFinalBroken

Definition at line 12214 of file class.ilObjTest.php.

12215 {
12216 $this->testFinalBroken = $testFinalBroken;
12217 }

References $testFinalBroken.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setTestId()

ilObjTest::setTestId (   $a_id)

Sets the test ID.

Parameters
integer$a_idTest ID

Definition at line 10270 of file class.ilObjTest.php.

10271 {
10272 $this->test_id = $a_id;
10273 }

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setTitleOutput()

ilObjTest::setTitleOutput (   $title_output = 0)

Sets the status of the title output.

Parameters
integer$title_output0 for full title, 1 for title without points, 2 for no title @access public
See also
$title_output

Definition at line 3119 of file class.ilObjTest.php.

3120 {
3121 switch ($title_output) {
3122 case 1:
3123 $this->title_output = 1;
3124 break;
3125 case 2:
3126 $this->title_output = 2;
3127 break;
3128 default:
3129 $this->title_output = 0;
3130 break;
3131 }
3132 }

References $title_output.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setTmpCopyWizardCopyId()

ilObjTest::setTmpCopyWizardCopyId (   $tmpCopyWizardCopyId)
Parameters
int$tmpCopyWizardCopyId

Definition at line 736 of file class.ilObjTest.php.

737 {
738 $this->tmpCopyWizardCopyId = $tmpCopyWizardCopyId;
739 }

References $tmpCopyWizardCopyId.

◆ setUsePreviousAnswers()

ilObjTest::setUsePreviousAnswers (   $use_previous_answers = 1)

Sets the status of the visibility of previous learner answers.

Parameters
integer$use_previous_answers1 if the previous answers should be shown @access public
See also
$use_previous_answers

Definition at line 3086 of file class.ilObjTest.php.

3087 {
3089 $this->use_previous_answers = 1;
3090 } else {
3091 $this->use_previous_answers = 0;
3092 }
3093 }

References $use_previous_answers.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ startingTimeReached()

ilObjTest::startingTimeReached ( )

Returns true if the starting time of a test is reached A starting time is not available for self assessment tests.

Returns
boolean true if the starting time is reached, otherwise false @access public

Definition at line 5542 of file class.ilObjTest.php.

5543 {
5544 if ($this->isStartingTimeEnabled() && $this->getStartingTime() != 0) {
5545 $now = time();
5546 if ($now < $this->getStartingTime()) {
5547 return false;
5548 }
5549 }
5550 return true;
5551 }

References getStartingTime(), and isStartingTimeEnabled().

Referenced by isExecutable().

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

◆ startWorkingTime()

ilObjTest::startWorkingTime (   $active_id,
  $pass 
)

Write the initial entry for the tests working time to the database.

Parameters
integer$user_idThe database id of the user working with the test @access public

Definition at line 3818 of file class.ilObjTest.php.

3819 {
3820 global $DIC;
3821 $ilDB = $DIC['ilDB'];
3822
3823 $next_id = $ilDB->nextId('tst_times');
3824 $affectedRows = $ilDB->manipulateF(
3825 "INSERT INTO tst_times (times_id, active_fi, started, finished, pass, tstamp) VALUES (%s, %s, %s, %s, %s, %s)",
3826 array('integer', 'integer', 'timestamp', 'timestamp', 'integer', 'integer'),
3827 array($next_id, $active_id, strftime("%Y-%m-%d %H:%M:%S"), strftime("%Y-%m-%d %H:%M:%S"), $pass, time())
3828 );
3829 return $next_id;
3830 }

References $DIC, $ilDB, and $pass.

◆ toXML()

ilObjTest::toXML ( )

Returns a QTI xml representation of the test.

Returns
string The QTI xml representation of the test

Definition at line 6055 of file class.ilObjTest.php.

6056 {
6057 include_once("./Services/Xml/classes/class.ilXmlWriter.php");
6058 $a_xml_writer = new ilXmlWriter;
6059 // set xml header
6060 $a_xml_writer->xmlHeader();
6061 $a_xml_writer->xmlSetDtdDef("<!DOCTYPE questestinterop SYSTEM \"ims_qtiasiv1p2p1.dtd\">");
6062 $a_xml_writer->xmlStartTag("questestinterop");
6063
6064 $attrs = array(
6065 "ident" => "il_" . IL_INST_ID . "_tst_" . $this->getTestId(),
6066 "title" => $this->getTitle()
6067 );
6068 $a_xml_writer->xmlStartTag("assessment", $attrs);
6069 // add qti comment
6070 $a_xml_writer->xmlElement("qticomment", null, $this->getDescription());
6071
6072 // add qti duration
6073 if ($this->enable_processing_time) {
6074 preg_match("/(\d+):(\d+):(\d+)/", $this->processing_time, $matches);
6075 $a_xml_writer->xmlElement("duration", null, sprintf("P0Y0M0DT%dH%dM%dS", $matches[1], $matches[2], $matches[3]));
6076 }
6077
6078 // add the rest of the preferences in qtimetadata tags, because there is no correspondent definition in QTI
6079 $a_xml_writer->xmlStartTag("qtimetadata");
6080 $a_xml_writer->xmlStartTag("qtimetadatafield");
6081 $a_xml_writer->xmlElement("fieldlabel", null, "ILIAS_VERSION");
6082 $a_xml_writer->xmlElement("fieldentry", null, $this->ilias->getSetting("ilias_version"));
6083 $a_xml_writer->xmlEndTag("qtimetadatafield");
6084
6085 // anonymity
6086 $a_xml_writer->xmlStartTag("qtimetadatafield");
6087 $a_xml_writer->xmlElement("fieldlabel", null, "anonymity");
6088 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getAnonymity()));
6089 $a_xml_writer->xmlEndTag("qtimetadatafield");
6090
6091 $a_xml_writer->xmlStartTag("qtimetadatafield");
6092 $a_xml_writer->xmlElement("fieldlabel", null, "use_pool");
6093 $a_xml_writer->xmlElement("fieldentry", null, $this->getPoolUsage() ? 1 : 0);
6094 $a_xml_writer->xmlEndTag("qtimetadatafield");
6095
6096 // question set type (fixed, random, dynamic, ...)
6097 $a_xml_writer->xmlStartTag("qtimetadatafield");
6098 $a_xml_writer->xmlElement("fieldlabel", null, "question_set_type");
6099 $a_xml_writer->xmlElement("fieldentry", null, $this->getQuestionSetType());
6100 $a_xml_writer->xmlEndTag("qtimetadatafield");
6101
6102 // sequence settings
6103 $a_xml_writer->xmlStartTag("qtimetadatafield");
6104 $a_xml_writer->xmlElement("fieldlabel", null, "sequence_settings");
6105 $a_xml_writer->xmlElement("fieldentry", null, $this->getSequenceSettings());
6106 $a_xml_writer->xmlEndTag("qtimetadatafield");
6107
6108 // author
6109 $a_xml_writer->xmlStartTag("qtimetadatafield");
6110 $a_xml_writer->xmlElement("fieldlabel", null, "author");
6111 $a_xml_writer->xmlElement("fieldentry", null, $this->getAuthor());
6112 $a_xml_writer->xmlEndTag("qtimetadatafield");
6113
6114 // reset processing time
6115 $a_xml_writer->xmlStartTag("qtimetadatafield");
6116 $a_xml_writer->xmlElement("fieldlabel", null, "reset_processing_time");
6117 $a_xml_writer->xmlElement("fieldentry", null, $this->getResetProcessingTime());
6118 $a_xml_writer->xmlEndTag("qtimetadatafield");
6119
6120 // count system
6121 $a_xml_writer->xmlStartTag("qtimetadatafield");
6122 $a_xml_writer->xmlElement("fieldlabel", null, "count_system");
6123 $a_xml_writer->xmlElement("fieldentry", null, $this->getCountSystem());
6124 $a_xml_writer->xmlEndTag("qtimetadatafield");
6125
6126 // multiple choice scoring
6127 $a_xml_writer->xmlStartTag("qtimetadatafield");
6128 $a_xml_writer->xmlElement("fieldlabel", null, "mc_scoring");
6129 $a_xml_writer->xmlElement("fieldentry", null, $this->getMCScoring());
6130 $a_xml_writer->xmlEndTag("qtimetadatafield");
6131
6132 // multiple choice scoring
6133 $a_xml_writer->xmlStartTag("qtimetadatafield");
6134 $a_xml_writer->xmlElement("fieldlabel", null, "score_cutting");
6135 $a_xml_writer->xmlElement("fieldentry", null, $this->getScoreCutting());
6136 $a_xml_writer->xmlEndTag("qtimetadatafield");
6137
6138 // multiple choice scoring
6139 $a_xml_writer->xmlStartTag("qtimetadatafield");
6140 $a_xml_writer->xmlElement("fieldlabel", null, "password");
6141 $a_xml_writer->xmlElement("fieldentry", null, $this->getPassword());
6142 $a_xml_writer->xmlEndTag("qtimetadatafield");
6143
6144 // allowed users
6145 $a_xml_writer->xmlStartTag("qtimetadatafield");
6146 $a_xml_writer->xmlElement("fieldlabel", null, "allowedUsers");
6147 $a_xml_writer->xmlElement("fieldentry", null, $this->getAllowedUsers());
6148 $a_xml_writer->xmlEndTag("qtimetadatafield");
6149
6150 // allowed users time gap
6151 $a_xml_writer->xmlStartTag("qtimetadatafield");
6152 $a_xml_writer->xmlElement("fieldlabel", null, "allowedUsersTimeGap");
6153 $a_xml_writer->xmlElement("fieldentry", null, $this->getAllowedUsersTimeGap());
6154 $a_xml_writer->xmlEndTag("qtimetadatafield");
6155
6156 // pass scoring
6157 $a_xml_writer->xmlStartTag("qtimetadatafield");
6158 $a_xml_writer->xmlElement("fieldlabel", null, "pass_scoring");
6159 $a_xml_writer->xmlElement("fieldentry", null, $this->getPassScoring());
6160 $a_xml_writer->xmlEndTag("qtimetadatafield");
6161
6162 $a_xml_writer->xmlStartTag('qtimetadatafield');
6163 $a_xml_writer->xmlElement('fieldlabel', null, 'pass_deletion_allowed');
6164 $a_xml_writer->xmlElement('fieldentry', null, (int) $this->isPassDeletionAllowed());
6165 $a_xml_writer->xmlEndTag('qtimetadatafield');
6166
6167 // score reporting date
6168 if ($this->getReportingDate()) {
6169 $a_xml_writer->xmlStartTag("qtimetadatafield");
6170 $a_xml_writer->xmlElement("fieldlabel", null, "reporting_date");
6171 preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->reporting_date, $matches);
6172 $a_xml_writer->xmlElement("fieldentry", null, sprintf("P%dY%dM%dDT%dH%dM%dS", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
6173 $a_xml_writer->xmlEndTag("qtimetadatafield");
6174 }
6175 // number of tries
6176 $a_xml_writer->xmlStartTag("qtimetadatafield");
6177 $a_xml_writer->xmlElement("fieldlabel", null, "nr_of_tries");
6178 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getNrOfTries()));
6179 $a_xml_writer->xmlEndTag("qtimetadatafield");
6180
6181 // number of tries
6182 $a_xml_writer->xmlStartTag('qtimetadatafield');
6183 $a_xml_writer->xmlElement('fieldlabel', null, 'block_after_passed');
6184 $a_xml_writer->xmlElement('fieldentry', null, (int) $this->isBlockPassesAfterPassedEnabled());
6185 $a_xml_writer->xmlEndTag('qtimetadatafield');
6186
6187 // pass_waiting
6188 $a_xml_writer->xmlStartTag("qtimetadatafield");
6189 $a_xml_writer->xmlElement("fieldlabel", null, "pass_waiting");
6190 $a_xml_writer->xmlElement("fieldentry", null, $this->getPassWaiting());
6191 $a_xml_writer->xmlEndTag("qtimetadatafield");
6192
6193 // kiosk
6194 $a_xml_writer->xmlStartTag("qtimetadatafield");
6195 $a_xml_writer->xmlElement("fieldlabel", null, "kiosk");
6196 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getKiosk()));
6197 $a_xml_writer->xmlEndTag("qtimetadatafield");
6198
6199
6200 //redirection_mode
6201 $a_xml_writer->xmlStartTag('qtimetadatafield');
6202 $a_xml_writer->xmlElement("fieldlabel", null, "redirection_mode");
6203 $a_xml_writer->xmlElement("fieldentry", null, $this->getRedirectionMode());
6204 $a_xml_writer->xmlEndTag("qtimetadatafield");
6205
6206 //redirection_url
6207 $a_xml_writer->xmlStartTag('qtimetadatafield');
6208 $a_xml_writer->xmlElement("fieldlabel", null, "redirection_url");
6209 $a_xml_writer->xmlElement("fieldentry", null, $this->getRedirectionUrl());
6210 $a_xml_writer->xmlEndTag("qtimetadatafield");
6211
6212 // use previous answers
6213 $a_xml_writer->xmlStartTag("qtimetadatafield");
6214 $a_xml_writer->xmlElement("fieldlabel", null, "use_previous_answers");
6215 $a_xml_writer->xmlElement("fieldentry", null, $this->getUsePreviousAnswers());
6216 $a_xml_writer->xmlEndTag("qtimetadatafield");
6217
6218 // hide title points
6219 $a_xml_writer->xmlStartTag("qtimetadatafield");
6220 $a_xml_writer->xmlElement("fieldlabel", null, "title_output");
6221 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getTitleOutput()));
6222 $a_xml_writer->xmlEndTag("qtimetadatafield");
6223
6224 // results presentation
6225 $a_xml_writer->xmlStartTag("qtimetadatafield");
6226 $a_xml_writer->xmlElement("fieldlabel", null, "results_presentation");
6227 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getResultsPresentation()));
6228 $a_xml_writer->xmlEndTag("qtimetadatafield");
6229
6230 // examid in test pass
6231 $a_xml_writer->xmlStartTag("qtimetadatafield");
6232 $a_xml_writer->xmlElement("fieldlabel", null, "examid_in_test_pass");
6233 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->isShowExamIdInTestPassEnabled()));
6234 $a_xml_writer->xmlEndTag("qtimetadatafield");
6235
6236 // examid in kiosk
6237 $a_xml_writer->xmlStartTag("qtimetadatafield");
6238 $a_xml_writer->xmlElement("fieldlabel", null, "examid_in_test_res");
6239 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->isShowExamIdInTestResultsEnabled()));
6240 $a_xml_writer->xmlEndTag("qtimetadatafield");
6241
6242 // solution details
6243 $a_xml_writer->xmlStartTag("qtimetadatafield");
6244 $a_xml_writer->xmlElement("fieldlabel", null, "show_summary");
6245 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getListOfQuestionsSettings()));
6246 $a_xml_writer->xmlEndTag("qtimetadatafield");
6247
6248 // solution details
6249 $a_xml_writer->xmlStartTag("qtimetadatafield");
6250 $a_xml_writer->xmlElement("fieldlabel", null, "score_reporting");
6251 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getScoreReporting()));
6252 $a_xml_writer->xmlEndTag("qtimetadatafield");
6253
6254 $a_xml_writer->xmlStartTag("qtimetadatafield");
6255 $a_xml_writer->xmlElement("fieldlabel", null, "solution_details");
6256 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getShowSolutionDetails());
6257 $a_xml_writer->xmlEndTag("qtimetadatafield");
6258 $a_xml_writer->xmlStartTag("qtimetadatafield");
6259 $a_xml_writer->xmlElement("fieldlabel", null, "print_bs_with_res");
6260 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getShowSolutionDetails() ? (int) $this->isBestSolutionPrintedWithResult() : 0);
6261 $a_xml_writer->xmlEndTag("qtimetadatafield");
6262
6263 // solution details
6264 $a_xml_writer->xmlStartTag("qtimetadatafield");
6265 $a_xml_writer->xmlElement("fieldlabel", null, "instant_verification");
6266 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getInstantFeedbackSolution()));
6267 $a_xml_writer->xmlEndTag("qtimetadatafield");
6268
6269 // answer specific feedback
6270 $a_xml_writer->xmlStartTag("qtimetadatafield");
6271 $a_xml_writer->xmlElement("fieldlabel", null, "answer_feedback");
6272 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getAnswerFeedback()));
6273 $a_xml_writer->xmlEndTag("qtimetadatafield");
6274
6275 // answer specific feedback of reached points
6276 $a_xml_writer->xmlStartTag("qtimetadatafield");
6277 $a_xml_writer->xmlElement("fieldlabel", null, "answer_feedback_points");
6278 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getAnswerFeedbackPoints()));
6279 $a_xml_writer->xmlEndTag("qtimetadatafield");
6280
6281 // followup question previous answer freezing
6282 $a_xml_writer->xmlStartTag("qtimetadatafield");
6283 $a_xml_writer->xmlElement("fieldlabel", null, "follow_qst_answer_fixation");
6284 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->isFollowupQuestionAnswerFixationEnabled());
6285 $a_xml_writer->xmlEndTag("qtimetadatafield");
6286
6287 // instant response answer freezing
6288 $a_xml_writer->xmlStartTag("qtimetadatafield");
6289 $a_xml_writer->xmlElement("fieldlabel", null, "instant_feedback_answer_fixation");
6290 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->isInstantFeedbackAnswerFixationEnabled());
6291 $a_xml_writer->xmlEndTag("qtimetadatafield");
6292
6293 // instant response forced
6294 $a_xml_writer->xmlStartTag("qtimetadatafield");
6295 $a_xml_writer->xmlElement("fieldlabel", null, "force_instant_feedback");
6296 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->isForceInstantFeedbackEnabled());
6297 $a_xml_writer->xmlEndTag("qtimetadatafield");
6298
6299
6300 // highscore
6301 $highscore_metadata = array(
6302 'highscore_enabled' => array('value' => $this->getHighscoreEnabled()),
6303 'highscore_anon' => array('value' => $this->getHighscoreAnon()),
6304 'highscore_achieved_ts' => array('value' => $this->getHighscoreAchievedTS()),
6305 'highscore_score' => array('value' => $this->getHighscoreScore()),
6306 'highscore_percentage' => array('value' => $this->getHighscorePercentage()),
6307 'highscore_hints' => array('value' => $this->getHighscoreHints()),
6308 'highscore_wtime' => array('value' => $this->getHighscoreWTime()),
6309 'highscore_own_table' => array('value' => $this->getHighscoreOwnTable()),
6310 'highscore_top_table' => array('value' => $this->getHighscoreTopTable()),
6311 'highscore_top_num' => array('value' => $this->getHighscoreTopNum()),
6312 );
6313 foreach ($highscore_metadata as $label => $data) {
6314 $a_xml_writer->xmlStartTag("qtimetadatafield");
6315 $a_xml_writer->xmlElement("fieldlabel", null, $label);
6316 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $data['value']));
6317 $a_xml_writer->xmlEndTag("qtimetadatafield");
6318 }
6319
6320 // show cancel
6321 $a_xml_writer->xmlStartTag("qtimetadatafield");
6322 $a_xml_writer->xmlElement("fieldlabel", null, "show_cancel");
6323 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getShowCancel()));
6324 $a_xml_writer->xmlEndTag("qtimetadatafield");
6325
6326 // show marker
6327 $a_xml_writer->xmlStartTag("qtimetadatafield");
6328 $a_xml_writer->xmlElement("fieldlabel", null, "show_marker");
6329 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getShowMarker()));
6330 $a_xml_writer->xmlEndTag("qtimetadatafield");
6331
6332 // fixed participants
6333 $a_xml_writer->xmlStartTag("qtimetadatafield");
6334 $a_xml_writer->xmlElement("fieldlabel", null, "fixed_participants");
6335 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getFixedParticipants()));
6336 $a_xml_writer->xmlEndTag("qtimetadatafield");
6337
6338 // show final statement
6339 $a_xml_writer->xmlStartTag("qtimetadatafield");
6340 $a_xml_writer->xmlElement("fieldlabel", null, "showfinalstatement");
6341 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", (($this->getShowFinalStatement()) ? "1" : "0")));
6342 $a_xml_writer->xmlEndTag("qtimetadatafield");
6343
6344 // show introduction only
6345 $a_xml_writer->xmlStartTag("qtimetadatafield");
6346 $a_xml_writer->xmlElement("fieldlabel", null, "showinfo");
6347 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", (($this->getShowInfo()) ? "1" : "0")));
6348 $a_xml_writer->xmlEndTag("qtimetadatafield");
6349
6350 // mail notification
6351 $a_xml_writer->xmlStartTag("qtimetadatafield");
6352 $a_xml_writer->xmlElement("fieldlabel", null, "mailnotification");
6353 $a_xml_writer->xmlElement("fieldentry", null, $this->getMailNotification());
6354 $a_xml_writer->xmlEndTag("qtimetadatafield");
6355
6356 // mail notification type
6357 $a_xml_writer->xmlStartTag("qtimetadatafield");
6358 $a_xml_writer->xmlElement("fieldlabel", null, "mailnottype");
6359 $a_xml_writer->xmlElement("fieldentry", null, $this->getMailNotificationType());
6360 $a_xml_writer->xmlEndTag("qtimetadatafield");
6361
6362 // export settings
6363 $a_xml_writer->xmlStartTag("qtimetadatafield");
6364 $a_xml_writer->xmlElement("fieldlabel", null, "exportsettings");
6365 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getExportSettings());
6366 $a_xml_writer->xmlEndTag("qtimetadatafield");
6367
6368 // force JavaScript
6369 $a_xml_writer->xmlStartTag("qtimetadatafield");
6370 $a_xml_writer->xmlElement("fieldlabel", null, "forcejs");
6371 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", (($this->getForceJS()) ? "1" : "0")));
6372 $a_xml_writer->xmlEndTag("qtimetadatafield");
6373
6374 // custom style
6375 $a_xml_writer->xmlStartTag("qtimetadatafield");
6376 $a_xml_writer->xmlElement("fieldlabel", null, "customstyle");
6377 $a_xml_writer->xmlElement("fieldentry", null, $this->getCustomStyle());
6378 $a_xml_writer->xmlEndTag("qtimetadatafield");
6379
6380 // shuffle questions
6381 $a_xml_writer->xmlStartTag("qtimetadatafield");
6382 $a_xml_writer->xmlElement("fieldlabel", null, "shuffle_questions");
6383 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getShuffleQuestions()));
6384 $a_xml_writer->xmlEndTag("qtimetadatafield");
6385
6386 // processing time
6387 $a_xml_writer->xmlStartTag("qtimetadatafield");
6388 $a_xml_writer->xmlElement("fieldlabel", null, "processing_time");
6389 $a_xml_writer->xmlElement("fieldentry", null, $this->getProcessingTime());
6390 $a_xml_writer->xmlEndTag("qtimetadatafield");
6391
6392 // enable_examview
6393 $a_xml_writer->xmlStartTag("qtimetadatafield");
6394 $a_xml_writer->xmlElement("fieldlabel", null, "enable_examview");
6395 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getEnableExamview());
6396 $a_xml_writer->xmlEndTag("qtimetadatafield");
6397
6398 // show_examview_html
6399 $a_xml_writer->xmlStartTag("qtimetadatafield");
6400 $a_xml_writer->xmlElement("fieldlabel", null, "show_examview_html");
6401 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getShowExamviewHtml());
6402 $a_xml_writer->xmlEndTag("qtimetadatafield");
6403
6404 // show_examview_pdf
6405 $a_xml_writer->xmlStartTag("qtimetadatafield");
6406 $a_xml_writer->xmlElement("fieldlabel", null, "show_examview_pdf");
6407 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getShowExamviewPdf());
6408 $a_xml_writer->xmlEndTag("qtimetadatafield");
6409
6410 // enable_archiving
6411 $a_xml_writer->xmlStartTag("qtimetadatafield");
6412 $a_xml_writer->xmlElement("fieldlabel", null, "enable_archiving");
6413 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getEnableArchiving());
6414 $a_xml_writer->xmlEndTag("qtimetadatafield");
6415
6416 // sign_submission
6417 $a_xml_writer->xmlStartTag("qtimetadatafield");
6418 $a_xml_writer->xmlElement("fieldlabel", null, "sign_submission");
6419 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getSignSubmission());
6420 $a_xml_writer->xmlEndTag("qtimetadatafield");
6421
6422 // char_selector_availability
6423 $a_xml_writer->xmlStartTag("qtimetadatafield");
6424 $a_xml_writer->xmlElement("fieldlabel", null, "char_selector_availability");
6425 $a_xml_writer->xmlElement("fieldentry", null, sprintf("%d", $this->getCharSelectorAvailability()));
6426 $a_xml_writer->xmlEndTag("qtimetadatafield");
6427
6428 // char_selector_definition
6429 $a_xml_writer->xmlStartTag("qtimetadatafield");
6430 $a_xml_writer->xmlElement("fieldlabel", null, "char_selector_definition");
6431 $a_xml_writer->xmlElement("fieldentry", null, $this->getCharSelectorDefinition());
6432 $a_xml_writer->xmlEndTag("qtimetadatafield");
6433
6434 // skill_service
6435 $a_xml_writer->xmlStartTag("qtimetadatafield");
6436 $a_xml_writer->xmlElement("fieldlabel", null, "skill_service");
6437 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->isSkillServiceEnabled());
6438 $a_xml_writer->xmlEndTag("qtimetadatafield");
6439
6440 // result_tax_filters
6441 $a_xml_writer->xmlStartTag("qtimetadatafield");
6442 $a_xml_writer->xmlElement("fieldlabel", null, "result_tax_filters");
6443 $a_xml_writer->xmlElement("fieldentry", null, serialize((array) $this->getResultFilterTaxIds()));
6444 $a_xml_writer->xmlEndTag("qtimetadatafield");
6445
6446 // show_grading_status
6447 $a_xml_writer->xmlStartTag("qtimetadatafield");
6448 $a_xml_writer->xmlElement("fieldlabel", null, "show_grading_status");
6449 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->isShowGradingStatusEnabled());
6450 $a_xml_writer->xmlEndTag("qtimetadatafield");
6451
6452 // show_grading_mark
6453 $a_xml_writer->xmlStartTag("qtimetadatafield");
6454 $a_xml_writer->xmlElement("fieldlabel", null, "show_grading_mark");
6455 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->isShowGradingMarkEnabled());
6456 $a_xml_writer->xmlEndTag("qtimetadatafield");
6457
6458
6459 // starting time
6460 if ($this->getStartingTime()) {
6461 $a_xml_writer->xmlStartTag("qtimetadatafield");
6462 $a_xml_writer->xmlElement("fieldlabel", null, "starting_time");
6463 $backward_compatibility_format = $this->buildIso8601PeriodFromUnixtimeForExportCompatibility($this->starting_time);
6464 $a_xml_writer->xmlElement("fieldentry", null, $backward_compatibility_format);
6465 $a_xml_writer->xmlEndTag("qtimetadatafield");
6466 }
6467 // ending time
6468 if ($this->getEndingTime()) {
6469 $a_xml_writer->xmlStartTag("qtimetadatafield");
6470 $a_xml_writer->xmlElement("fieldlabel", null, "ending_time");
6471 $backward_compatibility_format = $this->buildIso8601PeriodFromUnixtimeForExportCompatibility($this->ending_time);
6472 $a_xml_writer->xmlElement("fieldentry", null, $backward_compatibility_format);
6473 $a_xml_writer->xmlEndTag("qtimetadatafield");
6474 }
6475
6476
6477 //activation_limited
6478 $a_xml_writer->xmlStartTag("qtimetadatafield");
6479 $a_xml_writer->xmlElement("fieldlabel", null, "activation_limited");
6480 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->isActivationLimited());
6481 $a_xml_writer->xmlEndTag("qtimetadatafield");
6482
6483 //activation_start_time
6484 $a_xml_writer->xmlStartTag("qtimetadatafield");
6485 $a_xml_writer->xmlElement("fieldlabel", null, "activation_start_time");
6486 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getActivationStartingTime());
6487 $a_xml_writer->xmlEndTag("qtimetadatafield");
6488
6489 //activation_end_time
6490 $a_xml_writer->xmlStartTag("qtimetadatafield");
6491 $a_xml_writer->xmlElement("fieldlabel", null, "activation_end_time");
6492 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getActivationEndingTime());
6493 $a_xml_writer->xmlEndTag("qtimetadatafield");
6494
6495 //activation_visibility
6496 $a_xml_writer->xmlStartTag("qtimetadatafield");
6497 $a_xml_writer->xmlElement("fieldlabel", null, "activation_visibility");
6498 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getActivationVisibility());
6499 $a_xml_writer->xmlEndTag("qtimetadatafield");
6500
6501 // autosave
6502 $a_xml_writer->xmlStartTag("qtimetadatafield");
6503 $a_xml_writer->xmlElement("fieldlabel", null, "autosave");
6504 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getAutosave());
6505 $a_xml_writer->xmlEndTag("qtimetadatafield");
6506
6507 // autosave_ival
6508 $a_xml_writer->xmlStartTag("qtimetadatafield");
6509 $a_xml_writer->xmlElement("fieldlabel", null, "autosave_ival");
6510 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getAutosaveIval());
6511 $a_xml_writer->xmlEndTag("qtimetadatafield");
6512
6513 //offer_question_hints
6514 $a_xml_writer->xmlStartTag("qtimetadatafield");
6515 $a_xml_writer->xmlElement("fieldlabel", null, "offer_question_hints");
6516 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->isOfferingQuestionHintsEnabled());
6517 $a_xml_writer->xmlEndTag("qtimetadatafield");
6518
6519 //instant_feedback_specific
6520 $a_xml_writer->xmlStartTag("qtimetadatafield");
6521 $a_xml_writer->xmlElement("fieldlabel", null, "instant_feedback_specific");
6522 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getSpecificAnswerFeedback());
6523 $a_xml_writer->xmlEndTag("qtimetadatafield");
6524
6525 //instant_feedback_answer_fixation
6526 $a_xml_writer->xmlStartTag("qtimetadatafield");
6527 $a_xml_writer->xmlElement("fieldlabel", null, "instant_feedback_answer_fixation");
6528 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->isInstantFeedbackAnswerFixationEnabled());
6529 $a_xml_writer->xmlEndTag("qtimetadatafield");
6530
6531 //obligations_enabled
6532 $a_xml_writer->xmlStartTag("qtimetadatafield");
6533 $a_xml_writer->xmlElement("fieldlabel", null, "obligations_enabled");
6534 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->areObligationsEnabled());
6535 $a_xml_writer->xmlEndTag("qtimetadatafield");
6536
6537 //enable_processing_time
6538 $a_xml_writer->xmlStartTag("qtimetadatafield");
6539 $a_xml_writer->xmlElement("fieldlabel", null, "enable_processing_time");
6540 $a_xml_writer->xmlElement("fieldentry", null, (int) $this->getEnableProcessingTime());
6541 $a_xml_writer->xmlEndTag("qtimetadatafield");
6542
6543 foreach ($this->mark_schema->mark_steps as $index => $mark) {
6544 // mark steps
6545 $a_xml_writer->xmlStartTag("qtimetadatafield");
6546 $a_xml_writer->xmlElement("fieldlabel", null, "mark_step_$index");
6547 $a_xml_writer->xmlElement("fieldentry", null, sprintf(
6548 "<short>%s</short><official>%s</official><percentage>%.2f</percentage><passed>%d</passed>",
6549 $mark->getShortName(),
6550 $mark->getOfficialName(),
6551 $mark->getMinimumLevel(),
6552 $mark->getPassed()
6553 ));
6554 $a_xml_writer->xmlEndTag("qtimetadatafield");
6555 }
6556 $a_xml_writer->xmlEndTag("qtimetadata");
6557
6558 // add qti objectives
6559 $a_xml_writer->xmlStartTag("objectives");
6560 $this->addQTIMaterial($a_xml_writer, $this->getIntroduction());
6561 $a_xml_writer->xmlEndTag("objectives");
6562
6563 // add qti assessmentcontrol
6564 if ($this->getInstantFeedbackSolution() == 1) {
6565 $attrs = array(
6566 "solutionswitch" => "Yes"
6567 );
6568 } else {
6569 $attrs = null;
6570 }
6571 $a_xml_writer->xmlElement("assessmentcontrol", $attrs, null);
6572
6573 if (strlen($this->getFinalStatement())) {
6574 // add qti presentation_material
6575 $a_xml_writer->xmlStartTag("presentation_material");
6576 $a_xml_writer->xmlStartTag("flow_mat");
6577 $this->addQTIMaterial($a_xml_writer, $this->getFinalStatement());
6578 $a_xml_writer->xmlEndTag("flow_mat");
6579 $a_xml_writer->xmlEndTag("presentation_material");
6580 }
6581
6582 $attrs = array(
6583 "ident" => "1"
6584 );
6585 $a_xml_writer->xmlElement("section", $attrs, null);
6586 $a_xml_writer->xmlEndTag("assessment");
6587 $a_xml_writer->xmlEndTag("questestinterop");
6588
6589 $xml = $a_xml_writer->xmlDumpMem(false);
6590 return $xml;
6591 }
buildIso8601PeriodFromUnixtimeForExportCompatibility($unix_timestamp)
addQTIMaterial(&$a_xml_writer, $a_material='')
Creates a QTI material tag from a plain text or xhtml text.
getDescription()
get object description
XML writer class.
xmlHeader()
Writes xml header @access public.

References $data, $index, $xml, addQTIMaterial(), areObligationsEnabled(), buildIso8601PeriodFromUnixtimeForExportCompatibility(), getActivationEndingTime(), getActivationStartingTime(), getActivationVisibility(), getAllowedUsers(), getAllowedUsersTimeGap(), getAnonymity(), getAnswerFeedback(), getAnswerFeedbackPoints(), getAuthor(), getAutosave(), getAutosaveIval(), getCharSelectorAvailability(), getCharSelectorDefinition(), getCountSystem(), getCustomStyle(), ilObject\getDescription(), getEnableArchiving(), getEnableExamview(), getEnableProcessingTime(), getEndingTime(), getExportSettings(), getFinalStatement(), getFixedParticipants(), getForceJS(), getHighscoreAchievedTS(), getHighscoreAnon(), getHighscoreEnabled(), getHighscoreHints(), getHighscoreOwnTable(), getHighscorePercentage(), getHighscoreScore(), getHighscoreTopNum(), getHighscoreTopTable(), getHighscoreWTime(), getInstantFeedbackSolution(), getIntroduction(), getKiosk(), getListOfQuestionsSettings(), getMailNotification(), getMailNotificationType(), getMCScoring(), getNrOfTries(), getPassScoring(), getPassWaiting(), getPassword(), getPoolUsage(), getProcessingTime(), getQuestionSetType(), getRedirectionMode(), getRedirectionUrl(), getReportingDate(), getResetProcessingTime(), getResultFilterTaxIds(), getResultsPresentation(), getScoreCutting(), getScoreReporting(), getSequenceSettings(), getShowCancel(), getShowExamviewHtml(), getShowExamviewPdf(), getShowFinalStatement(), getShowInfo(), getShowMarker(), getShowSolutionDetails(), getShuffleQuestions(), getSignSubmission(), getSpecificAnswerFeedback(), getStartingTime(), getTestId(), ilObject\getTitle(), getTitleOutput(), getUsePreviousAnswers(), IL_INST_ID, isActivationLimited(), isBestSolutionPrintedWithResult(), isBlockPassesAfterPassedEnabled(), isFollowupQuestionAnswerFixationEnabled(), isForceInstantFeedbackEnabled(), isInstantFeedbackAnswerFixationEnabled(), isOfferingQuestionHintsEnabled(), isPassDeletionAllowed(), isShowExamIdInTestPassEnabled(), isShowExamIdInTestResultsEnabled(), isShowGradingMarkEnabled(), isShowGradingStatusEnabled(), isSkillServiceEnabled(), and ilXmlWriter\xmlHeader().

+ Here is the call graph for this function:

◆ update()

ilObjTest::update ( )

update object data

@access public

Returns
boolean

Reimplemented from ilObject.

Definition at line 762 of file class.ilObjTest.php.

763 {
764 if (!parent::update()) {
765 return false;
766 }
767
768 // put here object specific stuff
769 $this->updateMetaData();
770 return true;
771 }
updateMetaData()
update meta data entry

References ilObject\updateMetaData().

+ Here is the call graph for this function:

◆ updateWorkingTime()

ilObjTest::updateWorkingTime (   $times_id)

Update the working time of a test when a question is answered.

Parameters
integer$times_idThe database id of a working time entry @access public

Definition at line 3838 of file class.ilObjTest.php.

3839 {
3840 global $DIC;
3841 $ilDB = $DIC['ilDB'];
3842
3843 $affectedRows = $ilDB->manipulateF(
3844 "UPDATE tst_times SET finished = %s, tstamp = %s WHERE times_id = %s",
3845 array('timestamp', 'integer', 'integer'),
3846 array(strftime("%Y-%m-%d %H:%M:%S"), time(), $times_id)
3847 );
3848 }

References $DIC, and $ilDB.

◆ userLookupFullName()

ilObjTest::userLookupFullName (   $user_id,
  $overwrite_anonymity = false,
  $sorted_order = false,
  $suffix = "" 
)

Returns the full name of a test user according to the anonymity status.

Parameters
int$user_idThe database ID of the user
boolean$overwrite_anonymityIndicates if the anonymity status should be ignored
Returns
string The full name of the user or UNKNOWN if the anonymity status is affected @access public
Deprecated:
: use ilTestParticipantData instead

Definition at line 9571 of file class.ilObjTest.php.

9572 {
9573 if ($this->getAnonymity() && !$overwrite_anonymity) {
9574 return $this->lng->txt("anonymous") . $suffix;
9575 } else {
9576 include_once './Services/User/classes/class.ilObjUser.php';
9577 $uname = ilObjUser::_lookupName($user_id);
9578 if (strlen($uname["firstname"] . $uname["lastname"]) == 0) {
9579 $uname["firstname"] = $this->lng->txt("deleted_user");
9580 }
9581 if ($sorted_order) {
9582 return trim($uname["lastname"] . ", " . $uname["firstname"]) . $suffix;
9583 } else {
9584 return trim($uname["firstname"] . " " . $uname["lastname"]) . $suffix;
9585 }
9586 }
9587 }
static _lookupName($a_user_id)
lookup user name

References ilObjUser\_lookupName(), and getAnonymity().

Referenced by sendAdvancedNotification(), and sendSimpleNotification().

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

Field Documentation

◆ $_customStyle

ilObjTest::$_customStyle
private

Definition at line 456 of file class.ilObjTest.php.

◆ $_finalstatement

ilObjTest::$_finalstatement
private

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

◆ $_forcejs

ilObjTest::$_forcejs = true
private

Definition at line 449 of file class.ilObjTest.php.

◆ $_kiosk

ilObjTest::$_kiosk
protected

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

◆ $_showfinalstatement

ilObjTest::$_showfinalstatement
private

Definition at line 428 of file class.ilObjTest.php.

◆ $_showinfo

ilObjTest::$_showinfo
private

Definition at line 442 of file class.ilObjTest.php.

◆ $accessFilteredParticipantList

ilObjTest::$accessFilteredParticipantList
protected

◆ $activation_ending_time

ilObjTest::$activation_ending_time
protected

Definition at line 493 of file class.ilObjTest.php.

◆ $activation_starting_time

ilObjTest::$activation_starting_time
protected

Definition at line 491 of file class.ilObjTest.php.

◆ $activation_visibility

ilObjTest::$activation_visibility
protected

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

Referenced by getActivationVisibility().

◆ $allowedUsers

ilObjTest::$allowedUsers
protected

Definition at line 358 of file class.ilObjTest.php.

◆ $allowedUsersTimeGap

ilObjTest::$allowedUsersTimeGap
protected

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

◆ $anonymity

ilObjTest::$anonymity

Definition at line 379 of file class.ilObjTest.php.

◆ $answer_feedback

ilObjTest::$answer_feedback

Definition at line 407 of file class.ilObjTest.php.

Referenced by setAnswerFeedback().

◆ $answer_feedback_points

ilObjTest::$answer_feedback_points

Definition at line 174 of file class.ilObjTest.php.

Referenced by setAnswerFeedbackPoints().

◆ $author

ilObjTest::$author

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

Referenced by _lookupAuthor(), getAuthor(), and setAuthor().

◆ $autosave

ilObjTest::$autosave
protected

Definition at line 495 of file class.ilObjTest.php.

Referenced by getAutosave(), and setAutosave().

◆ $autosave_ival

ilObjTest::$autosave_ival
protected

Definition at line 497 of file class.ilObjTest.php.

Referenced by getAutosaveIval(), and setAutosaveIval().

◆ $blockPassesAfterPassedEnabled

ilObjTest::$blockPassesAfterPassedEnabled = false
protected

◆ $certificate_visibility

ilObjTest::$certificate_visibility

Definition at line 372 of file class.ilObjTest.php.

◆ $char_selector_availability

ilObjTest::$char_selector_availability
protected

Definition at line 546 of file class.ilObjTest.php.

Referenced by getCharSelectorAvailability().

◆ $char_selector_definition

ilObjTest::$char_selector_definition
protected

Definition at line 549 of file class.ilObjTest.php.

Referenced by getCharSelectorDefinition().

◆ $count_system

ilObjTest::$count_system

Definition at line 291 of file class.ilObjTest.php.

◆ $ects_fx

ilObjTest::$ects_fx = null
protected

Definition at line 276 of file class.ilObjTest.php.

◆ $ects_grades

ilObjTest::$ects_grades = array()
protected

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

Referenced by getECTSGrades().

◆ $ects_output

ilObjTest::$ects_output = false
protected

Definition at line 270 of file class.ilObjTest.php.

◆ $enable_archiving

ilObjTest::$enable_archiving
protected

Definition at line 524 of file class.ilObjTest.php.

Referenced by getEnableArchiving(), and setEnableArchiving().

◆ $enable_examview

ilObjTest::$enable_examview
protected

Definition at line 515 of file class.ilObjTest.php.

Referenced by getEnableExamview(), and setEnableExamview().

◆ $enable_processing_time

ilObjTest::$enable_processing_time

Definition at line 233 of file class.ilObjTest.php.

◆ $ending_time

ilObjTest::$ending_time
protected

Definition at line 264 of file class.ilObjTest.php.

Referenced by setActivationEndingTime(), and setEndingTime().

◆ $ending_time_enabled

ilObjTest::$ending_time_enabled
protected

Definition at line 257 of file class.ilObjTest.php.

Referenced by isEndingTimeEnabled(), and setEndingTimeEnabled().

◆ $evaluation_data

ilObjTest::$evaluation_data

Definition at line 191 of file class.ilObjTest.php.

◆ $exportsettings

ilObjTest::$exportsettings
protected

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

Referenced by getExportSettings().

◆ $fixed_participants

ilObjTest::$fixed_participants

Definition at line 400 of file class.ilObjTest.php.

◆ $followupQuestionAnswerFixationEnabled

ilObjTest::$followupQuestionAnswerFixationEnabled
protected

◆ $forceInstantFeedbackEnabled

ilObjTest::$forceInstantFeedbackEnabled
protected

◆ $instant_verification

ilObjTest::$instant_verification

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

◆ $instantFeedbackAnswerFixationEnabled

ilObjTest::$instantFeedbackAnswerFixationEnabled
protected

◆ $introduction

ilObjTest::$introduction
protected

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

Referenced by setIntroduction().

◆ $introductionEnabled

ilObjTest::$introductionEnabled
protected

Definition at line 123 of file class.ilObjTest.php.

Referenced by isIntroductionEnabled(), and setIntroductionEnabled().

◆ $invitation

ilObjTest::$invitation = INVITATION_OFF

Definition at line 96 of file class.ilObjTest.php.

◆ $isSkillManagementGloballyActivated

ilObjTest::$isSkillManagementGloballyActivated = null
staticprivate

Definition at line 12068 of file class.ilObjTest.php.

Referenced by isSkillManagementGloballyActivated().

◆ $limitUsersEnabled

ilObjTest::$limitUsersEnabled
protected

Definition at line 351 of file class.ilObjTest.php.

Referenced by isLimitUsersEnabled(), and setLimitUsersEnabled().

◆ $mailnotification

ilObjTest::$mailnotification
protected

Definition at line 458 of file class.ilObjTest.php.

Referenced by getMailNotification().

◆ $mailnottype

ilObjTest::$mailnottype
protected

Definition at line 460 of file class.ilObjTest.php.

Referenced by getMailNotificationType().

◆ $mark_schema

ilObjTest::$mark_schema

Definition at line 138 of file class.ilObjTest.php.

Referenced by getMarkSchema().

◆ $mc_scoring

ilObjTest::$mc_scoring

Definition at line 298 of file class.ilObjTest.php.

◆ $metadata

ilObjTest::$metadata

Definition at line 111 of file class.ilObjTest.php.

Referenced by fromXML().

◆ $nr_of_tries

ilObjTest::$nr_of_tries

Definition at line 199 of file class.ilObjTest.php.

Referenced by setNrOfTries().

◆ $obligationsEnabled

ilObjTest::$obligationsEnabled = null
private

Definition at line 487 of file class.ilObjTest.php.

Referenced by areObligationsEnabled(), and setObligationsEnabled().

◆ $offeringQuestionHintsEnabled

ilObjTest::$offeringQuestionHintsEnabled = null
private

◆ $oldOnlineStatus

ilObjTest::$oldOnlineStatus = null
protected

Definition at line 468 of file class.ilObjTest.php.

Referenced by getOldOnlineStatus(), and setOldOnlineStatus().

◆ $participantDataExist

ilObjTest::$participantDataExist = null
private

holds the fact wether participant data exists or not DO NOT USE TIS PROPERTY DRIRECTLY ALWAYS USE ilObjTest::paricipantDataExist() since this method initialises this property

Definition at line 512 of file class.ilObjTest.php.

Referenced by participantDataExist().

◆ $pass_scoring

ilObjTest::$pass_scoring

Definition at line 305 of file class.ilObjTest.php.

◆ $pass_waiting

ilObjTest::$pass_waiting = "00:000:00:00:00"
protected

Definition at line 589 of file class.ilObjTest.php.

Referenced by getPassWaiting(), and setPassWaiting().

◆ $passDeletionAllowed

ilObjTest::$passDeletionAllowed = null
private

Definition at line 505 of file class.ilObjTest.php.

Referenced by isPassDeletionAllowed(), and setPassDeletionAllowed().

◆ $password

ilObjTest::$password
protected

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

◆ $passwordEnabled

ilObjTest::$passwordEnabled
protected

Definition at line 339 of file class.ilObjTest.php.

Referenced by isPasswordEnabled(), and setPasswordEnabled().

◆ $poolUsage

ilObjTest::$poolUsage
protected

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

Referenced by getPoolUsage().

◆ $print_best_solution_with_result

ilObjTest::$print_best_solution_with_result = true
protected

Definition at line 473 of file class.ilObjTest.php.

Referenced by isBestSolutionPrintedWithResult().

◆ $processing_time

ilObjTest::$processing_time

Definition at line 226 of file class.ilObjTest.php.

Referenced by isMaxProcessingTimeReached(), and setProcessingTime().

◆ $questions

ilObjTest::$questions

◆ $questionSetType

ilObjTest::$questionSetType = self::QUESTION_SET_TYPE_FIXED
private

◆ $redirection_mode

ilObjTest::$redirection_mode = 0
private

Definition at line 529 of file class.ilObjTest.php.

Referenced by getRedirectionMode(), and setRedirectionMode().

◆ $redirection_url

ilObjTest::$redirection_url = null
private

Definition at line 534 of file class.ilObjTest.php.

Referenced by getRedirectionUrl(), and setRedirectionUrl().

◆ $reporting_date

ilObjTest::$reporting_date

Definition at line 184 of file class.ilObjTest.php.

Referenced by setReportingDate().

◆ $reset_processing_time

ilObjTest::$reset_processing_time

Definition at line 240 of file class.ilObjTest.php.

◆ $resultFilterTaxIds

ilObjTest::$resultFilterTaxIds = array()
private

Definition at line 73 of file class.ilObjTest.php.

Referenced by getResultFilterTaxIds(), and setResultFilterTaxIds().

◆ $results_presentation

ilObjTest::$results_presentation

Definition at line 320 of file class.ilObjTest.php.

◆ $score_cutting

ilObjTest::$score_cutting

Definition at line 334 of file class.ilObjTest.php.

◆ $score_reporting

ilObjTest::$score_reporting

Definition at line 158 of file class.ilObjTest.php.

Referenced by setScoreReporting().

◆ $sequence_settings

ilObjTest::$sequence_settings

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

Referenced by setSequenceSettings().

◆ $show_cancel

ilObjTest::$show_cancel

Definition at line 386 of file class.ilObjTest.php.

◆ $show_exam_id_in_test_pass_enabled

bool ilObjTest::$show_exam_id_in_test_pass_enabled
protected

◆ $show_exam_id_in_test_results_enabled

bool ilObjTest::$show_exam_id_in_test_results_enabled
protected

◆ $show_examview_html

ilObjTest::$show_examview_html
protected

Definition at line 518 of file class.ilObjTest.php.

Referenced by getShowExamviewHtml(), and setShowExamviewHtml().

◆ $show_examview_pdf

ilObjTest::$show_examview_pdf
protected

Definition at line 521 of file class.ilObjTest.php.

Referenced by getShowExamviewPdf(), and setShowExamviewPdf().

◆ $show_marker

ilObjTest::$show_marker

Definition at line 393 of file class.ilObjTest.php.

◆ $show_summary

ilObjTest::$show_summary

Definition at line 327 of file class.ilObjTest.php.

◆ $showGradingMarkEnabled

ilObjTest::$showGradingMarkEnabled
protected

Definition at line 559 of file class.ilObjTest.php.

Referenced by isShowGradingMarkEnabled(), and setShowGradingMarkEnabled().

◆ $showGradingStatusEnabled

ilObjTest::$showGradingStatusEnabled
protected

Definition at line 554 of file class.ilObjTest.php.

Referenced by isShowGradingStatusEnabled(), and setShowGradingStatusEnabled().

◆ $shuffle_questions

ilObjTest::$shuffle_questions

Definition at line 313 of file class.ilObjTest.php.

◆ $sign_submission

bool ilObjTest::$sign_submission
protected

Definition at line 543 of file class.ilObjTest.php.

Referenced by getSignSubmission(), and setSignSubmission().

◆ $skillServiceEnabled

ilObjTest::$skillServiceEnabled = false
private

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

Referenced by isSkillServiceEnabled(), and setSkillServiceEnabled().

◆ $starting_time

ilObjTest::$starting_time
protected

◆ $starting_time_enabled

ilObjTest::$starting_time_enabled
protected

Definition at line 245 of file class.ilObjTest.php.

Referenced by isStartingTimeEnabled(), and setStartingTimeEnabled().

◆ $template_id

ilObjTest::$template_id
private

Definition at line 466 of file class.ilObjTest.php.

Referenced by getTemplate(), and setTemplate().

◆ $test_id

◆ $testFinalBroken

ilObjTest::$testFinalBroken
protected

Definition at line 579 of file class.ilObjTest.php.

Referenced by isTestFinalBroken(), and setTestFinalBroken().

◆ $testSequence

◆ $testSession

◆ $title_output

ilObjTest::$title_output

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

Referenced by setTitleOutput().

◆ $tmpCopyWizardCopyId

ilObjTest::$tmpCopyWizardCopyId
private

Definition at line 584 of file class.ilObjTest.php.

Referenced by getTmpCopyWizardCopyId(), and setTmpCopyWizardCopyId().

◆ $use_previous_answers

ilObjTest::$use_previous_answers

Definition at line 209 of file class.ilObjTest.php.

Referenced by _getUsePreviousAnswers(), and setUsePreviousAnswers().

◆ DEFAULT_PROCESSING_TIME_MINUTES

const ilObjTest::DEFAULT_PROCESSING_TIME_MINUTES = 90

Definition at line 24 of file class.ilObjTest.php.

Referenced by getProcessingTimeAsMinutes().

◆ HIGHSCORE_SHOW_ALL_TABLES

◆ HIGHSCORE_SHOW_OWN_TABLE

◆ HIGHSCORE_SHOW_TOP_TABLE

◆ QUESTION_SET_TYPE_DYNAMIC

◆ QUESTION_SET_TYPE_FIXED

◆ QUESTION_SET_TYPE_RANDOM

◆ SCORE_REPORTING_AFTER_PASSED

◆ SCORE_REPORTING_DATE

◆ SCORE_REPORTING_DISABLED

const ilObjTest::SCORE_REPORTING_DISABLED = 0

◆ SCORE_REPORTING_FINISHED

◆ SCORE_REPORTING_IMMIDIATLY


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