ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 create ($a_upload=false)
 create test object More...
 
 update ()
 update object data More...
 
 read ($a_force_db=false)
 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...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event happend, each object may decide how it reacts. 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...
 
 _setImportDirectory ($a_import_dir=null)
 set import directory More...
 
 _getImportDirectory ()
 Get the import directory location of the test. More...
 
 getImportDirectory ()
 
 _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...
 
 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...
 
 getCustomStyles ()
 Return the available custom styles. More...
 
 getTestStyleLocation ($mode="output")
 get full style sheet file name (path inclusive) of current user 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 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...
 
 _getCountSystem ($active_id)
 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...
 
 _getPassScoring ($active_id)
 Gets the pass scoring type. More...
 
 _getMCScoring ($active_id)
 Gets the scoring type for multiple choice questions. More...
 
 _getScoreCutting ($active_id)
 Determines if the score of a question should be cut at 0 points or the score of the whole test. More...
 
 getReportingDate ()
 Gets the reporting date of the ilObjTest object. More...
 
 getNrOfTries ()
 Returns the nr of tries for the test. More...
 
 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...
 
 _getUsePreviousAnswers ($active_id, $user_active_user_setting=false)
 Returns if the previous results should be hidden for a learner. More...
 
 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...
 
 removeQuestion ($question_id)
 Removes a question from the test object. More...
 
 removeAllTestEditings ($question_id="")
 Removes all references to the question in executed tests in case the question has been changed. More...
 
 removeTestResults (ilTestParticipantData $participantData)
 
 removeTestResultsByUserIds ($userIds)
 
 removeTestResultsByActiveIds ($activeIds)
 
 removeTestActives ($activeIds)
 
 removeTestResultsForUser ($user_id)
 
 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)
 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...
 
 _getActiveIdOfUser ($user_id="", $test_id="")
 Gets the active id of the tst_active table for the active user. More...
 
 pcArrayShuffle ($array)
 Shuffles the values of a given array. More...
 
getTestResult ($active_id, $pass=NULL, $ordered_sequence=FALSE)
 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...
 
 _getWorkingTimeOfParticipantForPass ($active_id, $pass)
 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...
 
 evalTotalFinished ()
 Returns the number of total finished tests. 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...
 
 _getQuestionCountAndPointsForPassOfParticipant ($active_id, $pass)
 
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 ()
 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...
 
_instanciateQuestion ($question_id)
 Creates an instance of a question with a given question id. 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...
 
getQuestionTypeTranslations ()
 
 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 ($a_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...
 
 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...
 
 _lookupAuthor ($obj_id)
 Gets the authors name of the ilObjTest object. More...
 
_getAvailableTests ($use_object_id=FALSE)
 Returns the available tests for the active user. More...
 
 getQuestionCount ()
 Returns the number of questions in the test. More...
 
 logAction ($logtext="", $question_id="")
 Logs an action into the Test&Assessment log. More...
 
 _getObjectIDFromTestID ($test_id)
 Returns the ILIAS test object id for a given test id. More...
 
 _getObjectIDFromActiveID ($active_id)
 Returns the ILIAS test object id for a given active id. More...
 
 _getTestIDFromObjectID ($object_id)
 Returns the ILIAS test id for a given object id. 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...
 
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)
 
 _getSolvedQuestions ($active_id, $question_fi=null)
 get solved questions More...
 
 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...
 
 _getPass ($active_id)
 Retrieves the actual pass of a given user for a given test. More...
 
 _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...
 
 _getBestPass ($active_id)
 Retrieves the best pass of a given user for a given test. More...
 
 _getResultPass ($active_id)
 Retrieves the pass number that should be counted for a given user. More...
 
 getAnsweredQuestionCount ($active_id, $pass=NULL)
 Retrieves the number of answered questions for a given user in a given test. More...
 
 getPassFinishDate ($active_id, $pass)
 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...
 
 canViewResults ()
 Returns true, if the test results can be viewed. More...
 
 canShowTestResults ($testSession, $user_id)
 
 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 ()
 
 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...
 
 _lookupAnonymity ($a_obj_id)
 Returns the anonymity status of a test with a given object id. 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...
 
 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...
 
 _lookupTestObjIdForQuestionId ($a_q_id)
 Get test Object ID for question ID. 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)
 
 createRandomSolutions ($number)
 
 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)
 
 setScoringFeedbackOptionsByArray ($options)
 
 setResultsPresentationOptionsByArray ($options)
 
 getPoolUsage ()
 
 setPoolUsage ($usage)
 
 setQuestionOrderAndObligations ($orders, $obligations)
 
 moveQuestionAfter ($question_to_move, $question_before)
 
 hasQuestionsWithoutQuestionpool ()
 
 getQuestions ()
 
 isOnline ()
 
 setOnline ($a_online=true)
 
 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 ()
 
 getTimeExtensionsOfParticipants ()
 
 getExtraTime ($active_id)
 
 addExtraTime ($active_id, $minutes)
 
 setEnableArchiving ($enable_archiving)
 
 getEnableArchiving ()
 
 lookupExamId ($active_id, $pass)
 
 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 ()
 
 isScoreReportingAvailable ()
 
 recalculateScores ($preserve_manscoring=false)
 
 setSkillServiceEnabled ($skillServiceEnabled)
 
 isSkillServiceEnabled ()
 
 setResultFilterTaxIds ($resultFilterTaxIds)
 
 getResultFilterTaxIds ()
 
 isSkillServiceToBeConsidered ()
 
 setShowGradingStatusEnabled ($showGradingStatusEnabled)
 
 isShowGradingStatusEnabled ()
 
 setShowGradingMarkEnabled ($showGradingMarkEnabled)
 
 isShowGradingMarkEnabled ()
 
 setInstantFeedbackAnswerFixationEnabled ($instantFeedbackAnswerFixationEnabled)
 
 isInstantFeedbackAnswerFixationEnabled ()
 
 isTestFinalBroken ()
 
 setTestFinalBroken ($testFinalBroken)
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title 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...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) 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...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type 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) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 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...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
- Public Member Functions inherited from ilMarkSchemaAware
 onMarkSchemaSaved ()
 
- Public Member Functions inherited from ilEctsGradesEnabled
 saveECTSStatus ()
 

Static Public Member Functions

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 _getUserIdFromActiveId ($active_id)
 
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 manual feedback for a question in a test. 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 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 (ilDB $db, $poolObjId)
 
static getTestObjIdsWithActiveForUserId ($userId)
 
static isSkillManagementGloballyActivated ()
 
static ensureParticipantsLastActivePassFinished ($testObjId, $userId, $a_force_new_run=FALSE)
 
static isParticipantsLastPassActive ($testObjId, $userId)
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data 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 hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. 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
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $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
 
 $obj_data_record
 object_data record More...
 

Protected Member Functions

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

Protected Attributes

 $_kiosk
 
 $introductionEnabled
 
 $introduction
 
 $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
 
 $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
 
 $instantFeedbackAnswerFixationEnabled
 
 $testFinalBroken
 

Private Attributes

 $questionSetType = self::QUESTION_SET_TYPE_FIXED
 
 $skillServiceEnabled = false
 
 $resultFilterTaxIds = array()
 
 $_showfinalstatement
 
 $_finalstatement
 
 $_showinfo
 
 $_forcejs = TRUE
 
 $_customStyle
 
 $template_id
 
 $online = null
 the object's online status More...
 
 $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
 

Static Private Attributes

static $isSkillManagementGloballyActivated = null
 

Detailed Description

Definition at line 19 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

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

References $ilUser, ilObject\$lng, COUNT_PARTIAL_SOLUTIONS, ilObject\ilObject(), REPORT_AFTER_TEST, SCORE_CUT_QUESTION, SCORE_LAST_PASS, SCORE_ZERO_POINTS_WHEN_UNANSWERED, setShowPassDetails(), setShowSolutionAnswersOnly(), setShowSolutionDetails(), setShowSolutionSignature(), and TEST_FIXED_SEQUENCE.

582  {
583  global $ilUser, $lng;
584  $this->type = "tst";
585 
586  $lng->loadLanguageModule("assessment");
587  // Defaults:
588  include_once "./Modules/Test/classes/class.assMarkSchema.php";
589  $this->mark_schema = new ASS_MarkSchema();
590  $this->mark_schema->createSimpleSchema(
591  $lng->txt("failed_short"),
592  $lng->txt("failed_official"),
593  0,
594  0,
595  $lng->txt("passed_short"),
596  $lng->txt("passed_official"),
597  50,
598  1
599  );
600 
601  $this->test_id = -1;
602  $this->author = $ilUser->fullname;
603  $this->introductionEnabled = false;
604  $this->introduction = "";
605  $this->questions = array();
606  $this->sequence_settings = TEST_FIXED_SEQUENCE;
607  $this->score_reporting = REPORT_AFTER_TEST;
608  $this->instant_verification = 0;
609  $this->answer_feedback_points = 0;
610  $this->reporting_date = "";
611  $this->nr_of_tries = 0;
612  $this->_kiosk = 0;
613  $this->use_previous_answers = 1;
614  $this->title_output = 0;
615  $this->starting_time = "";
616  $this->ending_time = "";
617  $this->processing_time = "";
618  $this->enable_processing_time = "0";
619  $this->reset_processing_time = 0;
620  $this->ects_output = FALSE;
621  $this->ects_fx = NULL;
622  $this->shuffle_questions = FALSE;
623  $this->mailnottype = 0;
624  $this->exportsettings = 0;
625  $this->show_summary = 8;
626  $this->count_system = COUNT_PARTIAL_SOLUTIONS;
627  $this->mc_scoring = SCORE_ZERO_POINTS_WHEN_UNANSWERED;
628  $this->score_cutting = SCORE_CUT_QUESTION;
629  $this->pass_scoring = SCORE_LAST_PASS;
630  $this->answer_feedback = 0;
631  $this->password = "";
632  $this->certificate_visibility = 0;
633  $this->allowedUsers = "";
634  $this->_showfinalstatement = FALSE;
635  $this->_finalstatement = "";
636  $this->_showinfo = TRUE;
637  $this->_forcejs = TRUE;
638  $this->_customStyle = "";
639  $this->allowedUsersTimeGap = "";
640  $this->anonymity = 0;
641  $this->show_cancel = 0;
642  $this->show_marker = 0;
643  $this->fixed_participants = 0;
644  $this->setShowPassDetails(TRUE);
645  $this->setShowSolutionDetails(TRUE);
646  $this->setShowSolutionAnswersOnly(FALSE);
647  $this->setShowSolutionSignature(FALSE);
648  $this->testSession = FALSE;
649  $this->testSequence = FALSE;
650  $this->mailnotification = 0;
651  $this->poolUsage = 1;
652 
653  $this->ects_grades = array(
654  'A' => 90,
655  'B' => 65,
656  'C' => 35,
657  'D' => 10,
658  'E' => 0
659  );
660 
661  $this->autosave = FALSE;
662  $this->autosave_ival = 30000;
663 
664  $this->enable_examview = false;
665  $this->show_examview_html = false;
666  $this->show_examview_pdf = false;
667  $this->enable_archiving = false;
668 
669  $this->express_mode = false;
670  $this->template_id = '';
671  $this->redirection_mode = 0;
672  $this->redirection_url = NULL;
673  $this->show_exam_id_in_test_pass_enabled = false;
674  $this->show_exam_id_in_test_results_enabled = false;
675  $this->sign_submission = false;
676  $this->char_selector_availability = 0;
677  $this->char_selector_definition = null;
678 
679  $this->showGradingStatusEnabled = true;
680  $this->showGradingMarkEnabled = true;
681 
682  $this->instantFeedbackAnswerFixationEnabled = false;
683 
684  $this->testFinalBroken = false;
685 
686  $this->ilObject($a_id, $a_call_by_reference);
687  }
const REPORT_AFTER_TEST
setShowPassDetails($a_details=1)
Sets if the pass details should be shown when a test is not finished.
setShowSolutionDetails($a_details=1)
Sets if the the solution details should be presented to the user or not.
const SCORE_LAST_PASS
setShowSolutionAnswersOnly($a_full=TRUE)
Set to true, if the full solution (including the ILIAS content pages) should be shown in the solution...
setShowSolutionSignature($a_signature=FALSE)
Set to TRUE, if the signature field should be shown in the solution.
ilObject($a_id=0, $a_reference=true)
Constructor public.
const SCORE_ZERO_POINTS_WHEN_UNANSWERED
const COUNT_PARTIAL_SOLUTIONS
const SCORE_CUT_QUESTION
const TEST_FIXED_SEQUENCE
Test constants.
global $ilUser
Definition: imgupload.php:15
A class defining mark schemas for assessment test objects.
+ 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 public

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

References ilObject\$lng, and ilObject\$title.

5482  {
5483  global $lng;
5484  $name = "";
5485  if (strlen($firstname.$lastname.$title) == 0)
5486  {
5487  $name = $lng->txt("deleted_user");
5488  }
5489  else
5490  {
5491  if ($user_id == ANONYMOUS_USER_ID)
5492  {
5493  $name = $lastname;
5494  }
5495  else
5496  {
5497  $name = trim($lastname . ", " . $firstname . " " . $title);
5498  }
5499  if ($is_anonymous)
5500  {
5501  $name = $lng->txt("anonymous");
5502  }
5503  }
5504  return $name;
5505  }

◆ _createImportDirectory()

ilObjTest::_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)

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

References ilObject\$ilias, ilUtil\getDataDir(), and ilUtil\makeDir().

Referenced by ilObjTestGUI\uploadTstObject().

1026  {
1027  global $ilias;
1028  include_once "./Services/Utilities/classes/class.ilUtil.php";
1029  $tst_data_dir = ilUtil::getDataDir()."/tst_data";
1030  ilUtil::makeDir($tst_data_dir);
1031 
1032  if (!is_writable($tst_data_dir))
1033  {
1034  $this->ilias->raiseError("Test Data Directory (".$tst_data_dir
1035  .") not writeable.",$this->ilias->error_obj->FATAL);
1036  }
1037 
1038  // create test directory (data_dir/tst_data/tst_import)
1039  $tst_dir = $tst_data_dir."/tst_import";
1040  ilUtil::makeDir($tst_dir);
1041  if (!@is_dir($tst_dir))
1042  {
1043  $ilias->raiseError("Creation of test import directory failed.",$ilias->error_obj->FATAL);
1044  }
1045  return $tst_dir;
1046  }
redirection script todo: (a better solution should control the processing via a xml file) ...
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static getDataDir()
get data directory (outside webspace)
+ 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 public

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

References $ilDB, $result, and $row.

Referenced by evalResultsOverview().

5343  {
5344  global $ilDB;
5345 
5346  $result = $ilDB->queryF("SELECT usr_data.usr_id, usr_data.firstname, usr_data.lastname, usr_data.title, usr_data.login, " .
5347  "tst_test_result.*, qpl_questions.original_id, qpl_questions.title questiontitle, " .
5348  "qpl_questions.points maxpoints " .
5349  "FROM tst_test_result, qpl_questions, tst_active " .
5350  "LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id " .
5351  "WHERE tst_active.active_id = tst_test_result.active_fi " .
5352  "AND qpl_questions.question_id = tst_test_result.question_fi " .
5353  "AND tst_active.test_fi = %s " .
5354  "ORDER BY tst_active.active_id, tst_test_result.pass, tst_test_result.tstamp",
5355  array('integer'),
5356  array($test_id)
5357  );
5358  $overview = array();
5359  while ($row = $ilDB->fetchAssoc($result))
5360  {
5361  if (!array_key_exists($row["active_fi"], $overview))
5362  {
5363  $overview[$row["active_fi"]] = array();
5364  $overview[$row["active_fi"]]["firstname"] = $row["firstname"];
5365  $overview[$row["active_fi"]]["lastname"] = $row["lastname"];
5366  $overview[$row["active_fi"]]["title"] = $row["title"];
5367  $overview[$row["active_fi"]]["login"] = $row["login"];
5368  $overview[$row["active_fi"]]["usr_id"] = $row["usr_id"];
5369  $overview[$row["active_fi"]]["started"] = $row["started"];
5370  $overview[$row["active_fi"]]["finished"] = $row["finished"];
5371  }
5372  if (!array_key_exists($row["pass"], $overview[$row["active_fi"]]))
5373  {
5374  $overview[$row["active_fi"]][$row["pass"]] = array();
5375  $overview[$row["active_fi"]][$row["pass"]]["reached"] = 0;
5376  $overview[$row["active_fi"]][$row["pass"]]["maxpoints"] = $row["maxpoints"];
5377  }
5378  array_push($overview[$row["active_fi"]][$row["pass"]], $row);
5379  $overview[$row["active_fi"]][$row["pass"]]["reached"] += $row["points"];
5380  }
5381  return $overview;
5382  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _getActiveIdOfUser()

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

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 public

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

References $ilDB, $ilUser, $result, and $row.

4170  {
4171  global $ilDB;
4172  global $ilUser;
4173 
4174  if (!$user_id) {
4175  $user_id = $ilUser->id;
4176  }
4177  if (!$test_id)
4178  {
4179  return "";
4180  }
4181  $result = $ilDB->queryF("SELECT tst_active.active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s",
4182  array('integer', 'integer'),
4183  array($user_id, $test_id)
4184  );
4185  if ($result->numRows())
4186  {
4187  $row = $ilDB->fetchAssoc($result);
4188  return $row["active_id"];
4189  }
4190  else
4191  {
4192  return "";
4193  }
4194  }
$result
global $ilUser
Definition: imgupload.php:15
global $ilDB

◆ _getAvailableTests()

& ilObjTest::_getAvailableTests (   $use_object_id = FALSE)

Returns the available tests for the active user.

Returns
array The available tests public

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

References $ilDB, $ilLog, $ilUser, $mark_schema, ilObject\$ref_id, $tests, ilCopyWizardOptions\_getInstance(), ilUtil\_getObjectsByOperations(), ilObject\_lookupObjId(), ilObject\_prepareCloneSelection(), ilObject\cloneMetaData(), ilObject\cloneObject(), getAllowedUsers(), getAllowedUsersTimeGap(), getAnonymity(), getAnswerFeedback(), getAnswerFeedbackPoints(), getAuthor(), getCertificateVisibility(), getCharSelectorAvailability(), getCharSelectorDefinition(), getCountSystem(), getCustomStyle(), getECTSFX(), getECTSGrades(), getECTSOutput(), getEnableArchiving(), getEnabledViewMode(), getEnableExamview(), getEnableProcessingTime(), getEndingTime(), getFinalStatement(), getFixedParticipants(), getForceJS(), ilObject\getId(), getInstantFeedbackSolution(), getIntroduction(), getKiosk(), getListOfQuestionsSettings(), getMailNotification(), getMailNotificationType(), getMCScoring(), getNrOfTries(), getPassScoring(), getPassword(), getPoolUsage(), getProcessingTime(), getQuestionSetType(), getRedirectionMode(), getRedirectionUrl(), getReportingDate(), getResetProcessingTime(), getResultFilterTaxIds(), getResultsPresentation(), getScoreCutting(), getScoreReporting(), getSequenceSettings(), getShowCancel(), getShowExamviewHtml(), getShowExamviewPdf(), getShowFinalStatement(), getShowInfo(), getShowMarker(), getShuffleQuestions(), getSignSubmission(), getStartingTime(), getTemplate(), getTitleOutput(), getUsePreviousAnswers(), isBestSolutionPrintedWithResult(), isEndingTimeEnabled(), isInstantFeedbackAnswerFixationEnabled(), isIntroductionEnabled(), isLimitUsersEnabled(), isOnline(), isPasswordEnabled(), isShowExamIdInTestPassEnabled(), isShowExamIdInTestResultsEnabled(), isSkillServiceEnabled(), isStartingTimeEnabled(), and loadFromDb().

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

7284  {
7285  global $ilUser;
7286  global $ilDB;
7287 
7288  $result_array = array();
7289  $tests = ilUtil::_getObjectsByOperations("tst","write", $ilUser->getId(), -1);
7290  if (count($tests))
7291  {
7292  $titles = ilObject::_prepareCloneSelection($tests, "tst");
7293  foreach ($tests as $ref_id)
7294  {
7295  if ($use_object_id)
7296  {
7297  $obj_id = ilObject::_lookupObjId($ref_id);
7298  $result_array[$obj_id] = $titles[$ref_id];
7299  }
7300  else
7301  {
7302  $result_array[$ref_id] = $titles[$ref_id];
7303  }
7304  }
7305  }
7306  return $result_array;
7307  }
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, instead it parses the serialized rbac_pa entries.
static _lookupObjId($a_id)
global $ilUser
Definition: imgupload.php:15
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getBestPass()

ilObjTest::_getBestPass (   $active_id)

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

ilLog $ilLog ILIAS $ilias

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

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

References $ilDB, $result, and $row.

Referenced by _getResultPass().

8261  {
8262  global $ilDB;
8263 
8264  $result = $ilDB->queryF("SELECT * FROM tst_pass_result WHERE active_fi = %s",
8265  array('integer'),
8266  array($active_id)
8267  );
8268  if ($result->numRows())
8269  {
8270  $bestrow = null;
8271  $bestfactor = 0;
8272  while ($row = $ilDB->fetchAssoc($result))
8273  {
8274  if($row["maxpoints"] > 0)
8275  {
8276  $factor = $row["points"] / $row["maxpoints"];
8277  }
8278  else
8279  {
8280  $factor = 0;
8281  }
8282 
8283  if($factor > $bestfactor)
8284  {
8285  $bestrow = $row;
8286  $bestfactor = $factor;
8287  }
8288  }
8289  if (is_array($bestrow))
8290  {
8291  return $bestrow["pass"];
8292  }
8293  else
8294  {
8295  return 0;
8296  }
8297  }
8298  else
8299  {
8300  return 0;
8301  }
8302  }
$result
global $ilDB
+ 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 public

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

References $ilDB, $result, and $row.

Referenced by getCompleteWorkingTimeOfParticipants().

4489  {
4490  global $ilDB;
4491 
4492  $result = $ilDB->queryF("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",
4493  array('integer'),
4494  array($test_id)
4495  );
4496  $time = 0;
4497  $times = array();
4498  while ($row = $ilDB->fetchAssoc($result))
4499  {
4500  if (!array_key_exists($row["active_fi"], $times))
4501  {
4502  $times[$row["active_fi"]] = 0;
4503  }
4504  preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
4505  $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4506  preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4507  $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4508  $times[$row["active_fi"]] += ($epoch_2 - $epoch_1);
4509  }
4510  return $times;
4511  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _getCountSystem()

ilObjTest::_getCountSystem (   $active_id)

Gets the count system for the calculation of points.

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

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

References $ilDB, $result, and $row.

Referenced by assQuestion\adjustReachedPointsByScoringOptions().

2593  {
2594  global $ilDB;
2595  $result = $ilDB->queryF("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",
2596  array('integer'),
2597  array($active_id)
2598  );
2599  if ($result->numRows())
2600  {
2601  $row = $ilDB->fetchAssoc($result);
2602  return $row["count_system"];
2603  }
2604  return FALSE;
2605  }
$result
global $ilDB
+ 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 7023 of file class.ilObjTest.php.

References $d.

7024  {
7025  include_once "./Modules/Test/classes/class.ilStatistics.php";
7026  // calculate the median
7027  $passed_statistics = new ilStatistics();
7028  $passed_statistics->setData($points_passed);
7029  $ects_percentiles = array
7030  (
7031  "A" => $passed_statistics->quantile($a),
7032  "B" => $passed_statistics->quantile($b),
7033  "C" => $passed_statistics->quantile($c),
7034  "D" => $passed_statistics->quantile($d),
7035  "E" => $passed_statistics->quantile($e)
7036  );
7037  if (count($points_passed) && ($reached_points >= $ects_percentiles["A"]))
7038  {
7039  return "A";
7040  }
7041  else if (count($points_passed) && ($reached_points >= $ects_percentiles["B"]))
7042  {
7043  return "B";
7044  }
7045  else if (count($points_passed) && ($reached_points >= $ects_percentiles["C"]))
7046  {
7047  return "C";
7048  }
7049  else if (count($points_passed) && ($reached_points >= $ects_percentiles["D"]))
7050  {
7051  return "D";
7052  }
7053  else if (count($points_passed) && ($reached_points >= $ects_percentiles["E"]))
7054  {
7055  return "E";
7056  }
7057  else if (strcmp($fx, "") != 0)
7058  {
7059  if ($max_points > 0)
7060  {
7061  $percentage = ($reached_points / $max_points) * 100.0;
7062  if ($percentage < 0) $percentage = 0.0;
7063  }
7064  else
7065  {
7066  $percentage = 0.0;
7067  }
7068  if ($percentage >= $fx)
7069  {
7070  return "FX";
7071  }
7072  else
7073  {
7074  return "F";
7075  }
7076  }
7077  else
7078  {
7079  return "F";
7080  }
7081  }

◆ _getImportDirectory()

ilObjTest::_getImportDirectory ( )

Get the import directory location of the test.

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

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

References $_SESSION.

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

1007  {
1008  if (strlen($_SESSION["tst_import_dir"]))
1009  {
1010  return $_SESSION["tst_import_dir"];
1011  }
1012  return null;
1013  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ _getLastAccess()

ilObjTest::_getLastAccess (   $active_id)

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

References $ilDB, $result, and $row.

9365  {
9366  global $ilDB;
9367 
9368  $result = $ilDB->queryF("SELECT finished FROM tst_times WHERE active_fi = %s ORDER BY finished DESC",
9369  array('integer'),
9370  array($active_id)
9371  );
9372  if ($result->numRows())
9373  {
9374  $row = $ilDB->fetchAssoc($result);
9375  return $row["finished"];
9376  }
9377  return "";
9378  }
$result
global $ilDB

◆ _getMaxPass()

ilObjTest::_getMaxPass (   $active_id)

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 public

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

References $ilDB, $result, and $row.

Referenced by _getResultPass().

8232  {
8233  global $ilDB;
8234  $result = $ilDB->queryF("SELECT MAX(pass) maxpass FROM tst_pass_result WHERE active_fi = %s",
8235  array('integer'),
8236  array($active_id)
8237  );
8238  if ($result->numRows())
8239  {
8240  $row = $ilDB->fetchAssoc($result);
8241  $max = $row["maxpass"];
8242  }
8243  else
8244  {
8245  $max = NULL;
8246  }
8247  return $max;
8248  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _getMCScoring()

ilObjTest::_getMCScoring (   $active_id)

Gets the scoring type for multiple choice questions.

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

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

References $ilDB, $result, and $row.

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

2673  {
2674  global $ilDB;
2675  $result = $ilDB->queryF("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",
2676  array('integer'),
2677  array($active_id)
2678  );
2679  if ($result->numRows())
2680  {
2681  $row = $ilDB->fetchAssoc($result);
2682  return $row["mc_scoring"];
2683  }
2684  return FALSE;
2685  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _getObjectIDFromActiveID()

ilObjTest::_getObjectIDFromActiveID (   $active_id)

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 public

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

References $ilDB, $result, and $row.

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

7525  {
7526  global $ilDB;
7527  $object_id = FALSE;
7528  $result = $ilDB->queryF("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",
7529  array('integer'),
7530  array($active_id)
7531  );
7532  if ($result->numRows())
7533  {
7534  $row = $ilDB->fetchAssoc($result);
7535  $object_id = $row["obj_fi"];
7536  }
7537  return $object_id;
7538  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _getObjectIDFromTestID()

ilObjTest::_getObjectIDFromTestID (   $test_id)

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 public

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

References $ilDB, $result, and $row.

Referenced by assJavaAppletGUI\getSolutionOutput(), assJavaAppletGUI\getTestOutput(), and ASS_MarkSchema\setMarkSteps().

7502  {
7503  global $ilDB;
7504  $object_id = FALSE;
7505  $result = $ilDB->queryF("SELECT obj_fi FROM tst_tests WHERE test_id = %s",
7506  array('integer'),
7507  array($test_id)
7508  );
7509  if ($result->numRows())
7510  {
7511  $row = $ilDB->fetchAssoc($result);
7512  $object_id = $row["obj_fi"];
7513  }
7514  return $object_id;
7515  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _getPass()

ilObjTest::_getPass (   $active_id)

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 public

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

References $ilDB, $result, and $row.

Referenced by assMultipleChoice\calculateReachedPoints(), assQuestion\calculateResultsFromSolution(), assQuestion\getAdjustedReachedPoints(), getAllQuestions(), assFileUploadGUI\getSolutionOutput(), assFlashQuestionGUI\getSolutionOutput(), assJavaAppletGUI\getSolutionOutput(), assImagemapQuestionGUI\getSolutionOutput(), assFormulaQuestionGUI\getSolutionOutput(), getStartingTimeOfUser(), getStartTestLabel(), assOrderingHorizontalGUI\getTestOutput(), assTextSubsetGUI\getTestOutput(), assNumericGUI\getTestOutput(), assErrorTextGUI\getTestOutput(), assKprimChoiceGUI\getTestOutput(), assFileUploadGUI\getTestOutput(), assTextQuestionGUI\getTestOutput(), assFlashQuestionGUI\getTestOutput(), assSingleChoiceGUI\getTestOutput(), assMultipleChoiceGUI\getTestOutput(), assJavaAppletGUI\getTestOutput(), assImagemapQuestionGUI\getTestOutput(), assMatchingQuestionGUI\getTestOutput(), assOrderingQuestionGUI\getTestOutput(), assFormulaQuestionGUI\getTestOutput(), assClozeTestGUI\getTestOutput(), assKprimChoice\isComplete(), isExecutable(), assNumeric\isValidSolutionSubmit(), loadQuestions(), assImagemapQuestionGUI\outQuestionForTest(), assQuestion\persistWorkingState(), assOrderingHorizontal\saveWorkingData(), assErrorText\saveWorkingData(), assTextSubset\saveWorkingData(), assFileUpload\saveWorkingData(), assTextQuestion\saveWorkingData(), assSingleChoice\saveWorkingData(), assImagemapQuestion\saveWorkingData(), assOrderingQuestion\saveWorkingData(), assFormulaQuestion\saveWorkingData(), assMatchingQuestion\saveWorkingData(), and assClozeTest\saveWorkingData().

8205  {
8206  global $ilDB;
8207  $result = $ilDB->queryF("SELECT tries FROM tst_active WHERE active_id = %s",
8208  array('integer'),
8209  array($active_id)
8210  );
8211  if ($result->numRows())
8212  {
8213  $row = $ilDB->fetchAssoc($result);
8214  return $row["tries"];
8215  }
8216  else
8217  {
8218  return 0;
8219  }
8220  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _getPassScoring()

ilObjTest::_getPassScoring (   $active_id)

Gets the pass scoring type.

Returns
integer The pass scoring type public
See also
$pass_scoring

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

References $ilDB, $result, and $row.

Referenced by _getResultPass().

2651  {
2652  global $ilDB;
2653  $result = $ilDB->queryF("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",
2654  array('integer'),
2655  array($active_id)
2656  );
2657  if ($result->numRows())
2658  {
2659  $row = $ilDB->fetchAssoc($result);
2660  return $row["pass_scoring"];
2661  }
2662  return 0;
2663  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _getQuestionCountAndPointsForPassOfParticipant()

ilObjTest::_getQuestionCountAndPointsForPassOfParticipant (   $active_id,
  $pass 
)

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

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

Referenced by assQuestion\_updateTestResultCache(), and ilTestEvaluationData\generateOverview().

5222  {
5223  global $ilDB;
5224 
5226 
5227  switch( $questionSetType )
5228  {
5230 
5231  $res = $ilDB->queryF("
5232  SELECT COUNT(qpl_questions.question_id) qcount,
5233  SUM(qpl_questions.points) qsum
5234  FROM tst_active
5235  INNER JOIN tst_tests
5236  ON tst_tests.test_id = tst_active.test_fi
5237  INNER JOIN tst_dyn_quest_set_cfg
5238  ON tst_dyn_quest_set_cfg.test_fi = tst_tests.test_id
5239  INNER JOIN qpl_questions
5240  ON qpl_questions.obj_fi = tst_dyn_quest_set_cfg.source_qpl_fi
5241  AND qpl_questions.original_id IS NULL
5242  AND qpl_questions.complete = %s
5243  WHERE tst_active.active_id = %s
5244  ",
5245  array('integer', 'integer'),
5246  array(1, $active_id)
5247  );
5248 
5249  break;
5250 
5252 
5253  $res = $ilDB->queryF("
5254  SELECT tst_test_rnd_qst.pass,
5255  COUNT(tst_test_rnd_qst.question_fi) qcount,
5256  SUM(qpl_questions.points) qsum
5257 
5258  FROM tst_test_rnd_qst,
5259  qpl_questions
5260 
5261  WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id
5262  AND tst_test_rnd_qst.active_fi = %s
5263  AND pass = %s
5264 
5265  GROUP BY tst_test_rnd_qst.active_fi,
5266  tst_test_rnd_qst.pass
5267  ",
5268  array('integer', 'integer'),
5269  array($active_id, $pass)
5270  );
5271 
5272  break;
5273 
5275 
5276  $res = $ilDB->queryF("
5277  SELECT COUNT(tst_test_question.question_fi) qcount,
5278  SUM(qpl_questions.points) qsum
5279 
5280  FROM tst_test_question,
5281  qpl_questions,
5282  tst_active
5283 
5284  WHERE tst_test_question.question_fi = qpl_questions.question_id
5285  AND tst_test_question.test_fi = tst_active.test_fi
5286  AND tst_active.active_id = %s
5287 
5288  GROUP BY tst_test_question.test_fi
5289  ",
5290  array('integer'),
5291  array($active_id)
5292  );
5293 
5294  break;
5295 
5296  default:
5297 
5298  throw new ilTestException("not supported question set type: $questionSetType");
5299  }
5300 
5301  $row = $ilDB->fetchAssoc($res);
5302 
5303  if( is_array($row) )
5304  {
5305  return array("count" => $row["qcount"], "points" => $row["qsum"]);
5306  }
5307 
5308  return array("count" => 0, "points" => 0);
5309  }
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
Base Exception for all Exceptions relating to Modules/Test.
global $ilDB
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
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getResultPass()

ilObjTest::_getResultPass (   $active_id)

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 public

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

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

Referenced by assQuestion\_updateTestResultCache(), ilObjTestVerification\createFromTest(), evalStatistical(), getPassed(), ilTestEvaluationGUI\outCertificate(), and ilTestEvaluationGUI\outParticipantsResultsOverview().

8313  {
8314  $counted_pass = NULL;
8315  if (ilObjTest::_getPassScoring($active_id) == SCORE_BEST_PASS)
8316  {
8317  $counted_pass = ilObjTest::_getBestPass($active_id);
8318  }
8319  else
8320  {
8321  $counted_pass = ilObjTest::_getMaxPass($active_id);
8322  }
8323  return $counted_pass;
8324  }
_getPassScoring($active_id)
Gets the pass scoring type.
_getBestPass($active_id)
Retrieves the best pass of a given user for a given test.
_getMaxPass($active_id)
Retrieves the maximum pass of a given user for a given test in which the user answered at least one q...
const SCORE_BEST_PASS
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getScoreCutting()

ilObjTest::_getScoreCutting (   $active_id)

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 public
See also
$score_cutting

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

References $ilDB, $result, and $row.

Referenced by assQuestion\adjustReachedPointsByScoringOptions().

2695  {
2696  global $ilDB;
2697  $result = $ilDB->queryF("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",
2698  array('integer'),
2699  array($active_id)
2700  );
2701  if ($result->numRows())
2702  {
2703  $row = $ilDB->fetchAssoc($result);
2704  return $row["score_cutting"];
2705  }
2706  return FALSE;
2707  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _getSolvedQuestions()

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

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 7975 of file class.ilObjTest.php.

References $ilDB, $result, and $row.

Referenced by ilTestPlayerAbstractGUI\getMarkedQuestions(), ilTestSequence\getSequenceSummary(), ilTestPlayerAbstractGUI\outQuestionSummaryCmd(), ilTestOutputGUI\outWorkingForm(), and ilTestPlayerDynamicQuestionSetGUI\outWorkingForm().

7976  {
7977  global $ilDB;
7978  if (is_numeric($question_fi))
7979  {
7980  $result = $ilDB->queryF("SELECT question_fi, solved FROM tst_qst_solved WHERE active_fi = %s AND question_fi=%s",
7981  array('integer', 'integer'),
7982  array($active_id, $question_fi)
7983  );
7984  }
7985  else
7986  {
7987  $result = $ilDB->queryF("SELECT question_fi, solved FROM tst_qst_solved WHERE active_fi = %s",
7988  array('integer'),
7989  array($active_id)
7990  );
7991  }
7992  $result_array = array();
7993  while ($row = $ilDB->fetchAssoc($result))
7994  {
7995  $result_array[$row["question_fi"]]= $row;
7996  }
7997  return $result_array;
7998  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _getTestDefaults()

static ilObjTest::_getTestDefaults (   $test_defaults_id)
static

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

References $ilDB, $result, and $row.

Referenced by ilObjTestGUI\afterSave().

9823  {
9824  global $ilDB;
9825 
9826  $result = $ilDB->queryF("SELECT * FROM tst_test_defaults WHERE test_defaults_id = %s",
9827  array('integer'),
9828  array($test_defaults_id)
9829  );
9830  if ($result->numRows() == 1)
9831  {
9832  $row = $ilDB->fetchAssoc($result);
9833  return $row;
9834  }
9835  else
9836  {
9837  return NULL;
9838  }
9839  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _getTestIDFromObjectID()

ilObjTest::_getTestIDFromObjectID (   $object_id)

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 public

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

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

7548  {
7549  global $ilDB;
7550  $test_id = FALSE;
7551  $result = $ilDB->queryF("SELECT test_id FROM tst_tests WHERE obj_fi = %s",
7552  array('integer'),
7553  array($object_id)
7554  );
7555  if ($result->numRows())
7556  {
7557  $row = $ilDB->fetchAssoc($result);
7558  $test_id = $row["test_id"];
7559  }
7560  return $test_id;
7561  }
$result
global $ilDB

◆ _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 public
See also
$title_output

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

References $ilDB, $result, and $row.

Referenced by assQuestionGUI\outQuestionPage().

2912  {
2913  global $ilDB;
2914 
2915  $result = $ilDB->queryF("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",
2916  array('integer'),
2917  array($active_id)
2918  );
2919  if ($result->numRows())
2920  {
2921  $row = $ilDB->fetchAssoc($result);
2922  return $row["title_output"];
2923  }
2924  return 0;
2925  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _getUsePreviousAnswers()

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

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 public
See also
$use_previous_answers

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

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

Referenced by assFileUploadGUI\getSolutionOutput(), assImagemapQuestionGUI\getSolutionOutput(), assFormulaQuestionGUI\getSolutionOutput(), assTextSubsetGUI\getTestOutput(), assOrderingHorizontalGUI\getTestOutput(), assNumericGUI\getTestOutput(), assErrorTextGUI\getTestOutput(), assKprimChoiceGUI\getTestOutput(), assFileUploadGUI\getTestOutput(), assTextQuestionGUI\getTestOutput(), assSingleChoiceGUI\getTestOutput(), assMultipleChoiceGUI\getTestOutput(), assJavaAppletGUI\getTestOutput(), assImagemapQuestionGUI\getTestOutput(), assMatchingQuestionGUI\getTestOutput(), assOrderingQuestionGUI\getTestOutput(), assClozeTestGUI\getTestOutput(), and assImagemapQuestionGUI\outQuestionForTest().

2937  {
2938  global $ilDB;
2939  global $ilUser;
2940 
2942 
2943  $result = $ilDB->queryF("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",
2944  array("integer"),
2945  array($active_id)
2946  );
2947  if ($result->numRows())
2948  {
2949  $row = $ilDB->fetchAssoc($result);
2950  $use_previous_answers = $row["use_previous_answers"];
2951  }
2952 
2953  if ($use_previous_answers == 1)
2954  {
2955  if ($user_active_user_setting)
2956  {
2957  $res = $ilUser->getPref("tst_use_previous_answers");
2958  if ($res !== FALSE)
2959  {
2961  }
2962  }
2963  }
2964  return $use_previous_answers;
2965  }
$result
global $ilUser
Definition: imgupload.php:15
global $ilDB
+ Here is the caller graph for this function:

◆ _getUserIdFromActiveId()

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

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

References $ilDB, $result, and $row.

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

9271  {
9272  global $ilDB;
9273  $result = $ilDB->queryF("SELECT user_fi FROM tst_active WHERE active_id = %s",
9274  array('integer'),
9275  array($active_id)
9276  );
9277  if ($result->numRows())
9278  {
9279  $row = $ilDB->fetchAssoc($result);
9280  return $row["user_fi"];
9281  }
9282  else
9283  {
9284  return -1;
9285  }
9286  }
$result
global $ilDB
+ 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 public

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

References $ilDB, $result, and $row.

Referenced by getVisitTimeOfParticipant().

4586  {
4587  global $ilDB;
4588 
4589  $result = $ilDB->queryF("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",
4590  array('integer','integer'),
4591  array($test_id, $active_id)
4592  );
4593  $firstvisit = 0;
4594  $lastvisit = 0;
4595  while ($row = $ilDB->fetchAssoc($result))
4596  {
4597  preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
4598  $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4599  if ($firstvisit == 0 || $epoch_1 < $firstvisit) $firstvisit = $epoch_1;
4600  preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4601  $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4602  if ($epoch_2 > $lastvisit) $lastvisit = $epoch_2;
4603  }
4604  return array("firstvisit" => $firstvisit, "lastvisit" => $lastvisit);
4605  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _getWorkingTimeOfParticipantForPass()

ilObjTest::_getWorkingTimeOfParticipantForPass (   $active_id,
  $pass 
)

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

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

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

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

Referenced by assQuestion\_updateTestResultCache().

4546  {
4547  global $ilDB;
4548 
4549  $result = $ilDB->queryF("SELECT * FROM tst_times WHERE active_fi = %s AND pass = %s ORDER BY started",
4550  array('integer','integer'),
4551  array($active_id, $pass)
4552  );
4553  $time = 0;
4554  while ($row = $ilDB->fetchAssoc($result))
4555  {
4556  preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
4557  $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4558  preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4559  $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4560  $time += ($epoch_2 - $epoch_1);
4561  }
4562  return $time;
4563  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _instanciateQuestion()

& ilObjTest::_instanciateQuestion (   $question_id)

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

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

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

References assQuestion\_instanciateQuestion().

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

5664  {
5665  if (strcmp($question_id, "") != 0)
5666  {
5667  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
5668  return assQuestion::_instanciateQuestion($question_id);
5669  }
5670  }
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
+ 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 public

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

References $ilDB, $test, getECTSFX(), getECTSGrades(), getECTSOutput(), getTestId(), ilEctsGradesEnabled\saveECTSStatus(), and setECTSFX().

1167  {
1168  global $tree, $ilDB, $ilPluginAdmin;
1169 
1170  $test = new ilObjTest($obj_id, false);
1171  $test->loadFromDb();
1172 
1173  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
1174  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
1175 
1176  return $test->isComplete( $testQuestionSetConfigFactory->getQuestionSetConfig() );
1177  }
global $ilDB
$test
Definition: Utf8Test.php:85
+ Here is the call graph for this function:

◆ _lookupAnonymity()

ilObjTest::_lookupAnonymity (   $a_obj_id)

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) public

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

References $ilDB, $result, and $row.

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

9653  {
9654  global $ilDB;
9655 
9656  $result = $ilDB->queryF("SELECT anonymity FROM tst_tests WHERE obj_fi = %s",
9657  array('integer'),
9658  array($a_obj_id)
9659  );
9660  while($row = $ilDB->fetchAssoc($result))
9661  {
9662  return $row['anonymity'];
9663  }
9664  return 0;
9665  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupAuthor()

ilObjTest::_lookupAuthor (   $obj_id)

Gets the authors name of the ilObjTest object.

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

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

References ilObject\$id.

Referenced by assQuestion\getInstances().

7252  {
7253  $author = array();
7254  include_once "./Services/MetaData/classes/class.ilMD.php";
7255  $md =& new ilMD($obj_id, 0, "tst");
7256  $md_life =& $md->getLifecycle();
7257  if ($md_life)
7258  {
7259  $ids =& $md_life->getContributeIds();
7260  foreach ($ids as $id)
7261  {
7262  $md_cont =& $md_life->getContribute($id);
7263  if (strcmp($md_cont->getRole(), "Author") == 0)
7264  {
7265  $entids =& $md_cont->getEntityIds();
7266  foreach ($entids as $entid)
7267  {
7268  $md_ent =& $md_cont->getEntity($entid);
7269  array_push($author, $md_ent->getEntity());
7270  }
7271  }
7272  }
7273  }
7274  return join($author, ",");
7275  }
+ 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 11092 of file class.ilObjTest.php.

References $ilDB, $result, and $row.

11093  {
11094  global $ilDB;
11095 
11096  $result = $ilDB->queryF("SELECT test_fi,MAX(pass) AS pass FROM tst_active".
11097  " JOIN tst_pass_result ON (tst_pass_result.active_fi = tst_active.active_id)".
11098  " WHERE user_fi=%s".
11099  " GROUP BY test_fi",
11100  array('integer', 'integer'),
11101  array($a_user_id, 1)
11102  );
11103  $all = array();
11104  while($row = $ilDB->fetchAssoc($result))
11105  {
11106  $obj_id = self::_getObjectIDFromTestID($row["test_fi"]);
11107  $all[$obj_id] = (bool)$row["pass"];
11108  }
11109  return $all;
11110  }
$result
global $ilDB

◆ _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 12053 of file class.ilObjTest.php.

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

12054  {
12055  return self::lookupQuestionSetType($a_obj_id) == self::QUESTION_SET_TYPE_RANDOM;
12056  }
+ 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) public
Deprecated:

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

References $ilDB, $result, and $row.

9704  {
9705  throw new Exception(__METHOD__.' is deprecated ... use ilObjTest::lookupQuestionSetTypeByActiveId() instead!');
9706 
9707  global $ilDB;
9708 
9709  $result = $ilDB->queryF("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",
9710  array('integer'),
9711  array($active_id)
9712  );
9713  while($row = $ilDB->fetchAssoc($result))
9714  {
9715  return $row['random_test'];
9716  }
9717  return 0;
9718  }
$result
global $ilDB

◆ _lookupTestObjIdForQuestionId()

ilObjTest::_lookupTestObjIdForQuestionId (   $a_q_id)

Get test Object ID for question ID.

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

References $ilDB, and $result.

Referenced by ilObjMediaObject\getParentObjectIdForUsage().

10415  {
10416  global $ilDB;
10417 
10418  $result = $ilDB->queryF("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",
10419  array('integer'),
10420  array($a_q_id)
10421  );
10422  $rec = $ilDB->fetchAssoc($result);
10423  return $rec["obj_id"];
10424  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _setImportDirectory()

ilObjTest::_setImportDirectory (   $a_import_dir = null)

set import directory

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

References $_SESSION.

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

989  {
990  if (strlen($a_import_dir))
991  {
992  $_SESSION["tst_import_dir"] = $a_import_dir;
993  }
994  else
995  {
996  unset($_SESSION["tst_import_dir"]);
997  }
998  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ 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 public

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

References $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(), 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(), isEndingTimeEnabled(), isInstantFeedbackAnswerFixationEnabled(), isIntroductionEnabled(), isLimitUsersEnabled(), isOfferingQuestionHintsEnabled(), isPassDeletionAllowed(), isPasswordEnabled(), isShowExamIdInTestPassEnabled(), isShowExamIdInTestResultsEnabled(), isShowGradingMarkEnabled(), isShowGradingStatusEnabled(), isSkillServiceEnabled(), and isStartingTimeEnabled().

9863  {
9864  global $ilDB;
9865  global $ilUser;
9866  $testsettings = array(
9867  "TitleOutput" => $this->getTitleOutput(),
9868  "PassScoring" => $this->getPassScoring(),
9869  "IntroEnabled" => $this->isIntroductionEnabled(),
9870  "Introduction" => $this->getIntroduction(),
9871  "FinalStatement" => $this->getFinalStatement(),
9872  "ShowInfo" => $this->getShowInfo(),
9873  "ForceJS" => $this->getForceJS(),
9874  "CustomStyle" => $this->getCustomStyle(),
9875  "ShowFinalStatement" => $this->getShowFinalStatement(),
9876  "SequenceSettings" => $this->getSequenceSettings(),
9877  "ScoreReporting" => $this->getScoreReporting(),
9878  "ScoreCutting" => $this->getScoreCutting(),
9879  'SpecificAnswerFeedback' => $this->getSpecificAnswerFeedback(),
9880  'PrintBsWithRes' => (int)$this->isBestSolutionPrintedWithResult(),
9881  "InstantFeedbackSolution" => $this->getInstantFeedbackSolution(),
9882  "AnswerFeedback" => $this->getAnswerFeedback(),
9883  "AnswerFeedbackPoints" => $this->getAnswerFeedbackPoints(),
9884  "ResultsPresentation" => $this->getResultsPresentation(),
9885  "Anonymity" => $this->getAnonymity(),
9886  "ShowCancel" => $this->getShowCancel(),
9887  "ShowMarker" => $this->getShowMarker(),
9888  "ReportingDate" => $this->getReportingDate(),
9889  "NrOfTries" => $this->getNrOfTries(),
9890  "Shuffle" => $this->getShuffleQuestions(),
9891  "Kiosk" => $this->getKiosk(),
9892  "UsePreviousAnswers" => $this->getUsePreviousAnswers(),
9893  "ProcessingTime" => $this->getProcessingTime(),
9894  "EnableProcessingTime" => $this->getEnableProcessingTime(),
9895  "ResetProcessingTime" => $this->getResetProcessingTime(),
9896  "StartingTimeEnabled" => $this->isStartingTimeEnabled(),
9897  "StartingTime" => $this->getStartingTime(),
9898  "EndingTimeEnabled" => $this->isEndingTimeEnabled(),
9899  "EndingTime" => $this->getEndingTime(),
9900  "ECTSOutput" => $this->getECTSOutput(),
9901  "ECTSFX" => $this->getECTSFX(),
9902  "ECTSGrades" => $this->getECTSGrades(),
9903  "questionSetType" => $this->getQuestionSetType(),
9904  "CountSystem" => $this->getCountSystem(),
9905  "MCScoring" => $this->getMCScoring(),
9906  "mailnotification" => $this->getMailNotification(),
9907  "mailnottype" => $this->getMailNotificationType(),
9908  "exportsettings" => $this->getExportSettings(),
9909  "ListOfQuestionsSettings" => $this->getListOfQuestionsSettings(),
9910  'obligations_enabled' => (int)$this->areObligationsEnabled(),
9911  'offer_question_hints' => (int)$this->isOfferingQuestionHintsEnabled(),
9912  'pass_deletion_allowed' => (int)$this->isPassDeletionAllowed(),
9913  'enable_examview' => $this->getEnableExamview(),
9914  'show_examview_html' => $this->getShowExamviewHtml(),
9915  'show_examview_pdf' => $this->getShowExamviewPdf(),
9916  'char_selector_availability' => $this->getCharSelectorAvailability(),
9917  'char_selector_definition' => $this->getCharSelectorDefinition(),
9918  'skill_service' => (int)$this->isSkillServiceEnabled(),
9919  'result_tax_filters' => (array)$this->getResultFilterTaxIds(),
9920  'show_grading_status' => (int)$this->isShowGradingStatusEnabled(),
9921  'show_grading_mark' => (int)$this->isShowGradingMarkEnabled(),
9922 
9923  'inst_fb_answer_fixation' => $this->isInstantFeedbackAnswerFixationEnabled(),
9924  'redirection_mode' => $this->getRedirectionMode(),
9925  'redirection_url' => $this->getRedirectionUrl(),
9926  'sign_submission' => $this->getSignSubmission(),
9927  'autosave' => (int)$this->getAutosave(),
9928  'autosave_ival' => (int)$this->getAutosaveIval(),
9929  'examid_in_test_pass' => (int)$this->isShowExamIdInTestPassEnabled(),
9930  'examid_in_test_res' => (int)$this->isShowExamIdInTestResultsEnabled(),
9931 
9932  'enable_archiving' => (int)$this->getEnableArchiving(),
9933  'password_enabled' => (int)$this->isPasswordEnabled(),
9934  'password' => (string)$this->getPassword(),
9935  'fixed_participants' => $this->getFixedParticipants(),
9936  'limit_users_enabled' => $this->isLimitUsersEnabled(),
9937  'allowedusers' => $this->getAllowedUsers(),
9938  'alloweduserstimegap' => $this->getAllowedUsersTimeGap(),
9939  'pool_usage' => $this->getPoolUsage(),
9940  'activation_limited' => $this->isActivationLimited(),
9941  'activation_start_time' => $this->getActivationStartingTime(),
9942  'activation_end_time' => $this->getActivationEndingTime(),
9943  'activation_visibility' => $this->getActivationVisibility(),
9944  'highscore_enabled' => $this->getHighscoreEnabled(),
9945  'highscore_anon' => $this->getHighscoreAnon(),
9946  'highscore_achieved_ts' => $this->getHighscoreAchievedTS(),
9947  'highscore_score' => $this->getHighscoreScore(),
9948  'highscore_percentage' => $this->getHighscorePercentage(),
9949  'highscore_hints' => $this->getHighscoreHints(),
9950  'highscore_wtime' => $this->getHighscoreWTime(),
9951  'highscore_own_table' => $this->getHighscoreOwnTable(),
9952  'highscore_top_table' => $this->getHighscoreTopTable(),
9953  'highscore_top_num' => $this->getHighscoreTopNum(),
9954  'use_previous_answers' => (string)$this->getUsePreviousAnswers()
9955  );
9956 
9957  $next_id = $ilDB->nextId('tst_test_defaults');
9958  $ilDB->insert(
9959  'tst_test_defaults',
9960  array(
9961  'test_defaults_id' => array('integer', $next_id),
9962  'name' => array('text', $a_name),
9963  'user_fi' => array('integer', $ilUser->getId()),
9964  'defaults' => array('clob', serialize($testsettings)),
9965  'marks' => array('clob', serialize($this->mark_schema)),
9966  'tstamp' => array('integer', time())
9967  )
9968  );
9969  }
getScoreReporting()
Gets the score reporting of the ilObjTest object.
getHighscoreOwnTable()
Gets if the own rankings table should be shown.
getECTSOutput()
{int|bool}
getFixedParticipants()
Returns the fixed participants status.
getReportingDate()
Gets the reporting date of the ilObjTest object.
getCustomStyle()
Get the custom style.
getResultsPresentation()
Returns the combined results presentation value.
isPassDeletionAllowed()
getter for the test setting passDeletionAllowed
isShowExamIdInTestPassEnabled()
getMailNotification()
Get mail notification settings.
getEnableProcessingTime()
Returns the state of the processing time (enabled/disabled)
getHighscoreAchievedTS()
Returns if date and time of the scores achievement should be displayed.
getListOfQuestionsSettings()
Returns the settings for the list of questions options in the test properties This could contain one ...
getShowInfo()
Gets whether the complete information page is shown or the required data only.
getAnonymity()
Returns the anonymity status of the test.
getShuffleQuestions()
Returns the status of the shuffle_questions variable.
isShowExamIdInTestResultsEnabled()
getHighscoreWTime()
Gets if the column with the workingtime should be shown.
getHighscoreTopTable()
Gets, if the top-rankings table should be shown.
areObligationsEnabled()
returns the fact wether obligations are enabled or not
getSequenceSettings()
SEQUENCE SETTING = POSTPONING ENABLED !!
getHighscorePercentage()
Gets if the percentage column should be shown.
getCountSystem()
Gets the count system for the calculation of points.
getIntroduction()
Gets the introduction text of the ilObjTest object.
getHighscoreHints()
Gets, if the column with the number of requested hints should be shown.
getResetProcessingTime()
Returns wheather the processing time should be reset or not.
getHighscoreAnon()
Gets if the highscores should be anonymized per setting.
getShowMarker()
Returns wheather the marker button is shown or not.
getAnswerFeedback()
Returns 1 if generic answer feedback is activated.
getTitleOutput()
Returns the value of the title_output status.
getUsePreviousAnswers()
Returns if the previous answers should be shown for a learner.
getShowFinalStatement()
Returns whether the final statement should be shown or not.
getProcessingTime()
Returns the processing time for the test.
isOfferingQuestionHintsEnabled()
returns the fact wether offering hints is enabled or not
isBestSolutionPrintedWithResult()
getAnswerFeedbackPoints()
Returns 1 if answer specific feedback as reached points is activated.
getStartingTime()
Returns the starting time of the test.
getInstantFeedbackSolution()
Returns 1 if the correct solution will be shown after answering a question.
getFinalStatement()
Gets the final statement.
isInstantFeedbackAnswerFixationEnabled()
getPassword()
Returns the password for test access.
getNrOfTries()
Returns the nr of tries for the test.
getQuestionSetType()
getter for question set type
getEndingTime()
Returns the ending time of the test.
getScoreCutting()
Determines if the score of a question should be cut at 0 points or the score of the whole test...
global $ilUser
Definition: imgupload.php:15
getECTSGrades()
{array}
global $ilDB
getECTSFX()
{float|null}
getShowCancel()
Returns wheather the cancel test button is shown or not.
getHighscoreScore()
Gets if the score column should be shown.
getMCScoring()
Gets the scoring type for multiple choice questions.
getHighscoreEnabled()
Gets the setting which determines if the highscore feature is enabled.
getKiosk()
Returns the kiosk mode.
getForceJS()
Gets whether JavaScript should be forced for tests.
getHighscoreTopNum($a_retval=10)
Gets the number of entries which are to be shown in the top-rankings table.
getPassScoring()
Gets the pass scoring type.
+ Here is the call graph for this function:

◆ addExtraTime()

ilObjTest::addExtraTime (   $active_id,
  $minutes 
)

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

References $ilDB, $result, $row, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), getTestId(), and logAction().

11756  {
11757  global $ilDB;
11758 
11759  $participants = array();
11760  if ($active_id == 0)
11761  {
11762  $result = $ilDB->queryF("SELECT active_id FROM tst_active WHERE test_fi = %s",
11763  array('integer'),
11764  array($this->getTestId())
11765  );
11766  while ($row = $ilDB->fetchAssoc($result))
11767  {
11768  array_push($participants, $row['active_id']);
11769  }
11770  }
11771  else
11772  {
11773  array_push($participants, $active_id);
11774  }
11775  foreach ($participants as $active_id)
11776  {
11777  $result = $ilDB->queryF("SELECT active_fi FROM tst_addtime WHERE active_fi = %s",
11778  array('integer'),
11779  array($active_id)
11780  );
11781  if ($result->numRows() > 0)
11782  {
11783  $ilDB->manipulateF("DELETE FROM tst_addtime WHERE active_fi = %s",
11784  array('integer'),
11785  array($active_id)
11786  );
11787  }
11788 
11789  $ilDB->manipulateF("UPDATE tst_active SET tries = %s, submitted = %s, submittimestamp = %s WHERE active_id = %s",
11790  array('integer','integer','timestamp','integer'),
11791  array(0, 0, NULL, $active_id)
11792  );
11793 
11794  $ilDB->manipulateF("INSERT INTO tst_addtime (active_fi, additionaltime, tstamp) VALUES (%s, %s, %s)",
11795  array('integer','integer','integer'),
11796  array($active_id, $minutes, time())
11797  );
11798 
11799  require_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
11801  {
11802  $this->logAction(sprintf($this->lng->txtlng("assessment", "log_added_extratime", ilObjAssessmentFolder::_getLogLanguage()), $minutes, $active_id));
11803  }
11804  }
11805  }
logAction($logtext="", $question_id="")
Logs an action into the Test&Assessment log.
$result
getTestId()
Gets the database id of the additional test data.
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
_getLogLanguage()
retrieve the log language for assessment logging
global $ilDB
+ 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 public

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

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

Referenced by toXML().

9441  {
9442  include_once "./Services/RTE/classes/class.ilRTE.php";
9443  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
9444 
9445  $a_xml_writer->xmlStartTag("material");
9446  $attrs = array(
9447  "texttype" => "text/plain"
9448  );
9449  if ($this->isHTML($a_material))
9450  {
9451  $attrs["texttype"] = "text/xhtml";
9452  }
9453  $a_xml_writer->xmlElement("mattext", $attrs, ilRTE::_replaceMediaObjectImageSrc($a_material, 0));
9454 
9455  $mobs = ilObjMediaObject::_getMobsOfObject("tst:html", $this->getId());
9456  foreach ($mobs as $mob)
9457  {
9458  $moblabel = "il_" . IL_INST_ID . "_mob_" . $mob;
9459  if (strpos($a_material, "mm_$mob") !== FALSE)
9460  {
9461  if (ilObjMediaObject::_exists($mob))
9462  {
9463  $mob_obj =& new ilObjMediaObject($mob);
9464  $imgattrs = array(
9465  "label" => $moblabel,
9466  "uri" => "objects/" . "il_" . IL_INST_ID . "_mob_" . $mob . "/" . $mob_obj->getTitle()
9467  );
9468  }
9469  $a_xml_writer->xmlElement("matimage", $imgattrs, NULL);
9470  }
9471  }
9472  $a_xml_writer->xmlEndTag("material");
9473  }
isHTML($a_text)
Checks if a given string contains HTML or not.
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...
$mobs
getId()
get object id public
static _exists($a_id)
checks wether a lm content object with specified id exists or not
Class ilObjMediaObject.
_getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
+ 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

public ilDB $ilDB

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

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

References $ilDB, $pass, and $row.

Referenced by ilTestPlayerAbstractGUI\finishTestCmd(), and ilTestOutputGUI\redirectQuestionCmd().

11560  {
11561  global $ilDB;
11562 
11563  $rset = $ilDB->queryF(
11564  'SELECT obligations_answered FROM tst_pass_result WHERE active_fi = %s AND pass = %s',
11565  array('integer', 'integer'),
11566  array($active_id, $pass)
11567  );
11568 
11569  if( $row = $ilDB->fetchAssoc($rset) )
11570  {
11571  return (bool)$row['obligations_answered'];
11572  }
11573 
11574  return !self::hasObligations($test_id);
11575  }
global $ilDB
+ 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 9978 of file class.ilObjTest.php.

References saveToDb(), setActivationEndingTime(), setActivationLimited(), setActivationStartingTime(), setActivationVisibility(), setAllowedUsers(), setAllowedUsersTimeGap(), setAnonymity(), setAnswerFeedback(), setAnswerFeedbackPoints(), setAutosave(), setAutosaveIval(), setCharSelectorAvailability(), setCharSelectorDefinition(), setCountSystem(), setCustomStyle(), setECTSFX(), setECTSGrades(), setECTSOutput(), setEnableArchiving(), setEnableExamview(), setEnableProcessingTime(), setEndingTime(), setEndingTimeEnabled(), setExportSettings(), setFinalStatement(), setFixedParticipants(), 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(), 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().

9979  {
9980  $testsettings = unserialize($test_defaults["defaults"]);
9981  include_once "./Modules/Test/classes/class.assMarkSchema.php";
9982  $this->mark_schema = unserialize($test_defaults["marks"]);
9983 
9984  $this->setTitleOutput($testsettings["TitleOutput"]);
9985  $this->setPassScoring($testsettings["PassScoring"]);
9986  $this->setIntroductionEnabled($testsettings["IntroEnabled"]);
9987  $this->setIntroduction($testsettings["Introduction"]);
9988  $this->setFinalStatement($testsettings["FinalStatement"]);
9989  $this->setShowInfo($testsettings["ShowInfo"]);
9990  $this->setForceJS($testsettings["ForceJS"]);
9991  $this->setCustomStyle($testsettings["CustomStyle"]);
9992  $this->setShowFinalStatement($testsettings["ShowFinalStatement"]);
9993  $this->setSequenceSettings($testsettings["SequenceSettings"]);
9994  $this->setScoreReporting($testsettings["ScoreReporting"]);
9995  $this->setScoreCutting($testsettings['ScoreCutting']);
9996  $this->setSpecificAnswerFeedback($testsettings['SpecificAnswerFeedback']);
9997  $this->setPrintBestSolutionWithResult((bool)$testsettings['PrintBsWithRes']);
9998  $this->setInstantFeedbackSolution($testsettings["InstantFeedbackSolution"]);
9999  $this->setAnswerFeedback($testsettings["AnswerFeedback"]);
10000  $this->setAnswerFeedbackPoints($testsettings["AnswerFeedbackPoints"]);
10001  $this->setResultsPresentation($testsettings["ResultsPresentation"]);
10002  $this->setAnonymity($testsettings["Anonymity"]);
10003  $this->setShowCancel($testsettings["ShowCancel"]);
10004  $this->setShuffleQuestions($testsettings["Shuffle"]);
10005  $this->setShowMarker($testsettings["ShowMarker"]);
10006  $this->setReportingDate($testsettings["ReportingDate"]);
10007  $this->setNrOfTries($testsettings["NrOfTries"]);
10008  $this->setUsePreviousAnswers($testsettings["UsePreviousAnswers"]);
10009  $this->setRedirectionMode($testsettings['redirection_mode']);
10010  $this->setRedirectionUrl($testsettings['redirection_url']);
10011  $this->setProcessingTime($testsettings["ProcessingTime"]);
10012  $this->setResetProcessingTime($testsettings["ResetProcessingTime"]);
10013  $this->setEnableProcessingTime($testsettings["EnableProcessingTime"]);
10014  $this->setStartingTimeEnabled($testsettings["StartingTimeEnabled"]);
10015  $this->setStartingTime($testsettings["StartingTime"]);
10016  $this->setKiosk($testsettings["Kiosk"]);
10017  $this->setEndingTimeEnabled($testsettings["EndingTimeEnabled"]);
10018  $this->setEndingTime($testsettings["EndingTime"]);
10019  $this->setECTSOutput($testsettings["ECTSOutput"]);
10020  $this->setECTSFX($testsettings["ECTSFX"]);
10021  $this->setECTSGrades($testsettings["ECTSGrades"]);
10022  if( isset($testsettings["isRandomTest"]) )
10023  {
10024  if( $testsettings["isRandomTest"] )
10025  {
10026  $this->setQuestionSetType(self::QUESTION_SET_TYPE_RANDOM);
10027  }
10028  else
10029  {
10030  $this->setQuestionSetType(self::QUESTION_SET_TYPE_FIXED);
10031  }
10032  }
10033  elseif( isset($testsettings["questionSetType"]) )
10034  {
10035  $this->setQuestionSetType($testsettings["questionSetType"]);
10036  }
10037  $this->setCountSystem($testsettings["CountSystem"]);
10038  $this->setMCScoring($testsettings["MCScoring"]);
10039  $this->setMailNotification($testsettings["mailnotification"]);
10040  $this->setMailNotificationType($testsettings["mailnottype"]);
10041  $this->setExportSettings($testsettings['exportsettings']);
10042  $this->setListOfQuestionsSettings($testsettings["ListOfQuestionsSettings"]);
10043  $this->setObligationsEnabled($testsettings["obligations_enabled"]);
10044  $this->setOfferingQuestionHintsEnabled($testsettings["offer_question_hints"]);
10045  $this->setHighscoreEnabled($testsettings['highscore_enabled']);
10046  $this->setHighscoreAnon($testsettings['highscore_anon']);
10047  $this->setHighscoreAchievedTS($testsettings['highscore_achieved_ts']);
10048  $this->setHighscoreScore($testsettings['highscore_score']);
10049  $this->setHighscorePercentage($testsettings['highscore_percentage']);
10050  $this->setHighscoreHints($testsettings['highscore_hints']);
10051  $this->setHighscoreWTime($testsettings['highscore_wtime']);
10052  $this->setHighscoreOwnTable($testsettings['highscore_own_table']);
10053  $this->setHighscoreTopTable($testsettings['highscore_top_table']);
10054  $this->setHighscoreTopNum($testsettings['highscore_top_num']);
10055  $this->setPassDeletionAllowed($testsettings['pass_deletion_allowed']);
10056  if( isset($testsettings['examid_in_kiosk']) )
10057  {
10058  $this->setShowExamIdInTestPassEnabled($testsettings['examid_in_kiosk']);
10059  }
10060  else
10061  {
10062  $this->setShowExamIdInTestPassEnabled($testsettings['examid_in_test_pass']);
10063  }
10064  if( isset($testsettings['show_exam_id']) )
10065  {
10066  $this->setShowExamIdInTestResultsEnabled($testsettings['show_exam_id']);
10067  }
10068  else
10069  {
10070  $this->setShowExamIdInTestResultsEnabled($testsettings['examid_in_test_res']);
10071  }
10072  $this->setEnableExamview($testsettings['enable_examview']);
10073  $this->setShowExamviewHtml($testsettings['show_examview_html']);
10074  $this->setShowExamviewPdf($testsettings['show_examview_pdf']);
10075  $this->setEnableArchiving($testsettings['enable_archiving']);
10076  $this->setSignSubmission($testsettings['sign_submission']);
10077  $this->setCharSelectorAvailability($testsettings['char_selector_availability']);
10078  $this->setCharSelectorDefinition($testsettings['char_selector_definition']);
10079  $this->setSkillServiceEnabled((bool)$testsettings['skill_service']);
10080  $this->setResultFilterTaxIds((array)$testsettings['result_tax_filters']);
10081  $this->setShowGradingStatusEnabled((bool)$testsettings['show_grading_status']);
10082  $this->setShowGradingMarkEnabled((bool)$testsettings['show_grading_mark']);
10083 
10084  $this->setInstantFeedbackAnswerFixationEnabled($testsettings['inst_fb_answer_fixation']);
10085  $this->setRedirectionMode($testsettings['redirection_mode']);
10086  $this->setRedirectionUrl($testsettings['redirection_url']);
10087 
10088  $this->setAutosave($testsettings['autosave']);
10089  $this->setAutosaveIval($testsettings['autosave_ival']);
10090  $this->setShowExamIdInTestResultsEnabled((int)$testsettings['examid_in_test_res']);
10091  $this->setPasswordEnabled($testsettings['password_enabled']);
10092  $this->setPassword($testsettings['password']);
10093  $this->setFixedParticipants($testsettings['fixed_participants'] );
10094  $this->setLimitUsersEnabled($testsettings['limit_users_enabled']);
10095  $this->setAllowedUsers($testsettings['allowedusers']);
10096  $this->setAllowedUsersTimeGap($testsettings['alloweduserstimegap']);
10097  $this->setUsePreviousAnswers($testsettings['use_previous_answers']);
10098  $this->setPoolUsage($testsettings['pool_usage']);
10099  $this->setActivationLimited($testsettings['activation_limited']);
10100  $this->setActivationStartingTime($testsettings['activation_start_time']);
10101  $this->setActivationEndingTime($testsettings['activation_end_time']);
10102  $this->setActivationVisibility($testsettings['activation_visibility']);
10103 
10104  $this->saveToDb();
10105 
10106  return true;
10107  }
setStartingTime($starting_time=NULL)
Sets the starting time in database timestamp format for the test.
setAllowedUsers($a_allowed_users)
setAnswerFeedback($answer_feedback=0)
Sets the generic feedback for the test Use setGenericAnswerFeedback instead.
setECTSFX($a_ects_fx)
{}
setHighscoreTopTable($a_top_table)
Sets if the top-rankings table should be shown.
setPassScoring($a_pass_scoring=SCORE_LAST_PASS)
Sets the pass scoring.
setSkillServiceEnabled($skillServiceEnabled)
setRedirectionUrl($redirection_url=NULL)
setMailNotification($a_notification)
Set mail notification settings.
saveToDb($properties_only=FALSE)
Saves a ilObjTest object to a database.
setAutosave($autosave)
setEnableExamview($enable_examview)
setPassDeletionAllowed($passDeletionAllowed)
setter for the test setting passDeletionAllowed
setShowExamIdInTestPassEnabled($show_exam_id_in_test_pass_enabled)
setShowExamviewPdf($show_examview_pdf)
setRedirectionMode($redirection_mode=0)
setQuestionSetType($questionSetType)
setter for question set type
setECTSOutput($a_ects_output)
{}
setReportingDate($reporting_date)
Sets the reporting date of the ilObjTest object.
setResultFilterTaxIds($resultFilterTaxIds)
setShuffleQuestions($a_shuffle)
Sets the status of the shuffle_questions variable.
setFixedParticipants($a_value=1)
Sets the fixed participants status.
setCharSelectorDefinition($definition='')
setHighscoreScore($a_score)
Sets if the actual score should be displayed.
setHighscoreWTime($a_wtime)
Sets if the workingtime of the scores should be shown.
setFinalStatement($a_statement="")
Sets the final statement text of the ilObjTest object.
setScoreCutting($a_score_cutting=SCORE_CUT_QUESTION)
Sets the type of score cutting.
setEndingTime($ending_time=NULL)
Sets the ending time in database timestamp format for the test.
setResetProcessingTime($reset=0)
Sets wheather the processing time should be reset or not.
setCharSelectorAvailability($availability)
setShowMarker($a_value=1)
Sets the marker button status.
setEndingTimeEnabled($ending_time_enabled)
setActivationLimited($a_value)
setSpecificAnswerFeedback($specific_answer_feedback)
setShowGradingStatusEnabled($showGradingStatusEnabled)
setMailNotificationType($a_type)
setObligationsEnabled($obligationsEnabled=true)
sets obligations enabled/disabled
setHighscoreOwnTable($a_own_table)
Sets if the table with the own ranking should be shown.
setTitleOutput($title_output=0)
Sets the status of the title output.
setPoolUsage($usage)
setCustomStyle($a_customStyle=NULL)
Set the custom style.
setSignSubmission($sign_submission)
setNrOfTries($nr_of_tries=0)
Sets the nr of tries for the test.
setScoreReporting($score_reporting=0)
Sets the score reporting of the ilObjTest object.
setAnswerFeedbackPoints($answer_feedback_points=0)
Sets the answer specific feedback of reached points for the test.
setShowCancel($a_value=1)
Sets the cancel test button status.
setLimitUsersEnabled($limitUsersEnabled)
setAutosaveIval($autosave_ival)
setProcessingTime($processing_time="00:00:00")
Sets the processing time for the test.
setCountSystem($a_count_system=COUNT_PARTIAL_SOLUTIONS)
Sets the count system for the calculation of points.
setExportSettings($a_settings)
setHighscoreTopNum($a_top_num)
Sets the number of entries which are to be shown in the top-rankings table.
setActivationVisibility($a_value)
setShowInfo($a_info=1)
Set whether the complete information page is shown or the required data only.
setInstantFeedbackSolution($instant_feedback=0)
Sets the instant feedback for the solution.
setAllowedUsersTimeGap($a_allowed_users_time_gap)
setECTSGrades(array $a_ects_grades)
{}
setAnonymity($a_value=0)
Sets the anonymity status of the test.
setKiosk($kiosk=0)
Sets the kiosk mode for the test.
setUsePreviousAnswers($use_previous_answers=1)
Sets the status of the visibility of previous learner answers.
setResultsPresentation($a_results_presentation=3)
Sets the combined results presentation value.
setForceJS($a_js=1)
Set whether JavaScript should be forced for tests.
setHighscoreHints($a_hints)
Sets if the number of requested hints should be shown.
setEnableProcessingTime($enable=0)
Sets the processing time enabled or disabled.
setHighscoreAchievedTS($a_achieved_ts)
Sets if the date and time of the scores achievement should be displayed.
setEnableArchiving($enable_archiving)
setPasswordEnabled($passwordEnabled)
setShowExamviewHtml($show_examview_html)
setOfferingQuestionHintsEnabled($offeringQuestionHintsEnabled)
sets offering question hints enabled/disabled
setPrintBestSolutionWithResult($status)
setMCScoring($a_mc_scoring=SCORE_ZERO_POINTS_WHEN_UNANSWERED)
Sets the multiple choice scoring.
setHighscoreAnon($a_anon)
Sets if the highscores should be anonymized.
setActivationStartingTime($starting_time=NULL)
setShowExamIdInTestResultsEnabled($show_exam_id_in_test_results_enabled)
setIntroduction($introduction="")
Sets the introduction text of the ilObjTest object.
setHighscoreEnabled($a_enabled)
Sets if the highscore feature should be enabled.
setShowGradingMarkEnabled($showGradingMarkEnabled)
setInstantFeedbackAnswerFixationEnabled($instantFeedbackAnswerFixationEnabled)
setHighscorePercentage($a_percentage)
Sets if the percentages of the scores pass should be shown.
setIntroductionEnabled($introductionEnabled)
setActivationEndingTime($ending_time=NULL)
setShowFinalStatement($show=0)
Sets whether the final statement should be shown or not.
setSequenceSettings($sequence_settings=0)
SEQUENCE SETTING = POSTPONING ENABLED !!
setPassword($a_password=NULL)
Sets the password for test access.
setListOfQuestionsSettings($a_value=0)
Sets the settings for the list of questions options in the test properties This could contain one of ...
setStartingTimeEnabled($starting_time_enabled)
+ 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 11501 of file class.ilObjTest.php.

References $obligationsEnabled.

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

11502  {
11503  return (bool)$this->obligationsEnabled;
11504  }
+ 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

Move this to a proper place.

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

References $ilSetting, and $pass.

Referenced by assQuestion\_updateTestResultCache(), and ilTestPlayerAbstractGUI\getKioskHead().

11876  {
11878  global $ilSetting;
11879 
11880  $inst_id = $ilSetting->get( 'inst_id', null );
11881 
11882  if($test_obj_id === null)
11883  {
11884  $obj_id = self::_getObjectIDFromActiveID($active_id);
11885  }
11886  else
11887  {
11888  $obj_id = $test_obj_id;
11889  }
11890 
11891  $examId = 'I' . $inst_id . '_T' . $obj_id . '_A' . $active_id . '_P' . $pass;
11892 
11893  return $examId;
11894  }
global $ilSetting
Definition: privfeed.php:40
+ 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 public

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

References ilObject\$title, and getAnonymity().

5445  {
5446  $name = "";
5447  if (strlen($firstname.$lastname.$title) == 0)
5448  {
5449  $name = $this->lng->txt("deleted_user");
5450  }
5451  else
5452  {
5453  if ($user_id == ANONYMOUS_USER_ID)
5454  {
5455  $name = $lastname;
5456  }
5457  else
5458  {
5459  $name = trim($lastname . ", " . $firstname . " " . $title);
5460  }
5461  if ($this->getAnonymity())
5462  {
5463  $name = $this->lng->txt("anonymous");
5464  }
5465  }
5466  return $name;
5467  }
getAnonymity()
Returns the anonymity status of the test.
+ Here is the call graph for this function:

◆ canEditEctsGrades()

ilObjTest::canEditEctsGrades ( )

{

Returns
boolean
}

Implements ilEctsGradesEnabled.

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

References getReportingDate().

7008  {
7009  return $this->getReportingDate();
7010  }
getReportingDate()
Gets the reporting date of the ilObjTest object.
+ Here is the call graph for this function:

◆ canEditMarks()

ilObjTest::canEditMarks ( )
Returns
{}

Implements ilMarkSchemaAware.

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

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

7132  {
7133  $total = $this->evalTotalPersons();
7134  if($total > 0)
7135  {
7136  if($this->getReportingDate())
7137  {
7138  if(preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getReportingDate(), $matches))
7139  {
7140  $epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
7141  $now = mktime();
7142  if($now < $epoch_time)
7143  {
7144  return true;
7145  }
7146  }
7147  }
7148  return false;
7149  }
7150  else
7151  {
7152  return true;
7153  }
7154  }
getReportingDate()
Gets the reporting date of the ilObjTest object.
evalTotalPersons()
Returns the number of persons who started the test.
+ Here is the call 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.

public

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

References $ilDB, $query, $result, $row, canShowTestResults(), getCertificateVisibility(), and getPassed().

10472  {
10473  if ($this->canShowTestResults($testSession, $user_id))
10474  {
10475  include_once "./Services/Certificate/classes/class.ilCertificate.php";
10476  include_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
10477  $cert = new ilCertificate(new ilTestCertificateAdapter($this));
10478  if ($cert->isComplete())
10479  {
10480  $vis = $this->getCertificateVisibility();
10481  $showcert = FALSE;
10482  switch ($vis)
10483  {
10484  case 0:
10485  $showcert = TRUE;
10486  break;
10487  case 1:
10488  if ($this->getPassed($active_id))
10489  {
10490  $showcert = TRUE;
10491  }
10492  break;
10493  case 2:
10494  $showcert = FALSE;
10495  break;
10496  }
10497  if ($showcert)
10498  {
10499  return TRUE;
10500  }
10501  else
10502  {
10503  return FALSE;
10504  }
10505  }
10506  else
10507  {
10508  return FALSE;
10509  }
10510  }
10511  else
10512  {
10513  return FALSE;
10514  }
10515  }
getCertificateVisibility()
Returns the visibility settings of the certificate.
canShowTestResults($testSession, $user_id)
getPassed($active_id)
Create PDF certificates.
+ Here is the call 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 public

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

References getShowSolutionPrintview().

9138  {
9139  return $this->getShowSolutionPrintview();
9140  }
getShowSolutionPrintview()
Returns if the solution printview should be presented to the user or not.
+ Here is the call graph for this function:

◆ canShowTestResults()

ilObjTest::canShowTestResults (   $testSession,
  $user_id 
)

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

References $result, $starting_time, canViewResults(), endingTimeReached(), getActiveIdOfUser(), getScoreReporting(), getStartingTimeOfUser(), isMaxProcessingTimeReached(), isTestFinishedToViewResults(), and REPORT_AFTER_TEST.

Referenced by canShowCertificate().

8533  {
8534  $active_id = $this->getActiveIdOfUser($user_id);
8535  if ($active_id > 0)
8536  {
8537  $starting_time = $this->getStartingTimeOfUser($active_id);
8538  }
8539  $notimeleft = FALSE;
8540  if ($starting_time !== FALSE)
8541  {
8542  if ($this->isMaxProcessingTimeReached($starting_time, $active_id))
8543  {
8544  $notimeleft = TRUE;
8545  }
8546  }
8547  $result = TRUE;
8548  if (!$this->isTestFinishedToViewResults($active_id, $testSession->getPass()) && ($this->getScoreReporting() == REPORT_AFTER_TEST))
8549  {
8550  $result = FALSE;
8551  }
8552  if (($this->endingTimeReached()) || $notimeleft) $result = TRUE;
8553  $result = $result & $this->canViewResults();
8554  return $result;
8555  }
getScoreReporting()
Gets the score reporting of the ilObjTest object.
const REPORT_AFTER_TEST
$result
getActiveIdOfUser($user_id="", $anonymous_id="")
Gets the active id of a given user.
isMaxProcessingTimeReached($starting_time, $active_id)
Returns whether the maximum processing time for a test is reached or not.
canViewResults()
Returns true, if the test results can be viewed.
getStartingTimeOfUser($active_id, $pass=null)
Returns the unix timestamp of the time a user started a test.
isTestFinishedToViewResults($active_id, $currentpass)
Returns true if an active user completed a test pass and did not start a new pass.
endingTimeReached()
Returns true if the ending time of a test is reached An ending time is not available for self assessm...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ canViewResults()

ilObjTest::canViewResults ( )

Returns true, if the test results can be viewed.

Returns
boolean True, if the test results can be viewed, else false public

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

References $result, getReportingDate(), and getScoreReporting().

Referenced by canShowTestResults().

8514  {
8515  $result = true;
8516  if ($this->getScoreReporting() == 4) return false;
8517  if ($this->getReportingDate())
8518  {
8519  if (preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getReportingDate(), $matches))
8520  {
8521  $epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
8522  $now = mktime();
8523  if ($now < $epoch_time)
8524  {
8525  $result = false;
8526  }
8527  }
8528  }
8529  return $result;
8530  }
getScoreReporting()
Gets the score reporting of the ilObjTest object.
getReportingDate()
Gets the reporting date of the ilObjTest object.
$result
+ Here is the call graph for this function:
+ 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 7086 of file class.ilObjTest.php.

7087  {
7088  return $this->mark_schema->checkMarks();
7089  }

◆ checkMaximumAllowedUsers()

ilObjTest::checkMaximumAllowedUsers ( )

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

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

9325  {
9326  global $ilDB;
9327 
9328  $nr_of_users = $this->getAllowedUsers();
9329  $time_gap = ($this->getAllowedUsersTimeGap()) ? $this->getAllowedUsersTimeGap() : 60;
9330  if (($nr_of_users > 0) && ($time_gap > 0))
9331  {
9332  $now = mktime();
9333  $time_border = $now - $time_gap;
9334  $str_time_border = strftime("%Y%m%d%H%M%S", $time_border);
9335  $query = "
9336  SELECT DISTINCT tst_times.active_fi
9337  FROM tst_times
9338  INNER JOIN tst_active
9339  ON tst_times.active_fi = tst_active.active_id
9340  AND (
9341  tst_times.pass > tst_active.last_finished_pass OR tst_active.last_finished_pass IS NULL
9342  )
9343  WHERE tst_times.tstamp > %s
9344  AND tst_active.test_fi = %s
9345  ";
9346  $result = $ilDB->queryF($query, array('integer', 'integer'), array($time_border, $this->getTestId()));
9347  if ($result->numRows() >= $nr_of_users)
9348  {
9349  include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
9351  {
9352  $this->logAction($this->lng->txtlng("assessment", "log_could_not_enter_test_due_to_simultaneous_users", ilObjAssessmentFolder::_getLogLanguage()));
9353  }
9354  return FALSE;
9355  }
9356  else
9357  {
9358  return TRUE;
9359  }
9360  }
9361  return TRUE;
9362  }
logAction($logtext="", $question_id="")
Logs an action into the Test&Assessment log.
$result
getTestId()
Gets the database id of the additional test data.
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
_getLogLanguage()
retrieve the log language for assessment logging
global $ilDB
+ 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.

private

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

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

Referenced by saveToDb().

1255  {
1256  include_once("./Services/RTE/classes/class.ilRTE.php");
1257  $completecontent = "";
1258  foreach ($this->getAllRTEContent() as $content)
1259  {
1260  $completecontent .= $content;
1261  }
1262  ilRTE::_cleanupMediaObjectUsage($completecontent, $this->getType() . ":html",
1263  $this->getId());
1264  }
_cleanupMediaObjectUsage($a_text, $a_usage_type, $a_usage_id)
synchronises appearances of media objects in $a_text with media object usage table ...
getId()
get object id public
getAllRTEContent()
Returns the content of all RTE enabled text areas in the test.
getType()
get object type public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilObjTest::create (   $a_upload = false)

create test object

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

References createMetaData().

693  {
694  parent::create();
695 
696  // meta data will be created by
697  // import parser
698  if (!$a_upload)
699  {
700  $this->createMetaData();
701  }
702  }
createMetaData()
Create meta data entry.
+ 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 913 of file class.ilObjTest.php.

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

914  {
915  include_once "./Services/Utilities/classes/class.ilUtil.php";
916  $tst_data_dir = ilUtil::getDataDir()."/tst_data";
917  ilUtil::makeDir($tst_data_dir);
918  if (!is_writable($tst_data_dir))
919  {
920  $this->ilias->raiseError("Test Data Directory (".$tst_data_dir
921  .") not writeable.",$this->ilias->error_obj->MESSAGE);
922  }
923 
924  // create learning module directory (data_dir/lm_data/lm_<id>)
925  $tst_dir = $tst_data_dir."/tst_".$this->getId();
926  ilUtil::makeDir($tst_dir);
927  if (!@is_dir($tst_dir))
928  {
929  $this->ilias->raiseError("Creation of Test Directory failed.",$this->ilias->error_obj->MESSAGE);
930  }
931  // create Export subdirectory (data_dir/lm_data/lm_<id>/Export)
932  $export_dir = $tst_dir."/export";
933  ilUtil::makeDir($export_dir);
934  if (!@is_dir($export_dir))
935  {
936  $this->ilias->raiseError("Creation of Export Directory failed.",$this->ilias->error_obj->MESSAGE);
937  }
938  }
getId()
get object id public
redirection script todo: (a better solution should control the processing via a xml file) ...
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

◆ createMetaData()

ilObjTest::createMetaData ( )

Create meta data entry.

public

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

References saveAuthorToMetadata().

Referenced by create().

7206  {
7207  parent::createMetaData();
7208  $this->saveAuthorToMetadata();
7209  }
saveAuthorToMetadata($a_author="")
Saves an authors name into the lifecycle metadata if no lifecycle metadata exists This will only be c...
+ 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
object The question GUI instance public

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

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

5616  {
5617  if ((!$question_type) and ($question_id > 0))
5618  {
5619  $question_type = $this->getQuestionType($question_id);
5620  }
5621 
5622  if (!strlen($question_type)) return null;
5623 
5624  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
5625  assQuestion::_includeClass($question_type, 1);
5626 
5627  $question_type_gui = assQuestion::getGuiClassNameByQuestionType($question_type);
5628  $question = new $question_type_gui();
5629 
5630  $question->object->setObligationsToBeConsidered( $this->areObligationsEnabled() );
5631 
5632  if ($question_id > 0)
5633  {
5634  $question->object->loadFromDb($question_id);
5635 
5636  global $ilCtrl, $ilDB, $ilUser, $lng;
5637 
5638  $feedbackObjectClassname = assQuestion::getFeedbackClassNameByQuestionType($question_type);
5639  $question->object->feedbackOBJ = new $feedbackObjectClassname($question->object, $ilCtrl, $ilDB, $lng);
5640 
5641  $assSettings = new ilSetting('assessment');
5642  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockerFactory.php';
5643  $processLockerFactory = new ilAssQuestionProcessLockerFactory($assSettings, $ilDB);
5644  $processLockerFactory->setQuestionId($question->object->getId());
5645  $processLockerFactory->setUserId($ilUser->getId());
5646  include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
5647  $processLockerFactory->setAssessmentLogEnabled(ilObjAssessmentFolder::_enabledAssessmentLogging());
5648  $question->object->setProcessLocker($processLockerFactory->getLocker());
5649  }
5650 
5651  return $question;
5652  }
ILIAS Setting Class.
static _includeClass($question_type, $gui=0)
Include the php class file for a given question type.
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
areObligationsEnabled()
returns the fact wether obligations are enabled or not
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
global $ilDB
getQuestionType($question_id)
Returns the question type of a question with a given id.
static getGuiClassNameByQuestionType($questionType)
static getFeedbackClassNameByQuestionType($questionType)
+ Here is the call graph for this function:

◆ createRandomSolutions()

ilObjTest::createRandomSolutions (   $number)

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

References $data, $ilDB, $pass, $query, $result, _instanciateQuestion(), getNrOfTries(), getQuestionCount(), ilObject\getRefId(), getTestId(), and isRandomTest().

10714  {
10715  global $ilDB;
10716 
10717  // 1. get a user
10718  $query = "SELECT usr_id FROM usr_data";
10719  $result = $ilDB->query($query);
10720  while ($data = $ilDB->fetchAssoc($result))
10721  {
10722  $activequery = sprintf("SELECT user_fi FROM tst_active WHERE test_fi = %s AND user_fi = %s",
10723  $ilDB->quote($this->getTestId()),
10724  $ilDB->quote($data['usr_id'])
10725  );
10726  $activeresult = $ilDB->query($activequery);
10727  if ($activeresult->numRows() == 0)
10728  {
10729  $user_id = $data['usr_id'];
10730  if ($user_id != 13)
10731  {
10732  include_once "./Modules/Test/classes/class.ilTestSession.php";
10733  $testSession = FALSE;
10734  $testSession = new ilTestSession();
10735  $testSession->setRefId($this->getRefId());
10736  $testSession->setTestId($this->getTestId());
10737  $testSession->setUserId($user_id);
10738  $testSession->saveToDb();
10739  $passes = ($this->getNrOfTries()) ? $this->getNrOfTries() : 10;
10740  $nr_of_passes = rand(1, $passes);
10741  $active_id = $testSession->getActiveId();
10742  for ($pass = 0; $pass < $nr_of_passes; $pass++)
10743  {
10744  include_once "./Modules/Test/classes/class.ilTestSequence.php";
10745  $testSequence = new ilTestSequence($active_id, $pass, $this->isRandomTest());
10746  if (!$testSequence->hasSequence())
10747  {
10748  $testSequence->createNewSequence($this->getQuestionCount(), $shuffle);
10749  $testSequence->saveToDb();
10750  }
10751  for ($seq = 1; $seq <= count($this->questions); $seq++)
10752  {
10753  $question_id = $testSequence->getQuestionForSequence($seq);
10754  $objQuestion = ilObjTest::_instanciateQuestion($question_id);
10755  $objQuestion->createRandomSolution($testSession->getActiveId(), $pass);
10756  }
10757  if ($pass < $nr_of_passes - 1)
10758  {
10759  $testSession->increasePass();
10760  $testSession->setLastSequence(0);
10761  $testSession->saveToDb();
10762  }
10763  else
10764  {
10765  $testSession->setSubmitted(1);
10766  $testSession->setSubmittedTimestamp(date('Y-m-d H:i:s'));
10767  $testSession->saveToDb();
10768  }
10769  }
10770  $number--;
10771  if ($number == 0) return;
10772  }
10773  }
10774  }
10775  }
$result
getTestId()
Gets the database id of the additional test data.
& _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
getQuestionCount()
Returns the number of questions in the test.
Test sequence handler.
isRandomTest()
Returns the fact wether this test is a random questions test or not.
Test session handler.
getNrOfTries()
Returns the nr of tries for the test.
global $ilDB
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ createTestSequence()

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

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

References $pass, and isRandomTest().

10338  {
10339  include_once "./Modules/Test/classes/class.ilTestSequence.php";
10340  $this->testSequence = new ilTestSequence($active_id, $pass, $this->isRandomTest());
10341  }
Test sequence handler.
isRandomTest()
Returns the fact wether this test is a random questions test or not.
+ Here is the call graph for this function:

◆ delete()

ilObjTest::delete ( )

delete object and all related data

public

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

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

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

741  {
742  // always call parent delete function first!!
743  if (!parent::delete())
744  {
745  return false;
746  }
747 
748  // delet meta data
749  $this->deleteMetaData();
750 
751  //put here your module specific stuff
752  $this->deleteTest();
753 
754  return true;
755  }
deleteTest()
Deletes the test and all related objects, files and database entries.
deleteMetaData()
delete meta data entry
+ 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 public

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

References $ilDB.

9848  {
9849  global $ilDB;
9850  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_defaults WHERE test_defaults_id = %s",
9851  array('integer'),
9852  array($test_default_id)
9853  );
9854  }
global $ilDB

◆ deleteTest()

ilObjTest::deleteTest ( )

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

public

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

References $ilDB, $mobs, $result, $row, ilObjMediaObject\_exists(), ilObjMediaObject\_getMobsOfObject(), ilObjMediaObject\_removeUsage(), ilUtil\delDir(), ilUtil\getDataDir(), ilObject\getId(), getTestId(), and removeAllTestEditings().

Referenced by delete().

763  {
764  global $tree, $ilDB, $ilPluginAdmin;
765 
766  // first of all remove all test editings, because the delete statements used for this
767  // contain a subquery for active ids, that are deleted in the next steps
768  $this->removeAllTestEditings();
769 
770  $result = $ilDB->queryF("SELECT active_id FROM tst_active WHERE test_fi = %s",
771  array('integer'),
772  array($this->getTestId())
773  );
774  $active_array = array();
775  while ($row = $ilDB->fetchAssoc($result))
776  {
777  array_push($active_array, $row["active_id"]);
778  }
779 
780  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_active WHERE test_fi = %s",
781  array('integer'),
782  array($this->getTestId())
783  );
784 
785  if (count($active_array))
786  {
787  foreach ($active_array as $active_id)
788  {
789  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_times WHERE active_fi = %s",
790  array('integer'),
791  array($active_id)
792  );
793 
794  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_sequence WHERE active_fi = %s",
795  array('integer'),
796  array($active_id)
797  );
798  }
799  }
800 
801  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_mark WHERE test_fi = %s",
802  array('integer'),
803  array($this->getTestId())
804  );
805 
806  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_tests WHERE test_id = %s",
807  array('integer'),
808  array($this->getTestId())
809  );
810 
811  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
812  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this);
813  $testQuestionSetConfigFactory->getQuestionSetConfig()->removeQuestionSetRelatedData();
814 
815  // delete export files
816  include_once "./Services/Utilities/classes/class.ilUtil.php";
817  $tst_data_dir = ilUtil::getDataDir()."/tst_data";
818  $directory = $tst_data_dir."/tst_".$this->getId();
819  if (is_dir($directory))
820  {
821  include_once "./Services/Utilities/classes/class.ilUtil.php";
822  ilUtil::delDir($directory);
823  }
824  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
825  $mobs = ilObjMediaObject::_getMobsOfObject("tst:html", $this->getId());
826  // remaining usages are not in text anymore -> delete them
827  // and media objects (note: delete method of ilObjMediaObject
828  // checks whether object is used in another context; if yes,
829  // the object is not deleted!)
830  foreach($mobs as $mob)
831  {
832  ilObjMediaObject::_removeUsage($mob, "tst:html", $this->getId());
833  if (ilObjMediaObject::_exists($mob))
834  {
835  $mob_obj =& new ilObjMediaObject($mob);
836  $mob_obj->delete();
837  }
838  }
839  }
$result
removeAllTestEditings($question_id="")
Removes all references to the question in executed tests in case the question has been changed...
getTestId()
Gets the database id of the additional test data.
_removeUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
Remove usage of mob in another container.
$mobs
getId()
get object id public
static _exists($a_id)
checks wether a lm content object with specified id exists or not
Class ilObjMediaObject.
_getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
static getDataDir()
get data directory (outside webspace)
global $ilDB
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deliverPDFfromFO()

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

Delivers a PDF file from a XSL-FO string.

Parameters
string$foThe XSL-FO string public

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

References $filename, $ilLog, ilObject\$title, ilUtil\deliverData(), ilRpcClientFactory\factory(), ilUtil\getASCIIFilename(), ilObject\getTitle(), and ilUtil\ilTempnam().

Referenced by deliverPDFfromHTML().

10204  {
10205  global $ilLog;
10206 
10207  include_once "./Services/Utilities/classes/class.ilUtil.php";
10208  $fo_file = ilUtil::ilTempnam() . ".fo";
10209  $fp = fopen($fo_file, "w"); fwrite($fp, $fo); fclose($fp);
10210 
10211  include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
10212  try
10213  {
10214  $pdf_base64 = ilRpcClientFactory::factory('RPCTransformationHandler')->ilFO2PDF($fo);
10215  $filename = (strlen($title)) ? $title : $this->getTitle();
10216  ilUtil::deliverData($pdf_base64->scalar, ilUtil::getASCIIFilename($filename) . ".pdf", "application/pdf", false, true);
10217  return true;
10218  }
10219  catch(XML_RPC2_FaultException $e)
10220  {
10221  $ilLog->write(__METHOD__.': '.$e->getMessage());
10222  return false;
10223  }
10224  catch(Exception $e)
10225  {
10226  $ilLog->write(__METHOD__.': '.$e->getMessage());
10227  return false;
10228  }
10229 
10230  /*
10231  include_once "./Services/Transformation/classes/class.ilFO2PDF.php";
10232  $fo2pdf = new ilFO2PDF();
10233  $fo2pdf->setFOString($fo);
10234  $result = $fo2pdf->send();
10235  $filename = (strlen($title)) ? $title : $this->getTitle();
10236  ilUtil::deliverData($result, ilUtil::getASCIIFilename($filename) . ".pdf", "application/pdf", false, true);
10237  */
10238  }
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
getTitle()
get object title public
$filename
Definition: buildRTE.php:89
static factory($a_package)
Create an XML_RPC2 client instance.
static ilTempnam()
Create a temporary file in an ILIAS writable directory.
+ 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 public

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

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

10161  {
10162  $content = preg_replace("/href=\".*?\"/", "", $content);
10163  $printbody = new ilTemplate("tpl.il_as_tst_print_body.html", TRUE, TRUE, "Modules/Test");
10164  $printbody->setVariable("TITLE", ilUtil::prepareFormOutput($this->getTitle()));
10165  $printbody->setVariable("ADM_CONTENT", $content);
10166  $printbody->setCurrentBlock("css_file");
10167  $printbody->setVariable("CSS_FILE", $this->getTestStyleLocation("filesystem"));
10168  $printbody->parseCurrentBlock();
10169  $printbody->setCurrentBlock("css_file");
10170  $printbody->setVariable("CSS_FILE", ilUtil::getStyleSheetLocation("filesystem", "delos.css"));
10171  $printbody->parseCurrentBlock();
10172  $printoutput = $printbody->get();
10173  $html = str_replace("href=\"./", "href=\"" . ILIAS_HTTP_PATH . "/", $printoutput);
10174  $html = preg_replace("/<div id=\"dontprint\">.*?<\\/div>/ims", "", $html);
10175  if (extension_loaded("tidy"))
10176  {
10177  $config = array(
10178  "indent" => false,
10179  "output-xml" => true,
10180  "numeric-entities" => true
10181  );
10182  $tidy = new tidy();
10183  $tidy->parseString($html, $config, 'utf8');
10184  $tidy->cleanRepair();
10185  $html = tidy_get_output($tidy);
10186  $html = preg_replace("/^.*?(<html)/", "\\1", $html);
10187  }
10188  else
10189  {
10190  $html = str_replace("&nbsp;", "&#160;", $html);
10191  $html = str_replace("&otimes;", "X", $html);
10192  }
10193  $html = preg_replace("/src=\".\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $html);
10194  $this->deliverPDFfromFO($this->processPrintoutput2FO($html), $title);
10195  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
deliverPDFfromFO($fo, $title=null)
Delivers a PDF file from a XSL-FO string.
processPrintoutput2FO($print_output)
Convert a print output to XSL-FO.
getTestStyleLocation($mode="output")
get full style sheet file name (path inclusive) of current user
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
special template class to simplify handling of ITX/PEAR
getTitle()
get object title public
+ 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 public

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

References $ilDB, and getTestId().

7930  {
7931  global $ilDB;
7932 
7933  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_invited_user WHERE test_fi = %s AND user_fi = %s",
7934  array('integer', 'integer'),
7935  array($this->getTestId(), $user_id)
7936  );
7937  }
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ 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 public

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

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

Referenced by insertQuestion().

3770  {
3771  global $ilUser;
3772  $question =& ilObjTest::_instanciateQuestion($question_id);
3773  $duplicate_id = $question->duplicate(true, null, null, null, $this->getId());
3774 
3775  return $duplicate_id;
3776  }
& _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
getId()
get object id public
global $ilUser
Definition: imgupload.php:15
+ 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 public

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

References getEndingTime(), and isEndingTimeEnabled().

Referenced by canShowTestResults(), and isExecutable().

5752  {
5753  if( $this->isEndingTimeEnabled() && $this->getEndingTime() )
5754  {
5755  if (preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getEndingTime(), $matches))
5756  {
5757  $epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
5758  $now = mktime();
5759  if ($now > $epoch_time)
5760  {
5761  // ending time reached
5762  return true;
5763  }
5764  }
5765  }
5766  return false;
5767  }
getEndingTime()
Returns the ending time of the test.
+ 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 12224 of file class.ilObjTest.php.

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

Referenced by ilObjCourseGUI\redirectLocToTestObject().

12225  {
12226  global $ilDB, $lng, $ilPluginAdmin;
12227 
12228  /* @var ilObjTest $testOBJ */
12229 
12230  $testOBJ = ilObjectFactory::getInstanceByRefId($testObjId,false);
12231 
12232  $activeId = $testOBJ->getActiveIdOfUser($userId);
12233 
12234  require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
12235  $testSessionFactory = new ilTestSessionFactory($testOBJ);
12236 
12237  require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
12238  $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $testOBJ);
12239 
12240  $testSession = $testSessionFactory->getSession($activeId);
12241  $testSequence = $testSequenceFactory->getSequenceByPass($testSession, $testSession->getPass());
12242  $testSequence->loadFromDb();
12243 
12244  // begin-patch lok changed smeyer
12245  if($a_force_new_run)
12246  {
12247  if( $testSequence->hasSequence() )
12248  {
12249  $testSession->increasePass();
12250  }
12251  $testSession->setLastSequence(0);
12252  $testSession->saveToDb();
12253  }
12254  // end-patch lok
12255  }
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller 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 public

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

References _evalResultsOverview(), and getTestId().

5332  {
5333  return $this->_evalResultsOverview($this->getTestId());
5334  }
getTestId()
Gets the database id of the additional test data.
& _evalResultsOverview($test_id)
Creates an associated array with the results of all participants of a test.
+ 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 public

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

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

5392  {
5393  global $ilDB;
5394 
5395  $result = $ilDB->queryF("SELECT usr_data.usr_id, usr_data.firstname, usr_data.lastname, usr_data.title, usr_data.login, " .
5396  "tst_test_result.*, qpl_questions.original_id, qpl_questions.title questiontitle, " .
5397  "qpl_questions.points maxpoints " .
5398  "FROM tst_test_result, qpl_questions, tst_active " .
5399  "LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id " .
5400  "WHERE tst_active.active_id = tst_test_result.active_fi " .
5401  "AND qpl_questions.question_id = tst_test_result.question_fi " .
5402  "AND tst_active.test_fi = %s AND tst_active.active_id = %s" .
5403  "ORDER BY tst_active.active_id, tst_test_result.pass, tst_test_result.tstamp",
5404  array('integer', 'integer'),
5405  array($this->getTestId(), $active_id)
5406  );
5407  $overview = array();
5408  while ($row = $ilDB->fetchAssoc($result))
5409  {
5410  if (!array_key_exists($row["active_fi"], $overview))
5411  {
5412  $overview[$row["active_fi"]] = array();
5413  $overview[$row["active_fi"]]["firstname"] = $row["firstname"];
5414  $overview[$row["active_fi"]]["lastname"] = $row["lastname"];
5415  $overview[$row["active_fi"]]["title"] = $row["title"];
5416  $overview[$row["active_fi"]]["login"] = $row["login"];
5417  $overview[$row["active_fi"]]["usr_id"] = $row["usr_id"];
5418  $overview[$row["active_fi"]]["started"] = $row["started"];
5419  $overview[$row["active_fi"]]["finished"] = $row["finished"];
5420  }
5421  if (!array_key_exists($row["pass"], $overview[$row["active_fi"]]))
5422  {
5423  $overview[$row["active_fi"]][$row["pass"]] = array();
5424  $overview[$row["active_fi"]][$row["pass"]]["reached"] = 0;
5425  $overview[$row["active_fi"]][$row["pass"]]["maxpoints"] = $row["maxpoints"];
5426  }
5427  array_push($overview[$row["active_fi"]][$row["pass"]], $row);
5428  $overview[$row["active_fi"]][$row["pass"]]["reached"] += $row["points"];
5429  }
5430  return $overview;
5431  }
$result
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ 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 public

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

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

4614  {
4615  global $ilDB;
4616 // global $ilBench;
4617  $pass = ilObjTest::_getResultPass($active_id);
4618  $test_result =& $this->getTestResult($active_id, $pass);
4619  $result = $ilDB->queryF("SELECT tst_times.* FROM tst_active, tst_times WHERE tst_active.active_id = %s AND tst_active.active_id = tst_times.active_fi",
4620  array('integer'),
4621  array($active_id)
4622  );
4623  $times = array();
4624  $first_visit = 0;
4625  $last_visit = 0;
4626  while ($row = $ilDB->fetchObject($result))
4627  {
4628  preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->started, $matches);
4629  $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4630  if (!$first_visit) {
4631  $first_visit = $epoch_1;
4632  }
4633  if ($epoch_1 < $first_visit) {
4634  $first_visit = $epoch_1;
4635  }
4636  preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->finished, $matches);
4637  $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4638  if (!$last_visit) {
4639  $last_visit = $epoch_2;
4640  }
4641  if ($epoch_2 > $last_visit) {
4642  $last_visit = $epoch_2;
4643  }
4644  $times[$row->active_fi] += ($epoch_2 - $epoch_1);
4645  }
4646  $max_time = 0;
4647  foreach ($times as $key => $value) {
4648  $max_time += $value;
4649  }
4650  if ((!$test_result["test"]["total_reached_points"]) or (!$test_result["test"]["total_max_points"]))
4651  {
4652  $percentage = 0.0;
4653  }
4654  else
4655  {
4656  $percentage = ($test_result["test"]["total_reached_points"] / $test_result["test"]["total_max_points"]) * 100.0;
4657  if ($percentage < 0) $percentage = 0.0;
4658  }
4659  $mark_obj = $this->mark_schema->getMatchingMark($percentage);
4660  $first_date = getdate($first_visit);
4661  $last_date = getdate($last_visit);
4662  $qworkedthrough = 0;
4663  foreach ($test_result as $key => $value)
4664  {
4665  if (preg_match("/\d+/", $key))
4666  {
4667  $qworkedthrough += $value["workedthrough"];
4668  }
4669  }
4670  if (!$qworkedthrough)
4671  {
4672  $atimeofwork = 0;
4673  }
4674  else
4675  {
4676  $atimeofwork = $max_time / $qworkedthrough;
4677  }
4678 
4679  $obligationsAnswered = $test_result["test"]["obligations_answered"];
4680 
4681  $result_mark = "";
4682  $passed = "";
4683 
4684  if ($mark_obj)
4685  {
4686  $result_mark = $mark_obj->getShortName();
4687 
4688  if( $mark_obj->getPassed() && $obligationsAnswered )
4689  {
4690  $passed = 1;
4691  }
4692  else
4693  {
4694  $passed = 0;
4695  }
4696  }
4697  $percent_worked_through = 0;
4698  if (count($this->questions))
4699  {
4700  $percent_worked_through = $qworkedthrough / count($this->questions);
4701  }
4702  $result_array = array(
4703  "qworkedthrough" => $qworkedthrough,
4704  "qmax" => count($this->questions),
4705  "pworkedthrough" => $percent_worked_through,
4706  "timeofwork" => $max_time,
4707  "atimeofwork" => $atimeofwork,
4708  "firstvisit" => $first_date,
4709  "lastvisit" => $last_date,
4710  "resultspoints" => $test_result["test"]["total_reached_points"],
4711  "maxpoints" => $test_result["test"]["total_max_points"],
4712  "resultsmarks" => $result_mark,
4713  "passed" => $passed,
4714  "distancemedian" => "0"
4715  );
4716  foreach ($test_result as $key => $value)
4717  {
4718  if (preg_match("/\d+/", $key))
4719  {
4720  $result_array[$key] = $value;
4721  }
4722  }
4723  return $result_array;
4724  }
$result
_getResultPass($active_id)
Retrieves the pass number that should be counted for a given user.
global $ilDB
& getTestResult($active_id, $pass=NULL, $ordered_sequence=FALSE)
Calculates the results of a test for a given user and returns an array with all test results...
+ Here is the call graph for this function:

◆ evalTotalFinished()

ilObjTest::evalTotalFinished ( )

Returns the number of total finished tests.

Returns
integer The number of total finished tests public

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

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

Referenced by getAggregatedResultsData().

4899  {
4900  global $ilDB;
4901 
4902  $result = $ilDB->queryF("SELECT COUNT(active_id) total FROM tst_active WHERE test_fi = %s AND submitted = %s",
4903  array('integer', 'integer'),
4904  array($this->getTestId(), 1)
4905  );
4906  $row = $ilDB->fetchAssoc($result);
4907  return $row["total"];
4908  }
$result
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller 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 public

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

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

Referenced by getTotalPointsPassedArray().

4857  {
4858  global $ilDB;
4859  $result = $ilDB->queryF("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),
4860  array('integer'),
4861  array($this->getTestId())
4862  );
4863  $persons_array = array();
4864  while ($row = $ilDB->fetchAssoc($result))
4865  {
4866  if ($this->getAnonymity())
4867  {
4868  $persons_array[$row["active_id"]] = array("name" => $this->lng->txt("anonymous"));
4869  }
4870  else
4871  {
4872  if (strlen($row["firstname"].$row["lastname"].$row["title"]) == 0)
4873  {
4874  $persons_array[$row["active_id"]] = array("name" => $this->lng->txt("deleted_user"));
4875  }
4876  else
4877  {
4878  if ($row["user_fi"] == ANONYMOUS_USER_ID)
4879  {
4880  $persons_array[$row["active_id"]] = array("name" => $row["lastname"]);
4881  }
4882  else
4883  {
4884  $persons_array[$row["active_id"]] = array("name" => trim($row["lastname"] . ", " . $row["firstname"] . " " . $row["title"]), "login" => $row["login"]);
4885  }
4886  }
4887  }
4888  }
4889  return $persons_array;
4890  }
$result
getTestId()
Gets the database id of the additional test data.
getAnonymity()
Returns the anonymity status of the test.
global $ilDB
+ 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 public

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

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

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

4433  {
4434  global $ilDB;
4435 
4436  $result = $ilDB->queryF("SELECT COUNT(active_id) total FROM tst_active WHERE test_fi = %s",
4437  array('integer'),
4438  array($this->getTestId())
4439  );
4440  $row = $ilDB->fetchAssoc($result);
4441  return $row["total"];
4442  }
$result
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ 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 public

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

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

4815  {
4816  global $ilDB;
4817  $result = $ilDB->queryF("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),
4818  array('integer'),
4819  array($this->getTestId())
4820  );
4821  $persons_array = array();
4822  while ($row = $ilDB->fetchAssoc($result))
4823  {
4824  if ($this->getAnonymity())
4825  {
4826  $persons_array[$row["active_id"]] = $this->lng->txt("anonymous");
4827  }
4828  else
4829  {
4830  if (strlen($row["firstname"].$row["lastname"].$row["title"]) == 0)
4831  {
4832  $persons_array[$row["active_id"]] = $this->lng->txt("deleted_user");
4833  }
4834  else
4835  {
4836  if ($row["user_fi"] == ANONYMOUS_USER_ID)
4837  {
4838  $persons_array[$row["active_id"]] = $row["lastname"];
4839  }
4840  else
4841  {
4842  $persons_array[$row["active_id"]] = trim($row["lastname"] . ", " . $row["firstname"] . " " . $row["title"]);
4843  }
4844  }
4845  }
4846  }
4847  return $persons_array;
4848  }
$result
getTestId()
Gets the database id of the additional test data.
getAnonymity()
Returns the anonymity status of the test.
global $ilDB
+ Here is the call graph for this function:

◆ evalTotalStartedAverageTime()

ilObjTest::evalTotalStartedAverageTime ( )

Returns the average processing time for all started tests.

Returns
integer The average processing time for all started tests public

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

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

Referenced by getAggregatedResultsData().

5514  {
5515  global $ilDB;
5516 
5517  $result = $ilDB->queryF("SELECT tst_times.* FROM tst_active, tst_times WHERE tst_active.test_fi = %s AND tst_active.active_id = tst_times.active_fi",
5518  array('integer'),
5519  array($this->getTestId())
5520  );
5521  $times = array();
5522  while ($row = $ilDB->fetchObject($result))
5523  {
5524  preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->started, $matches);
5525  $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
5526  preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->finished, $matches);
5527  $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
5528  $times[$row->active_fi] += ($epoch_2 - $epoch_1);
5529  }
5530  $max_time = 0;
5531  $counter = 0;
5532  foreach ($times as $key => $value)
5533  {
5534  $max_time += $value;
5535  $counter++;
5536  }
5537  if ($counter)
5538  {
5539  $average_time = round($max_time / $counter);
5540  }
5541  else
5542  {
5543  $average_time = 0;
5544  }
5545  return $average_time;
5546  }
$result
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportFileItems()

ilObjTest::exportFileItems (   $a_target_dir,
$expLog 
)

export files of file itmes

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

Referenced by exportPagesXML().

6976  {
6977  include_once "./Modules/File/classes/class.ilObjFile.php";
6978 
6979  foreach ($this->file_ids as $file_id)
6980  {
6981  $expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
6982  $file_obj = new ilObjFile($file_id, false);
6983  $file_obj->export($a_target_dir);
6984  unset($file_obj);
6985  }
6986  }
Class ilObjFile.
+ 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 6813 of file class.ilObjTest.php.

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

6814  {
6815  global $ilBench;
6816 
6817  $this->mob_ids = array();
6818  $this->file_ids = array();
6819 
6820  $attrs = array();
6821  $attrs["Type"] = "Test";
6822  $a_xml_writer->xmlStartTag("ContentObject", $attrs);
6823 
6824  // MetaData
6825  $this->exportXMLMetaData($a_xml_writer);
6826 
6827  // PageObjects
6828  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Page Objects");
6829  $ilBench->start("ContentObjectExport", "exportPageObjects");
6830  $this->exportXMLPageObjects($a_xml_writer, $a_inst, $expLog);
6831  $ilBench->stop("ContentObjectExport", "exportPageObjects");
6832  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Page Objects");
6833 
6834  // MediaObjects
6835  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Media Objects");
6836  $ilBench->start("ContentObjectExport", "exportMediaObjects");
6837  $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
6838  $ilBench->stop("ContentObjectExport", "exportMediaObjects");
6839  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Media Objects");
6840 
6841  // FileItems
6842  $expLog->write(date("[y-m-d H:i:s] ")."Start Export File Items");
6843  $ilBench->start("ContentObjectExport", "exportFileItems");
6844  $this->exportFileItems($a_target_dir, $expLog);
6845  $ilBench->stop("ContentObjectExport", "exportFileItems");
6846  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export File Items");
6847 
6848  $a_xml_writer->xmlEndTag("ContentObject");
6849  }
exportFileItems($a_target_dir, &$expLog)
export files of file itmes
exportXMLMetaData(&$a_xml_writer)
export content objects meta data to xml (see ilias_co.dtd)
exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
export media objects to xml (see ilias_co.dtd)
global $ilBench
Definition: ilias.php:18
exportXMLPageObjects(&$a_xml_writer, $a_inst, &$expLog)
export page objects to xml (see ilias_co.dtd)
+ 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 6954 of file class.ilObjTest.php.

References ilObjMediaObject\_exists().

Referenced by exportPagesXML().

6955  {
6956  include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
6957 
6958  foreach ($this->mob_ids as $mob_id)
6959  {
6960  $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
6961  if (ilObjMediaObject::_exists($mob_id))
6962  {
6963  $media_obj = new ilObjMediaObject($mob_id);
6964  $media_obj->exportXML($a_xml_writer, $a_inst);
6965  $media_obj->exportFiles($a_target_dir);
6966  unset($media_obj);
6967  }
6968  }
6969  }
static _exists($a_id)
checks wether a lm content object with specified id exists or not
Class ilObjMediaObject.
+ 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 6857 of file class.ilObjTest.php.

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

Referenced by exportPagesXML().

6858  {
6859  include_once "./Services/MetaData/classes/class.ilMD2XML.php";
6860  $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
6861  $md2xml->setExportMode(true);
6862  $md2xml->startExport();
6863  $a_xml_writer->appendXML($md2xml->getXML());
6864  }
getId()
get object id public
getType()
get object type public
+ 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 6889 of file class.ilObjTest.php.

References $ilBench, and ilPCFileList\collectFileItems().

Referenced by exportPagesXML().

6890  {
6891  global $ilBench;
6892 
6893  include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
6894 
6895  foreach ($this->questions as $question_id)
6896  {
6897  $ilBench->start("ContentObjectExport", "exportPageObject");
6898  $expLog->write(date("[y-m-d H:i:s] ")."Page Object ".$question_id);
6899 
6900  $attrs = array();
6901  $a_xml_writer->xmlStartTag("PageObject", $attrs);
6902 
6903 
6904  // export xml to writer object
6905  $ilBench->start("ContentObjectExport", "exportPageObject_XML");
6906  include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
6907  $page_object = new ilAssQuestionPage($question_id);
6908  $page_object->buildDom();
6909  $page_object->insertInstIntoIDs($a_inst);
6910  $mob_ids = $page_object->collectMediaObjects(false);
6911  require_once 'Services/COPage/classes/class.ilPCFileList.php';
6912  $file_ids = ilPCFileList::collectFileItems($page_object, $page_object->getDomDoc());
6913  $xml = $page_object->getXMLFromDom(false, false, false, "", true);
6914  $xml = str_replace("&","&amp;", $xml);
6915  $a_xml_writer->appendXML($xml);
6916  $page_object->freeDom();
6917  unset ($page_object);
6918 
6919  $ilBench->stop("ContentObjectExport", "exportPageObject_XML");
6920 
6921  // collect media objects
6922  $ilBench->start("ContentObjectExport", "exportPageObject_CollectMedia");
6923  //$mob_ids = $page_obj->getMediaObjectIDs();
6924  foreach($mob_ids as $mob_id)
6925  {
6926  $this->mob_ids[$mob_id] = $mob_id;
6927  }
6928  $ilBench->stop("ContentObjectExport", "exportPageObject_CollectMedia");
6929 
6930  // collect all file items
6931  $ilBench->start("ContentObjectExport", "exportPageObject_CollectFileItems");
6932  //$file_ids = $page_obj->getFileItemIds();
6933  foreach($file_ids as $file_id)
6934  {
6935  $this->file_ids[$file_id] = $file_id;
6936  }
6937  $ilBench->stop("ContentObjectExport", "exportPageObject_CollectFileItems");
6938 
6939  $a_xml_writer->xmlEndTag("PageObject");
6940  //unset($page_obj);
6941 
6942  $ilBench->stop("ContentObjectExport", "exportPageObject");
6943 
6944 
6945  }
6946  }
Question page object.
static collectFileItems($a_page, $a_domdoc)
Get all file items that are used within the page.
global $ilBench
Definition: ilias.php:18
+ 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 5892 of file class.ilObjTest.php.

References $_SESSION, $ilLog, ilObject\$type, _getImportDirectory(), ilRTE\_replaceMediaObjectImageSrc(), ilObjMediaObject\_saveTempFileAsMediaObject(), ilObjMediaObject\_saveUsage(), ilQTIAssessment\getComment(), getFinalStatement(), ilObject\getId(), getIntroduction(), ilQTIAssessment\getPresentationMaterial(), ilQTIAssessment\getTitle(), QTIMaterialToString(), saveToDb(), setActivationEndingTime(), setActivationLimited(), setActivationStartingTime(), setActivationVisibility(), setAllowedUsers(), setAllowedUsersTimeGap(), setAnonymity(), setAnswerFeedback(), setAnswerFeedbackPoints(), setAuthor(), setAutosave(), setAutosaveIval(), setCharSelectorAvailability(), setCharSelectorDefinition(), setCountSystem(), setCustomStyle(), ilObject\setDescription(), setEnableArchiving(), setEnableExamview(), setEnableProcessingTime(), setEndingTime(), setEndingTimeEnabled(), setExportSettings(), setFinalStatement(), setFixedParticipants(), setForceJS(), setHighscoreAchievedTS(), setHighscoreAnon(), setHighscoreEnabled(), setHighscoreHints(), setHighscoreOwnTable(), setHighscorePercentage(), setHighscoreScore(), setHighscoreTopNum(), setHighscoreTopTable(), setHighscoreWTime(), setInstantFeedbackAnswerFixationEnabled(), setInstantFeedbackSolution(), setIntroduction(), setIntroductionEnabled(), setKiosk(), setLimitUsersEnabled(), setListOfQuestionsSettings(), setMailNotification(), setMailNotificationType(), setMCScoring(), setNrOfTries(), setObligationsEnabled(), setOfferingQuestionHintsEnabled(), setPassScoring(), setPassword(), setPasswordEnabled(), 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().

5893  {
5894  unset($_SESSION["import_mob_xhtml"]);
5895 
5896  $this->setDescription($assessment->getComment());
5897  $this->setTitle($assessment->getTitle());
5898 
5899  $this->setIntroductionEnabled(false);
5900  foreach ($assessment->objectives as $objectives)
5901  {
5902  foreach ($objectives->materials as $material)
5903  {
5904  $intro = $this->QTIMaterialToString($material);
5905  $this->setIntroduction($intro);
5906  $this->setIntroductionEnabled(strlen($intro) > 0);
5907  }
5908  }
5909 
5910  if(
5911  $assessment->getPresentationMaterial() &&
5912  $assessment->getPresentationMaterial()->getFlowMat(0) &&
5913  $assessment->getPresentationMaterial()->getFlowMat(0)->getMaterial(0)
5914  )
5915  {
5916  $this->setFinalStatement($this->QTIMaterialToString($assessment->getPresentationMaterial()->getFlowMat(0)->getMaterial(0)));
5917  }
5918 
5919  foreach ($assessment->assessmentcontrol as $assessmentcontrol)
5920  {
5921  switch ($assessmentcontrol->getSolutionswitch())
5922  {
5923  case "Yes":
5924  $this->setInstantFeedbackSolution(1);
5925  break;
5926  default:
5927  $this->setInstantFeedbackSolution(0);
5928  break;
5929  }
5930  }
5931 
5932  $this->setStartingTimeEnabled(false);
5933  $this->setEndingTimeEnabled(false);
5934  $this->setPasswordEnabled(false);
5935  $this->setLimitUsersEnabled(false);
5936 
5937  foreach ($assessment->qtimetadata as $metadata)
5938  {
5939  switch ($metadata["label"])
5940  {
5941  case "test_type":
5942  // for old tests with a test type
5943  $type = $metadata["entry"];
5944  switch ($type)
5945  {
5946  case 1:
5947  // assessment
5948  $this->setAnonymity(1);
5949  break;
5950  case 2:
5951  // self assessment
5952  break;
5953  case 4:
5954  // online exam
5955  $this->setFixedParticipants(1);
5956  $this->setListOfQuestionsSettings(7);
5957  $this->setShowSolutionPrintview(1);
5958  break;
5959  case 5:
5960  // varying random test
5961  break;
5962  }
5963  break;
5964  case "sequence_settings":
5965  $this->setSequenceSettings($metadata["entry"]);
5966  break;
5967  case "solution_details":
5968  $this->setShowSolutionDetails((int)$metadata["entry"]);
5969  break;
5970  case "print_bs_with_res":
5971  $this->setPrintBestSolutionWithResult((int)$metadata["entry"]);
5972  break;
5973  case "author":
5974  $this->setAuthor($metadata["entry"]);
5975  break;
5976  case "nr_of_tries":
5977  $this->setNrOfTries($metadata["entry"]);
5978  break;
5979  case "kiosk":
5980  $this->setKiosk($metadata["entry"]);
5981  break;
5982  case "showfinalstatement":
5983  $this->setShowFinalStatement($metadata["entry"]);
5984  break;
5985  case "showinfo":
5986  $this->setShowInfo($metadata["entry"]);
5987  break;
5988  case "forcejs":
5989  $this->setForceJS($metadata["entry"]);
5990  break;
5991  case "customstyle":
5992  $this->setCustomStyle($metadata["entry"]);
5993  break;
5994 
5995  case "highscore_enabled":
5996  $this->setHighscoreEnabled($metadata["entry"]);
5997  break;
5998 
5999  case "highscore_anon":
6000  $this->setHighscoreAnon($metadata["entry"]);
6001  break;
6002 
6003  case "highscore_achieved_ts":
6004  $this->setHighscoreAchievedTS($metadata["entry"]);
6005  break;
6006 
6007  case "highscore_score":
6008  $this->setHighscoreScore($metadata["entry"]);
6009  break;
6010 
6011  case "highscore_percentage":
6012  $this->setHighscorePercentage($metadata["entry"]);
6013  break;
6014 
6015  case "highscore_hints":
6016  $this->setHighscoreHints($metadata["entry"]);
6017  break;
6018 
6019  case "highscore_wtime":
6020  $this->setHighscoreWTime($metadata["entry"]);
6021  break;
6022 
6023  case "highscore_own_table":
6024  $this->setHighscoreOwnTable($metadata["entry"]);
6025  break;
6026 
6027  case "highscore_top_table":
6028  $this->setHighscoreTopTable($metadata["entry"]);
6029  break;
6030 
6031  case "highscore_top_num":
6032  $this->setHighscoreTopNum($metadata["entry"]);
6033  break;
6034 
6035  case "hide_previous_results":
6036  if ($metadata["entry"] == 0)
6037  {
6038  $this->setUsePreviousAnswers(1);
6039  }
6040  else
6041  {
6042  $this->setUsePreviousAnswers(0);
6043  }
6044  break;
6045  case "use_previous_answers":
6046  $this->setUsePreviousAnswers($metadata["entry"]);
6047  break;
6048  case "answer_feedback":
6049  $this->setAnswerFeedback($metadata["entry"]);
6050  break;
6051  case "hide_title_points":
6052  $this->setTitleOutput($metadata["entry"]);
6053  break;
6054  case "title_output":
6055  $this->setTitleOutput($metadata["entry"]);
6056  break;
6057  case "question_set_type":
6058  $this->setQuestionSetType($metadata["entry"]);
6059  break;
6060  case "random_test":
6061  if( $metadata["entry"] )
6062  {
6063  $this->setQuestionSetType(self::QUESTION_SET_TYPE_RANDOM);
6064  }
6065  else
6066  {
6067  $this->setQuestionSetType(self::QUESTION_SET_TYPE_FIXED);
6068  }
6069  break;
6070  case "results_presentation":
6071  $this->setResultsPresentation($metadata["entry"]);
6072  break;
6073  case "reset_processing_time":
6074  $this->setResetProcessingTime($metadata["entry"]);
6075  break;
6076  case "instant_verification":
6077  $this->setInstantFeedbackSolution($metadata["entry"]);
6078  break;
6079  case "answer_feedback_points":
6080  $this->setAnswerFeedbackPoints($metadata["entry"]);
6081  break;
6082  case "anonymity":
6083  $this->setAnonymity($metadata["entry"]);
6084  break;
6085  case "show_cancel":
6086  $this->setShowCancel($metadata["entry"]);
6087  break;
6088  case "show_marker":
6089  $this->setShowMarker($metadata["entry"]);
6090  break;
6091  case "fixed_participants":
6092  $this->setFixedParticipants($metadata["entry"]);
6093  break;
6094  case "score_reporting":
6095  $this->setScoreReporting($metadata["entry"]);
6096  break;
6097  case "shuffle_questions":
6098  $this->setShuffleQuestions($metadata["entry"]);
6099  break;
6100  case "count_system":
6101  $this->setCountSystem($metadata["entry"]);
6102  break;
6103  case "mc_scoring":
6104  $this->setMCScoring($metadata["entry"]);
6105  break;
6106  case "mailnotification":
6107  $this->setMailNotification($metadata["entry"]);
6108  break;
6109  case "mailnottype":
6110  $this->setMailNotificationType($metadata["entry"]);
6111  break;
6112  case "exportsettings":
6113  $this->setExportSettings($metadata['entry']);
6114  break;
6115  case "score_cutting":
6116  $this->setScoreCutting($metadata["entry"]);
6117  break;
6118  case "password":
6119  $this->setPassword($metadata["entry"]);
6120  $this->setPasswordEnabled(strlen($metadata["entry"]) > 0);
6121  break;
6122  case "allowedUsers":
6123  $this->setAllowedUsers($metadata["entry"]);
6124  $this->setLimitUsersEnabled((int)$metadata["entry"] > 0);
6125  break;
6126  case "allowedUsersTimeGap":
6127  $this->setAllowedUsersTimeGap($metadata["entry"]);
6128  break;
6129  case "pass_scoring":
6130  $this->setPassScoring($metadata["entry"]);
6131  break;
6132  case "show_summary":
6133  $this->setListOfQuestionsSettings($metadata["entry"]);
6134  break;
6135  case "reporting_date":
6136  $iso8601period = $metadata["entry"];
6137  if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $iso8601period, $matches))
6138  {
6139  $this->setReportingDate(sprintf("%02d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
6140  }
6141  break;
6142  case 'enable_processing_time':
6143  $this->setEnableProcessingTime($metadata['entry']);
6144  break;
6145  case "processing_time":
6146  $this->setProcessingTime($metadata['entry']);
6147  break;
6148  case "starting_time":
6149  $iso8601period = $metadata["entry"];
6150  if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $iso8601period, $matches))
6151  {
6152  $this->setStartingTime(sprintf("%02d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
6153  $this->setStartingTimeEnabled(true);
6154  }
6155  break;
6156  case "ending_time":
6157  $iso8601period = $metadata["entry"];
6158  if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $iso8601period, $matches))
6159  {
6160  $this->setEndingTime(sprintf("%02d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
6161  $this->setEndingTimeEnabled(true);
6162  }
6163  break;
6164  case "enable_examview":
6165  $this->setEnableExamview($metadata["entry"]);
6166  break;
6167  case 'show_examview_html':
6168  $this->setShowExamviewHtml($metadata['entry']);
6169  break;
6170  case 'show_examview_pdf':
6171  $this->setShowExamviewPdf($metadata['entry']);
6172  break;
6173  case 'redirection_mode':
6174  $this->setRedirectionMode($metadata['entry']);
6175  break;
6176  case 'redirection_url':
6177  $this->setRedirectionUrl($metadata['entry']);
6178  break;
6179  case 'examid_in_kiosk':
6180  case 'examid_in_test_pass':
6181  $this->setShowExamIdInTestPassEnabled($metadata['entry']);
6182  break;
6183  case 'show_exam_id':
6184  case 'examid_in_test_res':
6185  $this->setShowExamIdInTestResultsEnabled($metadata['entry']);
6186  break;
6187  case 'enable_archiving':
6188  $this->setEnableArchiving($metadata['entry']);
6189  break;
6190  case 'sign_submission':
6191  $this->setSignSubmission($metadata['entry']);
6192  break;
6193  case 'char_selector_availability':
6194  $this->setCharSelectorAvailability($metadata['entry']);
6195  break;
6196  case 'char_selector_definition':
6197  $this->setCharSelectorDefinition($metadata['entry']);
6198  break;
6199  case 'skill_service':
6200  $this->setSkillServiceEnabled((bool)$metadata['entry']);
6201  break;
6202  case 'result_tax_filters':
6203  $this->setResultFilterTaxIds(strlen($metadata['entry']) ? unserialize($metadata['entry']) : array());
6204  break;
6205  case 'show_grading_status':
6206  $this->setShowGradingStatusEnabled((bool)$metadata['entry']);
6207  break;
6208  case 'show_grading_mark':
6209  $this->setShowGradingMarkEnabled((bool)$metadata['entry']);
6210  break;
6211  case 'activation_limited':
6212  $this->setActivationLimited($metadata['entry']);
6213  break;
6214  case 'activation_start_time':
6215  $this->setActivationStartingTime($metadata['entry']);
6216  break;
6217  case 'activation_end_time':
6218  $this->setActivationEndingTime($metadata['entry']);
6219  break;
6220  case 'activation_visibility':
6221  $this->setActivationVisibility($metadata['entry']);
6222  break;
6223  case 'autosave':
6224  $this->setAutosave($metadata['entry']);
6225  break;
6226  case 'autosave_ival':
6227  $this->setAutosaveIval($metadata['entry']);
6228  break;
6229  case 'offer_question_hints':
6230  $this->setOfferingQuestionHintsEnabled($metadata['entry']);
6231  break;
6232  case 'instant_feedback_specific':
6233  $this->setSpecificAnswerFeedback($metadata['entry']);
6234  break;
6235  case 'instant_feedback_answer_fixation':
6236  $this->setInstantFeedbackAnswerFixationEnabled($metadata['entry']);
6237  break;
6238  case 'obligations_enabled':
6239  $this->setObligationsEnabled($metadata['entry']);
6240  break;
6241  }
6242  if (preg_match("/mark_step_\d+/", $metadata["label"]))
6243  {
6244  $xmlmark = $metadata["entry"];
6245  preg_match("/<short>(.*?)<\/short>/", $xmlmark, $matches);
6246  $mark_short = $matches[1];
6247  preg_match("/<official>(.*?)<\/official>/", $xmlmark, $matches);
6248  $mark_official = $matches[1];
6249  preg_match("/<percentage>(.*?)<\/percentage>/", $xmlmark, $matches);
6250  $mark_percentage = $matches[1];
6251  preg_match("/<passed>(.*?)<\/passed>/", $xmlmark, $matches);
6252  $mark_passed = $matches[1];
6253  $this->mark_schema->addMarkStep($mark_short, $mark_official, $mark_percentage, $mark_passed);
6254  }
6255  }
6256  // handle the import of media objects in XHTML code
6257  if (is_array($_SESSION["import_mob_xhtml"]))
6258  {
6259  include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
6260  include_once "./Services/RTE/classes/class.ilRTE.php";
6261  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
6262  foreach ($_SESSION["import_mob_xhtml"] as $mob)
6263  {
6264  $importfile = ilObjTest::_getImportDirectory() . '/' . $_SESSION["tst_import_subdir"] . '/' . $mob["uri"];
6265  if (file_exists($importfile))
6266  {
6267  $media_object =& ilObjMediaObject::_saveTempFileAsMediaObject(basename($importfile), $importfile, FALSE);
6268  ilObjMediaObject::_saveUsage($media_object->getId(), "tst:html", $this->getId());
6269  $this->setIntroduction(ilRTE::_replaceMediaObjectImageSrc(str_replace("src=\"" . $mob["mob"] . "\"", "src=\"" . "il_" . IL_INST_ID . "_mob_" . $media_object->getId() . "\"", $this->getIntroduction()), 1));
6270  $this->setFinalStatement(ilRTE::_replaceMediaObjectImageSrc(str_replace("src=\"" . $mob["mob"] . "\"", "src=\"" . "il_" . IL_INST_ID . "_mob_" . $media_object->getId() . "\"", $this->getFinalStatement()), 1));
6271  }
6272  else
6273  {
6274  global $ilLog;
6275  $ilLog->write("Error: Could not open XHTML mob file for test introduction during test import. File $importfile does not exist!");
6276  }
6277  }
6278  $this->saveToDb();
6279  }
6280  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
setStartingTime($starting_time=NULL)
Sets the starting time in database timestamp format for the test.
setAllowedUsers($a_allowed_users)
setAnswerFeedback($answer_feedback=0)
Sets the generic feedback for the test Use setGenericAnswerFeedback instead.
setHighscoreTopTable($a_top_table)
Sets if the top-rankings table should be shown.
setPassScoring($a_pass_scoring=SCORE_LAST_PASS)
Sets the pass scoring.
setSkillServiceEnabled($skillServiceEnabled)
setRedirectionUrl($redirection_url=NULL)
setMailNotification($a_notification)
Set mail notification settings.
saveToDb($properties_only=FALSE)
Saves a ilObjTest object to a database.
setAutosave($autosave)
setEnableExamview($enable_examview)
setShowExamIdInTestPassEnabled($show_exam_id_in_test_pass_enabled)
setShowExamviewPdf($show_examview_pdf)
setRedirectionMode($redirection_mode=0)
setQuestionSetType($questionSetType)
setter for question set type
_getImportDirectory()
Get the import directory location of the test.
setReportingDate($reporting_date)
Sets the reporting date of the ilObjTest object.
setShowSolutionDetails($a_details=1)
Sets if the the solution details should be presented to the user or not.
setResultFilterTaxIds($resultFilterTaxIds)
& _saveTempFileAsMediaObject($name, $tmp_name, $upload=TRUE)
Create new media object and update page in db and return new media object.
setShuffleQuestions($a_shuffle)
Sets the status of the shuffle_questions variable.
setFixedParticipants($a_value=1)
Sets the fixed participants status.
getPresentationMaterial()
{ilQTIPresentationMaterial|null}
setCharSelectorDefinition($definition='')
setHighscoreScore($a_score)
Sets if the actual score should be displayed.
setHighscoreWTime($a_wtime)
Sets if the workingtime of the scores should be shown.
setFinalStatement($a_statement="")
Sets the final statement text of the ilObjTest object.
setScoreCutting($a_score_cutting=SCORE_CUT_QUESTION)
Sets the type of score cutting.
setEndingTime($ending_time=NULL)
Sets the ending time in database timestamp format for the test.
setResetProcessingTime($reset=0)
Sets wheather the processing time should be reset or not.
setCharSelectorAvailability($availability)
setShowMarker($a_value=1)
Sets the marker button status.
setEndingTimeEnabled($ending_time_enabled)
setActivationLimited($a_value)
setSpecificAnswerFeedback($specific_answer_feedback)
setShowGradingStatusEnabled($showGradingStatusEnabled)
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...
setMailNotificationType($a_type)
setTitle($a_title)
set object title
setObligationsEnabled($obligationsEnabled=true)
sets obligations enabled/disabled
setHighscoreOwnTable($a_own_table)
Sets if the table with the own ranking should be shown.
setTitleOutput($title_output=0)
Sets the status of the title output.
setShowSolutionPrintview($a_printview=1)
Sets if the the solution printview should be presented to the user or not.
setCustomStyle($a_customStyle=NULL)
Set the custom style.
setSignSubmission($sign_submission)
getIntroduction()
Gets the introduction text of the ilObjTest object.
setNrOfTries($nr_of_tries=0)
Sets the nr of tries for the test.
setScoreReporting($score_reporting=0)
Sets the score reporting of the ilObjTest object.
setAnswerFeedbackPoints($answer_feedback_points=0)
Sets the answer specific feedback of reached points for the test.
setShowCancel($a_value=1)
Sets the cancel test button status.
_saveUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
Save usage of mob within another container (e.g.
setLimitUsersEnabled($limitUsersEnabled)
setAutosaveIval($autosave_ival)
QTIMaterialToString($a_material)
Reads an QTI material tag an creates a text string.
setProcessingTime($processing_time="00:00:00")
Sets the processing time for the test.
setCountSystem($a_count_system=COUNT_PARTIAL_SOLUTIONS)
Sets the count system for the calculation of points.
setExportSettings($a_settings)
getId()
get object id public
setHighscoreTopNum($a_top_num)
Sets the number of entries which are to be shown in the top-rankings table.
setActivationVisibility($a_value)
setShowInfo($a_info=1)
Set whether the complete information page is shown or the required data only.
setInstantFeedbackSolution($instant_feedback=0)
Sets the instant feedback for the solution.
setAllowedUsersTimeGap($a_allowed_users_time_gap)
setAnonymity($a_value=0)
Sets the anonymity status of the test.
getFinalStatement()
Gets the final statement.
setKiosk($kiosk=0)
Sets the kiosk mode for the test.
setUsePreviousAnswers($use_previous_answers=1)
Sets the status of the visibility of previous learner answers.
setResultsPresentation($a_results_presentation=3)
Sets the combined results presentation value.
setForceJS($a_js=1)
Set whether JavaScript should be forced for tests.
setHighscoreHints($a_hints)
Sets if the number of requested hints should be shown.
setEnableProcessingTime($enable=0)
Sets the processing time enabled or disabled.
setHighscoreAchievedTS($a_achieved_ts)
Sets if the date and time of the scores achievement should be displayed.
setEnableArchiving($enable_archiving)
setPasswordEnabled($passwordEnabled)
setShowExamviewHtml($show_examview_html)
setOfferingQuestionHintsEnabled($offeringQuestionHintsEnabled)
sets offering question hints enabled/disabled
setPrintBestSolutionWithResult($status)
setMCScoring($a_mc_scoring=SCORE_ZERO_POINTS_WHEN_UNANSWERED)
Sets the multiple choice scoring.
setHighscoreAnon($a_anon)
Sets if the highscores should be anonymized.
setActivationStartingTime($starting_time=NULL)
setShowExamIdInTestResultsEnabled($show_exam_id_in_test_results_enabled)
setDescription($a_desc)
set object description
setIntroduction($introduction="")
Sets the introduction text of the ilObjTest object.
setHighscoreEnabled($a_enabled)
Sets if the highscore feature should be enabled.
setShowGradingMarkEnabled($showGradingMarkEnabled)
setAuthor($author="")
Sets the authors name of the ilObjTest object.
setInstantFeedbackAnswerFixationEnabled($instantFeedbackAnswerFixationEnabled)
setHighscorePercentage($a_percentage)
Sets if the percentages of the scores pass should be shown.
setIntroductionEnabled($introductionEnabled)
setActivationEndingTime($ending_time=NULL)
setShowFinalStatement($show=0)
Sets whether the final statement should be shown or not.
setSequenceSettings($sequence_settings=0)
SEQUENCE SETTING = POSTPONING ENABLED !!
setPassword($a_password=NULL)
Sets the password for test access.
setListOfQuestionsSettings($a_value=0)
Sets the settings for the list of questions options in the test properties This could contain one of ...
setStartingTimeEnabled($starting_time_enabled)
+ Here is the call graph for this function:

◆ getActivationEndingTime()

ilObjTest::getActivationEndingTime ( )

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

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

11706  {
11707  return (strlen($this->activation_ending_time)) ? $this->activation_ending_time : NULL;
11708  }
+ Here is the caller graph for this function:

◆ getActivationStartingTime()

ilObjTest::getActivationStartingTime ( )

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

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

11701  {
11702  return (strlen($this->activation_starting_time)) ? $this->activation_starting_time : NULL;
11703  }
+ Here is the caller graph for this function:

◆ getActivationVisibility()

ilObjTest::getActivationVisibility ( )

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

References $activation_visibility.

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

11162  {
11164  }
+ 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 public

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

References $_SESSION, $ilDB, $ilUser, $result, $row, and getTestId().

Referenced by canShowTestResults(), ilObjTestVerification\createFromTest(), getAllQuestions(), getExistingQuestions(), isExecutable(), loadQuestions(), removeTestResultsForUser(), ilCourseObjectiveResult\resetTestForUser(), and setQuestionSetSolved().

4120  {
4121  global $ilDB;
4122  global $ilUser;
4123 
4124  if (!$user_id) $user_id = $ilUser->getId();
4125  if (($_SESSION["AccountId"] == ANONYMOUS_USER_ID) && (strlen($_SESSION["tst_access_code"][$this->getTestId()])))
4126  {
4127  $result = $ilDB->queryF("SELECT active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
4128  array('integer','integer','text'),
4129  array($user_id, $this->test_id, $_SESSION["tst_access_code"][$this->getTestId()])
4130  );
4131  }
4132  else if (strlen($anonymous_id))
4133  {
4134  $result = $ilDB->queryF("SELECT active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
4135  array('integer','integer','text'),
4136  array($user_id, $this->test_id, $anonymous_id)
4137  );
4138  }
4139  else
4140  {
4141  if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID)
4142  {
4143  return NULL;
4144  }
4145  $result = $ilDB->queryF("SELECT active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s",
4146  array('integer','integer'),
4147  array($user_id, $this->test_id)
4148  );
4149  }
4150  if ($result->numRows())
4151  {
4152  $row = $ilDB->fetchAssoc($result);
4153  return $row["active_id"];
4154  }
4155  else
4156  {
4157  return 0;
4158  }
4159  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$result
getTestId()
Gets the database id of the additional test data.
global $ilUser
Definition: imgupload.php:15
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAggregatedResultsData()

ilObjTest::getAggregatedResultsData ( )

Returns the aggregated test results.

public

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

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

10556  {
10557  $data =& $this->getCompleteEvaluationData();
10558  $foundParticipants =& $data->getParticipants();
10559  $results = array("overview" => array(), "questions" => array());
10560  if (count($foundParticipants))
10561  {
10562  $results["overview"][$this->lng->txt("tst_eval_total_persons")] = count($foundParticipants);
10563  $total_finished = $this->evalTotalFinished();
10564  $results["overview"][$this->lng->txt("tst_eval_total_finished")] = $total_finished;
10565  $average_time = $this->evalTotalStartedAverageTime();
10566  $diff_seconds = $average_time;
10567  $diff_hours = floor($diff_seconds/3600);
10568  $diff_seconds -= $diff_hours * 3600;
10569  $diff_minutes = floor($diff_seconds/60);
10570  $diff_seconds -= $diff_minutes * 60;
10571  $results["overview"][$this->lng->txt("tst_eval_total_finished_average_time")] = sprintf("%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds);
10572  $total_passed = 0;
10573  $total_passed_reached = 0;
10574  $total_passed_max = 0;
10575  $total_passed_time = 0;
10576  foreach ($foundParticipants as $userdata)
10577  {
10578  if ($userdata->getPassed())
10579  {
10580  $total_passed++;
10581  $total_passed_reached += $userdata->getReached();
10582  $total_passed_max += $userdata->getMaxpoints();
10583  $total_passed_time += $userdata->getTimeOfWork();
10584  }
10585  }
10586  $average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
10587  $average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
10588  $average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
10589  $results["overview"][$this->lng->txt("tst_eval_total_passed")] = $total_passed;
10590  $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);
10591  $average_time = $average_passed_time;
10592  $diff_seconds = $average_time;
10593  $diff_hours = floor($diff_seconds/3600);
10594  $diff_seconds -= $diff_hours * 3600;
10595  $diff_minutes = floor($diff_seconds/60);
10596  $diff_seconds -= $diff_minutes * 60;
10597  $results["overview"][$this->lng->txt("tst_eval_total_passed_average_time")] = sprintf("%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds);
10598  }
10599 
10600  foreach ($data->getQuestionTitles() as $question_id => $question_title)
10601  {
10602  $answered = 0;
10603  $reached = 0;
10604  $max = 0;
10605  foreach ($foundParticipants as $userdata)
10606  {
10607  for ($i = 0; $i <= $userdata->getLastPass(); $i++)
10608  {
10609  if (is_object($userdata->getPass($i)))
10610  {
10611  $question =& $userdata->getPass($i)->getAnsweredQuestionByQuestionId($question_id);
10612  if (is_array($question))
10613  {
10614  $answered++;
10615  $reached += $question["reached"];
10616  $max += $question["points"];
10617  }
10618  }
10619  }
10620  }
10621  $percent = $max ? $reached/$max * 100.0 : 0;
10622  $counter++;
10623  $results["questions"][$question_id] = array(
10624  $question_title,
10625  sprintf("%.2f", $answered ? $reached / $answered : 0) . " " . strtolower($this->lng->txt("of")) . " " . sprintf("%.2f", $answered ? $max / $answered : 0),
10626  sprintf("%.2f", $percent) . "%",
10627  $answered,
10628  sprintf("%.2f", $answered ? $reached / $answered : 0),
10629  sprintf("%.2f", $answered ? $max / $answered : 0),
10630  $percent / 100.0
10631  );
10632  }
10633  return $results;
10634  }
& getCompleteEvaluationData($withStatistics=TRUE, $filterby="", $filtertext="")
evalTotalFinished()
Returns the number of total finished tests.
$results
evalTotalStartedAverageTime()
Returns the average processing time for all started tests.
+ Here is the call graph for this function:

◆ getAllowedUsers()

ilObjTest::getAllowedUsers ( )

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

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

9305  {
9306  return ($this->allowedUsers) ? $this->allowedUsers : 0;
9307  }
+ Here is the caller graph for this function:

◆ getAllowedUsersTimeGap()

ilObjTest::getAllowedUsersTimeGap ( )

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

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

9315  {
9316  return ($this->allowedUsersTimeGap) ? $this->allowedUsersTimeGap : 0;
9317  }
+ 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 public

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

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

4080  {
4081  global $ilUser;
4082  global $ilDB;
4083 
4084  $result_array = array();
4085  if ($this->isRandomTest())
4086  {
4087  $active_id = $this->getActiveIdOfUser($ilUser->getId());
4088  $this->loadQuestions($active_id, $pass);
4089  if (count($this->questions) == 0) return $result_array;
4090  if (is_null($pass))
4091  {
4092  $pass = $this->_getPass($active_id);
4093  }
4094  $result = $ilDB->queryF("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'),
4095  array('integer','integer'),
4096  array($active_id, $pass)
4097  );
4098  }
4099  else
4100  {
4101  if (count($this->questions) == 0) return $result_array;
4102  $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'));
4103  }
4104  while ($row = $ilDB->fetchAssoc($result))
4105  {
4106  $result_array[$row["question_id"]] = $row;
4107  }
4108  return $result_array;
4109  }
$result
_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.
isRandomTest()
Returns the fact wether this test is a random questions test or not.
loadQuestions($active_id="", $pass=NULL)
Load the test question id&#39;s from the database.
global $ilUser
Definition: imgupload.php:15
global $ilDB
+ Here is the call graph for this function:

◆ getAllRTEContent()

ilObjTest::getAllRTEContent ( )

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

private

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

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

Referenced by cleanupMediaobjectUsage().

1242  {
1243  $result = array();
1244  array_push($result, $this->getIntroduction());
1245  array_push($result, $this->getFinalStatement());
1246  return $result;
1247  }
$result
getIntroduction()
Gets the introduction text of the ilObjTest object.
getFinalStatement()
Gets the final statement.
+ 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 8079 of file class.ilObjTest.php.

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

8080  {
8081  $results = array();
8082  $row = array(
8083  "user_id" => $this->lng->txt("user_id"),
8084  "matriculation" => $this->lng->txt("matriculation"),
8085  "lastname" => $this->lng->txt("lastname"),
8086  "firstname" => $this->lng->txt("firstname"),
8087  "login" =>$this->lng->txt("login"),
8088  "reached_points" => $this->lng->txt("tst_reached_points"),
8089  "max_points" => $this->lng->txt("tst_maximum_points"),
8090  "percent_value" => $this->lng->txt("tst_percent_solved"),
8091  "mark" => $this->lng->txt("tst_mark"),
8092  "ects" => $this->lng->txt("ects_grade")
8093  );
8094  $results[] = $row;
8095  if (count($participants))
8096  {
8097  if($this->getECTSOutput())
8098  {
8099  $passed_array =& $this->getTotalPointsPassedArray();
8100  }
8101  foreach ($participants as $active_id => $user_rec)
8102  {
8103  $row = array();
8104  $reached_points = 0;
8105  $max_points = 0;
8106  foreach ($this->questions as $value)
8107  {
8108  $question =& ilObjTest::_instanciateQuestion($value);
8109  if (is_object($question))
8110  {
8111  $max_points += $question->getMaximumPoints();
8112  $reached_points += $question->getReachedPoints($active_id);
8113  }
8114  }
8115  if ($max_points > 0)
8116  {
8117  $percentvalue = $reached_points / $max_points;
8118  if ($percentvalue < 0) $percentvalue = 0.0;
8119  }
8120  else
8121  {
8122  $percentvalue = 0;
8123  }
8124  $mark_obj = $this->mark_schema->getMatchingMark($percentvalue * 100);
8125  $passed = "";
8126  if ($mark_obj)
8127  {
8128  $mark = $mark_obj->getOfficialName();
8129  $ects_mark = $this->getECTSGrade($passed_array, $reached_points, $max_points);
8130  }
8131  if ($this->getAnonymity())
8132  {
8133  $user_rec['firstname'] = "";
8134  $user_rec['lastname'] = $this->lng->txt("anonymous");
8135  }
8136  $row = array(
8137  "user_id"=>$user_rec['usr_id'],
8138  "matriculation" => $user_rec['matriculation'],
8139  "lastname" => $user_rec['lastname'],
8140  "firstname" => $user_rec['firstname'],
8141  "login"=>$user_rec['login'],
8142  "reached_points" => $reached_points,
8143  "max_points" => $max_points,
8144  "percent_value" => $percentvalue,
8145  "mark" => $mark,
8146  "ects" => $ects_mark
8147  );
8148  $results[] = $prepareForCSV ? $this->processCSVRow ($row, true) : $row;
8149  }
8150  }
8151  return $results;
8152  }
getECTSOutput()
{int|bool}
& _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
getECTSGrade($passed_array, $reached_points, $max_points)
{Returns the ECTS grade for a number of reached points.An array with the points of all users who pass...
getAnonymity()
Returns the anonymity status of the test.
& processCSVRow($row, $quoteAll=FALSE, $separator=";")
Processes an array as a CSV row and converts the array values to correct CSV values.
$results
& getTotalPointsPassedArray()
Returns an array with the total points of all users who passed the test This array could be used for ...
+ 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) public

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

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

9532  {
9533  return ($this->anonymity) ? 1 : 0;
9534  }
+ 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 public

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

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

8336  {
8337  if( $this->isDynamicTest() )
8338  {
8339  global $tree, $ilDB, $lng, $ilPluginAdmin;
8340 
8341  require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
8342  $testSessionFactory = new ilTestSessionFactory($this);
8343  $testSession = $testSessionFactory->getSession($active_id);
8344 
8345  require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
8346  $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this);
8347  $testSequence = $testSequenceFactory->getSequence($testSession);
8348 
8349  require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
8350  $dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this);
8351  $dynamicQuestionSetConfig->loadFromDb();
8352 
8353  $testSequence->loadFromDb($dynamicQuestionSetConfig);
8354  $testSequence->loadQuestions($dynamicQuestionSetConfig, new ilTestDynamicQuestionSetFilterSelection());
8355 
8356  return $testSequence->getTrackedQuestionCount();
8357  }
8358 
8359  if ($this->isRandomTest())
8360  {
8361  $this->loadQuestions($active_id, $pass);
8362  }
8363  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
8364  $workedthrough = 0;
8365  foreach ($this->questions as $value)
8366  {
8367  if (assQuestion::_isWorkedThrough($active_id, $value, $pass))
8368  {
8369  $workedthrough += 1;
8370  }
8371  }
8372  return $workedthrough;
8373  }
isDynamicTest()
Returns the fact wether this test is a dynamic question set test or not.
isRandomTest()
Returns the fact wether this test is a random questions test or not.
loadQuestions($active_id="", $pass=NULL)
Load the test question id&#39;s from the database.
global $ilDB
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 ...
+ 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 public
See also
$answer_feedback

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

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

2544  {
2545  return ($this->answer_feedback) ? $this->answer_feedback : 0;
2546  }
+ 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 public
See also
$answer_feedback_points

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

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

2569 {
2570  return ($this->answer_feedback_points) ? $this->answer_feedback_points : 0;
2571 }
+ 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 public
See also
$author

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

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

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

7219  {
7220  $author = array();
7221  include_once "./Services/MetaData/classes/class.ilMD.php";
7222  $md =& new ilMD($this->getId(), 0, $this->getType());
7223  $md_life =& $md->getLifecycle();
7224  if ($md_life)
7225  {
7226  $ids =& $md_life->getContributeIds();
7227  foreach ($ids as $id)
7228  {
7229  $md_cont =& $md_life->getContribute($id);
7230  if (strcmp($md_cont->getRole(), "Author") == 0)
7231  {
7232  $entids =& $md_cont->getEntityIds();
7233  foreach ($entids as $entid)
7234  {
7235  $md_ent =& $md_cont->getEntity($entid);
7236  array_push($author, $md_ent->getEntity());
7237  }
7238  }
7239  }
7240  }
7241  return join($author, ",");
7242  }
getId()
get object id public
getType()
get object type public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAutosave()

ilObjTest::getAutosave ( )

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

References $autosave.

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

11605  {
11606  return $this->autosave;
11607  }
+ Here is the caller graph for this function:

◆ getAutosaveIval()

ilObjTest::getAutosaveIval ( )

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

References $autosave_ival.

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

11615  {
11616  return $this->autosave_ival;
11617  }
+ 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 public

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

References ilObjQuestionPool\_getAvailableQuestionpools().

5555  {
5556  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
5557  return ilObjQuestionPool::_getAvailableQuestionpools($use_object_id, $equal_points, $could_be_offline, $show_path, $with_questioncount, $permission);
5558  }
& _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.
+ Here is the call graph for this function:

◆ getAvailableQuestions()

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

Calculates the available questions for a test.

public

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

References $ilDB, $ilUser, $row, ilObjQuestionPool\_getAvailableQuestionpools(), getExistingQuestions(), getQuestionTypeTranslations(), and isPluginActive().

5775  {
5776  global $ilUser;
5777  global $ilDB;
5778 
5779  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
5780  $available_pools = array_keys(ilObjQuestionPool::_getAvailableQuestionpools($use_object_id = TRUE, $equal_points = FALSE, $could_be_offline = FALSE, $showPath = FALSE, $with_questioncount = FALSE));
5781  $available = "";
5782  if (count($available_pools))
5783  {
5784  $available = " AND " . $ilDB->in('qpl_questions.obj_fi', $available_pools, false, 'integer');
5785  }
5786  else
5787  {
5788  return array();
5789  }
5790  if ($completeonly)
5791  {
5792  $available .= " AND qpl_questions.complete = " . $ilDB->quote("1", 'text');
5793  }
5794 
5795  $where = "";
5796  if (is_array($arrFilter))
5797  {
5798  if (array_key_exists('title', $arrFilter) && strlen($arrFilter['title']))
5799  {
5800  $where .= " AND " . $ilDB->like('qpl_questions.title', 'text', "%%" . $arrFilter['title'] . "%%");
5801  }
5802  if (array_key_exists('description', $arrFilter) && strlen($arrFilter['description']))
5803  {
5804  $where .= " AND " . $ilDB->like('qpl_questions.description', 'text', "%%" . $arrFilter['description'] . "%%");
5805  }
5806  if (array_key_exists('author', $arrFilter) && strlen($arrFilter['author']))
5807  {
5808  $where .= " AND " . $ilDB->like('qpl_questions.author', 'text', "%%" . $arrFilter['author'] . "%%");
5809  }
5810  if (array_key_exists('type', $arrFilter) && strlen($arrFilter['type']))
5811  {
5812  $where .= " AND qpl_qst_type.type_tag = " . $ilDB->quote($arrFilter['type'], 'text');
5813  }
5814  if (array_key_exists('qpl', $arrFilter) && strlen($arrFilter['qpl']))
5815  {
5816  $where .= " AND " . $ilDB->like('object_data.title', 'text', "%%" . $arrFilter['qpl'] . "%%");
5817  }
5818  }
5819 
5820  $original_ids =& $this->getExistingQuestions();
5821  $original_clause = " qpl_questions.original_id IS NULL";
5822  if (count($original_ids))
5823  {
5824  $original_clause = " qpl_questions.original_id IS NULL AND " . $ilDB->in('qpl_questions.question_id', $original_ids, true, 'integer');
5825  }
5826 
5827  $query_result = $ilDB->query(
5828  "SELECT qpl_questions.*, qpl_questions.tstamp, qpl_qst_type.type_tag, qpl_qst_type.plugin, object_data.title qpl " .
5829  "FROM qpl_questions, qpl_qst_type, object_data WHERE $original_clause $available AND " .
5830  "object_data.obj_id = qpl_questions.obj_fi AND qpl_questions.tstamp > 0 AND " .
5831  "qpl_questions.question_type_fi = qpl_qst_type.question_type_id$where");
5832  $rows = array();
5833  $types = $this->getQuestionTypeTranslations();
5834  if ($query_result->numRows())
5835  {
5836  while ($row = $ilDB->fetchAssoc($query_result))
5837  {
5838  $row['ttype'] = $types[$row['type_tag']];
5839  if ($row["plugin"])
5840  {
5841  if ($this->isPluginActive($row["type_tag"]))
5842  {
5843  array_push($rows, $row);
5844  }
5845  }
5846  else
5847  {
5848  array_push($rows, $row);
5849  }
5850  }
5851  }
5852  return $rows;
5853  }
& getExistingQuestions($pass=NULL)
Get the id&#39;s of the questions which are already part of the test.
& getQuestionTypeTranslations()
global $ilUser
Definition: imgupload.php:15
global $ilDB
& _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.
isPluginActive($a_pname)
Checks wheather or not a question plugin with a given name is active.
+ 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) public

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

Referenced by _getAvailableTests(), canShowCertificate(), and saveToDb().

9510  {
9511  return (strlen($this->certificate_visibility)) ? $this->certificate_visibility : 0;
9512  }
+ Here is the caller graph for this function:

◆ getCharSelectorAvailability()

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

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

References $char_selector_availability.

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

11950  {
11951  return (int) $this->char_selector_availability;
11952  }
+ Here is the caller graph for this function:

◆ getCharSelectorDefinition()

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

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

References $char_selector_definition.

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

11966  {
11968  }
+ Here is the caller graph for this function:

◆ getCompleteEvaluationData()

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

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

References $data.

Referenced by getAggregatedResultsData().

5312  {
5313  include_once "./Modules/Test/classes/class.ilTestEvaluationData.php";
5314  include_once "./Modules/Test/classes/class.ilTestEvaluationPassData.php";
5315  include_once "./Modules/Test/classes/class.ilTestEvaluationUserData.php";
5316  $data = $this->getUnfilteredEvaluationData();
5317  if ($withStatistics)
5318  {
5319  $data->calculateStatistics();
5320  }
5321  $data->setFilter($filterby, $filtertext);
5322  return $data;
5323  }
+ Here is the caller 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 public

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

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

4451  {
4452  global $ilDB;
4453 
4454  $result = $ilDB->queryF("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",
4455  array('integer','integer'),
4456  array($this->getTestId(), $user_id)
4457  );
4458  $time = 0;
4459  while ($row = $ilDB->fetchAssoc($result))
4460  {
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  preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4464  $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4465  $time += ($epoch_2 - $epoch_1);
4466  }
4467  return $time;
4468  }
$result
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ 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 public

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

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

4520  {
4521  global $ilDB;
4522 
4523  $result = $ilDB->queryF("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",
4524  array('integer','integer'),
4525  array($this->getTestId(), $active_id)
4526  );
4527  $time = 0;
4528  while ($row = $ilDB->fetchAssoc($result))
4529  {
4530  preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
4531  $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4532  preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4533  $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4534  $time += ($epoch_2 - $epoch_1);
4535  }
4536  return $time;
4537  }
$result
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ 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 public

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

References _getCompleteWorkingTimeOfParticipants(), and getTestId().

4477  {
4478  return $this->_getCompleteWorkingTimeOfParticipants($this->getTestId());
4479  }
getTestId()
Gets the database id of the additional test data.
& _getCompleteWorkingTimeOfParticipants($test_id)
Returns the complete working time in seconds for all test participants.
+ 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 public
See also
$count_system

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

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

2581  {
2582  return ($this->count_system) ? $this->count_system : 0;
2583  }
+ Here is the caller graph for this function:

◆ getCustomStyle()

ilObjTest::getCustomStyle ( )

Get the custom style.

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

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

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

2173  {
2174  return (strlen($this->_customStyle)) ? $this->_customStyle : NULL;
2175  }
+ Here is the caller graph for this function:

◆ getCustomStyles()

ilObjTest::getCustomStyles ( )

Return the available custom styles.

Returns
array An array of strings containing the available custom styles public
See also
$_customStyle

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

References $filename, $results, ilUtil\getStyleSheetLocation(), and ilFileUtils\recursive_dirscan().

2185  {
2186  $css_path = ilUtil::getStyleSheetLocation("filesystem", "ta.css", "Modules/Test");
2187  $css_path = str_replace("ta.css", "customstyles", $css_path) . "/";
2188  $customstyles = array();
2189  if (is_dir($css_path))
2190  {
2191  $results = array();
2192  include_once "./Services/Utilities/classes/class.ilFileUtils.php";
2194  if (is_array($results["file"]))
2195  {
2196  foreach ($results["file"] as $filename)
2197  {
2198  if (strpos($filename, ".css"))
2199  {
2200  array_push($customstyles, $filename);
2201  }
2202  }
2203  }
2204  }
2205  return $customstyles;
2206  }
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$results
$filename
Definition: buildRTE.php:89
recursive_dirscan($dir, &$arr)
Recursively scans a given directory and writes path and filename into referenced array.
+ Here is the call 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 10361 of file class.ilObjTest.php.

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

10362  {
10363  $results = array();
10364  if (count($participants))
10365  {
10366  foreach ($participants as $active_id => $user_rec)
10367  {
10368  $row = array();
10369  $reached_points = 0;
10370  $max_points = 0;
10371  foreach ($this->questions as $value)
10372  {
10373  $question =& ilObjTest::_instanciateQuestion($value);
10374  if (is_object($question))
10375  {
10376  $max_points += $question->getMaximumPoints();
10377  $reached_points += $question->getReachedPoints($active_id);
10378  if ($max_points > 0)
10379  {
10380  $percentvalue = $reached_points / $max_points;
10381  if ($percentvalue < 0) $percentvalue = 0.0;
10382  }
10383  else
10384  {
10385  $percentvalue = 0;
10386  }
10387  if ($this->getAnonymity())
10388  {
10389  $user_rec['firstname'] = "";
10390  $user_rec['lastname'] = $this->lng->txt("anonymous");
10391  }
10392  $row = array(
10393  "user_id"=>$user_rec['usr_id'],
10394  "matriculation" => $user_rec['matriculation'],
10395  "lastname" => $user_rec['lastname'],
10396  "firstname" => $user_rec['firstname'],
10397  "login"=>$user_rec['login'],
10398  "question_id" => $question->getId(),
10399  "question_title" => $question->getTitle(),
10400  "reached_points" => $reached_points,
10401  "max_points" => $max_points
10402  );
10403  $results[] = $row;
10404  }
10405  }
10406  }
10407  }
10408  return $results;
10409  }
& _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
getAnonymity()
Returns the anonymity status of the test.
$results
+ Here is the call graph for this function:

◆ getECTSFX()

ilObjTest::getECTSFX ( )

{

Returns
float|null
}

Implements ilEctsGradesEnabled.

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

Referenced by _getAvailableTests(), _isComplete(), addDefaults(), and saveToDb().

2329  {
2330  return (strlen($this->ects_fx)) ? $this->ects_fx : NULL;
2331  }
+ 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 7015 of file class.ilObjTest.php.

Referenced by getAllTestResults(), and getQuestionsOfPass().

7016  {
7017  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);
7018  }
+ Here is the caller graph for this function:

◆ getECTSGrades()

ilObjTest::getECTSGrades ( )

{

Returns
array
}

Implements ilEctsGradesEnabled.

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

References $ects_grades.

Referenced by _getAvailableTests(), _isComplete(), and addDefaults().

2345  {
2346  return $this->ects_grades;
2347  }
+ Here is the caller graph for this function:

◆ getECTSOutput()

ilObjTest::getECTSOutput ( )

{

Returns
int|bool
}

Implements ilEctsGradesEnabled.

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

Referenced by _getAvailableTests(), _isComplete(), addDefaults(), getAllTestResults(), getQuestionsOfPass(), and saveToDb().

2313  {
2314  return ($this->ects_output) ? 1 : 0;
2315  }
+ Here is the caller graph for this function:

◆ getEnableArchiving()

ilObjTest::getEnableArchiving ( )
Returns
boolean

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

References $data, $enable_archiving, $ilDB, $query, $res, and getTestId().

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

11822  {
11823  return $this->enable_archiving;
11824  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEnabledViewMode()

ilObjTest::getEnabledViewMode ( )

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

Referenced by _getAvailableTests(), and saveToDb().

10889  {
10890  return $this->enabled_view_mode;
10891  }
+ Here is the caller graph for this function:

◆ getEnableExamview()

ilObjTest::getEnableExamview ( )
Returns
boolean

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

References $enable_examview.

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

11684  {
11685  return $this->enable_examview;
11686  }
+ 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) public
See also
$processing_time

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

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

3070  {
3071  return ($this->enable_processing_time) ? $this->enable_processing_time : 0;
3072  }
+ 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 public
See also
$ending_time

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

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

3150  {
3151  return (strlen($this->ending_time)) ? $this->ending_time : NULL;
3152  }
+ 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 public

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

References $result, and _instanciateQuestion().

Referenced by getProcessingTimeAsArray().

5567  {
5568  $time_in_seconds = 0;
5569  foreach ($this->questions as $question_id)
5570  {
5571  $question =& ilObjTest::_instanciateQuestion($question_id);
5572  $est_time = $question->getEstimatedWorkingTime();
5573  $time_in_seconds += $est_time["h"] * 3600 + $est_time["m"] * 60 + $est_time["s"];
5574  }
5575  $hours = (int)($time_in_seconds / 3600) ;
5576  $time_in_seconds = $time_in_seconds - ($hours * 3600);
5577  $minutes = (int)($time_in_seconds / 60);
5578  $time_in_seconds = $time_in_seconds - ($minutes * 60);
5579  $result = array("hh" => $hours, "mm" => $minutes, "ss" => $time_in_seconds);
5580  return $result;
5581  }
$result
& _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
+ 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 10679 of file class.ilObjTest.php.

References getAnonymity().

10680  {
10681  include_once "./Modules/Test/classes/class.ilObjTestGUI.php";
10682  include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
10683  $table_gui = new ilEvaluationAllTableGUI(new ilObjTestGUI(), 'outEvaluation', $this->getAnonymity());
10684  return $table_gui->getSelectedColumns();
10685  }
Class ilObjTestGUI.
getAnonymity()
Returns the anonymity status of the test.
TableGUI class for evaluation of all users.
+ 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 public

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

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

Referenced by getAvailableQuestions().

3932  {
3933  global $ilUser;
3934  global $ilDB;
3935 
3936  $existing_questions = array();
3937  $active_id = $this->getActiveIdOfUser($ilUser->getId());
3938  if ($this->isRandomTest())
3939  {
3940  if (is_null($pass)) $pass = 0;
3941  $result = $ilDB->queryF("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",
3942  array('integer','integer'),
3943  array($active_id, $pass)
3944  );
3945  }
3946  else
3947  {
3948  $result = $ilDB->queryF("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",
3949  array('integer'),
3950  array($this->getTestId())
3951  );
3952  }
3953  while ($data = $ilDB->fetchObject($result))
3954  {
3955  if( $data->original_id === null )
3956  {
3957  continue;
3958  }
3959 
3960  array_push($existing_questions, $data->original_id);
3961  }
3962  return $existing_questions;
3963  }
$result
getTestId()
Gets the database id of the additional test data.
getActiveIdOfUser($user_id="", $anonymous_id="")
Gets the active id of a given user.
isRandomTest()
Returns the fact wether this test is a random questions test or not.
global $ilUser
Definition: imgupload.php:15
global $ilDB
+ 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.

public

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

References $file, and ilUtil\getDataDir().

946  {
947  include_once "./Services/Utilities/classes/class.ilUtil.php";
948  $export_dir = ilUtil::getDataDir()."/tst_data"."/tst_".$this->getId()."/export";
949  return $export_dir;
950  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

◆ getExportSettings()

ilObjTest::getExportSettings ( )

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

References $exportsettings.

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

10839  {
10840  if ($this->exportsettings)
10841  {
10842  return $this->exportsettings;
10843  }
10844  else
10845  {
10846  return 0;
10847  }
10848  }
+ Here is the caller graph for this function:

◆ getExportSettingsSingleChoiceShort()

ilObjTest::getExportSettingsSingleChoiceShort ( )

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

Referenced by setExportSettingsSingleChoiceShort().

10863  {
10864  if (($this->exportsettings & 1) > 0)
10865  {
10866  return true;
10867  }
10868  else
10869  {
10870  return false;
10871  }
10872  }
+ Here is the caller graph for this function:

◆ getExtraTime()

ilObjTest::getExtraTime (   $active_id)

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

References $ilDB, $result, and $row.

Referenced by getProcessingTimeInSeconds().

11740  {
11741  global $ilDB;
11742 
11743  $result = $ilDB->queryF("SELECT additionaltime FROM tst_addtime WHERE active_fi = %s",
11744  array('integer'),
11745  array($active_id)
11746  );
11747  if ($result->numRows() > 0)
11748  {
11749  $row = $ilDB->fetchAssoc($result);
11750  return $row['additionaltime'];
11751  }
11752  return 0;
11753  }
$result
global $ilDB
+ 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 2256 of file class.ilObjTest.php.

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

2257  {
2258  return (strlen($this->_finalstatement)) ? $this->_finalstatement : NULL;
2259  }
+ 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) public

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

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

9622  {
9623  return ($this->fixed_participants) ? 1 : 0;
9624  }
+ Here is the caller graph for this function:

◆ getForceJS()

ilObjTest::getForceJS ( )

Gets whether JavaScript should be forced for tests.

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

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

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

2281  {
2282  return ($this->_forcejs) ? 1 : 0;
2283  }
+ 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. public
See also
$answer_feedback
Todo:
Rename $this->answer_feedback to something more meaningful.

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

Referenced by saveToDb().

2557  {
2558  return ($this->answer_feedback) ? $this->answer_feedback : 0;
2559  }
+ Here is the caller graph for this function:

◆ getGroupData()

& ilObjTest::getGroupData (   $ids)

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

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

7863  {
7864  if (!is_array($ids) || count($ids) ==0) return array();
7865  $result = array();
7866  foreach ($ids as $ref_id)
7867  {
7868  $obj_id = ilObject::_lookupObjId($ref_id);
7869  $result[$ref_id] = array("ref_id" => $ref_id, "title" => ilObject::_lookupTitle($obj_id), "description" => ilObject::_lookupDescription($obj_id));
7870  }
7871  return $result;
7872  }
$result
static _lookupTitle($a_id)
lookup object title
static _lookupDescription($a_id)
lookup object description
static _lookupObjId($a_id)
+ 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 11259 of file class.ilObjTest.php.

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

11260  {
11261  return (bool) $this->_highscore_achieved_ts;
11262  }
+ 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 11219 of file class.ilObjTest.php.

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

11220  {
11221  return (bool) $this->_highscore_anon;
11222  }
+ 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 11193 of file class.ilObjTest.php.

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

11194  {
11195  return (bool) $this->_highscore_enabled;
11196  }
+ 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 11319 of file class.ilObjTest.php.

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

11320  {
11321  return (bool) $this->_highscore_hints;
11322  }
+ Here is the caller graph for this function:

◆ getHighscoreMode()

ilObjTest::getHighscoreMode ( )
Returns
int

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

References getHighscoreOwnTable(), and getHighscoreTopTable().

11418  {
11419  switch(true)
11420  {
11421  case $this->getHighscoreOwnTable() && $this->getHighscoreTopTable():
11422  return self::HIGHSCORE_SHOW_ALL_TABLES;
11423  break;
11424 
11425  case $this->getHighscoreTopTable():
11426  return self::HIGHSCORE_SHOW_TOP_TABLE;
11427  break;
11428 
11429  case $this->getHighscoreOwnTable():
11430  default:
11431  return self::HIGHSCORE_SHOW_OWN_TABLE;
11432  break;
11433  }
11434  }
getHighscoreOwnTable()
Gets if the own rankings table should be shown.
getHighscoreTopTable()
Gets, if the top-rankings table should be shown.
const HIGHSCORE_SHOW_TOP_TABLE
const HIGHSCORE_SHOW_OWN_TABLE
const HIGHSCORE_SHOW_ALL_TABLES
+ 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 11359 of file class.ilObjTest.php.

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

11360  {
11361  return (bool) $this->_highscore_own_table;
11362  }
+ 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 11299 of file class.ilObjTest.php.

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

11300  {
11301  return (bool) $this->_highscore_percentage;
11302  }
+ 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 11279 of file class.ilObjTest.php.

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

11280  {
11281  return (bool) $this->_highscore_score;
11282  }
+ 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 11403 of file class.ilObjTest.php.

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

11404  {
11405  $retval = $a_retval;
11406  if ( (int) $this->_highscore_top_num != 0)
11407  {
11408  $retval = $this->_highscore_top_num;
11409  }
11410 
11411  return $retval;
11412  }
+ 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 11379 of file class.ilObjTest.php.

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

11380  {
11381  return (bool) $this->_highscore_top_table;
11382  }
+ 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 11339 of file class.ilObjTest.php.

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

11340  {
11341  return (bool) $this->_highscore_wtime;
11342  }
+ 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.

public

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

References ilObject\getId().

5590  {
5591  return CLIENT_WEB_DIR . "/assessment/" . $this->getId() . "/images/";
5592  }
getId()
get object id public
+ 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.

public

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

References ilObject\getId(), ILIAS_ABSOLUTE_PATH, and ilUtil\removeTrailingPathSeparators().

5601  {
5602  include_once "./Services/Utilities/classes/class.ilUtil.php";
5603  $webdir = ilUtil::removeTrailingPathSeparators(CLIENT_WEB_DIR) . "/assessment/" . $this->getId() . "/images/";
5605  }
getId()
get object id public
const ILIAS_ABSOLUTE_PATH
static removeTrailingPathSeparators($path)
+ Here is the call graph for this function:

◆ getImportDirectory()

ilObjTest::getImportDirectory ( )

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

References _getImportDirectory().

1016  {
1018  }
_getImportDirectory()
Get the import directory location of the test.
+ Here is the call graph for this function:

◆ getImportMapping()

ilObjTest::getImportMapping ( )

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

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

6993  {
6994  if (!is_array($this->import_mapping))
6995  {
6996  return array();
6997  }
6998  else
6999  {
7000  return $this->import_mapping;
7001  }
7002  }

◆ 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 public
See also
$instant_verification

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

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

2531  {
2532  return ($this->instant_verification) ? $this->instant_verification : 0;
2533  }
+ 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 2099 of file class.ilObjTest.php.

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

2100  {
2101  return (strlen($this->introduction)) ? $this->introduction : NULL;
2102  }
+ Here is the caller 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 public

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

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

7630  {
7631  global $ilDB;
7632 
7633  $result_array = array();
7634 
7635  if ($this->getAnonymity())
7636  {
7637  if (is_numeric($user_id))
7638  {
7639  $result = $ilDB->queryF("SELECT tst_active.active_id, tst_active.tries, usr_id, %s login, %s lastname, %s firstname, tst_invited_user.clientip, " .
7640  "tst_active.submitted test_finished, matriculation FROM usr_data, tst_invited_user " .
7641  "LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
7642  "WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id AND usr_data.usr_id=%s " .
7643  "ORDER BY $order",
7644  array('text', 'text', 'text', 'integer', 'integer'),
7645  array("", $this->lng->txt("anonymous"), "", $this->getTestId(), $user_id)
7646  );
7647  }
7648  else
7649  {
7650  $result = $ilDB->queryF("SELECT tst_active.active_id, usr_id, %s login, %s lastname, %s firstname, tst_invited_user.clientip, " .
7651  "tst_active.submitted test_finished, matriculation FROM usr_data, tst_invited_user " .
7652  "LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
7653  "WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id " .
7654  "ORDER BY $order",
7655  array('text', 'text', 'text', 'integer'),
7656  array("", $this->lng->txt("anonymous"), "", $this->getTestId())
7657  );
7658  }
7659  }
7660  else
7661  {
7662  if (is_numeric($user_id))
7663  {
7664  $result = $ilDB->queryF("SELECT tst_active.active_id, tst_active.tries, usr_id, login, lastname, firstname, tst_invited_user.clientip, " .
7665  "tst_active.submitted test_finished, matriculation FROM usr_data, tst_invited_user " .
7666  "LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
7667  "WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id AND usr_data.usr_id=%s " .
7668  "ORDER BY $order",
7669  array('integer', 'integer'),
7670  array($this->getTestId(), $user_id)
7671  );
7672  }
7673  else
7674  {
7675  $result = $ilDB->queryF("SELECT tst_active.active_id, tst_active.tries, usr_id, login, lastname, firstname, tst_invited_user.clientip, " .
7676  "tst_active.submitted test_finished, matriculation FROM usr_data, tst_invited_user " .
7677  "LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
7678  "WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id " .
7679  "ORDER BY $order",
7680  array('integer'),
7681  array($this->getTestId())
7682  );
7683  }
7684  }
7685  $result_array = array();
7686  while ($row = $ilDB->fetchAssoc($result))
7687  {
7688  $result_array[$row['usr_id']]= $row;
7689  }
7690  return $result_array;
7691  }
$result
getTestId()
Gets the database id of the additional test data.
getAnonymity()
Returns the anonymity status of the test.
global $ilDB
+ Here is the call 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 public

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

10327  {
10328  return TRUE;
10329 
10330 // global $ilUser;
10331 // if (strcmp($_GET["tst_javascript"], "0") == 0) return FALSE;
10332 // if ($this->getForceJS()) return TRUE;
10333 // $assessmentSetting = new ilSetting("assessment");
10334 // return ($ilUser->getPref("tst_javascript") === FALSE) ? $assessmentSetting->get("use_javascript") : $ilUser->getPref("tst_javascript");
10335  }

◆ getKiosk()

ilObjTest::getKiosk ( )

Returns the kiosk mode.

Returns
integer Kiosk mode public
See also
$_kiosk

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

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

2741  {
2742  return ($this->_kiosk) ? $this->_kiosk : 0;
2743  }
+ Here is the caller graph for this function:

◆ getKioskMode()

ilObjTest::getKioskMode ( )

Returns the kiosk mode.

Returns
boolean Kiosk mode public
See also
$_kiosk

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

Referenced by setKioskMode().

2766  {
2767  if (($this->_kiosk & 1) > 0)
2768  {
2769  return TRUE;
2770  }
2771  else
2772  {
2773  return FALSE;
2774  }
2775  }
+ 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 public

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

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

8779  {
8780  if (($this->show_summary & 1) > 0)
8781  {
8782  return TRUE;
8783  }
8784  else
8785  {
8786  return FALSE;
8787  }
8788  }
+ 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 public

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

Referenced by setListOfQuestionsDescription().

8893  {
8894  if (($this->show_summary & 8) > 0)
8895  {
8896  return TRUE;
8897  }
8898  else
8899  {
8900  return FALSE;
8901  }
8902  }
+ 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 public

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

Referenced by setListOfQuestionsEnd().

8854  {
8855  if (($this->show_summary & 4) > 0)
8856  {
8857  return TRUE;
8858  }
8859  else
8860  {
8861  return FALSE;
8862  }
8863  }
+ 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 public

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

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

8751  {
8752  return ($this->show_summary) ? $this->show_summary : 0;
8753  }
+ 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 public

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

Referenced by setListOfQuestionsStart().

8815  {
8816  if (($this->show_summary & 2) > 0)
8817  {
8818  return TRUE;
8819  }
8820  else
8821  {
8822  return FALSE;
8823  }
8824  }
+ Here is the caller graph for this function:

◆ getMailNotification()

ilObjTest::getMailNotification ( )

Get mail notification settings.

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

References $mailnotification.

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

10650  {
10651  return $this->mailnotification;
10652  }
+ Here is the caller graph for this function:

◆ getMailNotificationType()

ilObjTest::getMailNotificationType ( )

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

References $mailnottype.

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

10815  {
10816  if ($this->mailnottype == 1)
10817  {
10818  return $this->mailnottype;
10819  }
10820  else
10821  {
10822  return 0;
10823  }
10824  }
+ Here is the caller graph for this function:

◆ getManualFeedback()

static ilObjTest::getManualFeedback (   $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
string The feedback text public

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

References $ilDB, ilObject\$ilias, $ilUser, ilObject\$lng, $pass, $result, $row, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilObjTestAccess\_getParticipantData(), assQuestion\_getQuestionTitle(), ilRTE\_replaceMediaObjectImageSrc(), PEAR\isError(), and logAction().

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

10250  {
10251  global $ilDB;
10252  $feedback = "";
10253  $result = $ilDB->queryF("SELECT feedback FROM tst_manual_fb WHERE active_fi = %s AND question_fi = %s AND pass = %s",
10254  array('integer', 'integer', 'integer'),
10255  array($active_id, $question_id, $pass)
10256  );
10257  if ($result->numRows())
10258  {
10259  $row = $ilDB->fetchAssoc($result);
10260  include_once("./Services/RTE/classes/class.ilRTE.php");
10261  $feedback = ilRTE::_replaceMediaObjectImageSrc($row["feedback"], 1);
10262  }
10263  return $feedback;
10264  }
$result
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...
global $ilDB
+ 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 7094 of file class.ilObjTest.php.

References $mark_schema.

7095  {
7096  return $this->mark_schema;
7097  }

◆ getMarkSchemaForeignId()

ilObjTest::getMarkSchemaForeignId ( )

{

Returns
int
}

Implements ilMarkSchemaAware.

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

References $ilDB, getTestId(), ilMarkSchemaAware\onMarkSchemaSaved(), participantDataExist(), recalculateScores(), and saveCompleteStatus().

7103  {
7104  return $this->getTestId();
7105  }
getTestId()
Gets the database id of the additional test data.
+ 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 public
See also
$mc_scoring

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

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

2615  {
2616  return ($this->mc_scoring) ? $this->mc_scoring : 0;
2617  }
+ 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.

private

Deprecated:
: still in use?

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

References $ilDB, $pass, and $result.

Referenced by getStartTestLabel().

1854  {
1855  global $ilDB;
1856 
1857  $result = $ilDB->queryF("SELECT test_result_id FROM tst_test_result WHERE active_fi = %s AND pass = %s",
1858  array('integer','integer'),
1859  array($active_id, $pass)
1860  );
1861  return $result->numRows();
1862  }
$result
global $ilDB
+ 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 public
See also
$nr_of_tries

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

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

2729  {
2730  return ($this->nr_of_tries) ? $this->nr_of_tries : 0;
2731  }
+ 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 4763 of file class.ilObjTest.php.

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

4764  {
4765  global $ilDB;
4766  $result = $ilDB->queryF("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",
4767  array('integer'),
4768  array($this->getTestId())
4769  );
4770  $persons_array = array();
4771  while ($row = $ilDB->fetchAssoc($result))
4772  {
4773  $name = $this->lng->txt("anonymous");
4774  $fullname = $this->lng->txt("anonymous");
4775  $login = "";
4776  if (!$this->getAnonymity())
4777  {
4778  if (strlen($row["firstname"].$row["lastname"].$row["title"]) == 0)
4779  {
4780  $name = $this->lng->txt("deleted_user");
4781  $fullname = $this->lng->txt("deleted_user");
4782  $login = $this->lng->txt("unknown");
4783  }
4784  else
4785  {
4786  $login = $row["login"];
4787  if ($row["user_fi"] == ANONYMOUS_USER_ID)
4788  {
4789  $name = $this->lng->txt("anonymous");
4790  $fullname = $this->lng->txt("anonymous");
4791  }
4792  else
4793  {
4794  $name = trim($row["lastname"] . ", " . $row["firstname"] . " " . $row["title"]);
4795  $fullname = trim($row["title"] . " " . $row["firstname"] . " " . $row["lastname"]);
4796  }
4797  }
4798  }
4799  $persons_array[$row["active_id"]] = array(
4800  "name" => $name,
4801  "fullname" => $fullname,
4802  "login" => $login
4803  );
4804  }
4805  return $persons_array;
4806  }
$result
getTestId()
Gets the database id of the additional test data.
getAnonymity()
Returns the anonymity status of the test.
global $ilDB
+ Here is the call graph for this function:

◆ getPassed()

ilObjTest::getPassed (   $active_id)

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

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

Referenced by canShowCertificate().

10446  {
10447  global $ilDB;
10448 
10449  $result = $ilDB->queryF("SELECT passed FROM tst_result_cache WHERE active_fi = %s",
10450  array('integer'),
10451  array($active_id)
10452  );
10453  if ($result->numRows())
10454  {
10455  $row = $ilDB->fetchAssoc($result);
10456  return $row['passed'];
10457  }
10458  else
10459  {
10460  $counted_pass = ilObjTest::_getResultPass($active_id);
10461  $result_array =& $this->getTestResult($active_id, $counted_pass);
10462  return $result_array["test"]["passed"];
10463  }
10464  }
$result
_getResultPass($active_id)
Retrieves the pass number that should be counted for a given user.
global $ilDB
& getTestResult($active_id, $pass=NULL, $ordered_sequence=FALSE)
Calculates the results of a test for a given user and returns an array with all test results...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPassFinishDate()

ilObjTest::getPassFinishDate (   $active_id,
  $pass 
)

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
Returns
timestamp The SQL timestamp of the finished pass public

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

References $ilDB, $pass, $query, $result, and $row.

Referenced by ilObjTestVerification\createFromTest(), and isTestFinishedToViewResults().

8385  {
8386  global $ilDB;
8387 
8388  if (is_null($pass))
8389  {
8390  $pass = 0;
8391  }
8392 
8393  $query = "
8394  SELECT tst_pass_result.tstamp pass_res_tstamp,
8395  tst_test_result.tstamp quest_res_tstamp
8396 
8397  FROM tst_pass_result
8398 
8399  LEFT JOIN tst_test_result
8400  ON tst_test_result.active_fi = tst_pass_result.active_fi
8401  AND tst_test_result.pass = tst_pass_result.pass
8402 
8403  WHERE tst_pass_result.active_fi = %s
8404  AND tst_pass_result.pass = %s
8405 
8406  ORDER BY tst_test_result.tstamp DESC
8407  ";
8408 
8409  $result = $ilDB->queryF($query,
8410  array('integer', 'integer'),
8411  array($active_id, $pass)
8412  );
8413 
8414  while( $row = $ilDB->fetchAssoc($result) )
8415  {
8416  if( $row['qres_tstamp'] )
8417  {
8418  return $row['quest_res_tstamp'];
8419  }
8420 
8421  return $row['pass_res_tstamp'];
8422  }
8423 
8424  return 0;
8425  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ getPassScoring()

ilObjTest::getPassScoring ( )

Gets the pass scoring type.

Returns
integer The pass scoring type public
See also
$pass_scoring

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

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

2639  {
2640  return ($this->pass_scoring) ? $this->pass_scoring : 0;
2641  }
+ Here is the caller graph for this function:

◆ getPassword()

ilObjTest::getPassword ( )

Returns the password for test access.

Returns
striong Password for test access public
See also
$password

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

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

3325  {
3326  return (strlen($this->password)) ? $this->password : NULL;
3327  }
+ Here is the caller graph for this function:

◆ getPoolQuestionChangeListeners()

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

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

References ilObjTestDynamicQuestionSetConfig\getPoolQuestionChangeListener().

Referenced by ilObjQuestionPool\addQuestionChangeListeners().

12109  {
12110  require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
12111 
12112  $questionChangeListeners = array(
12114  );
12115 
12116  return $questionChangeListeners;
12117  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPoolUsage()

ilObjTest::getPoolUsage ( )

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

References $poolUsage.

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

10991  {
10992  return (boolean) $this->poolUsage;
10993  }
+ 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 public
See also
$processing_time

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

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

2975  {
2976  return (strlen($this->processing_time)) ? $this->processing_time : NULL;
2977  }
+ 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 2985 of file class.ilObjTest.php.

References getEstimatedWorkingTime().

2986  {
2987  if (strlen($this->processing_time))
2988  {
2989  if (preg_match("/(\d{2}):(\d{2}):(\d{2})/is", $this->processing_time, $matches))
2990  {
2991  if ((int)$matches[1]+(int)$matches[2]+(int)$matches[3] == 0)
2992  {
2993  return $this->getEstimatedWorkingTime();
2994  }
2995  else
2996  {
2997  return array(
2998  'hh' => $matches[1],
2999  'mm' => $matches[2],
3000  'ss' => $matches[3],
3001  );
3002  }
3003  }
3004  }
3005  return $this->getEstimatedWorkingTime();
3006  }
getEstimatedWorkingTime()
Returns the estimated working time for the test calculated from the working time of the contained que...
+ Here is the call graph for this function:

◆ getProcessingTimeAsMinutes()

ilObjTest::getProcessingTimeAsMinutes ( )

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

3009  {
3010  if (strlen($this->processing_time))
3011  {
3012  if (preg_match("/(\d{2}):(\d{2}):(\d{2})/is", $this->processing_time, $matches))
3013  {
3014  return ($matches[1] * 60) + $matches[2];
3015  }
3016  }
3017 
3018  return self::DEFAULT_PROCESSING_TIME_MINUTES;
3019  }

◆ getProcessingTimeInSeconds()

ilObjTest::getProcessingTimeInSeconds (   $active_id = "")

Returns the processing time for the test in seconds.

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

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

References getExtraTime(), and getProcessingTime().

Referenced by isMaxProcessingTimeReached().

3029  {
3030  if (preg_match("/(\d{2}):(\d{2}):(\d{2})/", $this->getProcessingTime(), $matches))
3031  {
3032  $extratime = $this->getExtraTime($active_id) * 60;
3033  return ($matches[1] * 3600) + ($matches[2] * 60) + $matches[3] + $extratime;
3034  }
3035  else
3036  {
3037  return 0;
3038  }
3039  }
getProcessingTime()
Returns the processing time for the test.
getExtraTime($active_id)
+ 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 public

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

References $ilDB, and isRandomTest().

Referenced by createRandomSolutions(), getQuestionsOfPass(), and getQuestionsOfTest().

7433  {
7434  $num = 0;
7435 
7436  if( $this->isRandomTest() )
7437  {
7438  global $tree, $ilDB, $ilPluginAdmin;
7439 
7440  $questionSetConfig = new ilTestRandomQuestionSetConfig(
7441  $tree, $ilDB, $ilPluginAdmin, $this
7442  );
7443 
7444  $questionSetConfig->loadFromDb();
7445 
7446  if( $questionSetConfig->isQuestionAmountConfigurationModePerPool() )
7447  {
7448  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
7449  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetBuilderWithAmountPerPool.php';
7450  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
7451 
7452  $sourcePoolDefinitionList = new ilTestRandomQuestionSetSourcePoolDefinitionList(
7453  $ilDB, $this, new ilTestRandomQuestionSetSourcePoolDefinitionFactory($ilDB, $this)
7454  );
7455 
7456  $sourcePoolDefinitionList->loadDefinitions();
7457 
7458  $num = $sourcePoolDefinitionList->getQuestionAmount();
7459  }
7460  else
7461  {
7462  $num = $questionSetConfig->getQuestionAmountPerTest();
7463  }
7464  }
7465  else
7466  {
7467  $num = count($this->questions);
7468  }
7469 
7470  return $num;
7471  }
isRandomTest()
Returns the fact wether this test is a random questions test or not.
global $ilDB
+ 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 public
See also
$questions

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

References $ilDB, $result, and $row.

3914  {
3915  global $ilDB;
3916 
3917  $result = $ilDB->queryF("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",
3918  array('integer'),
3919  array($question_id)
3920  );
3921  $row = $ilDB->fetchObject($result);
3922  return $row;
3923  }
$result
global $ilDB

◆ getQuestions()

ilObjTest::getQuestions ( )

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

References $questions.

11112  {
11113  return $this->questions;
11114  }

◆ getQuestionSetType()

ilObjTest::getQuestionSetType ( )

getter for question set type

Returns
string $questionSetType

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

References $questionSetType.

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

11987  {
11988  return $this->questionSetType;
11989  }
+ Here is the caller graph for this function:

◆ getQuestionSetTypeTranslation()

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

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

References $questionSetType, QUESTION_SET_TYPE_DYNAMIC, QUESTION_SET_TYPE_FIXED, QUESTION_SET_TYPE_RANDOM, and ilLanguage\txt().

12059  {
12060  switch( $questionSetType )
12061  {
12063  return $lng->txt('tst_question_set_type_fixed');
12064 
12066  return $lng->txt('tst_question_set_type_random');
12067 
12069  return $lng->txt('tst_question_set_type_dynamic');
12070  }
12071 
12072  throw new ilTestException('invalid question set type value given: '.$questionSetType);
12073  }
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
Base Exception for all Exceptions relating to Modules/Test.
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
txt($a_topic, $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)
+ Here is the call graph for this function:

◆ 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 public

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

References $data, $ilDB, $pass, $query, $res, $result, $row, getECTSGrade(), getECTSOutput(), getQuestionCount(), getTestId(), getTotalPointsPassedArray(), getVisitTimeOfParticipant(), isDynamicTest(), isRandomTest(), and ilObjTestDynamicQuestionSetConfig\loadFromDb().

4960  {
4961  global $ilDB;
4962  if ($this->isRandomTest())
4963  {
4964  $ilDB->setLimit($this->getQuestionCount(), 0);
4965  $result = $ilDB->queryF("SELECT tst_test_rnd_qst.sequence, tst_test_rnd_qst.question_fi, " .
4966  "qpl_questions.points " .
4967  "FROM tst_test_rnd_qst, qpl_questions " .
4968  "WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id " .
4969  "AND tst_test_rnd_qst.active_fi = %s AND tst_test_rnd_qst.pass = %s " .
4970  "ORDER BY tst_test_rnd_qst.sequence",
4971  array('integer', 'integer'),
4972  array($active_id, $pass)
4973  );
4974  }
4975  else
4976  {
4977  $result = $ilDB->queryF("SELECT tst_test_question.sequence, tst_test_question.question_fi, " .
4978  "qpl_questions.points " .
4979  "FROM tst_test_question, tst_active, qpl_questions " .
4980  "WHERE tst_test_question.question_fi = qpl_questions.question_id " .
4981  "AND tst_active.active_id = %s AND tst_active.test_fi = tst_test_question.test_fi",
4982  array('integer'),
4983  array($active_id)
4984  );
4985  }
4986  $qpass = array();
4987  if ($result->numRows())
4988  {
4989  while ($row = $ilDB->fetchAssoc($result))
4990  {
4991  array_push($qpass, $row);
4992  }
4993  }
4994  return $qpass;
4995  }
$result
getQuestionCount()
Returns the number of questions in the test.
isRandomTest()
Returns the fact wether this test is a random questions test or not.
global $ilDB
+ 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 public

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

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

4917  {
4918  global $ilDB;
4919  if ($this->isRandomTest())
4920  {
4921  $ilDB->setLimit($this->getQuestionCount(), 0);
4922  $result = $ilDB->queryF("SELECT tst_test_rnd_qst.sequence, tst_test_rnd_qst.question_fi, " .
4923  "tst_test_rnd_qst.pass, qpl_questions.points " .
4924  "FROM tst_test_rnd_qst, qpl_questions " .
4925  "WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id " .
4926  "AND tst_test_rnd_qst.active_fi = %s ORDER BY tst_test_rnd_qst.sequence",
4927  array('integer'),
4928  array($active_id)
4929  );
4930  }
4931  else
4932  {
4933  $result = $ilDB->queryF("SELECT tst_test_question.sequence, tst_test_question.question_fi, " .
4934  "qpl_questions.points " .
4935  "FROM tst_test_question, tst_active, qpl_questions " .
4936  "WHERE tst_test_question.question_fi = qpl_questions.question_id " .
4937  "AND tst_active.active_id = %s AND tst_active.test_fi = tst_test_question.test_fi",
4938  array('integer'),
4939  array($active_id)
4940  );
4941  }
4942  $qtest = array();
4943  if ($result->numRows())
4944  {
4945  while ($row = $ilDB->fetchAssoc($result))
4946  {
4947  array_push($qtest, $row);
4948  }
4949  }
4950  return $qtest;
4951  }
$result
getQuestionCount()
Returns the number of questions in the test.
isRandomTest()
Returns the fact wether this test is a random questions test or not.
global $ilDB
+ 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 public

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

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

7604  {
7605  global $ilDB;
7606 
7607  $res = "";
7608  if ($question_id)
7609  {
7610  $result = $ilDB->queryF("SELECT question_text FROM qpl_questions WHERE question_id = %s",
7611  array('integer'),
7612  array($question_id)
7613  );
7614  if ($result->numRows() == 1)
7615  {
7616  $row = $ilDB->fetchAssoc($result);
7617  $res = $row["question_text"];
7618  }
7619  }
7620  return $res;
7621  }
$result
global $ilDB

◆ getQuestionTitle()

ilObjTest::getQuestionTitle (   $title)

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
Returns
string The title for the question title output public

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

References ilObject\$title, and getTitleOutput().

3894  {
3895  if ($this->getTitleOutput() == 2)
3896  {
3897  return $this->lng->txt("ass_question");
3898  }
3899  else
3900  {
3901  return $title;
3902  }
3903  }
getTitleOutput()
Returns the value of the title_output status.
+ 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 public
See also
$questions

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

References $ilDB, $result, $row, getQuestionSetType(), and getTestId().

3843  {
3844  $titles = array();
3845  if ($this->getQuestionSetType() == self::QUESTION_SET_TYPE_FIXED)
3846  {
3847  global $ilDB;
3848  $result = $ilDB->queryF("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",
3849  array('integer'),
3850  array($this->getTestId())
3851  );
3852  while ($row = $ilDB->fetchAssoc($result))
3853  {
3854  array_push($titles, $row["title"]);
3855  }
3856  }
3857  return $titles;
3858  }
$result
getTestId()
Gets the database id of the additional test data.
getQuestionSetType()
getter for question set type
global $ilDB
+ 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 public
See also
$questions

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

References $ilDB, $result, $row, getQuestionSetType(), and getTestId().

Referenced by hasQuestionsWithoutQuestionpool().

3868  {
3869  $titles = array();
3870  if ($this->getQuestionSetType() == self::QUESTION_SET_TYPE_FIXED)
3871  {
3872  global $ilDB;
3873  $result = $ilDB->queryF("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",
3874  array('integer'),
3875  array($this->getTestId())
3876  );
3877  while ($row = $ilDB->fetchAssoc($result))
3878  {
3879  $titles[$row['question_id']] = $row["title"];
3880  }
3881  }
3882  return $titles;
3883  }
$result
getTestId()
Gets the database id of the additional test data.
getQuestionSetType()
getter for question set type
global $ilDB
+ 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 private

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

References $data, $ilDB, and $result.

Referenced by createQuestionGUI().

3973  {
3974  global $ilDB;
3975 
3976  if ($question_id < 1) return -1;
3977  $result = $ilDB->queryF("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",
3978  array('integer'),
3979  array($question_id)
3980  );
3981  if ($result->numRows() == 1)
3982  {
3983  $data = $ilDB->fetchObject($result);
3984  return $data->type_tag;
3985  }
3986  else
3987  {
3988  return "";
3989  }
3990  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ getQuestionTypeTranslations()

& ilObjTest::getQuestionTypeTranslations ( )

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

References $ilDB, $ilLog, ilObject\$lng, $result, $row, ilPlugin\getPluginObject(), and IL_COMP_MODULE.

Referenced by getAvailableQuestions().

5856  {
5857  global $ilDB;
5858  global $lng;
5859  global $ilLog;
5860  global $ilPluginAdmin;
5861 
5862  $lng->loadLanguageModule("assessment");
5863  $result = $ilDB->query("SELECT * FROM qpl_qst_type");
5864  $types = array();
5865  while ($row = $ilDB->fetchAssoc($result))
5866  {
5867  if ($row["plugin"] == 0)
5868  {
5869  $types[$row['type_tag']] = $lng->txt($row["type_tag"]);
5870  }
5871  else
5872  {
5873  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, "TestQuestionPool", "qst");
5874  foreach ($pl_names as $pl_name)
5875  {
5876  $pl = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", $pl_name);
5877  if (strcmp($pl->getQuestionType(), $row["type_tag"]) == 0)
5878  {
5879  $types[$row['type_tag']] = $pl->getQuestionTypeTranslation();
5880  }
5881  }
5882  }
5883  }
5884  ksort($types);
5885  return $types;
5886  }
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
$result
const IL_COMP_MODULE
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRedirectionMode()

ilObjTest::getRedirectionMode ( )

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

References $redirection_mode.

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

3202  {
3203  return $this->redirection_mode;
3204  }
+ Here is the caller graph for this function:

◆ getRedirectionUrl()

ilObjTest::getRedirectionUrl ( )

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

References $redirection_url.

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

3210  {
3211  return $this->redirection_url;
3212  }
+ 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 public
See also
$reporting_date

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

Referenced by _getAvailableTests(), addDefaults(), canEditEctsGrades(), canEditMarks(), canViewResults(), isScoreReportingAvailable(), saveToDb(), and toXML().

2717  {
2718  return (strlen($this->reporting_date)) ? $this->reporting_date : NULL;
2719  }
+ 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 public
See also
$reset_processing_time

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

Referenced by _getAvailableTests(), addDefaults(), getStartingTimeOfUser(), isExecutable(), saveToDb(), and toXML().

3082  {
3083  return ($this->reset_processing_time) ? $this->reset_processing_time : 0;
3084  }
+ Here is the caller graph for this function:

◆ getResultFilterTaxIds()

ilObjTest::getResultFilterTaxIds ( )

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

References $resultFilterTaxIds.

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

12159  {
12161  }
+ Here is the caller graph for this function:

◆ getResultsForActiveId()

ilObjTest::getResultsForActiveId (   $active_id)

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

References $ilDB, $query, $result, $row, and assQuestion\_updateTestResultCache().

Referenced by getTestResult().

10778  {
10779  global $ilDB;
10780 
10781  $query = "
10782  SELECT *
10783  FROM tst_result_cache
10784  WHERE active_fi = %s
10785  ";
10786 
10787  $result = $ilDB->queryF(
10788  $query, array('integer'), array($active_id)
10789  );
10790 
10791  if( !$result->numRows() )
10792  {
10793  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
10794 
10796 
10797  $query = "
10798  SELECT *
10799  FROM tst_result_cache
10800  WHERE active_fi = %s
10801  ";
10802 
10803  $result = $ilDB->queryF(
10804  $query, array('integer'), array($active_id)
10805  );
10806  }
10807 
10808  $row = $ilDB->fetchAssoc($result);
10809 
10810  return $row;
10811 
10812  }
$result
global $ilDB
_updateTestResultCache($active_id, ilAssQuestionProcessLocker $processLocker=null)
Move this to a proper place.
+ 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 public

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

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

8932  {
8933  return ($this->results_presentation) ? $this->results_presentation : 0;
8934  }
+ Here is the caller graph for this function:

◆ getRoleData()

& ilObjTest::getRoleData (   $ids)

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

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

7875  {
7876  if (!is_array($ids) || count($ids) ==0) return array();
7877  $result = array();
7878  foreach ($ids as $obj_id)
7879  {
7880  $result[$obj_id] = array("obj_id" => $obj_id, "title" => ilObject::_lookupTitle($obj_id), "description" => ilObject::_lookupDescription($obj_id));
7881  }
7882  return $result;
7883  }
$result
static _lookupTitle($a_id)
lookup object title
static _lookupDescription($a_id)
lookup object description
+ 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 public
See also
$score_cutting

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

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

2627  {
2628  return ($this->score_cutting) ? $this->score_cutting : 0;
2629  }
+ 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 public
See also
$score_reporting

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

Referenced by _getAvailableTests(), addDefaults(), canShowTestResults(), canViewResults(), isScoreReportingAvailable(), isScoreReportingEnabled(), saveToDb(), and toXML().

2514  {
2515  return ($this->score_reporting) ? $this->score_reporting : 0;
2516  }
+ 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 public
See also
$ending_time

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

References getEndingTime().

3049  {
3050  if (preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getEndingTime(), $matches))
3051  {
3052  $ending = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
3053  $now = time();
3054  return $ending - $now;
3055  }
3056  else
3057  {
3058  return 0;
3059  }
3060  }
getEndingTime()
Returns the ending time of the test.
+ Here is the call graph for this function:

◆ getSequenceSettings()

ilObjTest::getSequenceSettings ( )

SEQUENCE SETTING = POSTPONING ENABLED !!

Returns
integer The POSTPONING ENABLED status

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

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

2363  {
2364  return ($this->sequence_settings) ? $this->sequence_settings : 0;
2365  }
+ 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) public

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

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

9562  {
9563  return ($this->show_cancel) ? 1 : 0;
9564  }
+ Here is the caller graph for this function:

◆ getShowExamviewHtml()

ilObjTest::getShowExamviewHtml ( )
Returns
boolean

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

References $show_examview_html.

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

11652  {
11654  }
+ Here is the caller graph for this function:

◆ getShowExamviewPdf()

ilObjTest::getShowExamviewPdf ( )
Returns
boolean

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

References $show_examview_pdf.

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

11668  {
11669  return $this->show_examview_pdf;
11670  }
+ 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 public
See also
$_showfinalstatement

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

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

2293  {
2294  return ($this->_showfinalstatement) ? 1 : 0;
2295  }
+ 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 public
See also
$_showinfo

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

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

2269  {
2270  return ($this->_showinfo) ? 1 : 0;
2271  }
+ Here is the caller graph for this function:

◆ getShowKioskModeParticipant()

ilObjTest::getShowKioskModeParticipant ( )

Returns the status of the kiosk mode participant.

Returns
boolean Kiosk mode participant public
See also
$_kiosk

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

Referenced by setShowKioskModeParticipant().

2847  {
2848  if (($this->_kiosk & 4) > 0)
2849  {
2850  return TRUE;
2851  }
2852  else
2853  {
2854  return FALSE;
2855  }
2856  }
+ Here is the caller graph for this function:

◆ getShowKioskModeTitle()

ilObjTest::getShowKioskModeTitle ( )

Returns the status of the kiosk mode title.

Returns
boolean Kiosk mode title public
See also
$_kiosk

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

Referenced by setShowKioskModeTitle().

2807  {
2808  if (($this->_kiosk & 2) > 0)
2809  {
2810  return TRUE;
2811  }
2812  else
2813  {
2814  return FALSE;
2815  }
2816  }
+ 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) public

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

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

9592  {
9593  return ($this->show_marker) ? 1 : 0;
9594  }
+ 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 public

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

Referenced by setShowPassDetails().

8943  {
8944  if (($this->results_presentation & 1) > 0)
8945  {
8946  return TRUE;
8947  }
8948  else
8949  {
8950  return FALSE;
8951  }
8952  }
+ 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 public

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

Referenced by setShowSolutionAnswersOnly().

9015  {
9016  if (($this->results_presentation & 16) > 0)
9017  {
9018  return TRUE;
9019  }
9020  else
9021  {
9022  return FALSE;
9023  }
9024  }
+ 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 public

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

Referenced by setShowSolutionDetails(), and toXML().

8961  {
8962  if (($this->results_presentation & 2) > 0)
8963  {
8964  return TRUE;
8965  }
8966  else
8967  {
8968  return FALSE;
8969  }
8970  }
+ 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 public

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

Referenced by setShowSolutionFeedback().

8997  {
8998  if (($this->results_presentation & 8) > 0)
8999  {
9000  return TRUE;
9001  }
9002  else
9003  {
9004  return FALSE;
9005  }
9006  }
+ 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 public

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

Referenced by setShowSolutionListComparison().

9065  {
9066  if(($this->results_presentation & 128) > 0)
9067  {
9068  return TRUE;
9069  }
9070  else
9071  {
9072  return FALSE;
9073  }
9074  }
+ 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 public

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

Referenced by canShowSolutionPrintview(), and setShowSolutionPrintview().

8979  {
8980  if (($this->results_presentation & 4) > 0)
8981  {
8982  return TRUE;
8983  }
8984  else
8985  {
8986  return FALSE;
8987  }
8988  }
+ 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 public

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

Referenced by setShowSolutionSignature().

9033  {
9034  if (($this->results_presentation & 32) > 0)
9035  {
9036  return TRUE;
9037  }
9038  else
9039  {
9040  return FALSE;
9041  }
9042  }
+ Here is the caller graph for this function:

◆ getShowSolutionSuggested()

ilObjTest::getShowSolutionSuggested ( )
Returns
boolean TRUE if the suggested solutions should be shown, FALSE otherwise public

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

Referenced by setShowSolutionSuggested().

9049  {
9050  if (($this->results_presentation & 64) > 0)
9051  {
9052  return TRUE;
9053  }
9054  else
9055  {
9056  return FALSE;
9057  }
9058  }
+ 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 public

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

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

8723  {
8724  return ($this->shuffle_questions) ? 1 : 0;
8725  }
+ Here is the caller graph for this function:

◆ getSignSubmission()

ilObjTest::getSignSubmission ( )
Returns
boolean

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

References $sign_submission.

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

11934  {
11935  return $this->sign_submission;
11936  }
+ Here is the caller graph for this function:

◆ getSpecificAnswerFeedback()

ilObjTest::getSpecificAnswerFeedback ( )

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

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

11476  {
11477  switch ($this->specific_answer_feedback)
11478  {
11479  case 1:
11480  return 1;
11481  default:
11482  return 0;
11483  }
11484  }
+ 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 public
See also
$starting_time

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

Referenced by _getAvailableTests(), addDefaults(), isExecutable(), saveToDb(), startingTimeReached(), and toXML().

3110  {
3111  return (strlen($this->starting_time)) ? $this->starting_time : NULL;
3112  }
+ Here is the caller graph for this function:

◆ getStartingTimeOfParticipants()

ilObjTest::getStartingTimeOfParticipants ( )

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

References $ilDB, $result, and $row.

11711  {
11712  global $ilDB;
11713 
11714  $times = array();
11715  $result = $ilDB->query("SELECT tst_times.active_fi, tst_times.started FROM tst_times, tst_active WHERE tst_times.active_fi = tst_active.active_id ORDER BY tst_times.tstamp DESC");
11716  while ($row = $ilDB->fetchAssoc($result))
11717  {
11718  $times[$row['active_fi']] = $row['started'];
11719  }
11720  return $times;
11721  }
$result
global $ilDB

◆ 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 public

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

References $ilDB, $pass, $result, $row, _getPass(), and getResetProcessingTime().

Referenced by canShowTestResults(), and isExecutable().

8565  {
8566  global $ilDB;
8567 
8568  if ($active_id < 1) return FALSE;
8569  if($pass === null)
8570  {
8571  $pass = ($this->getResetProcessingTime()) ? $this->_getPass($active_id) : 0;
8572  }
8573  $result = $ilDB->queryF("SELECT tst_times.started FROM tst_times WHERE tst_times.active_fi = %s AND tst_times.pass = %s ORDER BY tst_times.started",
8574  array('integer', 'integer'),
8575  array($active_id, $pass)
8576  );
8577  if ($result->numRows())
8578  {
8579  $row = $ilDB->fetchAssoc($result);
8580  if (preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches))
8581  {
8582  return mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
8583  }
8584  else
8585  {
8586  return mktime();
8587  }
8588  }
8589  else
8590  {
8591  return mktime();
8592  }
8593  }
$result
_getPass($active_id)
Retrieves the actual pass of a given user for a given test.
getResetProcessingTime()
Returns wheather the processing time should be reset or not.
global $ilDB
+ 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 public

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

References $ilDB, $ilUser, $res, $result, $row, _getPass(), getNrOfResultsForPass(), and getNrOfTries().

9760  {
9761  if ($this->getNrOfTries() == 1)
9762  {
9763  return $this->lng->txt("tst_start_test");
9764  }
9765  $active_pass = $this->_getPass($active_id);
9766  $res = $this->getNrOfResultsForPass($active_id, $active_pass);
9767  if ($res == 0)
9768  {
9769  if ($active_pass == 0)
9770  {
9771  return $this->lng->txt("tst_start_test");
9772  }
9773  else
9774  {
9775  return $this->lng->txt("tst_start_new_test_pass");
9776  }
9777  }
9778  else
9779  {
9780  return $this->lng->txt("tst_resume_test");
9781  }
9782  }
_getPass($active_id)
Retrieves the actual pass of a given user for a given test.
getNrOfTries()
Returns the nr of tries for the test.
getNrOfResultsForPass($active_id, $pass)
Calculates the number of user results for a specific test pass.
+ Here is the call graph for this function:

◆ getTemplate()

ilObjTest::getTemplate ( )

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

References $template_id.

Referenced by _getAvailableTests(), and saveToDb().

10901  {
10902  return $this->template_id;
10903  }
+ 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 public

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

9818  {
9819  return self::_getTestDefaults($test_defaults_id);
9820  }

◆ getTestId()

ilObjTest::getTestId ( )

Gets the database id of the additional test data.

Returns
integer The database id of the additional test data public
See also
$test_id

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

References $test_id.

Referenced by _isComplete(), addExtraTime(), checkMaximumAllowedUsers(), createRandomSolutions(), deleteTest(), disinviteUser(), evalResultsOverview(), evalResultsOverviewOfParticipant(), evalTotalFinished(), evalTotalParticipantsArray(), evalTotalPersons(), evalTotalPersonsArray(), evalTotalStartedAverageTime(), getActiveIdOfUser(), getCompleteWorkingTime(), getCompleteWorkingTimeOfParticipant(), getCompleteWorkingTimeOfParticipants(), getEnableArchiving(), getExistingQuestions(), getInvitedUsers(), getMarkSchemaForeignId(), getParticipants(), getQuestionsOfPass(), getQuestionTitles(), getQuestionTitlesAndIndexes(), getTestParticipants(), getTestQuestions(), getTimeExtensionsOfParticipants(), getVisitTimeOfParticipant(), hasSingleChoiceQuestions(), insertQuestion(), inviteUser(), isActiveTestSubmitted(), isNewRandomTest(), isSingleChoiceTest(), isSingleChoiceTestWithoutShuffle(), loadFromDb(), moveQuestionAfter(), moveQuestionAfterOLD(), questionMoveDown(), questionMoveUp(), randomSelectQuestions(), removeAllTestEditings(), removeTestResultsByActiveIds(), removeTestResultsByUserIds(), removeTestResultsForUser(), saveCertificateVisibility(), saveCompleteStatus(), saveQuestionsToDb(), saveToDb(), and setClientIP().

2305  {
2306  return $this->test_id;
2307  }
+ Here is the caller graph for this function:

◆ getTestObjIdsWithActiveForUserId()

static ilObjTest::getTestObjIdsWithActiveForUserId (   $userId)
static

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

References $ilDB, $query, $res, and $row.

Referenced by ilTestVerificationTableGUI\getItems().

12120  {
12121  global $ilDB;
12122 
12123  $query = "
12124  SELECT obj_fi
12125  FROM tst_active
12126  INNER JOIN tst_tests
12127  ON test_id = test_fi
12128  WHERE user_fi = %s
12129  ";
12130 
12131  $res = $ilDB->queryF($query, array('integer'), array($userId));
12132 
12133  $objIds = array();
12134 
12135  while( $row = $ilDB->fetchAssoc($res) )
12136  {
12137  $objIds[] = (int)$row['obj_fi'];
12138  }
12139 
12140  return $objIds;
12141  }
global $ilDB
+ Here is the caller graph for this function:

◆ getTestParticipants()

& ilObjTest::getTestParticipants ( )

Returns a list of all participants in a test.

Returns
array The user id's of the participants public

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

References $data, $ilDB, $result, $row, getAnonymity(), and getTestId().

Referenced by getTestParticipantsForManualScoring().

7700  {
7701  global $ilDB;
7702 
7703  if ($this->getAnonymity())
7704  {
7705  $result = $ilDB->queryF("SELECT tst_active.active_id, tst_active.tries, tst_active.user_fi usr_id, %s login, %s lastname, %s firstname, tst_active.submitted test_finished, usr_data.matriculation, usr_data.active ".
7706  "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),
7707  array('text', 'text', 'text', 'integer'),
7708  array("", $this->lng->txt("anonymous"), "", $this->getTestId())
7709  );
7710  }
7711  else
7712  {
7713  $result = $ilDB->queryF("SELECT tst_active.active_id, tst_active.tries, tst_active.user_fi usr_id, usr_data.login, usr_data.lastname, usr_data.firstname, tst_active.submitted test_finished, usr_data.matriculation, usr_data.active ".
7714  "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),
7715  array('integer'),
7716  array($this->getTestId())
7717  );
7718  }
7719  $data = array();
7720  while ($row = $ilDB->fetchAssoc($result))
7721  {
7722  $data[$row['active_id']] = $row;
7723  }
7724  foreach ($data as $index => $participant)
7725  {
7726  if (strlen(trim($participant["firstname"].$participant["lastname"])) == 0)
7727  {
7728  $data[$index]["lastname"] = $this->lng->txt("deleted_user");
7729  }
7730  }
7731  return $data;
7732  }
$result
getTestId()
Gets the database id of the additional test data.
getAnonymity()
Returns the anonymity status of the test.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTestParticipantsForManualScoring()

ilObjTest::getTestParticipantsForManualScoring (   $filter = NULL)

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

References $ilDB, $result, $row, ilObjAssessmentFolder\_getManualScoring(), and getTestParticipants().

7735  {
7736  global $ilDB;
7737 
7738  include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
7740  if (count($scoring) == 0) return array();
7741 
7742  $participants =& $this->getTestParticipants();
7743  $filtered_participants = array();
7744  foreach ($participants as $active_id => $participant)
7745  {
7746  $qstType_IN_manScoreableQstTypes = $ilDB->in('qpl_questions.question_type_fi', $scoring, false, 'integer');
7747 
7748  $queryString = "
7749  SELECT tst_test_result.manual
7750 
7751  FROM tst_test_result
7752 
7753  INNER JOIN qpl_questions
7754  ON tst_test_result.question_fi = qpl_questions.question_id
7755 
7756  WHERE tst_test_result.active_fi = %s
7757  AND $qstType_IN_manScoreableQstTypes
7758  ";
7759 
7760  $result = $ilDB->queryF(
7761  $queryString, array("integer"), array($active_id)
7762  );
7763 
7764  $count = $result->numRows();
7765 
7766  if ($count > 0)
7767  {
7768  switch ($filter)
7769  {
7770  case 1: // only active users
7771  if ($participant->active) $filtered_participants[$active_id] = $participant;
7772  break;
7773  case 2: // only inactive users
7774  if (!$participant->active) $filtered_participants[$active_id] = $participant;
7775  break;
7776  case 3: // all users
7777  $filtered_participants[$active_id] = $participant;
7778  break;
7779  case 4:
7780  // already scored participants
7781  //$found = 0;
7782  //while ($row = $ilDB->fetchAssoc($result))
7783  //{
7784  // if ($row["manual"]) $found++;
7785  //}
7786  //if ($found == $count)
7787  //{
7788  //$filtered_participants[$active_id] = $participant;
7789  //}
7790  //else
7791  //{
7792  $assessmentSetting = new ilSetting("assessment");
7793  $manscoring_done = $assessmentSetting->get("manscoring_done_" . $active_id);
7794  if ($manscoring_done) $filtered_participants[$active_id] = $participant;
7795  //}
7796  break;
7797  case 5:
7798  // unscored participants
7799  //$found = 0;
7800  //while ($row = $ilDB->fetchAssoc($result))
7801  //{
7802  // if ($row["manual"]) $found++;
7803  //}
7804  //if ($found == 0)
7805  //{
7806  $assessmentSetting = new ilSetting("assessment");
7807  $manscoring_done = $assessmentSetting->get("manscoring_done_" . $active_id);
7808  if (!$manscoring_done) $filtered_participants[$active_id] = $participant;
7809  //}
7810  break;
7811  case 6:
7812  // partially scored participants
7813  $found = 0;
7814  while ($row = $ilDB->fetchAssoc($result))
7815  {
7816  if ($row["manual"]) $found++;
7817  }
7818  if (($found > 0) && ($found < $count)) $filtered_participants[$active_id] = $participant;
7819  break;
7820  default:
7821  $filtered_participants[$active_id] = $participant;
7822  break;
7823  }
7824  }
7825  }
7826  return $filtered_participants;
7827  }
ILIAS Setting Class.
$result
& getTestParticipants()
Returns a list of all participants in a test.
global $ilDB
_getManualScoring()
Retrieve the manual scoring settings.
+ Here is the call graph for this function:

◆ getTestQuestions()

& ilObjTest::getTestQuestions ( )

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

References $ilDB, $query, $questions, $row, and getTestId().

8625  {
8626  global $ilDB;
8627 
8628  $query = "
8629  SELECT questions.*,
8630  questtypes.type_tag,
8631  tstquest.sequence,
8632  tstquest.obligatory,
8633  origquest.obj_fi orig_obj_fi
8634 
8635  FROM qpl_questions questions
8636 
8637  INNER JOIN qpl_qst_type questtypes
8638  ON questtypes.question_type_id = questions.question_type_fi
8639 
8640  INNER JOIN tst_test_question tstquest
8641  ON tstquest.question_fi = questions.question_id
8642 
8643  LEFT JOIN qpl_questions origquest
8644  ON origquest.question_id = questions.original_id
8645 
8646  WHERE tstquest.test_fi = %s
8647 
8648  ORDER BY tstquest.sequence
8649  ";
8650 
8651  $query_result = $ilDB->queryF(
8652  $query, array('integer'), array($this->getTestId())
8653  );
8654 
8655  $questions = array();
8656 
8657  while ($row = $ilDB->fetchAssoc($query_result))
8658  {
8659  $question = $row;
8660 
8661  $question['obligationPossible'] = self::isQuestionObligationPossible($row['question_id']);
8662 
8663  $questions[] = $question;
8664  }
8665 
8666  return $questions;
8667  }
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ Here is the call graph for this function:

◆ getTestResult()

& ilObjTest::getTestResult (   $active_id,
  $pass = NULL,
  $ordered_sequence = FALSE 
)

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 public

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

References $data, $ilDB, ilObject\$lng, $pass, $query, $result, $results, $row, assQuestion\_getSuggestedSolutionOutput(), getResultsForActiveId(), getScoreCutting(), isDynamicTest(), and ilUtil\prepareFormOutput().

Referenced by evalStatistical(), getPassed(), getTotalPointsPassedArray(), and ilTestSequence\hideCorrectAnsweredQuestions().

4222  {
4223  global $tree, $ilDB, $lng, $ilPluginAdmin;
4224 
4225  $results = $this->getResultsForActiveId($active_id);
4226 
4227  if( is_null($pass) )
4228  {
4229  $pass = $results['pass'];
4230  }
4231 
4232  require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
4233  $testSessionFactory = new ilTestSessionFactory($this);
4234  $testSession = $testSessionFactory->getSession($active_id);
4235 
4236  require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
4237  $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this);
4238  $testSequence = $testSequenceFactory->getSequenceByPass($testSession, $pass);
4239 
4240  if( $this->isDynamicTest() )
4241  {
4242  require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
4243  $dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this);
4244  $dynamicQuestionSetConfig->loadFromDb();
4245 
4246  $testSequence->loadFromDb($dynamicQuestionSetConfig);
4247  $testSequence->loadQuestions($dynamicQuestionSetConfig, new ilTestDynamicQuestionSetFilterSelection());
4248 
4249  $sequence = $testSequence->getUserSequenceQuestions();
4250  }
4251  else
4252  {
4253  $testSequence->loadFromDb();
4254  $testSequence->loadQuestions();
4255 
4256  if( $ordered_sequence )
4257  {
4258  $sequence = $testSequence->getOrderedSequenceQuestions();
4259  }
4260  else
4261  {
4262  $sequence = $testSequence->getUserSequenceQuestions();
4263  }
4264  }
4265 
4266  $arrResults = array();
4267 
4268  $query = "
4269  SELECT tst_test_result.question_fi,
4270  tst_test_result.points reached,
4271  tst_test_result.hint_count requested_hints,
4272  tst_test_result.hint_points hint_points,
4273  tst_test_result.answered answered
4274 
4275  FROM tst_test_result
4276 
4277  LEFT JOIN tst_solutions
4278  ON tst_solutions.active_fi = tst_test_result.active_fi
4279  AND tst_solutions.question_fi = tst_test_result.question_fi
4280 
4281  WHERE tst_test_result.active_fi = %s
4282  AND tst_test_result.pass = %s
4283  ";
4284 
4285  $solutionresult = $ilDB->queryF(
4286  $query, array('integer', 'integer'), array($active_id, $pass)
4287  );
4288 
4289  while( $row = $ilDB->fetchAssoc($solutionresult) )
4290  {
4291  $arrResults[ $row['question_fi'] ] = $row;
4292  }
4293 
4294  $numWorkedThrough = count($arrResults);
4295 
4296  require_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
4297 
4298  $IN_question_ids = $ilDB->in('qpl_questions.question_id', $sequence, false, 'integer');
4299 
4300  $query = "
4301  SELECT qpl_questions.*,
4302  qpl_qst_type.type_tag,
4303  qpl_sol_sug.question_fi has_sug_sol
4304 
4305  FROM qpl_qst_type,
4306  qpl_questions
4307 
4308  LEFT JOIN qpl_sol_sug
4309  ON qpl_sol_sug.question_fi = qpl_questions.question_id
4310 
4311  WHERE qpl_qst_type.question_type_id = qpl_questions.question_type_fi
4312  AND $IN_question_ids
4313  ";
4314 
4315  $result = $ilDB->query($query);
4316 
4317  $unordered = array();
4318 
4319  $key = 1;
4320 
4321  $obligationsAnswered = true;
4322 
4323  while( $row = $ilDB->fetchAssoc($result) )
4324  {
4325  $percentvalue = (
4326  $row['points'] ? $arrResults[ $row['question_id'] ]['reached'] / $row['points'] : 0
4327  );
4328 
4329  if( $percentvalue < 0 ) $percentvalue = 0.0;
4330 
4331  $data = array(
4332  "nr" => "$key",
4333  "title" => ilUtil::prepareFormOutput($row['title']),
4334  "max" => round($row['points'], 2),
4335  "reached" => round($arrResults[$row['question_id']]['reached'],2),
4336  'requested_hints' => $arrResults[$row['question_id']]['requested_hints'],
4337  'hint_points' => $arrResults[$row['question_id']]['hint_points'],
4338  "percent" => sprintf("%2.2f ", ($percentvalue) * 100) . "%",
4339  "solution" => ($row['has_sug_sol']) ? assQuestion::_getSuggestedSolutionOutput($row['question_id']) : '',
4340  "type" => $row["type_tag"],
4341  "qid" => $row['question_id'],
4342  "original_id" => $row["original_id"],
4343  "workedthrough" => isset($arrResults[$row['question_id']]) ? 1 : 0,
4344  'answered' => $arrResults[$row['question_id']]['answered']
4345  );
4346 
4347  if( !$arrResults[ $row['question_id'] ]['answered'] )
4348  {
4349  $obligationsAnswered = false;
4350  }
4351 
4352  $unordered[ $row['question_id'] ] = $data;
4353 
4354  $key++;
4355  }
4356 
4357  $pass_max = 0;
4358  $pass_reached = 0;
4359  $pass_requested_hints = 0;
4360  $pass_hint_points = 0;
4361  $key = 1;
4362 
4363  $found = array();
4364 
4365  foreach( $sequence as $qid )
4366  {
4367  // building pass point sums based on prepared data
4368  // for question that exists in users qst sequence
4369  $pass_max += round($unordered[$qid]['max'], 2);
4370  $pass_reached += round($unordered[$qid]['reached'], 2);
4371  $pass_requested_hints += $unordered[$qid]['requested_hints'];
4372  $pass_hint_points += $unordered[$qid]['hint_points'];
4373 
4374  // pickup prepared data for question
4375  // that exists in users qst sequence
4376  $unordered[$qid]['nr'] = $key;
4377  array_push($found, $unordered[$qid]);
4378 
4379  // increment key counter
4380  $key++;
4381  }
4382 
4383  $unordered = null;
4384 
4385  if( $this->getScoreCutting() == 1 )
4386  {
4387  if( $results['reached_points'] < 0 )
4388  {
4389  $results['reached_points'] = 0;
4390  }
4391 
4392  if( $pass_reached < 0 ) $pass_reached = 0;
4393  }
4394 
4395  $found['pass']['total_max_points'] = $pass_max;
4396  $found['pass']['total_reached_points'] = $pass_reached;
4397  $found['pass']['total_requested_hints'] = $pass_requested_hints;
4398  $found['pass']['total_hint_points'] = $pass_hint_points;
4399  $found['pass']['percent'] = ($pass_max > 0) ? $pass_reached / $pass_max : 0;
4400  $found['pass']['obligationsAnswered'] = $obligationsAnswered;
4401  $found['pass']['num_workedthrough'] = $numWorkedThrough;
4402 
4403  $found["test"]["total_max_points"] = $results['max_points'];
4404  $found["test"]["total_reached_points"] = $results['reached_points'];
4405  $found["test"]["total_requested_hints"] = $results['hint_count'];
4406  $found["test"]["total_hint_points"] = $results['hint_points'];
4407  $found["test"]["result_pass"] = $results['pass'];
4408  $found['test']['obligations_answered'] = $results['obligations_answered'];
4409 
4410  if( (!$total_reached_points) or (!$total_max_points) )
4411  {
4412  $percentage = 0.0;
4413  }
4414  else
4415  {
4416  $percentage = ($total_reached_points / $total_max_points) * 100.0;
4417 
4418  if( $percentage < 0 ) $percentage = 0.0;
4419  }
4420 
4421  $found["test"]["passed"] = $results['passed'];
4422 
4423  return $found;
4424  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
isDynamicTest()
Returns the fact wether this test is a dynamic question set test or not.
$result
$results
static _getSuggestedSolutionOutput($question_id)
Returns the output of the suggested solution.
getResultsForActiveId($active_id)
getScoreCutting()
Determines if the score of a question should be cut at 0 points or the score of the whole test...
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTestStyleLocation()

ilObjTest::getTestStyleLocation (   $mode = "output")

get full style sheet file name (path inclusive) of current user

Parameters
$modestring Output mode of the style sheet ("output" or "filesystem"). !"filesystem" generates the ILIAS version number as attribute to force the reload of the style sheet in a different ILIAS version public

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

References getCustomStyle(), and ilUtil\getStyleSheetLocation().

Referenced by deliverPDFfromHTML().

2216  {
2217  if (strlen($this->getCustomStyle()))
2218  {
2219  $default = ilUtil::getStyleSheetLocation("filesystem", "ta.css", "Modules/Test");
2220  $custom = str_replace("ta.css", "customstyles/" . $this->getCustomStyle(), $default);
2221  if (file_exists($custom))
2222  {
2223  $custom = ilUtil::getStyleSheetLocation($mode, "ta.css", "Modules/Test");
2224  $custom = str_replace("ta.css", "customstyles/" . $this->getCustomStyle(), $custom);
2225  return $custom;
2226  }
2227  else
2228  {
2229  return ilUtil::getStyleSheetLocation($mode, "ta.css", "Modules/Test");
2230  }
2231  }
2232  else
2233  {
2234  return ilUtil::getStyleSheetLocation($mode, "ta.css", "Modules/Test");
2235  }
2236  }
getCustomStyle()
Get the custom style.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
+ 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 public

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

References $ilDB, $pass, $res, $result, $row, and assQuestion\_getSolutionMaxPass().

7572  {
7573  global $ilDB;
7574 
7575  $res = "";
7576  if (($active_id) && ($question_id))
7577  {
7578  if (is_null($pass))
7579  {
7580  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
7581  $pass = assQuestion::_getSolutionMaxPass($question_id, $active_id);
7582  }
7583  $result = $ilDB->queryF("SELECT value1 FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
7584  array('integer', 'integer', 'integer'),
7585  array($active_id, $question_id, $pass)
7586  );
7587  if ($result->numRows() == 1)
7588  {
7589  $row = $ilDB->fetchAssoc($result);
7590  $res = $row["value1"];
7591  }
7592  }
7593  return $res;
7594  }
$result
_getSolutionMaxPass($question_id, $active_id)
Returns the maximum pass a users question solution.
global $ilDB
+ Here is the call graph for this function:

◆ getTimeExtensionsOfParticipants()

ilObjTest::getTimeExtensionsOfParticipants ( )

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

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

11724  {
11725  global $ilDB;
11726 
11727  $times = array();
11728  $result = $ilDB->queryF("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",
11729  array('integer'),
11730  array($this->getTestId())
11731  );
11732  while ($row = $ilDB->fetchAssoc($result))
11733  {
11734  $times[$row['active_fi']] = $row['additionaltime'];
11735  }
11736  return $times;
11737  }
$result
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ 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 public
See also
$title_output

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

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

2899  {
2900  return ($this->title_output) ? $this->title_output : 0;
2901  }
+ 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 public

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

References $total, evalTotalParticipantsArray(), and getTestResult().

Referenced by getAllTestResults(), and getQuestionsOfPass().

4734  {
4735  $totalpoints_array = array();
4736  $all_users =& $this->evalTotalParticipantsArray();
4737  foreach ($all_users as $active_id => $user_name)
4738  {
4739  $test_result =& $this->getTestResult($active_id);
4740  $reached = $test_result["test"]["total_reached_points"];
4741  $total = $test_result["test"]["total_max_points"];
4742  $percentage = $total != 0 ? $reached/$total : 0;
4743  $mark = $this->mark_schema->getMatchingMark($percentage*100.0);
4744 
4745  $obligationsAnswered = $test_result["test"]["obligations_answered"];
4746 
4747  if ($mark)
4748  {
4749  if( $mark->getPassed() && $obligationsAnswered )
4750  {
4751  array_push($totalpoints_array, $test_result["test"]["total_reached_points"]);
4752  }
4753  }
4754  }
4755  return $totalpoints_array;
4756  }
& evalTotalParticipantsArray($name_sort_order="asc")
Returns all participants who started the test.
& getTestResult($active_id, $pass=NULL, $ordered_sequence=FALSE)
Calculates the results of a test for a given user and returns an array with all test results...
+ 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 public
See also
$use_previous_answers

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

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

2887  {
2888  return ($this->use_previous_answers) ? $this->use_previous_answers : 0;
2889  }
+ 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 public

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

References $ilDB, $result, $row, and getAnonymity().

7837  {
7838  global $ilDB;
7839 
7840  if (!is_array($ids) || count($ids) ==0) return array();
7841 
7842  if ($this->getAnonymity())
7843  {
7844  $result = $ilDB->queryF("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",
7845  array('text', 'text', 'text'),
7846  array("", $this->lng->txt("anonymous"), "")
7847  );
7848  }
7849  else
7850  {
7851  $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");
7852  }
7853 
7854  $result_array = array();
7855  while ($row = $ilDB->fetchAssoc($result))
7856  {
7857  $result_array[$row["usr_id"]]= $row;
7858  }
7859  return $result_array;
7860  }
$result
getAnonymity()
Returns the anonymity status of the test.
global $ilDB
+ 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 public

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

References _getVisitTimeOfParticipant(), and getTestId().

Referenced by getQuestionsOfPass().

4573  {
4574  return ilObjTest::_getVisitTimeOfParticipant($this->getTestId(), $active_id);
4575  }
getTestId()
Gets the database id of the additional test data.
_getVisitTimeOfParticipant($test_id, $active_id)
Returns the first and last visit of a participant.
+ Here is the call graph for this function:
+ Here is the caller 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 public

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

References $ilDB, $ilUser, $pass, $result, and $row.

4033  {
4034  global $ilUser;
4035  global $ilDB;
4036 
4037  if (is_null($pass))
4038  {
4039  $result = $ilDB->queryF("SELECT question_fi FROM tst_solutions WHERE active_fi = %s AND pass = %s GROUP BY question_fi",
4040  array('integer','integer'),
4041  array($active_id, 0)
4042  );
4043  }
4044  else
4045  {
4046  $result = $ilDB->queryF("SELECT question_fi FROM tst_solutions WHERE active_fi = %s AND pass = %s GROUP BY question_fi",
4047  array('integer','integer'),
4048  array($active_id, $pass)
4049  );
4050  }
4051  $result_array = array();
4052  while ($row = $ilDB->fetchAssoc($result))
4053  {
4054  array_push($result_array, $row["question_fi"]);
4055  }
4056  return $result_array;
4057  }
$result
global $ilUser
Definition: imgupload.php:15
global $ilDB

◆ getXMLZip()

ilObjTest::getXMLZip ( )

Get zipped xml file for test.

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

10640  {
10641  include_once("./Modules/Test/classes/class.ilTestExport.php");
10642  $test_exp = new ilTestExport($this, "xml");
10643  return $test_exp->buildExportFile();
10644  }
Export class for tests.

◆ hasNrOfTriesRestriction()

ilObjTest::hasNrOfTriesRestriction ( )

returns if the numbers of tries have to be checked

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

References getNrOfTries().

Referenced by isExecutable().

8055  {
8056  return $this->getNrOfTries() != 0;
8057  }
getNrOfTries()
Returns the nr of tries for the test.
+ 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

ilDB $ilDB

Parameters
integer$test_id
Returns
boolean $hasObligations

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

References $ilDB, and $row.

11586  {
11587  global $ilDB;
11588 
11589  $rset = $ilDB->queryF(
11590  'SELECT count(*) cnt FROM tst_test_question WHERE test_fi = %s AND obligatory = 1',
11591  array('integer'), array($test_id)
11592  );
11593 
11594  $row = $ilDB->fetchAssoc($rset);
11595 
11596  return (bool)$row['cnt'] > 0;
11597  }
global $ilDB

◆ hasQuestionsWithoutQuestionpool()

ilObjTest::hasQuestionsWithoutQuestionpool ( )

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

References $ilDB, $query, $row, and getQuestionTitlesAndIndexes().

11060  {
11061  global $ilDB;
11062 
11064 
11065  $IN_questions = $ilDB->in('q1.question_id', array_keys($questions), false, 'integer');
11066 
11067  $query = "
11068  SELECT count(q1.question_id) cnt
11069 
11070  FROM qpl_questions q1
11071 
11072  INNER JOIN qpl_questions q2
11073  ON q2.question_id = q1.original_id
11074 
11075  WHERE $IN_questions
11076  AND q1.obj_fi = q2.obj_fi
11077  ";
11078 
11079  $rset = $ilDB->query($query);
11080 
11081  $row = $ilDB->fetchAssoc($rset);
11082 
11083  return $row['cnt'] > 0;
11084  }
& getQuestionTitlesAndIndexes()
Returns the titles of the test questions in question sequence.
global $ilDB
+ 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.

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 1874 of file class.ilObjTest.php.

References $ilDB, $pass, and $result.

1875  {
1876  global $ilDB;
1877  $result = $ilDB->queryF("SELECT test_random_question_id FROM tst_test_rnd_qst WHERE active_fi = %s AND pass = %s",
1878  array('integer','integer'),
1879  array($active_id, $pass)
1880  );
1881  return ($result->numRows() > 0) ? true : false;
1882  }
$result
global $ilDB

◆ hasSingleChoiceQuestions()

ilObjTest::hasSingleChoiceQuestions ( )

Returns TRUE if the test contains single choice results.

Returns
boolean public

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

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

Referenced by isSingleChoiceTestWithoutShuffle().

1055  {
1056  global $ilDB;
1057 
1058  $result = $ilDB->queryF("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",
1059  array('integer'),
1060  array($this->getTestId())
1061  );
1062  $hasSC = false;
1063  while ($row = $ilDB->fetchAssoc($result))
1064  {
1065  if (strcmp($row['foundtypes'], 'assSingleChoice') == 0)
1066  {
1067  $hasSC = true;
1068  }
1069  }
1070  return $hasSC;
1071  }
$result
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ 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 3786 of file class.ilObjTest.php.

References $data, $ilDB, $result, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), duplicateQuestionForTest(), getTestId(), loadQuestions(), logAction(), and saveCompleteStatus().

3787  {
3788  global $ilDB;
3789 #var_dump($question_id);
3790  if ($linkOnly)
3791  {
3792  $duplicate_id = $question_id;
3793  }
3794  else
3795  {
3796  $duplicate_id = $this->duplicateQuestionForTest($question_id);
3797  }
3798 
3799  // get maximum sequence index in test
3800  $result = $ilDB->queryF("SELECT MAX(sequence) seq FROM tst_test_question WHERE test_fi=%s",
3801  array('integer'),
3802  array($this->getTestId())
3803  );
3804  $sequence = 1;
3805 
3806  if ($result->numRows() == 1)
3807  {
3808  $data = $ilDB->fetchObject($result);
3809  $sequence = $data->seq + 1;
3810  }
3811 
3812  $next_id = $ilDB->nextId('tst_test_question');
3813  $affectedRows = $ilDB->manipulateF("INSERT INTO tst_test_question (test_question_id, test_fi, question_fi, sequence, tstamp) VALUES (%s, %s, %s, %s, %s)",
3814  array('integer', 'integer','integer','integer','integer'),
3815  array($next_id, $this->getTestId(), $duplicate_id, $sequence, time())
3816  );
3817  if ($affectedRows == 1)
3818  {
3819  include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3821  {
3822  $this->logAction($this->lng->txtlng("assessment", "log_question_added", ilObjAssessmentFolder::_getLogLanguage()) . ": " . $sequence, $duplicate_id);
3823  }
3824  }
3825  // remove test_active entries, because test has changed
3826  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_active WHERE test_fi = %s",
3827  array('integer'),
3828  array($this->getTestId())
3829  );
3830  $this->loadQuestions();
3831  $this->saveCompleteStatus($testQuestionSetConfig);
3832  return $duplicate_id;
3833  }
logAction($logtext="", $question_id="")
Logs an action into the Test&Assessment log.
$result
saveCompleteStatus(ilTestQuestionSetConfig $testQuestionSetConfig)
Checks if the test is complete and saves the status in the database.
getTestId()
Gets the database id of the additional test data.
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
loadQuestions($active_id="", $pass=NULL)
Load the test question id&#39;s from the database.
_getLogLanguage()
retrieve the log language for assessment logging
duplicateQuestionForTest($question_id)
Takes a question and creates a copy of the question for use in the test.
global $ilDB
+ 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 public

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

References ilObjUser\_lookupClientIP(), and inviteUser().

7893  {
7894  include_once "./Modules/Group/classes/class.ilObjGroup.php";
7895  $group = new ilObjGroup($group_id);
7896  $members = $group->getGroupMemberIds();
7897  include_once './Services/User/classes/class.ilObjUser.php';
7898  foreach ($members as $user_id)
7899  {
7900  $this->inviteUser($user_id, ilObjUser::_lookupClientIP($user_id));
7901  }
7902  }
inviteUser($user_id, $client_ip="")
Invites a user to a test.
Class ilObjGroup.
_lookupClientIP($a_user_id)
Lookup client ip.
+ 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 public

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

References ilObjUser\_lookupClientIP(), and inviteUser().

7911  {
7912  global $rbacreview;
7913  $members = $rbacreview->assignedUsers($role_id,"usr_id");
7914  include_once './Services/User/classes/class.ilObjUser.php';
7915  foreach ($members as $user_id)
7916  {
7917  $this->inviteUser($user_id, ilObjUser::_lookupClientIP($user_id));
7918  }
7919  }
inviteUser($user_id, $client_ip="")
Invites a user to a test.
_lookupClientIP($a_user_id)
Lookup client ip.
+ 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 public

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

References $ilDB, and getTestId().

Referenced by inviteGroup(), and inviteRole().

7946  {
7947  global $ilDB;
7948 
7949  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_invited_user WHERE test_fi = %s AND user_fi = %s",
7950  array('integer', 'integer'),
7951  array($this->getTestId(), $user_id)
7952  );
7953  $affectedRows = $ilDB->manipulateF("INSERT INTO tst_invited_user (test_fi, user_fi, clientip, tstamp) VALUES (%s, %s, %s, %s)",
7954  array('integer', 'integer', 'text', 'integer'),
7955  array($this->getTestId(), $user_id, (strlen($client_ip)) ? $client_ip : NULL, time())
7956  );
7957  }
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActivationLimited()

ilObjTest::isActivationLimited ( )

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

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

11167  {
11168  return (bool)$this->activation_limited;
11169  }
+ 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 8036 of file class.ilObjTest.php.

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

8037  {
8038  global $ilUser;
8039  global $ilDB;
8040 
8041  if (!is_numeric($user_id))
8042  $user_id = $ilUser->getId();
8043 
8044  $result = $ilDB->queryF("SELECT submitted FROM tst_active WHERE test_fi=%s AND user_fi=%s AND submitted=%s",
8045  array('integer', 'integer', 'integer'),
8046  array($this->getTestId(), $user_id, 1)
8047  );
8048  return $result->numRows() == 1;
8049  }
$result
getTestId()
Gets the database id of the additional test data.
global $ilUser
Definition: imgupload.php:15
global $ilDB
+ Here is the call graph for this function:

◆ isBestSolutionPrintedWithResult()

ilObjTest::isBestSolutionPrintedWithResult ( )

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

References $print_best_solution_with_result.

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

11132  {
11134  }
$print_best_solution_with_result
+ 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 1145 of file class.ilObjTest.php.

References ilTestQuestionSetConfig\isQuestionSetConfigured().

Referenced by saveCompleteStatus(), and saveToDb().

1146  {
1147  if( !count($this->mark_schema->mark_steps) )
1148  {
1149  return false;
1150  }
1151 
1152  if( !$testQuestionSetConfig->isQuestionSetConfigured() )
1153  {
1154  return false;
1155  }
1156 
1157  return true;
1158  }
+ 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 12041 of file class.ilObjTest.php.

References getQuestionSetType().

Referenced by getAnsweredQuestionCount(), getQuestionsOfPass(), getTestResult(), and removeTestResultsByActiveIds().

12042  {
12043  return $this->getQuestionSetType() == self::QUESTION_SET_TYPE_DYNAMIC;
12044  }
getQuestionSetType()
getter for question set type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isEndingTimeEnabled()

ilObjTest::isEndingTimeEnabled ( )
Returns
boolean

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

References $ending_time_enabled.

Referenced by _getAvailableTests(), addDefaults(), endingTimeReached(), and saveToDb().

3130  {
3132  }
+ 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 public

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

References $GLOBALS, $result, $starting_time, _getPass(), endingTimeReached(), ilDatePresentation\formatDate(), getActiveIdOfUser(), getEnableProcessingTime(), getEndingTime(), getNrOfTries(), getResetProcessingTime(), getStartingTime(), getStartingTimeOfUser(), hasNrOfTriesRestriction(), IL_CAL_TIMESTAMP, isMaxProcessingTimeReached(), and startingTimeReached().

8436  {
8437  $result = array(
8438  "executable" => true,
8439  "errormessage" => ""
8440  );
8441  if (!$this->startingTimeReached())
8442  {
8443  $result["executable"] = false;
8444  $result["errormessage"] = sprintf($this->lng->txt("detail_starting_time_not_reached"), ilDatePresentation::formatDate(new ilDateTime($this->getStartingTime(), IL_CAL_TIMESTAMP)));
8445  return $result;
8446  }
8447  if ($this->endingTimeReached())
8448  {
8449  $result["executable"] = false;
8450  $result["errormessage"] = sprintf($this->lng->txt("detail_ending_time_reached"), ilDatePresentation::formatDate(new ilDateTime($this->getEndingTime(), IL_CAL_TIMESTAMP)));
8451  return $result;
8452  }
8453 
8454  $active_id = $this->getActiveIdOfUser($user_id);
8455 
8456  if ($this->getEnableProcessingTime())
8457  {
8458  if ($active_id > 0)
8459  {
8460  $starting_time = $this->getStartingTimeOfUser($active_id);
8461  if ($starting_time !== FALSE)
8462  {
8463  if ($this->isMaxProcessingTimeReached($starting_time, $active_id))
8464  {
8465  if ($allowPassIncrease && $this->getResetProcessingTime() && (($this->getNrOfTries() == 0) || ($this->getNrOfTries() > ($this->_getPass($active_id)+1))))
8466  {
8467  // a test pass was quitted because the maximum processing time was reached, but the time
8468  // will be resetted for future passes, so if there are more passes allowed, the participant may
8469  // start the test again.
8470  // This code block is only called when $allowPassIncrease is TRUE which only happens when
8471  // the test info page is opened. Otherwise this will lead to unexpected results!
8472  $testSession->increasePass();
8473  $testSession->setLastSequence(0);
8474  $testSession->saveToDb();
8475  }
8476  else
8477  {
8478  $result["executable"] = false;
8479  $result["errormessage"] = $this->lng->txt("detail_max_processing_time_reached");
8480  }
8481  return $result;
8482  }
8483  }
8484  }
8485  }
8486 
8487  if ($this->hasNrOfTriesRestriction() && ($active_id > 0))
8488  {
8489  require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
8490  $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this);
8491  $testPassesSelector->setActiveId($active_id);
8492  $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
8493 
8494  $closedPasses = $testPassesSelector->getClosedPasses();
8495 
8496  if( count($closedPasses) >= $this->getNrOfTries() )
8497  {
8498  $result["executable"] = false;
8499  $result["errormessage"] = $this->lng->txt("maximum_nr_of_tries_reached");
8500  return $result;
8501  }
8502  }
8503 
8504  return $result;
8505  }
$result
getEnableProcessingTime()
Returns the state of the processing time (enabled/disabled)
_getPass($active_id)
Retrieves the actual pass of a given user for a given test.
startingTimeReached()
Returns true if the starting time of a test is reached A starting time is not available for self asse...
getActiveIdOfUser($user_id="", $anonymous_id="")
Gets the active id of a given user.
isMaxProcessingTimeReached($starting_time, $active_id)
Returns whether the maximum processing time for a test is reached or not.
getResetProcessingTime()
Returns wheather the processing time should be reset or not.
$GLOBALS['ct_recipient']
getStartingTimeOfUser($active_id, $pass=null)
Returns the unix timestamp of the time a user started a test.
hasNrOfTriesRestriction()
returns if the numbers of tries have to be checked
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
getStartingTime()
Returns the starting time of the test.
getNrOfTries()
Returns the nr of tries for the test.
getEndingTime()
Returns the ending time of the test.
endingTimeReached()
Returns true if the ending time of a test is reached An ending time is not available for self assessm...
const IL_CAL_TIMESTAMP
+ 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 12021 of file class.ilObjTest.php.

References getQuestionSetType().

12022  {
12023  return $this->getQuestionSetType() == self::QUESTION_SET_TYPE_FIXED;
12024  }
getQuestionSetType()
getter for question set type
+ Here is the call 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 11232 of file class.ilObjTest.php.

References getAnonymity(), and getHighscoreAnon().

11233  {
11234  if ($this->getAnonymity() == 1)
11235  {
11236  return true;
11237  }
11238  else
11239  {
11240  return (bool)$this->getHighscoreAnon();
11241  }
11242  }
getAnonymity()
Returns the anonymity status of the test.
getHighscoreAnon()
Gets if the highscores should be anonymized per setting.
+ 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 public

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

Referenced by addQTIMaterial().

9388  {
9389  if (preg_match("/<[^>]*?>/", $a_text))
9390  {
9391  return TRUE;
9392  }
9393  else
9394  {
9395  return FALSE;
9396  }
9397  }
+ Here is the caller graph for this function:

◆ isInstantFeedbackAnswerFixationEnabled()

ilObjTest::isInstantFeedbackAnswerFixationEnabled ( )

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

References $instantFeedbackAnswerFixationEnabled.

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

12220  {
12222  }
$instantFeedbackAnswerFixationEnabled
+ Here is the caller graph for this function:

◆ isIntroductionEnabled()

ilObjTest::isIntroductionEnabled ( )
Returns
boolean

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

References $introductionEnabled.

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

2081  {
2083  }
+ Here is the caller graph for this function:

◆ isLimitUsersEnabled()

ilObjTest::isLimitUsersEnabled ( )
Returns
boolean

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

References $limitUsersEnabled.

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

9292  {
9293  return $this->limitUsersEnabled;
9294  }
+ 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 public

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

References $starting_time, getEnableProcessingTime(), and getProcessingTimeInSeconds().

Referenced by canShowTestResults(), and isExecutable().

8604  {
8605  if ($this->getEnableProcessingTime())
8606  {
8607  $processing_time = $this->getProcessingTimeInSeconds($active_id);
8608  $now = mktime();
8609  if ($now > ($starting_time + $processing_time))
8610  {
8611  return TRUE;
8612  }
8613  else
8614  {
8615  return FALSE;
8616  }
8617  }
8618  else
8619  {
8620  return FALSE;
8621  }
8622  }
getEnableProcessingTime()
Returns the state of the processing time (enabled/disabled)
getProcessingTimeInSeconds($active_id="")
Returns the processing time for the test in seconds.
+ 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 1731 of file class.ilObjTest.php.

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

1732  {
1733  global $ilDB;
1734  $result = $ilDB->queryF('SELECT copy_id FROM tst_rnd_cpy WHERE tst_fi = %s',
1735  array('integer'),
1736  array($this->getTestId())
1737  );
1738  return $result->numRows() > 0;
1739  }
$result
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ 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 8065 of file class.ilObjTest.php.

References getNrOfTries().

8066  {
8067  return $tries >= (int) $this->getNrOfTries();
8068  }
getNrOfTries()
Returns the nr of tries for the test.
+ 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 11141 of file class.ilObjTest.php.

References $offeringQuestionHintsEnabled.

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

11142  {
11144  }
+ Here is the caller graph for this function:

◆ isOnline()

ilObjTest::isOnline ( )

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

References $online.

Referenced by _getAvailableTests(), and saveToDb().

11117  {
11118  return $this->online;
11119  }
$online
the object&#39;s online status
+ Here is the caller graph for this function:

◆ isParticipantsLastPassActive()

static ilObjTest::isParticipantsLastPassActive (   $testObjId,
  $userId 
)
static

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

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

Referenced by ilObjCourseGUI\handleActivePass(), ilLOUtils\hasActiveRun(), ilObjCourseGUI\redirectLocToTestObject(), and ilContainerObjectiveGUI\updateResult().

12258  {
12259  global $ilDB, $lng, $ilPluginAdmin;
12260 
12261  /* @var ilObjTest $testOBJ */
12262 
12263  $testOBJ = ilObjectFactory::getInstanceByRefId($testObjId,false);
12264 
12265 
12266  $activeId = $testOBJ->getActiveIdOfUser($userId);
12267 
12268  require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
12269  $testSessionFactory = new ilTestSessionFactory($testOBJ);
12270  // Added temporarily bugfix smeyer
12271  $testSessionFactory->reset();
12272 
12273  require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
12274  $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $testOBJ);
12275 
12276  $testSession = $testSessionFactory->getSession($activeId);
12277  $testSequence = $testSequenceFactory->getSequenceByPass($testSession, $testSession->getPass());
12278  $testSequence->loadFromDb();
12279 
12280  return $testSequence->hasSequence();
12281  }
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
global $ilDB
+ 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 11624 of file class.ilObjTest.php.

References $passDeletionAllowed.

Referenced by addDefaults(), and saveToDb().

11625  {
11627  }
+ Here is the caller graph for this function:

◆ isPasswordEnabled()

ilObjTest::isPasswordEnabled ( )
Returns
boolean

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

References $passwordEnabled.

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

3305  {
3306  return $this->passwordEnabled;
3307  }
+ 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 public

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

References IL_COMP_MODULE.

Referenced by getAvailableQuestions().

10433  {
10434  global $ilPluginAdmin;
10435  if ($ilPluginAdmin->isActive(IL_COMP_MODULE, "TestQuestionPool", "qst", $a_pname))
10436  {
10437  return TRUE;
10438  }
10439  else
10440  {
10441  return FALSE;
10442  }
10443  }
const IL_COMP_MODULE
+ Here is the caller graph for this function:

◆ isPostponingEnabled()

ilObjTest::isPostponingEnabled ( )
Returns
bool $postponingEnabled

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

References getSequenceSettings().

2381  {
2382  return (bool)$this->getSequenceSettings();
2383  }
getSequenceSettings()
SEQUENCE SETTING = POSTPONING ENABLED !!
+ 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 11512 of file class.ilObjTest.php.

References assQuestion\_getQuestionType(), and assQuestion\_includeClass().

Referenced by ilObjTestGUI\saveOrderAndObligationsObject().

11513  {
11514  require_once('Modules/TestQuestionPool/classes/class.assQuestion.php');
11515 
11516  $classConcreteQuestion = assQuestion::_getQuestionType($questionId);
11517 
11518  assQuestion::_includeClass($classConcreteQuestion, 0);
11519 
11520  // static binder is not at work yet (in PHP < 5.3)
11521  //$obligationPossible = $classConcreteQuestion::isObligationPossible();
11522  $obligationPossible = call_user_func(array($classConcreteQuestion, 'isObligationPossible'), $questionId);
11523 
11524  return $obligationPossible;
11525  }
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.
+ 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 11533 of file class.ilObjTest.php.

References $ilDB, and $row.

Referenced by assQuestion\calculateResultsFromSolution(), ilTestSequence\getSequenceSummary(), assQuestionGUI\outQuestionPage(), ilTestOutputGUI\outWorkingForm(), and ilTestPlayerDynamicQuestionSetGUI\outWorkingForm().

11534  {
11535  global $ilDB;
11536 
11537  $rset = $ilDB->queryF('SELECT obligatory FROM tst_test_question WHERE question_fi = %s', array('integer'), array($question_id));
11538 
11539  if( $row = $ilDB->fetchAssoc($rset) )
11540  {
11541  return (bool) $row['obligatory'];
11542  }
11543 
11544  return false;
11545  }
global $ilDB
+ 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 12031 of file class.ilObjTest.php.

References getQuestionSetType().

Referenced by createRandomSolutions(), createTestSequence(), getAllQuestions(), getAnsweredQuestionCount(), getExistingQuestions(), getQuestionCount(), getQuestionsOfPass(), getQuestionsOfTest(), loadQuestions(), removeAllTestEditings(), removeTestResultsByActiveIds(), and removeTestResultsForUser().

12032  {
12033  return $this->getQuestionSetType() == self::QUESTION_SET_TYPE_RANDOM;
12034  }
getQuestionSetType()
getter for question set type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isScoreReportingAvailable()

ilObjTest::isScoreReportingAvailable ( )

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

References getReportingDate(), and getScoreReporting().

12086  {
12087  if ($this->getScoreReporting() == 4)
12088  {
12089  return false;
12090  }
12091 
12092  if ($this->getScoreReporting() == 3 && $this->getReportingDate() > time())
12093  {
12094  return false;
12095  }
12096 
12097  return true;
12098  }
getScoreReporting()
Gets the score reporting of the ilObjTest object.
getReportingDate()
Gets the reporting date of the ilObjTest object.
+ Here is the call graph for this function:

◆ isScoreReportingEnabled()

ilObjTest::isScoreReportingEnabled ( )

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

References getScoreReporting().

2519  {
2520  return $this->getScoreReporting() > 0 && $this->getScoreReporting() < 4;
2521  }
getScoreReporting()
Gets the score reporting of the ilObjTest object.
+ Here is the call graph for this function:

◆ isShowExamIdInTestPassEnabled()

ilObjTest::isShowExamIdInTestPassEnabled ( )

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

References $show_exam_id_in_test_pass_enabled.

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

11902  {
11904  }
$show_exam_id_in_test_pass_enabled
+ Here is the caller graph for this function:

◆ isShowExamIdInTestResultsEnabled()

ilObjTest::isShowExamIdInTestResultsEnabled ( )
Returns
boolean

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

References $show_exam_id_in_test_results_enabled.

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

11918  {
11920  }
$show_exam_id_in_test_results_enabled
+ Here is the caller graph for this function:

◆ isShowGradingMarkEnabled()

ilObjTest::isShowGradingMarkEnabled ( )

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

References $showGradingMarkEnabled.

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

12210  {
12212  }
+ Here is the caller graph for this function:

◆ isShowGradingStatusEnabled()

ilObjTest::isShowGradingStatusEnabled ( )

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

References $showGradingStatusEnabled.

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

12199  {
12201  }
+ Here is the caller graph for this function:

◆ isSingleChoiceTest()

ilObjTest::isSingleChoiceTest ( )

Returns TRUE if the test contains single choice results only.

Returns
boolean public

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

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

1080  {
1081  global $ilDB;
1082 
1083  $result = $ilDB->queryF("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",
1084  array('integer'),
1085  array($this->getTestId())
1086  );
1087  if ($result->numRows() == 1)
1088  {
1089  $row = $ilDB->fetchAssoc($result);
1090  if (strcmp($row['foundtypes'], 'assSingleChoice') == 0)
1091  {
1092  return TRUE;
1093  }
1094  else
1095  {
1096  return false;
1097  }
1098  }
1099  return FALSE;
1100  }
$result
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ 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 public

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

References $ilDB, $result, $row, getTestId(), and hasSingleChoiceQuestions().

1109  {
1110  global $ilDB;
1111 
1112  if (!$this->hasSingleChoiceQuestions()) return false;
1113 
1114  $result = $ilDB->queryF("
1115  SELECT DISTINCT(qpl_qst_sc.shuffle) foundshuffles
1116  FROM qpl_questions,
1117  qpl_qst_sc,
1118  tst_test_result,
1119  qpl_qst_type,
1120  tst_active
1121  WHERE tst_test_result.question_fi = qpl_questions.question_id
1122  AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id
1123  AND tst_test_result.active_fi = tst_active.active_id
1124  AND qpl_questions.question_id = qpl_qst_sc.question_fi
1125  AND tst_active.test_fi = %s
1126  AND qpl_qst_type.type_tag = %s
1127  ",
1128  array('integer', 'text'),
1129  array($this->getTestId(), 'assSingleChoice')
1130  );
1131  if ($result->numRows() == 1)
1132  {
1133  $row = $ilDB->fetchAssoc($result);
1134  return ($row['foundshuffles'] == 0);
1135  }
1136  return FALSE;
1137  }
$result
getTestId()
Gets the database id of the additional test data.
hasSingleChoiceQuestions()
Returns TRUE if the test contains single choice results.
global $ilDB
+ Here is the call graph for this function:

◆ isSkillManagementGloballyActivated()

static ilObjTest::isSkillManagementGloballyActivated ( )
static

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

Referenced by ilObjTestSettingsGeneralGUI\buildForm(), ilObjTestGUI\getTabs(), ilTestSkillAdministrationGUI\isAccessDenied(), ilObjTestSettingsGeneralGUI\isSkillServiceSettingToBeAdjusted(), and ilObjTestSettingsGeneralGUI\performSaveForm().

12181  {
12182  if( self::$isSkillManagementGloballyActivated === null )
12183  {
12184  include_once 'Services/Skill/classes/class.ilSkillManagementSettings.php';
12185  $skmgSet = new ilSkillManagementSettings();
12186 
12187  self::$isSkillManagementGloballyActivated = $skmgSet->isActivated();
12188  }
12189 
12190  return self::$isSkillManagementGloballyActivated;
12191  }
+ Here is the caller graph for this function:

◆ isSkillServiceEnabled()

ilObjTest::isSkillServiceEnabled ( )

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

References $skillServiceEnabled.

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

12149  {
12151  }
+ Here is the caller graph for this function:

◆ isSkillServiceToBeConsidered()

ilObjTest::isSkillServiceToBeConsidered ( )

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

References isSkillServiceEnabled().

12164  {
12165  if( !$this->isSkillServiceEnabled() )
12166  {
12167  return false;
12168  }
12169 
12170  if( !self::isSkillManagementGloballyActivated() )
12171  {
12172  return false;
12173  }
12174 
12175  return true;
12176  }
+ Here is the call graph for this function:

◆ isStartingTimeEnabled()

ilObjTest::isStartingTimeEnabled ( )
Returns
boolean

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

References $starting_time_enabled.

Referenced by _getAvailableTests(), addDefaults(), saveToDb(), and startingTimeReached().

3090  {
3092  }
+ Here is the caller graph for this function:

◆ isTestFinalBroken()

ilObjTest::isTestFinalBroken ( )
Returns
boolean

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

References $testFinalBroken.

Referenced by saveToDb().

12287  {
12288  return $this->testFinalBroken;
12289  }
+ 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 8022 of file class.ilObjTest.php.

References $ilDB, and $result.

Referenced by isTestFinishedToViewResults().

8023  {
8024  global $ilDB;
8025 
8026  $result = $ilDB->queryF("SELECT submitted FROM tst_active WHERE active_id=%s AND submitted=%s",
8027  array('integer', 'integer'),
8028  array($active_id, 1)
8029  );
8030  return $result->numRows() == 1;
8031  }
$result
global $ilDB
+ 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 public

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

References getPassFinishDate(), and isTestFinished().

Referenced by canShowTestResults().

4068  {
4069  $num = $this->getPassFinishDate($active_id, $currentpass);
4070  return ((($currentpass > 0) && ($num == 0)) || $this->isTestFinished($active_id)) ? true : false;
4071  }
isTestFinished($active_id)
returns if the active for user_id has been submitted
getPassFinishDate($active_id, $pass)
Retrieves the number of answered questions for a given user in a given test.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadFromDb()

ilObjTest::loadFromDb ( )

Loads a ilObjTest object from a database.

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

References $data, $ilDB, $result, ilRTE\_replaceMediaObjectImageSrc(), getAuthor(), ilObject\getId(), ilObjectActivation\getItem(), getTestId(), loadQuestions(), saveAuthorToMetadata(), setActivationEndingTime(), setActivationLimited(), setActivationStartingTime(), setActivationVisibility(), setAllowedUsers(), setAllowedUsersTimeGap(), setAnonymity(), setAnswerFeedback(), setAnswerFeedbackPoints(), setAuthor(), setAutosave(), setAutosaveIval(), setCertificateVisibility(), setCharSelectorAvailability(), setCharSelectorDefinition(), setCountSystem(), setCustomStyle(), setECTSFX(), setECTSGrades(), setECTSOutput(), setEnableArchiving(), setEnabledViewMode(), setEnableExamview(), setEnableProcessingTime(), setEndingTime(), setEndingTimeEnabled(), setExportSettings(), setFinalStatement(), setFixedParticipants(), setForceJS(), setHighscoreAchievedTS(), setHighscoreAnon(), setHighscoreEnabled(), setHighscoreHints(), setHighscoreOwnTable(), setHighscorePercentage(), setHighscoreScore(), setHighscoreTopNum(), setHighscoreTopTable(), setHighscoreWTime(), setInstantFeedbackAnswerFixationEnabled(), setInstantFeedbackSolution(), setIntroduction(), setIntroductionEnabled(), setKiosk(), setLimitUsersEnabled(), setListOfQuestionsSettings(), setMailNotification(), setMailNotificationType(), setMCScoring(), setNrOfTries(), setObligationsEnabled(), setOfferingQuestionHintsEnabled(), setOnline(), setPassDeletionAllowed(), setPassScoring(), 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 _getAvailableTests(), and read().

1888  {
1889  global $ilDB;
1890 
1891  $result = $ilDB->queryF("SELECT * FROM tst_tests WHERE obj_fi = %s",
1892  array('integer'),
1893  array($this->getId())
1894  );
1895  if ($result->numRows() == 1)
1896  {
1897  $data = $ilDB->fetchObject($result);
1898  $this->setTestId($data->test_id);
1899  if (strlen($this->getAuthor()) == 0)
1900  {
1901  $this->saveAuthorToMetadata($data->author);
1902  }
1903  $this->setAuthor($data->author);
1904  include_once("./Services/RTE/classes/class.ilRTE.php");
1905  $this->setIntroductionEnabled($data->intro_enabled);
1906  $this->setIntroduction(ilRTE::_replaceMediaObjectImageSrc($data->introduction, 1));
1907  $this->setShowInfo($data->showinfo);
1908  $this->setFinalStatement(ilRTE::_replaceMediaObjectImageSrc($data->finalstatement, 1));
1909  $this->setForceJS($data->forcejs);
1910  $this->setCustomStyle($data->customstyle);
1911  $this->setShowFinalStatement($data->showfinalstatement);
1912  $this->setSequenceSettings($data->sequence_settings);
1913  $this->setScoreReporting($data->score_reporting);
1914  $this->setInstantFeedbackSolution($data->instant_verification);
1915  $this->setAnswerFeedbackPoints($data->answer_feedback_points);
1916  $this->setAnswerFeedback($data->answer_feedback);
1917  $this->setAnonymity($data->anonymity);
1918  $this->setShowCancel($data->show_cancel);
1919  $this->setShowMarker($data->show_marker);
1920  $this->setFixedParticipants($data->fixed_participants);
1921  $this->setNrOfTries($data->nr_of_tries);
1922  $this->setKiosk($data->kiosk);
1923  $this->setUsePreviousAnswers($data->use_previous_answers);
1924  $this->setRedirectionMode($data->redirection_mode);
1925  $this->setRedirectionUrl($data->redirection_url);
1926  $this->setTitleOutput($data->title_output);
1927  $this->setProcessingTime($data->processing_time);
1928  $this->setEnableProcessingTime($data->enable_processing_time);
1929  $this->setResetProcessingTime($data->reset_processing_time);
1930  $this->setReportingDate($data->reporting_date);
1931  $this->setShuffleQuestions($data->shuffle_questions);
1932  $this->setResultsPresentation($data->results_presentation);
1933  $this->setStartingTimeEnabled($data->starting_time_enabled);
1934  $this->setStartingTime($data->starting_time);
1935  $this->setEndingTimeEnabled($data->ending_time_enabled);
1936  $this->setEndingTime($data->ending_time);
1937  $this->setListOfQuestionsSettings($data->show_summary);
1938  $this->setECTSOutput($data->ects_output);
1939  $this->setECTSGrades(
1940  array(
1941  "A" => $data->ects_a,
1942  "B" => $data->ects_b,
1943  "C" => $data->ects_c,
1944  "D" => $data->ects_d,
1945  "E" => $data->ects_e
1946  )
1947  );
1948  $this->setECTSFX($data->ects_fx);
1949  $this->mark_schema->flush();
1950  $this->mark_schema->loadFromDb($this->getTestId());
1951  $this->setCountSystem($data->count_system);
1952  $this->setMCScoring($data->mc_scoring);
1953  $this->setMailNotification($data->mailnotification);
1954  $this->setMailNotificationType($data->mailnottype);
1955  $this->setExportSettings($data->exportsettings);
1956  $this->setScoreCutting($data->score_cutting);
1957  $this->setPasswordEnabled($data->password_enabled);
1958  $this->setPassword($data->password);
1959  $this->setLimitUsersEnabled($data->limit_users_enabled);
1960  $this->setAllowedUsers($data->allowedusers);
1961  $this->setAllowedUsersTimeGap($data->alloweduserstimegap);
1962  $this->setPassScoring($data->pass_scoring);
1963  $this->setObligationsEnabled($data->obligations_enabled);
1964  $this->setOfferingQuestionHintsEnabled($data->offer_question_hints);
1965  $this->setCertificateVisibility($data->certificate_visibility);
1966  $this->setEnabledViewMode($data->enabled_view_mode);
1967  $this->setTemplate($data->template_id);
1968  $this->setPoolUsage($data->pool_usage);
1969  $this->setPrintBestSolutionWithResult((bool) $data->print_bs_with_res);
1970  $this->setHighscoreEnabled((bool) $data->highscore_enabled);
1971  $this->setHighscoreAnon((bool) $data->highscore_anon);
1972  $this->setHighscoreAchievedTS((bool) $data->highscore_achieved_ts);
1973  $this->setHighscoreScore((bool) $data->highscore_score);
1974  $this->setHighscorePercentage((bool) $data->highscore_percentage);
1975  $this->setHighscoreHints((bool) $data->highscore_hints);
1976  $this->setHighscoreWTime((bool) $data->highscore_wtime);
1977  $this->setHighscoreOwnTable((bool) $data->highscore_own_table);
1978  $this->setHighscoreTopTable((bool) $data->highscore_top_table);
1979  $this->setHighscoreTopNum((int) $data->highscore_top_num);
1980  $this->setOnline((bool) $data->online_status);
1981  $this->setSpecificAnswerFeedback((int) $data->specific_feedback);
1982  $this->setAutosave((bool)$data->autosave);
1983  $this->setAutosaveIval((int)$data->autosave_ival);
1984  $this->setPassDeletionAllowed($data->pass_deletion_allowed);
1985  $this->setEnableExamview((bool)$data->enable_examview);
1986  $this->setShowExamviewHtml((bool)$data->show_examview_html);
1987  $this->setShowExamviewPdf((bool)$data->show_examview_pdf);
1988  $this->setEnableArchiving((bool)$data->enable_archiving);
1989  $this->setShowExamIdInTestPassEnabled( (bool)$data->examid_in_test_pass);
1990  $this->setShowExamIdInTestResultsEnabled( (bool)$data->examid_in_test_res);
1991  $this->setSignSubmission( (bool)$data->sign_submission );
1992  $this->setQuestionSetType($data->question_set_type);
1993  $this->setCharSelectorAvailability((int)$data->char_selector_availability);
1994  $this->setCharSelectorDefinition($data->char_selector_definition);
1995  $this->setSkillServiceEnabled((bool)$data->skill_service);
1996  $this->setResultFilterTaxIds(strlen($data->result_tax_filters) ? unserialize($data->result_tax_filters) : array());
1997  $this->setShowGradingStatusEnabled((bool)$data->show_grading_status);
1998  $this->setShowGradingMarkEnabled((bool)$data->show_grading_mark);
1999  $this->setInstantFeedbackAnswerFixationEnabled((bool)$data->inst_fb_answer_fixation);
2000  $this->setTestFinalBroken((bool)$data->broken);
2001  $this->loadQuestions();
2002  }
2003 
2004  // moved activation to ilObjectActivation
2005  if($this->ref_id)
2006  {
2007  include_once "./Services/Object/classes/class.ilObjectActivation.php";
2008  $activation = ilObjectActivation::getItem($this->ref_id);
2009  switch($activation["timing_type"])
2010  {
2012  $this->setActivationLimited(true);
2013  $this->setActivationStartingTime($activation["timing_start"]);
2014  $this->setActivationEndingTime($activation["timing_end"]);
2015  $this->setActivationVisibility($activation["visible"]);
2016  break;
2017 
2018  default:
2019  $this->setActivationLimited(false);
2020  break;
2021  }
2022  }
2023  }
setStartingTime($starting_time=NULL)
Sets the starting time in database timestamp format for the test.
setAllowedUsers($a_allowed_users)
setAnswerFeedback($answer_feedback=0)
Sets the generic feedback for the test Use setGenericAnswerFeedback instead.
setECTSFX($a_ects_fx)
{}
setHighscoreTopTable($a_top_table)
Sets if the top-rankings table should be shown.
setPassScoring($a_pass_scoring=SCORE_LAST_PASS)
Sets the pass scoring.
setSkillServiceEnabled($skillServiceEnabled)
setRedirectionUrl($redirection_url=NULL)
setMailNotification($a_notification)
Set mail notification settings.
setAutosave($autosave)
setEnableExamview($enable_examview)
setPassDeletionAllowed($passDeletionAllowed)
setter for the test setting passDeletionAllowed
setOnline($a_online=true)
setShowExamIdInTestPassEnabled($show_exam_id_in_test_pass_enabled)
setShowExamviewPdf($show_examview_pdf)
setRedirectionMode($redirection_mode=0)
setQuestionSetType($questionSetType)
setter for question set type
setECTSOutput($a_ects_output)
{}
$result
setReportingDate($reporting_date)
Sets the reporting date of the ilObjTest object.
setCertificateVisibility($a_value)
Sets the visibility settings of the certificate.
setResultFilterTaxIds($resultFilterTaxIds)
setShuffleQuestions($a_shuffle)
Sets the status of the shuffle_questions variable.
setFixedParticipants($a_value=1)
Sets the fixed participants status.
setCharSelectorDefinition($definition='')
setHighscoreScore($a_score)
Sets if the actual score should be displayed.
getTestId()
Gets the database id of the additional test data.
setHighscoreWTime($a_wtime)
Sets if the workingtime of the scores should be shown.
static getItem($a_ref_id)
Get item data.
setFinalStatement($a_statement="")
Sets the final statement text of the ilObjTest object.
setScoreCutting($a_score_cutting=SCORE_CUT_QUESTION)
Sets the type of score cutting.
setEndingTime($ending_time=NULL)
Sets the ending time in database timestamp format for the test.
setResetProcessingTime($reset=0)
Sets wheather the processing time should be reset or not.
setCharSelectorAvailability($availability)
setShowMarker($a_value=1)
Sets the marker button status.
setEndingTimeEnabled($ending_time_enabled)
setActivationLimited($a_value)
setSpecificAnswerFeedback($specific_answer_feedback)
setTestId($a_id)
Sets the test ID.
setShowGradingStatusEnabled($showGradingStatusEnabled)
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...
setMailNotificationType($a_type)
setObligationsEnabled($obligationsEnabled=true)
sets obligations enabled/disabled
setHighscoreOwnTable($a_own_table)
Sets if the table with the own ranking should be shown.
setTitleOutput($title_output=0)
Sets the status of the title output.
setTestFinalBroken($testFinalBroken)
setPoolUsage($usage)
setCustomStyle($a_customStyle=NULL)
Set the custom style.
setSignSubmission($sign_submission)
setNrOfTries($nr_of_tries=0)
Sets the nr of tries for the test.
setScoreReporting($score_reporting=0)
Sets the score reporting of the ilObjTest object.
setAnswerFeedbackPoints($answer_feedback_points=0)
Sets the answer specific feedback of reached points for the test.
setShowCancel($a_value=1)
Sets the cancel test button status.
setLimitUsersEnabled($limitUsersEnabled)
setAutosaveIval($autosave_ival)
setProcessingTime($processing_time="00:00:00")
Sets the processing time for the test.
setCountSystem($a_count_system=COUNT_PARTIAL_SOLUTIONS)
Sets the count system for the calculation of points.
setExportSettings($a_settings)
getId()
get object id public
setHighscoreTopNum($a_top_num)
Sets the number of entries which are to be shown in the top-rankings table.
setActivationVisibility($a_value)
getAuthor()
Gets the authors name of the ilObjTest object.
setTemplate($template_id)
setShowInfo($a_info=1)
Set whether the complete information page is shown or the required data only.
setInstantFeedbackSolution($instant_feedback=0)
Sets the instant feedback for the solution.
setAllowedUsersTimeGap($a_allowed_users_time_gap)
loadQuestions($active_id="", $pass=NULL)
Load the test question id&#39;s from the database.
setECTSGrades(array $a_ects_grades)
{}
setAnonymity($a_value=0)
Sets the anonymity status of the test.
setKiosk($kiosk=0)
Sets the kiosk mode for the test.
setUsePreviousAnswers($use_previous_answers=1)
Sets the status of the visibility of previous learner answers.
setResultsPresentation($a_results_presentation=3)
Sets the combined results presentation value.
setForceJS($a_js=1)
Set whether JavaScript should be forced for tests.
setHighscoreHints($a_hints)
Sets if the number of requested hints should be shown.
setEnableProcessingTime($enable=0)
Sets the processing time enabled or disabled.
setEnabledViewMode($mode)
setHighscoreAchievedTS($a_achieved_ts)
Sets if the date and time of the scores achievement should be displayed.
setEnableArchiving($enable_archiving)
setPasswordEnabled($passwordEnabled)
setShowExamviewHtml($show_examview_html)
setOfferingQuestionHintsEnabled($offeringQuestionHintsEnabled)
sets offering question hints enabled/disabled
setPrintBestSolutionWithResult($status)
setMCScoring($a_mc_scoring=SCORE_ZERO_POINTS_WHEN_UNANSWERED)
Sets the multiple choice scoring.
global $ilDB
setHighscoreAnon($a_anon)
Sets if the highscores should be anonymized.
saveAuthorToMetadata($a_author="")
Saves an authors name into the lifecycle metadata if no lifecycle metadata exists This will only be c...
setActivationStartingTime($starting_time=NULL)
setShowExamIdInTestResultsEnabled($show_exam_id_in_test_results_enabled)
setIntroduction($introduction="")
Sets the introduction text of the ilObjTest object.
setHighscoreEnabled($a_enabled)
Sets if the highscore feature should be enabled.
setShowGradingMarkEnabled($showGradingMarkEnabled)
setAuthor($author="")
Sets the authors name of the ilObjTest object.
setInstantFeedbackAnswerFixationEnabled($instantFeedbackAnswerFixationEnabled)
setHighscorePercentage($a_percentage)
Sets if the percentages of the scores pass should be shown.
setIntroductionEnabled($introductionEnabled)
setActivationEndingTime($ending_time=NULL)
setShowFinalStatement($show=0)
Sets whether the final statement should be shown or not.
setSequenceSettings($sequence_settings=0)
SEQUENCE SETTING = POSTPONING ENABLED !!
setPassword($a_password=NULL)
Sets the password for test access.
setListOfQuestionsSettings($a_value=0)
Sets the settings for the list of questions options in the test properties This could contain one of ...
setStartingTimeEnabled($starting_time_enabled)
+ 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) public

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

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

Referenced by getAllQuestions(), getAnsweredQuestionCount(), insertQuestion(), loadFromDb(), questionMoveDown(), questionMoveUp(), removeQuestion(), and setQuestionOrderAndObligations().

2032 {
2033  global $ilUser;
2034  global $ilDB;
2035 
2036  $this->questions = array();
2037  if (strcmp($active_id, "") == 0)
2038  {
2039  $active_id = $this->getActiveIdOfUser($ilUser->getId());
2040  }
2041  if ($this->isRandomTest())
2042  {
2043  if (is_null($pass))
2044  {
2045  $pass = $this->_getPass($active_id);
2046  }
2047  $result = $ilDB->queryF("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",
2048  array('integer', 'integer'),
2049  array($active_id, $pass)
2050  );
2051  // The following is a fix for random tests prior to ILIAS 3.8. If someone started a random test in ILIAS < 3.8, there
2052  // is only one test pass (pass = 0) in tst_test_rnd_qst while with ILIAS 3.8 there are questions for every test pass.
2053  // To prevent problems with tests started in an older version and continued in ILIAS 3.8, the first pass should be taken if
2054  // no questions are present for a newer pass.
2055  if ($result->numRows() == 0)
2056  {
2057  $result = $ilDB->queryF("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",
2058  array('integer'),
2059  array($active_id)
2060  );
2061  }
2062  }
2063  else
2064  {
2065  $result = $ilDB->queryF("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",
2066  array('integer'),
2067  array($this->test_id)
2068  );
2069  }
2070  $index = 1;
2071  while ($data = $ilDB->fetchAssoc($result))
2072  {
2073  $this->questions[$index++] = $data["question_fi"];
2074  }
2075 }
$result
_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.
isRandomTest()
Returns the fact wether this test is a random questions test or not.
global $ilUser
Definition: imgupload.php:15
global $ilDB
+ 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 public

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

References $ilUser, ilObjAssessmentFolder\_addLog(), assQuestion\_getOriginalId(), ilObject\getId(), and ilObject\getRefId().

Referenced by addExtraTime(), checkMaximumAllowedUsers(), getManualFeedback(), insertQuestion(), questionMoveDown(), questionMoveUp(), removeAllTestEditings(), removeQuestion(), removeTestResultsByActiveIds(), removeTestResultsForUser(), saveQuestionsToDb(), and saveToDb().

7481  {
7482  global $ilUser;
7483 
7484  $original_id = "";
7485  if (strcmp($question_id, "") != 0)
7486  {
7487  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
7488  $original_id = assQuestion::_getOriginalId($question_id);
7489  }
7490  include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
7491  ilObjAssessmentFolder::_addLog($ilUser->getId(), $this->getId(), $logtext, $question_id, $original_id, TRUE, $this->getRefId());
7492  }
static _getOriginalId($question_id)
Returns the original id of a question.
getId()
get object id public
_addLog($user_id, $object_id, $logtext, $question_id="", $original_id="", $test_only=FALSE, $test_ref_id=NULL)
Add an assessment log entry.
global $ilUser
Definition: imgupload.php:15
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupExamId()

ilObjTest::lookupExamId (   $active_id,
  $pass 
)
Parameters
$active_id
$pass
Returns
array

Move this to a proper place.

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

References $ilDB, $ilSetting, and $pass.

Referenced by ilTestPlayerDynamicQuestionSetGUI\outCurrentlyFinishedPage(), and ilTestPlayerAbstractGUI\outTestPage().

11850  {
11852  global $ilDB, $ilSetting;
11853 
11854  $exam_id_query = 'SELECT exam_id FROM tst_pass_result WHERE active_fi = %s AND pass = %s';
11855  $exam_id_result = $ilDB->queryF( $exam_id_query, array( 'integer', 'integer' ), array( $active_id, $pass ) );
11856  if ($ilDB->numRows( $exam_id_result ) == 1)
11857  {
11858  $exam_id_row = $ilDB->fetchAssoc( $exam_id_result );
11859 
11860  if ($exam_id_row['exam_id'] != null)
11861  {
11862  return $exam_id_row['exam_id'];
11863  }
11864  }
11865 
11866  return null;
11867  }
global $ilSetting
Definition: privfeed.php:40
global $ilDB
+ Here is the caller graph for this function:

◆ lookupQuestionSetType()

static ilObjTest::lookupQuestionSetType (   $objId)
static

lookup-er for question set type

ilDB $ilDB

Parameters
integer$objId
Returns
string $questionSetType

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

References $ilDB, $query, $questionSetType, $res, and $row.

11999  {
12000  global $ilDB;
12001 
12002  $query = "SELECT question_set_type FROM tst_tests WHERE obj_fi = %s";
12003 
12004  $res = $ilDB->queryF($query, array('integer'), array($objId));
12005 
12006  $questionSetType = null;
12007 
12008  while( $row = $ilDB->fetchAssoc($res) )
12009  {
12010  $questionSetType = $row['question_set_type'];
12011  }
12012 
12013  return $questionSetType;
12014  }
global $ilDB

◆ 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 9673 of file class.ilObjTest.php.

References $ilDB, $query, $res, and $row.

Referenced by _getQuestionCountAndPointsForPassOfParticipant().

9674  {
9675  global $ilDB;
9676 
9677  $query = "
9678  SELECT tst_tests.question_set_type
9679  FROM tst_active
9680  INNER JOIN tst_tests
9681  ON tst_active.test_fi = tst_tests.test_id
9682  WHERE tst_active.active_id = %s
9683  ";
9684 
9685  $res = $ilDB->queryF( $query, array('integer'), array($active_id) );
9686 
9687  while($row = $ilDB->fetchAssoc($res))
9688  {
9689  return $row['question_set_type'];
9690  }
9691 
9692  return null;
9693  }
global $ilDB
+ 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.

private

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

References ilUtil\insertInstIntoID().

6872  {
6873  if ($a_tag == "Identifier" && $a_param == "Entry")
6874  {
6875  include_once "./Services/Utilities/classes/class.ilUtil.php";
6876  $a_value = ilUtil::insertInstIntoID($a_value);
6877  }
6878 
6879  return $a_value;
6880  }
static insertInstIntoID($a_value)
inserts installation id into ILIAS id
+ Here is the call graph for this function:

◆ moveQuestionAfter()

ilObjTest::moveQuestionAfter (   $question_to_move,
  $question_before 
)

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

References $ilDB, $query, $row, and getTestId().

11030  {
11031  global $ilDB;
11032  //var_dump(func_get_args());
11033  if ($question_before) {
11034  $query = 'SELECT sequence, test_fi FROM tst_test_question WHERE question_fi = %s';
11035  $types = array('integer');
11036  $values = array($question_before);
11037  $rset = $ilDB->queryF($query, $types, $values);
11038  }
11039 
11040  if (!$question_before || ($rset && !($row = $ilDB->fetchAssoc($rset)))) {
11041  $row = array(
11042  'sequence' => 0,
11043  'test_fi' => $this->getTestId(),
11044  );
11045  }
11046 
11047  $update = 'UPDATE tst_test_question SET sequence = sequence + 1 WHERE sequence > %s AND test_fi = %s';
11048  $types = array('integer', 'integer');
11049  $values = array($row['sequence'], $row['test_fi']);
11050  $ilDB->manipulateF($update, $types, $values);
11051 
11052  $update = 'UPDATE tst_test_question SET sequence = %s WHERE question_fi = %s';
11053  $types = array('integer', 'integer');
11054  $values = array($row['sequence'] + 1, $question_to_move);
11055  $ilDB->manipulateF($update, $types, $values);
11056 
11057  }
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ Here is the call graph for this function:

◆ moveQuestionAfterOLD()

ilObjTest::moveQuestionAfterOLD (   $previous_question_id,
  $new_question_id 
)

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

References $ilDB, $query, $res, $row, and getTestId().

10905  {
10906  $new_array = array();
10907  $position = 1;
10908 
10909  $query = 'SELECT question_fi FROM tst_test_question WHERE test_fi = %s';
10910  $types = array('integer');
10911  $values = array($this->getTestId());
10912 
10913  $new_question_id += 1;
10914 
10915  global $ilDB;
10916  $inserted = false;
10917  $res = $ilDB->queryF($query, $types, $values);
10918  while($row = $ilDB->fetchAssoc($res)) {
10919 
10920  $qid = $row['question_fi'];
10921 
10922  if ($qid == $new_question_id) {
10923  continue;
10924  }
10925  else if ($qid == $previous_question_id) {
10926  $new_array[$position++] = $qid;
10927  $new_array[$position++] = $new_question_id;
10928  $inserted = true;
10929  }
10930  else {
10931  $new_array[$position++] = $qid;
10932  }
10933  }
10934 
10935  $update_query = 'UPDATE tst_test_question SET sequence = %s WHERE test_fi = %s AND question_fi = %s';
10936  $update_types = array('integer', 'integer', 'integer');
10937 
10938  foreach($new_array as $position => $qid) {
10939  $ilDB->manipulateF(
10940  $update_query,
10941  $update_types,
10942  $vals = array(
10943  $position,
10944  $this->getTestId(),
10945  $qid
10946  )
10947  );
10948  }
10949  }
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ 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 public

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

References saveQuestionsToDb().

5681  {
5682  $this->questions = array_values($this->questions);
5683  $array_pos = array_search($target_index, $this->questions);
5684  if ($insert_mode == 0)
5685  {
5686  $part1 = array_slice($this->questions, 0, $array_pos);
5687  $part2 = array_slice($this->questions, $array_pos);
5688  }
5689  else if ($insert_mode == 1)
5690  {
5691  $part1 = array_slice($this->questions, 0, $array_pos + 1);
5692  $part2 = array_slice($this->questions, $array_pos + 1);
5693  }
5694  foreach ($move_questions as $question_id)
5695  {
5696  if (!(array_search($question_id, $part1) === FALSE))
5697  {
5698  unset($part1[array_search($question_id, $part1)]);
5699  }
5700  if (!(array_search($question_id, $part2) === FALSE))
5701  {
5702  unset($part2[array_search($question_id, $part2)]);
5703  }
5704  }
5705  $part1 = array_values($part1);
5706  $part2 = array_values($part2);
5707  $new_array = array_values(array_merge($part1, $move_questions, $part2));
5708  $this->questions = array();
5709  $counter = 1;
5710  foreach ($new_array as $question_id)
5711  {
5712  $this->questions[$counter] = $question_id;
5713  $counter++;
5714  }
5715  $this->saveQuestionsToDb();
5716  }
saveQuestionsToDb()
Saves the test questions to the database.
+ Here is the call graph for this function:

◆ notify()

ilObjTest::notify (   $a_event,
  $a_ref_id,
  $a_parent_non_rbac_id,
  $a_node_id,
  $a_params = 0 
)

notifys an object about an event occured Based on the event happend, each object may decide how it reacts.

If you are not required to handle any events related to your module, just delete this method. (For an example how this method is used, look at ilObjGroup)

public

Parameters
stringevent
integerreference id of object where the event occured
arraypasses optional parameters if required
Returns
boolean

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

References $_GET, and ilObject\getType().

856  {
857  global $tree;
858 
859  switch ($a_event)
860  {
861  case "link":
862 
863  //var_dump("<pre>",$a_params,"</pre>");
864  //echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
865  //exit;
866  break;
867 
868  case "cut":
869 
870  //echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
871  //exit;
872  break;
873 
874  case "copy":
875 
876  //var_dump("<pre>",$a_params,"</pre>");
877  //echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
878  //exit;
879  break;
880 
881  case "paste":
882 
883  //echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
884  //exit;
885  break;
886 
887  case "new":
888 
889  //echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
890  //exit;
891  break;
892  }
893 
894  // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
895  if ($a_node_id==$_GET["ref_id"])
896  {
897  $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
898  $parent_type = $parent_obj->getType();
899  if ($parent_type == $this->getType())
900  {
901  $a_node_id = (int) $tree->getParentId($a_node_id);
902  }
903  }
904 
905  parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
906  }
$_GET["client_id"]
redirection script todo: (a better solution should control the processing via a xml file) ...
getType()
get object type public
+ Here is the call graph for this function:

◆ participantDataExist()

ilObjTest::participantDataExist ( )

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

References $participantDataExist, and evalTotalPersons().

Referenced by getMarkSchemaForeignId().

12076  {
12077  if( $this->participantDataExist === null )
12078  {
12079  $this->participantDataExist = (bool)$this->evalTotalPersons();
12080  }
12081 
12083  }
$participantDataExist
holds the fact wether participant data exists or not DO NOT USE TIS PROPERTY DRIRECTLY ALWAYS USE ilO...
evalTotalPersons()
Returns the number of persons who started the test.
+ 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 public

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

References $result.

4203  {
4204  $keys = array_keys($array);
4205  shuffle($keys);
4206  $result = array();
4207  foreach ($keys as $key)
4208  {
4209  $result[$key] = $array[$key];
4210  }
4211  return $result;
4212  }
$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 public

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

References ilUtil\prepareTextareaOutput().

9482  {
9483  include_once "./Services/Utilities/classes/class.ilUtil.php";
9484  return ilUtil::prepareTextareaOutput($txt_output, $prepare_for_latex_output, $omitNl2BrWhenTextArea);
9485  }
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...
+ 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 public

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

References $row, and $separator.

Referenced by getAllTestResults().

8165  {
8166  $resultarray = array();
8167  foreach ($row as $rowindex => $entry)
8168  {
8169  $surround = FALSE;
8170  if ($quoteAll)
8171  {
8172  $surround = TRUE;
8173  }
8174  if (strpos($entry, "\"") !== FALSE)
8175  {
8176  $entry = str_replace("\"", "\"\"", $entry);
8177  $surround = TRUE;
8178  }
8179  if (strpos($entry, $separator) !== FALSE)
8180  {
8181  $surround = TRUE;
8182  }
8183  // replace all CR LF with LF (for Excel for Windows compatibility
8184  $entry = str_replace(chr(13).chr(10), chr(10), $entry);
8185 
8186  if ($surround)
8187  {
8188  $entry = "\"" . $entry . "\"";
8189  }
8190 
8191  $resultarray[$rowindex] = $entry;
8192  }
8193  return $resultarray;
8194  }
$separator
+ 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 public

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

References $GLOBALS, xslt_create(), xslt_error(), and xslt_free().

Referenced by deliverPDFfromHTML().

10117  {
10118  if (extension_loaded("tidy"))
10119  {
10120  $config = array(
10121  "indent" => false,
10122  "output-xml" => true,
10123  "numeric-entities" => true
10124  );
10125  $tidy = new tidy();
10126  $tidy->parseString($print_output, $config, 'utf8');
10127  $tidy->cleanRepair();
10128  $print_output = tidy_get_output($tidy);
10129  $print_output = preg_replace("/^.*?(<html)/", "\\1", $print_output);
10130  }
10131  else
10132  {
10133  $print_output = str_replace("&nbsp;", "&#160;", $print_output);
10134  $print_output = str_replace("&otimes;", "X", $print_output);
10135  }
10136  $xsl = file_get_contents("./Modules/Test/xml/question2fo.xsl");
10137 
10138  // additional font support
10139  $xsl = str_replace(
10140  'font-family="Helvetica, unifont"',
10141  'font-family="'.$GLOBALS['ilSetting']->get('rpc_pdf_font','Helvetica, unifont').'"',
10142  $xsl
10143  );
10144 
10145  $args = array( '/_xml' => $print_output, '/_xsl' => $xsl );
10146  $xh = xslt_create();
10147  $params = array();
10148  $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params);
10149  xslt_error($xh);
10150  xslt_free($xh);
10151  return $output;
10152  }
xslt_create()
xslt_free(&$proc)
xslt_error(&$proc)
$GLOBALS['ct_recipient']
+ 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 public

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

References $_SESSION, $ilLog, and $result.

Referenced by fromXML().

9407  {
9408  $result = "";
9409  for ($i = 0; $i < $a_material->getMaterialCount(); $i++)
9410  {
9411  $material = $a_material->getMaterial($i);
9412  if (strcmp($material["type"], "mattext") == 0)
9413  {
9414  $result .= $material["material"]->getContent();
9415  }
9416  if (strcmp($material["type"], "matimage") == 0)
9417  {
9418  $matimage = $material["material"];
9419  if (preg_match("/(il_([0-9]+)_mob_([0-9]+))/", $matimage->getLabel(), $matches))
9420  {
9421  // import an mediaobject which was inserted using tiny mce
9422  if (!is_array($_SESSION["import_mob_xhtml"])) $_SESSION["import_mob_xhtml"] = array();
9423  array_push($_SESSION["import_mob_xhtml"], array("mob" => $matimage->getLabel(), "uri" => $matimage->getUri()));
9424  }
9425  }
9426  }
9427  global $ilLog;
9428  $ilLog->write(print_r($_SESSION["import_mob_xhtml"], true));
9429  return $result;
9430  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$result
+ 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 public
See also
$test_id

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

References $data, $ilDB, $result, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), getTestId(), loadQuestions(), and logAction().

3726  {
3727  global $ilDB;
3728 
3729  // Move a question down in sequence
3730  $result = $ilDB->queryF("SELECT * FROM tst_test_question WHERE test_fi=%s AND question_fi=%s",
3731  array('integer','integer'),
3732  array($this->getTestId(), $question_id)
3733  );
3734  $data = $ilDB->fetchObject($result);
3735  $result = $ilDB->queryF("SELECT * FROM tst_test_question WHERE test_fi=%s AND sequence=%s",
3736  array('integer','integer'),
3737  array($this->getTestId(), $data->sequence + 1)
3738  );
3739  if ($result->numRows() == 1)
3740  {
3741  // OK, it's not the last question, so move it down
3742  $data_next = $ilDB->fetchObject($result);
3743  // change next dataset
3744  $affectedRows = $ilDB->manipulateF("UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
3745  array('integer','integer'),
3746  array($data->sequence, $data_next->test_question_id)
3747  );
3748  // move actual dataset down
3749  $affectedRows = $ilDB->manipulateF("UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
3750  array('integer','integer'),
3751  array($data->sequence + 1, $data->test_question_id)
3752  );
3753  include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3755  {
3756  $this->logAction($this->lng->txtlng("assessment", "log_question_position_changed", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($data->sequence) . " => " . ($data->sequence+1), $question_id);
3757  }
3758  }
3759  $this->loadQuestions();
3760  }
logAction($logtext="", $question_id="")
Logs an action into the Test&Assessment log.
$result
getTestId()
Gets the database id of the additional test data.
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
loadQuestions($active_id="", $pass=NULL)
Load the test question id&#39;s from the database.
_getLogLanguage()
retrieve the log language for assessment logging
global $ilDB
+ 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 public
See also
$test_id

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

References $data, $ilDB, $result, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), getTestId(), loadQuestions(), and logAction().

3682  {
3683  global $ilDB;
3684 
3685  // Move a question up in sequence
3686  $result = $ilDB->queryF("SELECT * FROM tst_test_question WHERE test_fi=%s AND question_fi=%s",
3687  array('integer', 'integer'),
3688  array($this->getTestId(), $question_id)
3689  );
3690  $data = $ilDB->fetchObject($result);
3691  if ($data->sequence > 1)
3692  {
3693  // OK, it's not the top question, so move it up
3694  $result = $ilDB->queryF("SELECT * FROM tst_test_question WHERE test_fi=%s AND sequence=%s",
3695  array('integer','integer'),
3696  array($this->getTestId(), $data->sequence - 1)
3697  );
3698  $data_previous = $ilDB->fetchObject($result);
3699  // change previous dataset
3700  $affectedRows = $ilDB->manipulateF("UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
3701  array('integer','integer'),
3702  array($data->sequence, $data_previous->test_question_id)
3703  );
3704  // move actual dataset up
3705  $affectedRows = $ilDB->manipulateF("UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
3706  array('integer','integer'),
3707  array($data->sequence - 1, $data->test_question_id)
3708  );
3709  include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3711  {
3712  $this->logAction($this->lng->txtlng("assessment", "log_question_position_changed", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($data->sequence) . " => " . ($data->sequence-1), $question_id);
3713  }
3714  }
3715  $this->loadQuestions();
3716  }
logAction($logtext="", $question_id="")
Logs an action into the Test&Assessment log.
$result
getTestId()
Gets the database id of the additional test data.
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
loadQuestions($active_id="", $pass=NULL)
Load the test question id&#39;s from the database.
_getLogLanguage()
retrieve the log language for assessment logging
global $ilDB
+ 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 public
Deprecated:
–> old school random test

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

References $ilDB, $result, $row, ilObjQuestionPool\_getAvailableQuestionpools(), ilObject\_lookupObjId(), ilObject\_lookupOwner(), ilObject\getId(), and getTestId().

1754  {
1755  global $rbacsystem;
1756  global $ilDB;
1757 
1758  // retrieve object id instead of ref id if necessary
1759  if (($questionpool != 0) && (!$use_obj_id)) $questionpool = ilObject::_lookupObjId($questionpool);
1760 
1761  // get original ids of all existing questions in the test
1762  $result = $ilDB->queryF("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",
1763  array("integer"),
1764  array($this->getTestId())
1765  );
1766  $original_ids = array();
1767  $paramtypes = array();
1768  $paramvalues = array();
1769  while ($row = $ilDB->fetchAssoc($result))
1770  {
1771  array_push($original_ids, $row['original_id']);
1772  }
1773 
1774  $available = "";
1775  // get a list of all available questionpools
1776  if (($questionpool == 0) && (!is_array($qpls)))
1777  {
1778  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
1779  $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())));
1780  if (count($available_pools))
1781  {
1782  $available = " AND " . $ilDB->in('obj_fi', $available_pools, false, 'integer');
1783  }
1784  else
1785  {
1786  return array();
1787  }
1788  }
1789 
1790  $constraint_qpls = "";
1791  $result_array = array();
1792  if ($questionpool == 0)
1793  {
1794  if (is_array($qpls))
1795  {
1796  if (count($qpls) > 0)
1797  {
1798  $constraint_qpls = " AND " . $ilDB->in('obj_fi', $qpls, false, 'integer');
1799  }
1800  }
1801  }
1802 
1803  $original_clause = "";
1804  if (count($original_ids))
1805  {
1806  $original_clause = " AND " . $ilDB->in('question_id', $original_ids, true, 'integer');
1807  }
1808 
1809  if ($questionpool == 0)
1810  {
1811  $result = $ilDB->queryF("SELECT question_id FROM qpl_questions WHERE original_id IS NULL $available $constraint_qpls AND owner > %s AND complete = %s $original_clause",
1812  array('integer', 'text'),
1813  array(0, "1")
1814  );
1815  }
1816  else
1817  {
1818  $result = $ilDB->queryF("SELECT question_id FROM qpl_questions WHERE original_id IS NULL AND obj_fi = %s AND owner > %s AND complete = %s $original_clause",
1819  array('integer','integer', 'text'),
1820  array($questionpool, 0, "1")
1821  );
1822  }
1823  $found_ids = array();
1824  while ($row = $ilDB->fetchAssoc($result))
1825  {
1826  array_push($found_ids, $row['question_id']);
1827  }
1828  $nr_of_questions = ($nr_of_questions > count($found_ids)) ? count($found_ids) : $nr_of_questions;
1829  if ($nr_of_questions == 0) return array();
1830  $rand_keys = array_rand($found_ids, $nr_of_questions);
1831  $result = array();
1832  if (is_array($rand_keys))
1833  {
1834  foreach ($rand_keys as $key)
1835  {
1836  $result[$found_ids[$key]] = $found_ids[$key];
1837  }
1838  }
1839  else
1840  {
1841  $result[$found_ids[$rand_keys]] = $found_ids[$rand_keys];
1842  }
1843  return $result;
1844  }
_lookupOwner($a_id)
lookup object owner
$result
getTestId()
Gets the database id of the additional test data.
getId()
get object id public
static _lookupObjId($a_id)
global $ilDB
& _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.
+ Here is the call graph for this function:

◆ read()

ilObjTest::read (   $a_force_db = false)

read object data from db into object

Parameters
booleanpublic

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

References loadFromDb().

728  {
729  parent::read($a_force_db);
730  $this->loadFromDb();
731  }
loadFromDb()
Loads a ilObjTest object from a database.
+ Here is the call graph for this function:

◆ recalculateScores()

ilObjTest::recalculateScores (   $preserve_manscoring = false)

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

Referenced by getMarkSchemaForeignId().

12101  {
12102  require_once 'class.ilTestScoring.php';
12103  $scoring = new ilTestScoring($this);
12104  $scoring->setPreserveManualScores($preserve_manscoring);
12105  $scoring->recalculateSolutions();
12106  }
Class ilTestScoring.
+ Here is the caller graph for this function:

◆ removeAllTestEditings()

ilObjTest::removeAllTestEditings (   $question_id = "")

Removes all references to the question in executed tests in case the question has been changed.

If a question was changed it cannot be guaranteed that the content and the meaning of the question is the same as before. So we have to delete all already started or completed tests using that question. Therefore we have to delete all references to that question in tst_solutions and the tst_active entries which were created for the user and test in the tst_solutions entry.

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

References $ilDB, $query, $res, $row, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilUtil\delDir(), ilAssQuestionHintTracking\deleteRequestsByActiveIds(), ilAssQuestionHintTracking\deleteRequestsByQuestionIds(), getTestId(), isRandomTest(), and logAction().

Referenced by deleteTest(), and removeQuestion().

3414  {
3415  global $ilDB;
3416 
3417  // remove the question from tst_solutions
3418  if ($question_id)
3419  {
3420  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_solutions WHERE tst_solutions.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s) AND tst_solutions.question_fi = %s",
3421  array('integer','integer'),
3422  array($this->getTestId(), $question_id)
3423  );
3424  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_qst_solved WHERE tst_qst_solved.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s) AND tst_qst_solved.question_fi = %s",
3425  array('integer','integer'),
3426  array($this->getTestId(), $question_id)
3427  );
3428  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_result WHERE tst_test_result.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s) AND tst_test_result.question_fi = %s",
3429  array('integer','integer'),
3430  array($this->getTestId(), $question_id)
3431  );
3432  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_pass_result WHERE tst_pass_result.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s)",
3433  array('integer'),
3434  array($this->getTestId())
3435  );
3436 
3437  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
3439  }
3440  else
3441  {
3442  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_solutions WHERE tst_solutions.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s)",
3443  array('integer'),
3444  array($this->getTestId())
3445  );
3446  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_qst_solved WHERE tst_qst_solved.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s)",
3447  array('integer'),
3448  array($this->getTestId())
3449  );
3450  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_result WHERE tst_test_result.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s)",
3451  array('integer'),
3452  array($this->getTestId())
3453  );
3454  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_pass_result WHERE tst_pass_result.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s)",
3455  array('integer'),
3456  array($this->getTestId())
3457  );
3458 
3459  $query = "SELECT active_id FROM tst_active WHERE test_fi = %s";
3460  $res = $ilDB->queryF($query, array('integer'), array($this->getTestId()));
3461  $activeIds = array();
3462  while( $row = $ilDB->fetchAssoc($res) )
3463  {
3464  $activeIds[] = $row['active_id'];
3465  }
3466 
3467  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
3469 
3470  include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3472  {
3473  $this->logAction($this->lng->txtlng("assessment", "log_user_data_removed", ilObjAssessmentFolder::_getLogLanguage()));
3474  }
3475  }
3476 
3477  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_sequence WHERE tst_sequence.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s)",
3478  array('integer'),
3479  array($this->getTestId())
3480  );
3481 
3482  if ($this->isRandomTest())
3483  {
3484  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_rnd_qst WHERE tst_test_rnd_qst.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s)",
3485  array('integer'),
3486  array($this->getTestId())
3487  );
3488  }
3489 
3490  // remove test_active entries, because test has changed
3491  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_active WHERE test_fi = %s",
3492  array('integer'),
3493  array($this->getTestId())
3494  );
3495 
3496  // remove saved user passwords
3497  $affectedRows = $ilDB->manipulateF("DELETE FROM usr_pref WHERE keyword = %s",
3498  array('text'),
3499  array("tst_password_".$this->getTestId())
3500  );
3501 
3502  // TODO: this shouldn't be here since it is question stuff and should be modular but there's no other solution yet
3503  // remove file uploads
3504  if (@is_dir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId()))
3505  {
3506  ilUtil::delDir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId());
3507  }
3508  }
logAction($logtext="", $question_id="")
Logs an action into the Test&Assessment log.
getTestId()
Gets the database id of the additional test data.
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
deleteRequestsByActiveIds($activeIds)
Deletes all hint requests relating to a testactive included in given active ids.
isRandomTest()
Returns the fact wether this test is a random questions test or not.
deleteRequestsByQuestionIds($questionIds)
Deletes all hint requests relating to a question included in given question ids.
_getLogLanguage()
retrieve the log language for assessment logging
global $ilDB
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeQuestion()

ilObjTest::removeQuestion (   $question_id)

Removes a question from the test object.

Parameters
integer$question_idThe database id of the question to be removed public
See also
$test_id

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

References ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), _instanciateQuestion(), loadQuestions(), logAction(), removeAllTestEditings(), and saveQuestionsToDb().

3393  {
3394  $question =& ilObjTest::_instanciateQuestion($question_id);
3395  include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3397  {
3398  $this->logAction($this->lng->txtlng("assessment", "log_question_removed", ilObjAssessmentFolder::_getLogLanguage()), $question_id);
3399  }
3400  $question->delete($question_id);
3401  $this->removeAllTestEditings($question_id);
3402  $this->loadQuestions();
3403  $this->saveQuestionsToDb();
3404  }
logAction($logtext="", $question_id="")
Logs an action into the Test&Assessment log.
removeAllTestEditings($question_id="")
Removes all references to the question in executed tests in case the question has been changed...
& _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
loadQuestions($active_id="", $pass=NULL)
Load the test question id&#39;s from the database.
_getLogLanguage()
retrieve the log language for assessment logging
saveQuestionsToDb()
Saves the test questions to the database.
+ Here is the call graph for this function:

◆ removeTestActives()

ilObjTest::removeTestActives (   $activeIds)

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

References $ilDB.

Referenced by removeTestResults(), and ilCourseObjectiveResult\resetTestForUser().

3598  {
3599  global $ilDB;
3600 
3601  $IN_activeIds = $ilDB->in('active_id', $activeIds, false, 'integer');
3602  $ilDB->manipulate("DELETE FROM tst_active WHERE $IN_activeIds");
3603  }
global $ilDB
+ Here is the caller graph for this function:

◆ removeTestResults()

ilObjTest::removeTestResults ( ilTestParticipantData  $participantData)

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

References ilTestParticipantData\getActiveIds(), ilTestParticipantData\getAnonymousActiveIds(), ilObject\getId(), ilObjectLP\getInstance(), ilTestParticipantData\getUserIds(), removeTestActives(), and removeTestResultsByActiveIds().

3511  {
3512  if( count($participantData->getAnonymousActiveIds()) )
3513  {
3514  $this->removeTestResultsByActiveIds($participantData->getAnonymousActiveIds());
3515  }
3516 
3517  if( count($participantData->getUserIds()) )
3518  {
3519  /* @var ilTestLP $testLP */
3520  require_once 'Services/Object/classes/class.ilObjectLP.php';
3521  $testLP = ilObjectLP::getInstance($this->getId());
3522  $testLP->resetLPDataForUserIds($participantData->getUserIds(), false);
3523  }
3524 
3525  if( count($participantData->getActiveIds()) )
3526  {
3527  $this->removeTestActives($participantData->getActiveIds());
3528  }
3529  }
getId()
get object id public
removeTestActives($activeIds)
removeTestResultsByActiveIds($activeIds)
static getInstance($a_obj_id)
+ Here is the call graph for this function:

◆ removeTestResultsByActiveIds()

ilObjTest::removeTestResultsByActiveIds (   $activeIds)

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

References $ilDB, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), _getUserIdFromActiveId(), ilUtil\delDir(), ilAssQuestionHintTracking\deleteRequestsByActiveIds(), getTestId(), isDynamicTest(), isRandomTest(), logAction(), and userLookupFullName().

Referenced by removeTestResults(), and removeTestResultsByUserIds().

3552  {
3553  global $ilDB;
3554 
3555  $IN_activeIds = $ilDB->in('active_fi', $activeIds, false, 'integer');
3556 
3557  $ilDB->manipulate("DELETE FROM tst_solutions WHERE $IN_activeIds");
3558  $ilDB->manipulate("DELETE FROM tst_qst_solved WHERE $IN_activeIds");
3559  $ilDB->manipulate("DELETE FROM tst_test_result WHERE $IN_activeIds");
3560  $ilDB->manipulate("DELETE FROM tst_pass_result WHERE $IN_activeIds");
3561  $ilDB->manipulate("DELETE FROM tst_result_cache WHERE $IN_activeIds");
3562  $ilDB->manipulate("DELETE FROM tst_sequence WHERE $IN_activeIds");
3563 
3564  if( $this->isRandomTest() )
3565  {
3566  $ilDB->manipulate("DELETE FROM tst_test_rnd_qst WHERE $IN_activeIds");
3567  }
3568  elseif( $this->isDynamicTest() )
3569  {
3570  $ilDB->manipulate("DELETE FROM tst_seq_qst_tracking WHERE $IN_activeIds");
3571  $ilDB->manipulate("DELETE FROM tst_seq_qst_answstatus WHERE $IN_activeIds");
3572  $ilDB->manipulate("DELETE FROM tst_seq_qst_postponed WHERE $IN_activeIds");
3573  $ilDB->manipulate("DELETE FROM tst_seq_qst_checked WHERE $IN_activeIds");
3574  }
3575 
3576  include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3577 
3578  foreach ($activeIds as $active_id)
3579  {
3580  // TODO: this shouldn't be here since it is question stuff and should be modular but there's no other solution yet
3581  // remove file uploads
3582  if (@is_dir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId() . "/$active_id"))
3583  {
3584  ilUtil::delDir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId() . "/$active_id");
3585  }
3586 
3588  {
3589  $this->logAction(sprintf($this->lng->txtlng("assessment", "log_selected_user_data_removed", ilObjAssessmentFolder::_getLogLanguage()), $this->userLookupFullName($this->_getUserIdFromActiveId($active_id))));
3590  }
3591  }
3592 
3593  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
3595  }
static _getUserIdFromActiveId($active_id)
isDynamicTest()
Returns the fact wether this test is a dynamic question set test or not.
logAction($logtext="", $question_id="")
Logs an action into the Test&Assessment log.
getTestId()
Gets the database id of the additional test data.
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
deleteRequestsByActiveIds($activeIds)
Deletes all hint requests relating to a testactive included in given active ids.
isRandomTest()
Returns the fact wether this test is a random questions test or not.
userLookupFullName($user_id, $overwrite_anonymity=FALSE, $sorted_order=FALSE, $suffix="")
Returns the full name of a test user according to the anonymity status.
_getLogLanguage()
retrieve the log language for assessment logging
global $ilDB
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeTestResultsByUserIds()

ilObjTest::removeTestResultsByUserIds (   $userIds)

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

References $ilDB, ilObject\$lng, getTestId(), and removeTestResultsByActiveIds().

3532  {
3533  global $ilDB, $lng;
3534 
3535  require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
3536  $participantData = new ilTestParticipantData($ilDB, $lng);
3537  $participantData->setUserIds($userIds);
3538  $participantData->load($this->getTestId());
3539 
3540  $IN_userIds = $ilDB->in('usr_id', $participantData->getUserIds(), false, 'integer');
3541  $ilDB->manipulateF("DELETE FROM usr_pref WHERE $IN_userIds AND keyword = %s",
3542  array('text'), array("tst_password_".$this->getTestId())
3543  );
3544 
3545  if( count($participantData->getActiveIds()) )
3546  {
3547  $this->removeTestResultsByActiveIds($participantData->getActiveIds());
3548  }
3549  }
getTestId()
Gets the database id of the additional test data.
global $ilDB
removeTestResultsByActiveIds($activeIds)
+ Here is the call graph for this function:

◆ removeTestResultsForUser()

ilObjTest::removeTestResultsForUser (   $user_id)

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

References $ilDB, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), _getUserIdFromActiveId(), ilUtil\delDir(), ilAssQuestionHintTracking\deleteRequestsByActiveIds(), getActiveIdOfUser(), getTestId(), isRandomTest(), logAction(), and userLookupFullName().

3606  {
3607  global $ilDB;
3608 
3609  $active_id = $this->getActiveIdOfUser($user_id);
3610 
3611  // remove the question from tst_solutions
3612  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_solutions WHERE active_fi = %s",
3613  array('integer'),
3614  array($active_id)
3615  );
3616  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_qst_solved WHERE active_fi = %s",
3617  array('integer'),
3618  array($active_id)
3619  );
3620  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_result WHERE active_fi = %s",
3621  array('integer'),
3622  array($active_id)
3623  );
3624  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_pass_result WHERE active_fi = %s",
3625  array('integer'),
3626  array($active_id)
3627  );
3628 
3629  if ($this->isRandomTest())
3630  {
3631  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_rnd_qst WHERE active_fi = %s",
3632  array('integer'),
3633  array($active_id)
3634  );
3635  }
3636 
3637  include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3639  {
3640  $this->logAction(sprintf($this->lng->txtlng("assessment", "log_selected_user_data_removed", ilObjAssessmentFolder::_getLogLanguage()), $this->userLookupFullName($this->_getUserIdFromActiveId($active_id))));
3641  }
3642 
3643  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_sequence WHERE active_fi = %s",
3644  array('integer'),
3645  array($active_id)
3646  );
3647 
3648  // remove test_active entry
3649  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_active WHERE active_id = %s",
3650  array('integer'),
3651  array($active_id)
3652  );
3653 
3654  // remove saved user password
3655  if ($user_id > 0)
3656  {
3657  $affectedRows = $ilDB->manipulateF("DELETE FROM usr_pref WHERE usr_id = %s AND keyword = %s",
3658  array('integer', 'text'),
3659  array($user_id, "tst_password_".$this->getTestId())
3660  );
3661  }
3662 
3663  // TODO: this shouldn't be here since it is question stuff and should be modular but there's no other solution yet
3664  // remove file uploads
3665  if (@is_dir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId() . "/$active_id"))
3666  {
3667  ilUtil::delDir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId() . "/$active_id");
3668  }
3669 
3670  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
3672  }
static _getUserIdFromActiveId($active_id)
logAction($logtext="", $question_id="")
Logs an action into the Test&Assessment log.
getTestId()
Gets the database id of the additional test data.
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
getActiveIdOfUser($user_id="", $anonymous_id="")
Gets the active id of a given user.
deleteRequestsByActiveIds($activeIds)
Deletes all hint requests relating to a testactive included in given active ids.
isRandomTest()
Returns the fact wether this test is a random questions test or not.
userLookupFullName($user_id, $overwrite_anonymity=FALSE, $sorted_order=FALSE, $suffix="")
Returns the full name of a test user according to the anonymity status.
_getLogLanguage()
retrieve the log language for assessment logging
global $ilDB
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ 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 private
See also
$author

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

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

Referenced by createMetaData(), and loadFromDb().

7178  {
7179  $md =& new ilMD($this->getId(), 0, $this->getType());
7180  $md_life =& $md->getLifecycle();
7181  if (!$md_life)
7182  {
7183  if (strlen($a_author) == 0)
7184  {
7185  global $ilUser;
7186  $a_author = $ilUser->getFullname();
7187  }
7188 
7189  $md_life =& $md->addLifecycle();
7190  $md_life->save();
7191  $con =& $md_life->addContribute();
7192  $con->setRole("Author");
7193  $con->save();
7194  $ent =& $con->addEntity();
7195  $ent->setEntity($a_author);
7196  $ent->save();
7197  }
7198  }
getId()
get object id public
getType()
get object type public
global $ilUser
Definition: imgupload.php:15
+ 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) private

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

References $ilDB, and getTestId().

9494  {
9495  global $ilDB;
9496 
9497  $affectedRows = $ilDB->manipulateF("UPDATE tst_tests SET certificate_visibility = %s, tstamp = %s WHERE test_id = %s",
9498  array('text', 'integer', 'integer'),
9499  array($a_value, time(), $this->getTestId())
9500  );
9501  }
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ 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 1217 of file class.ilObjTest.php.

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

Referenced by getMarkSchemaForeignId(), and insertQuestion().

1218  {
1219  global $ilDB;
1220 
1221  $complete = 0;
1222  if($this->isComplete($testQuestionSetConfig))
1223  {
1224  $complete = 1;
1225  }
1226  if($this->getTestId() > 0)
1227  {
1228  $ilDB->manipulateF(
1229  "UPDATE tst_tests SET complete = %s WHERE test_id = %s",
1230  array('text', 'integer'),
1231  array($complete, $this->test_id)
1232  );
1233  }
1234  }
getTestId()
Gets the database id of the additional test data.
global $ilDB
isComplete(ilTestQuestionSetConfig $testQuestionSetConfig)
Returns true, if a test is complete for use and can be set online.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveQuestionsToDb()

ilObjTest::saveQuestionsToDb ( )

Saves the test questions to the database.

public

See also
$questions

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

References $ilDB, $result, $row, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), getTestId(), and logAction().

Referenced by moveQuestions(), removeQuestion(), and saveToDb().

1635  {
1636  global $ilDB;
1637 
1638  $oldquestions = array();
1639  include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
1641  {
1642  $result = $ilDB->queryF("SELECT question_fi FROM tst_test_question WHERE test_fi = %s ORDER BY sequence",
1643  array('integer'),
1644  array($this->getTestId())
1645  );
1646  if ($result->numRows() > 0)
1647  {
1648  while ($row = $ilDB->fetchAssoc($result))
1649  {
1650  array_push($oldquestions, $row["question_fi"]);
1651  }
1652  }
1653  }
1654  // workaround for lost obligations
1655  // this method is called if a question is removed
1656  $currentQuestionsObligationsQuery = 'SELECT question_fi, obligatory FROM tst_test_question WHERE test_fi = %s';
1657  $rset = $ilDB->queryF($currentQuestionsObligationsQuery, array('integer'), array($this->getTestId()));
1658  while ($row = $ilDB->fetchAssoc($rset)) {
1659  $obligatoryQuestionState[$row['question_fi']] = $row['obligatory'];
1660  }
1661  // delete existing category relations
1662  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_question WHERE test_fi = %s",
1663  array('integer'),
1664  array($this->getTestId())
1665  );
1666  // create new category relations
1667  foreach ($this->questions as $key => $value)
1668  {
1669  // workaround for import witout obligations information
1670  if( !isset($obligatoryQuestionState[$value]) || is_null($obligatoryQuestionState[$value]) )
1671  {
1672  $obligatoryQuestionState[$value] = 0;
1673  }
1674 
1675  // insert question
1676  $next_id = $ilDB->nextId('tst_test_question');
1677  $ilDB->insert('tst_test_question', array(
1678  'test_question_id' => array('integer', $next_id),
1679  'test_fi' => array('integer', $this->getTestId()),
1680  'question_fi' => array('integer', $value),
1681  'sequence' => array('integer', $key),
1682  'obligatory' => array('integer', $obligatoryQuestionState[$value]),
1683  'tstamp' => array('integer', time())
1684  ));
1685  }
1686  include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
1688  {
1689  $result = $ilDB->queryF("SELECT question_fi FROM tst_test_question WHERE test_fi = %s ORDER BY sequence",
1690  array('integer'),
1691  array($this->getTestId())
1692  );
1693  $newquestions = array();
1694  if ($result->numRows() > 0)
1695  {
1696  while ($row = $ilDB->fetchAssoc($result))
1697  {
1698  array_push($newquestions, $row["question_fi"]);
1699  }
1700  }
1701  foreach ($oldquestions as $index => $question_id)
1702  {
1703  if (strcmp($newquestions[$index], $question_id) != 0)
1704  {
1705  $pos = array_search($question_id, $newquestions);
1706  if ($pos === FALSE)
1707  {
1708  $this->logAction($this->lng->txtlng("assessment", "log_question_removed", ilObjAssessmentFolder::_getLogLanguage()), $question_id);
1709  }
1710  else
1711  {
1712  $this->logAction($this->lng->txtlng("assessment", "log_question_position_changed", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($index+1) . " => " . ($pos+1), $question_id);
1713  }
1714  }
1715  }
1716  foreach ($newquestions as $index => $question_id)
1717  {
1718  if (array_search($question_id, $oldquestions) === FALSE)
1719  {
1720  $this->logAction($this->lng->txtlng("assessment", "log_question_added", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($index+1), $question_id);
1721  }
1722  }
1723  }
1724  }
logAction($logtext="", $question_id="")
Logs an action into the Test&Assessment log.
$result
getTestId()
Gets the database id of the additional test data.
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
_getLogLanguage()
retrieve the log language for assessment logging
global $ilDB
+ 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 1271 of file class.ilObjTest.php.

References $ilDB, ilObject\$ilias, $result, $row, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilRTE\_replaceMediaObjectImageSrc(), areObligationsEnabled(), cleanupMediaobjectUsage(), 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(), 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(), getPassScoring(), 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(), isComplete(), isEndingTimeEnabled(), PEAR\isError(), isInstantFeedbackAnswerFixationEnabled(), isIntroductionEnabled(), isLimitUsersEnabled(), isOfferingQuestionHintsEnabled(), isOnline(), isPassDeletionAllowed(), isPasswordEnabled(), isShowExamIdInTestPassEnabled(), isShowExamIdInTestResultsEnabled(), isShowGradingMarkEnabled(), isShowGradingStatusEnabled(), isSkillServiceEnabled(), isStartingTimeEnabled(), isTestFinalBroken(), logAction(), saveQuestionsToDb(), ilObjectActivation\setTimingType(), ilObjectActivation\TIMINGS_ACTIVATION, and ilObjectActivation\TIMINGS_DEACTIVATED.

Referenced by applyDefaults(), and fromXML().

1272  {
1273  global $tree, $ilDB, $ilPluginAdmin;
1274 
1275  // moved online_status to ilObjectActivation (see below)
1276 
1277  // cleanup RTE images
1278  $this->cleanupMediaobjectUsage();
1279 
1280  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
1281  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this);
1282  $testQuestionSetConfig = $testQuestionSetConfigFactory->getQuestionSetConfig();
1283 
1284  include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
1285  if ($this->test_id == -1)
1286  {
1287  // Create new dataset
1288  $next_id = $ilDB->nextId('tst_tests');
1289 
1290  $ilDB->insert('tst_tests', array(
1291  'test_id' => array('integer', $next_id),
1292  'obj_fi' => array('integer', $this->getId()),
1293  'author' => array('text', $this->getAuthor()),
1294  'intro_enabled' => array('integer', (int)$this->isIntroductionEnabled()),
1295  'introduction' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getIntroduction(), 0)),
1296  'finalstatement' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getFinalStatement(), 0)),
1297  'showinfo' => array('integer', $this->getShowInfo()),
1298  'forcejs' => array('integer', $this->getForceJS()),
1299  'customstyle' => array('text', $this->getCustomStyle()),
1300  'showfinalstatement' => array('integer', $this->getShowFinalStatement()),
1301  'sequence_settings' => array('integer', $this->getSequenceSettings()),
1302  'score_reporting' => array('integer', $this->getScoreReporting()),
1303  'instant_verification' => array('text', $this->getInstantFeedbackSolution()),
1304  'answer_feedback_points' => array('text', $this->getAnswerFeedbackPoints()),
1305  'answer_feedback' => array('text', $this->getAnswerFeedback()),
1306  'anonymity' => array('text', $this->getAnonymity()),
1307  'show_cancel' => array('text', $this->getShowCancel()),
1308  'show_marker' => array('integer', $this->getShowMarker()),
1309  'fixed_participants' => array('text', $this->getFixedParticipants()),
1310  'nr_of_tries' => array('integer', $this->getNrOfTries()),
1311  'kiosk' => array('integer', $this->getKiosk()),
1312  'use_previous_answers' => array('text', $this->getUsePreviousAnswers()),
1313  'title_output' => array('text', $this->getTitleOutput()),
1314  'processing_time' => array('text', $this->getProcessingTime()),
1315  'enable_processing_time' => array('text', $this->getEnableProcessingTime()),
1316  'reset_processing_time' => array('integer', $this->getResetProcessingTime()),
1317  'reporting_date' => array('text', $this->getReportingDate()),
1318  'starting_time_enabled' => array('integer', $this->isStartingTimeEnabled()),
1319  'starting_time' => array('text', $this->getStartingTime()),
1320  'ending_time_enabled' => array('integer', $this->isEndingTimeEnabled()),
1321  'ending_time' => array('text', $this->getEndingTime()),
1322  'complete' => array('text', $this->isComplete($testQuestionSetConfig)),
1323  'ects_output' => array('text', $this->getECTSOutput()),
1324  'ects_a' => array('float', strlen($this->ects_grades["A"]) ? $this->ects_grades["A"] : NULL),
1325  'ects_b' => array('float', strlen($this->ects_grades["B"]) ? $this->ects_grades["B"] : NULL),
1326  'ects_c' => array('float', strlen($this->ects_grades["C"]) ? $this->ects_grades["C"] : NULL),
1327  'ects_d' => array('float', strlen($this->ects_grades["D"]) ? $this->ects_grades["D"] : NULL),
1328  'ects_e' => array('float', strlen($this->ects_grades["E"]) ? $this->ects_grades["E"] : NULL),
1329  'ects_fx' => array('float', $this->getECTSFX()),
1330  'count_system' => array('text', $this->getCountSystem()),
1331  'mc_scoring' => array('text', $this->getMCScoring()),
1332  'score_cutting' => array('text', $this->getScoreCutting()),
1333  'pass_scoring' => array('text', $this->getPassScoring()),
1334  'shuffle_questions' => array('text', $this->getShuffleQuestions()),
1335  'results_presentation' => array('integer', $this->getResultsPresentation()),
1336  'show_summary' => array('integer', $this->getListOfQuestionsSettings()),
1337  'password_enabled' => array('integer', (int)$this->isPasswordEnabled()),
1338  'password' => array('text', $this->getPassword()),
1339  'limit_users_enabled' => array('integer', (int)$this->isLimitUsersEnabled()),
1340  'allowedusers' => array('integer', $this->getAllowedUsers()),
1341  'alloweduserstimegap' => array('integer', $this->getAllowedUsersTimeGap()),
1342  'mailnottype' => array('integer', $this->getMailNotificationType()),
1343  'exportsettings' => array('integer', $this->getExportSettings()),
1344  'certificate_visibility' => array('text', $this->getCertificateVisibility()),
1345  'mailnotification' => array('integer', $this->getMailNotification()),
1346  'created' => array('integer', time()),
1347  'tstamp' => array('integer', time()),
1348  'enabled_view_mode' => array('text', $this->getEnabledViewMode()),
1349  'template_id' => array('integer', $this->getTemplate()),
1350  'pool_usage' => array('integer', $this->getPoolUsage()),
1351  'print_bs_with_res' => array('integer', (int)$this->isBestSolutionPrintedWithResult()),
1352  'obligations_enabled' => array('integer', (int)$this->areObligationsEnabled()),
1353  'offer_question_hints' => array('integer', (int)$this->isOfferingQuestionHintsEnabled()),
1354  'highscore_enabled' => array('integer', (int)$this->getHighscoreEnabled()),
1355  'highscore_anon' => array('integer', (int)$this->getHighscoreAnon()),
1356  'highscore_achieved_ts' => array('integer', (int)$this->getHighscoreAchievedTS()),
1357  'highscore_score' => array('integer', (int)$this->getHighscoreScore()),
1358  'highscore_percentage' => array('integer', (int)$this->getHighscorePercentage()),
1359  'highscore_hints' => array('integer', (int)$this->getHighscoreHints()),
1360  'highscore_wtime' => array('integer', (int)$this->getHighscoreWTime()),
1361  'highscore_own_table' => array('integer', (int)$this->getHighscoreOwnTable()),
1362  'highscore_top_table' => array('integer', (int)$this->getHighscoreTopTable()),
1363  'highscore_top_num' => array('integer', (int)$this->getHighscoreTopNum()),
1364  'online_status' => array('integer', (int)$this->isOnline()),
1365  'specific_feedback' => array('integer', (int)$this->getSpecificAnswerFeedback()),
1366  'autosave' => array('integer', (int)$this->getAutosave()),
1367  'autosave_ival' => array('integer', (int)$this->getAutosaveIval()),
1368  'pass_deletion_allowed' => array('integer', (int)$this->isPassDeletionAllowed()),
1369  'enable_examview' => array('integer', (int)$this->getEnableExamview()),
1370  'show_examview_html' => array('integer', (int)$this->getShowExamviewHtml()),
1371  'show_examview_pdf' => array('integer', (int)$this->getShowExamviewPdf()),
1372  'redirection_mode' => array('integer', (int)$this->getRedirectionMode()),
1373  'redirection_url' => array('text', (string)$this->getRedirectionUrl()),
1374  'enable_archiving' => array('integer', (int)$this->getEnableArchiving()),
1375  'examid_in_test_pass' => array('integer', (int)$this->isShowExamIdInTestPassEnabled()),
1376  'examid_in_test_res' => array('integer', (int)$this->isShowExamIdInTestResultsEnabled()),
1377  'sign_submission' => array('integer', (int)$this->getSignSubmission()),
1378  'question_set_type' => array('text', $this->getQuestionSetType()),
1379  'char_selector_availability' => array('integer', (int)$this->getCharSelectorAvailability()),
1380  'char_selector_definition' => array('text', (string)$this->getCharSelectorDefinition()),
1381  'skill_service' => array('integer', (int)$this->isSkillServiceEnabled()),
1382  'result_tax_filters' => array('text', serialize((array)$this->getResultFilterTaxIds())),
1383  'show_grading_status' => array('integer', (int)$this->isShowGradingStatusEnabled()),
1384  'show_grading_mark' => array('integer', (int)$this->isShowGradingMarkEnabled()),
1385  'inst_fb_answer_fixation' => array('integer', (int)$this->isInstantFeedbackAnswerFixationEnabled()),
1386  'broken' => array('integer', (int)$this->isTestFinalBroken())
1387  ));
1388 
1389  $this->test_id = $next_id;
1390 
1392  {
1393  $this->logAction($this->lng->txtlng("assessment", "log_create_new_test", ilObjAssessmentFolder::_getLogLanguage()));
1394  }
1395  }
1396  else
1397  {
1398  // Modify existing dataset
1399  $oldrow = array();
1401  {
1402  $result = $ilDB->queryF("SELECT * FROM tst_tests WHERE test_id = %s",
1403  array('integer'),
1404  array($this->test_id)
1405  );
1406  if ($result->numRows() == 1)
1407  {
1408  $oldrow = $ilDB->fetchAssoc($result);
1409  }
1410  }
1411 
1412  $ilDB->update('tst_tests',
1413  array(
1414  'author' => array('text', $this->getAuthor()),
1415  'intro_enabled' => array('integer', (int)$this->isIntroductionEnabled()),
1416  'introduction' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getIntroduction(), 0)),
1417  'finalstatement' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getFinalStatement(), 0)),
1418  'showinfo' => array('integer', $this->getShowInfo()),
1419  'forcejs' => array('integer', $this->getForceJS()),
1420  'customstyle' => array('text', $this->getCustomStyle()),
1421  'showfinalstatement' => array('integer', $this->getShowFinalStatement()),
1422  'sequence_settings' => array('integer', $this->getSequenceSettings()),
1423  'score_reporting' => array('integer', $this->getScoreReporting()),
1424  'instant_verification' => array('text', $this->getInstantFeedbackSolution()),
1425  'answer_feedback_points' => array('text', $this->getAnswerFeedbackPoints()),
1426  'answer_feedback' => array('text', $this->getGenericAnswerFeedback()),
1427  'anonymity' => array('text', $this->getAnonymity()),
1428  'show_cancel' => array('text', $this->getShowCancel()),
1429  'show_marker' => array('integer', $this->getShowMarker()),
1430  'fixed_participants' => array('text', $this->getFixedParticipants()),
1431  'nr_of_tries' => array('integer', $this->getNrOfTries()),
1432  'kiosk' => array('integer', $this->getKiosk()),
1433  'use_previous_answers' => array('text', $this->getUsePreviousAnswers()),
1434  'title_output' => array('text', $this->getTitleOutput()),
1435  'processing_time' => array('text', $this->getProcessingTime()),
1436  'enable_processing_time' => array('text', $this->getEnableProcessingTime()),
1437  'reset_processing_time' => array('integer', $this->getResetProcessingTime()),
1438  'reporting_date' => array('text', $this->getReportingDate()),
1439  'starting_time_enabled' => array('integer', $this->isStartingTimeEnabled()),
1440  'starting_time' => array('text', $this->getStartingTime()),
1441  'ending_time_enabled' => array('integer', $this->isEndingTimeEnabled()),
1442  'ending_time' => array('text', $this->getEndingTime()),
1443  'complete' => array('text', $this->isComplete($testQuestionSetConfig)),
1444  'ects_output' => array('text', $this->getECTSOutput()),
1445  'ects_a' => array('float', strlen($this->ects_grades["A"]) ? $this->ects_grades["A"] : NULL),
1446  'ects_b' => array('float', strlen($this->ects_grades["B"]) ? $this->ects_grades["B"] : NULL),
1447  'ects_c' => array('float', strlen($this->ects_grades["C"]) ? $this->ects_grades["C"] : NULL),
1448  'ects_d' => array('float', strlen($this->ects_grades["D"]) ? $this->ects_grades["D"] : NULL),
1449  'ects_e' => array('float', strlen($this->ects_grades["E"]) ? $this->ects_grades["E"] : NULL),
1450  'ects_fx' => array('float', $this->getECTSFX()),
1451  'count_system' => array('text', $this->getCountSystem()),
1452  'mc_scoring' => array('text', $this->getMCScoring()),
1453  'score_cutting' => array('text', $this->getScoreCutting()),
1454  'pass_scoring' => array('text', $this->getPassScoring()),
1455  'shuffle_questions' => array('text', $this->getShuffleQuestions()),
1456  'results_presentation' => array('integer', $this->getResultsPresentation()),
1457  'show_summary' => array('integer', $this->getListOfQuestionsSettings()),
1458  'password_enabled' => array('integer', (int)$this->isPasswordEnabled()),
1459  'password' => array('text', $this->getPassword()),
1460  'limit_users_enabled' => array('integer', (int)$this->isLimitUsersEnabled()),
1461  'allowedusers' => array('integer', $this->getAllowedUsers()),
1462  'alloweduserstimegap' => array('integer', $this->getAllowedUsersTimeGap()),
1463  'mailnottype' => array('integer', $this->getMailNotificationType()),
1464  'exportsettings' => array('integer', $this->getExportSettings()),
1465  'certificate_visibility' => array('text', $this->getCertificateVisibility()),
1466  'mailnotification' => array('integer', $this->getMailNotification()),
1467  'tstamp' => array('integer', time()),
1468  'enabled_view_mode' => array('text', $this->getEnabledViewMode()),
1469  'template_id' => array('integer', $this->getTemplate()),
1470  'pool_usage' => array('integer', $this->getPoolUsage()),
1471  'print_bs_with_res' => array('integer', (int)$this->isBestSolutionPrintedWithResult()),
1472  'obligations_enabled' => array('integer', (int)$this->areObligationsEnabled()),
1473  'offer_question_hints' => array('integer', (int)$this->isOfferingQuestionHintsEnabled()),
1474  'highscore_enabled' => array('integer', (int)$this->getHighscoreEnabled()),
1475  'highscore_anon' => array('integer', (int)$this->getHighscoreAnon()),
1476  'highscore_achieved_ts' => array('integer', (int)$this->getHighscoreAchievedTS()),
1477  'highscore_score' => array('integer', (int)$this->getHighscoreScore()),
1478  'highscore_percentage' => array('integer', (int)$this->getHighscorePercentage()),
1479  'highscore_hints' => array('integer', (int)$this->getHighscoreHints()),
1480  'highscore_wtime' => array('integer', (int)$this->getHighscoreWTime()),
1481  'highscore_own_table' => array('integer', (int)$this->getHighscoreOwnTable()),
1482  'highscore_top_table' => array('integer', (int)$this->getHighscoreTopTable()),
1483  'highscore_top_num' => array('integer', (int)$this->getHighscoreTopNum()),
1484  'online_status' => array('integer', (int)$this->isOnline()),
1485  'specific_feedback' => array('integer', (int)$this->getSpecificAnswerFeedback()),
1486  'autosave' => array('integer', (int)$this->getAutosave()),
1487  'autosave_ival' => array('integer', (int)$this->getAutosaveIval()),
1488  'pass_deletion_allowed' => array('integer', (int)$this->isPassDeletionAllowed()),
1489  'enable_examview' => array('integer', (int)$this->getEnableExamview()),
1490  'show_examview_html' => array('integer', (int)$this->getShowExamviewHtml()),
1491  'show_examview_pdf' => array('integer', (int)$this->getShowExamviewPdf()),
1492  'redirection_mode' => array('integer', (int)$this->getRedirectionMode()),
1493  'redirection_url' => array('text', (string)$this->getRedirectionUrl()),
1494  'enable_archiving' => array('integer', (int)$this->getEnableArchiving()),
1495  'examid_in_test_pass' => array('integer', (int)$this->isShowExamIdInTestPassEnabled()),
1496  'examid_in_test_res' => array('integer', (int)$this->isShowExamIdInTestResultsEnabled()),
1497  'sign_submission' => array('integer', (int)$this->getSignSubmission()),
1498  'question_set_type' => array('text', $this->getQuestionSetType()),
1499  'char_selector_availability' => array('integer', (int)$this->getCharSelectorAvailability()),
1500  'char_selector_definition' => array('text', (string)$this->getCharSelectorDefinition()),
1501  'skill_service' => array('integer', (int)$this->isSkillServiceEnabled()),
1502  'result_tax_filters' => array('text', serialize((array)$this->getResultFilterTaxIds())),
1503  'show_grading_status' => array('integer', (int)$this->isShowGradingStatusEnabled()),
1504  'show_grading_mark' => array('integer', (int)$this->isShowGradingMarkEnabled()),
1505  'inst_fb_answer_fixation' => array('integer', (int)$this->isInstantFeedbackAnswerFixationEnabled()),
1506  'broken' => array('integer', (int)$this->isTestFinalBroken())
1507  ),
1508  array(
1509  'test_id' => array('integer', (int)$this->getTestId())
1510  )
1511  );
1512 
1513  include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
1515  {
1516  $logresult = $ilDB->queryF("SELECT * FROM tst_tests WHERE test_id = %s",
1517  array('integer'),
1518  array($this->getTestId())
1519  );
1520  $newrow = array();
1521  if ($logresult->numRows() == 1)
1522  {
1523  $newrow = $ilDB->fetchAssoc($logresult);
1524  }
1525  $changed_fields = array();
1526  foreach ($oldrow as $key => $value)
1527  {
1528  if (strcmp($oldrow[$key], $newrow[$key]) != 0)
1529  {
1530  array_push($changed_fields, "$key: " . $oldrow[$key] . " => " . $newrow[$key]);
1531  }
1532  }
1533  $changes = join($changed_fields, ", ");
1534  if (count($changed_fields) > 0)
1535  {
1536  $this->logAction($this->lng->txtlng("assessment", "log_modified_test", ilObjAssessmentFolder::_getLogLanguage()) . " [".$changes."]");
1537  }
1538  }
1539  if ($this->evalTotalPersons() > 0)
1540  {
1541  // reset the finished status of participants if the nr of test passes did change
1542  if ($this->getNrOfTries() > 0)
1543  {
1544  // set all unfinished tests with nr of passes >= allowed passes finished
1545  $aresult = $ilDB->queryF("SELECT active_id FROM tst_active WHERE test_fi = %s AND tries >= %s AND submitted = %s",
1546  array('integer', 'integer', 'integer'),
1547  array($this->getTestId(), $this->getNrOfTries(), 0)
1548  );
1549  while ($row = $ilDB->fetchAssoc($aresult))
1550  {
1551  $ilDB->manipulateF("UPDATE tst_active SET submitted = %s, submittimestamp = %s WHERE active_id = %s",
1552  array('integer', 'timestamp', 'integer'),
1553  array(1, date('Y-m-d H:i:s'), $row["active_id"])
1554  );
1555  }
1556 
1557  // set all finished tests with nr of passes < allowed passes not finished
1558  $aresult = $ilDB->queryF("SELECT active_id FROM tst_active WHERE test_fi = %s AND tries < %s AND submitted = %s",
1559  array('integer', 'integer', 'integer'),
1560  array($this->getTestId(), $this->getNrOfTries()-1, 1)
1561  );
1562  while ($row = $ilDB->fetchAssoc($aresult))
1563  {
1564  $ilDB->manipulateF("UPDATE tst_active SET submitted = %s, submittimestamp = %s WHERE active_id = %s",
1565  array('integer', 'timestamp', 'integer'),
1566  array(0, NULL, $row["active_id"])
1567  );
1568  }
1569  }
1570  else
1571  {
1572  // set all finished tests with nr of passes >= allowed passes not finished
1573  $aresult = $ilDB->queryF("SELECT active_id FROM tst_active WHERE test_fi = %s AND submitted = %s",
1574  array('integer', 'integer'),
1575  array($this->getTestId(), 1)
1576  );
1577  while ($row = $ilDB->fetchAssoc($aresult))
1578  {
1579  $ilDB->manipulateF("UPDATE tst_active SET submitted = %s, submittimestamp = %s WHERE active_id = %s",
1580  array('integer', 'timestamp', 'integer'),
1581  array(0, NULL, $row["active_id"])
1582  );
1583  }
1584  }
1585  }
1586  }
1587 
1588  // moved activation to ilObjectActivation
1589  if($this->ref_id)
1590  {
1591  include_once "./Services/Object/classes/class.ilObjectActivation.php";
1592  ilObjectActivation::getItem($this->ref_id);
1593 
1594  $item = new ilObjectActivation;
1595  if(!$this->isActivationLimited())
1596  {
1598  }
1599  else
1600  {
1601  $item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);
1602  $item->setTimingStart($this->getActivationStartingTime());
1603  $item->setTimingEnd($this->getActivationEndingTime());
1604  $item->toggleVisible($this->getActivationVisibility());
1605  }
1606 
1607  $item->update($this->ref_id);
1608  }
1609 
1610  if (!$properties_only)
1611  {
1612  if (PEAR::isError($result))
1613  {
1614  global $ilias;
1615  $ilias->raiseError($result->getMessage());
1616  }
1617  else
1618  {
1619  if ($this->getQuestionSetType() == self::QUESTION_SET_TYPE_FIXED)
1620  {
1621  $this->saveQuestionsToDb();
1622  }
1623  $this->mark_schema->saveToDb($this->test_id);
1624  }
1625  }
1626  }
getScoreReporting()
Gets the score reporting of the ilObjTest object.
getHighscoreOwnTable()
Gets if the own rankings table should be shown.
getECTSOutput()
{int|bool}
getFixedParticipants()
Returns the fixed participants status.
getReportingDate()
Gets the reporting date of the ilObjTest object.
getCustomStyle()
Get the custom style.
getResultsPresentation()
Returns the combined results presentation value.
logAction($logtext="", $question_id="")
Logs an action into the Test&Assessment log.
isPassDeletionAllowed()
getter for the test setting passDeletionAllowed
isShowExamIdInTestPassEnabled()
$result
getMailNotification()
Get mail notification settings.
getEnableProcessingTime()
Returns the state of the processing time (enabled/disabled)
getCertificateVisibility()
Returns the visibility settings of the certificate.
getHighscoreAchievedTS()
Returns if date and time of the scores achievement should be displayed.
getTestId()
Gets the database id of the additional test data.
static getItem($a_ref_id)
Get item data.
getListOfQuestionsSettings()
Returns the settings for the list of questions options in the test properties This could contain one ...
getShowInfo()
Gets whether the complete information page is shown or the required data only.
getAnonymity()
Returns the anonymity status of the test.
getShuffleQuestions()
Returns the status of the shuffle_questions variable.
isShowExamIdInTestResultsEnabled()
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
getHighscoreWTime()
Gets if the column with the workingtime should be shown.
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...
getHighscoreTopTable()
Gets, if the top-rankings table should be shown.
areObligationsEnabled()
returns the fact wether obligations are enabled or not
getSequenceSettings()
SEQUENCE SETTING = POSTPONING ENABLED !!
getHighscorePercentage()
Gets if the percentage column should be shown.
getCountSystem()
Gets the count system for the calculation of points.
getIntroduction()
Gets the introduction text of the ilObjTest object.
getHighscoreHints()
Gets, if the column with the number of requested hints should be shown.
getResetProcessingTime()
Returns wheather the processing time should be reset or not.
getHighscoreAnon()
Gets if the highscores should be anonymized per setting.
getId()
get object id public
evalTotalPersons()
Returns the number of persons who started the test.
getShowMarker()
Returns wheather the marker button is shown or not.
getAnswerFeedback()
Returns 1 if generic answer feedback is activated.
getTitleOutput()
Returns the value of the title_output status.
getAuthor()
Gets the authors name of the ilObjTest object.
getUsePreviousAnswers()
Returns if the previous answers should be shown for a learner.
getShowFinalStatement()
Returns whether the final statement should be shown or not.
getProcessingTime()
Returns the processing time for the test.
isOfferingQuestionHintsEnabled()
returns the fact wether offering hints is enabled or not
isBestSolutionPrintedWithResult()
getAnswerFeedbackPoints()
Returns 1 if answer specific feedback as reached points is activated.
getStartingTime()
Returns the starting time of the test.
getInstantFeedbackSolution()
Returns 1 if the correct solution will be shown after answering a question.
_getLogLanguage()
retrieve the log language for assessment logging
getFinalStatement()
Gets the final statement.
setTimingType($a_type)
Set timing type.
isInstantFeedbackAnswerFixationEnabled()
getPassword()
Returns the password for test access.
getNrOfTries()
Returns the nr of tries for the test.
getQuestionSetType()
getter for question set type
getGenericAnswerFeedback()
Returns 1 if generic answer feedback is to be shown.
getEndingTime()
Returns the ending time of the test.
getScoreCutting()
Determines if the score of a question should be cut at 0 points or the score of the whole test...
cleanupMediaobjectUsage()
Cleans up the media objects for all text fields in a test which are using an RTE field.
global $ilDB
getECTSFX()
{float|null}
getShowCancel()
Returns wheather the cancel test button is shown or not.
getHighscoreScore()
Gets if the score column should be shown.
saveQuestionsToDb()
Saves the test questions to the database.
getMCScoring()
Gets the scoring type for multiple choice questions.
getHighscoreEnabled()
Gets the setting which determines if the highscore feature is enabled.
getKiosk()
Returns the kiosk mode.
getForceJS()
Gets whether JavaScript should be forced for tests.
Class ilObjectActivation.
isComplete(ilTestQuestionSetConfig $testQuestionSetConfig)
Returns true, if a test is complete for use and can be set online.
getHighscoreTopNum($a_retval=10)
Gets the number of entries which are to be shown in the top-rankings table.
isError($data, $code=null)
Tell whether a value is a PEAR error.
Definition: PEAR.php:279
getPassScoring()
Gets the pass scoring type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendAdvancedNotification()

ilObjTest::sendAdvancedNotification (   $active_id)

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

References $file, _getUserIdFromActiveId(), ilObject\getOwner(), ilObject\getTitle(), and userLookupFullName().

10688  {
10689  include_once "./Modules/Test/classes/class.ilTestMailNotification.php";
10690 
10691  $mail = new ilTestMailNotification();
10692  $owner_id = $this->getOwner();
10693  $usr_data = $this->userLookupFullName(ilObjTest::_getUserIdFromActiveId($active_id));
10694 
10695  include_once "./Modules/Test/classes/class.ilTestExport.php";
10696  $exportObj = new ilTestExport($this, "results");
10697  $file = $exportObj->exportToExcel($deliver = FALSE, 'active_id', $active_id, $passedonly = FALSE);
10698  include_once "./Services/Mail/classes/class.ilFileDataMail.php";
10699  $fd = new ilFileDataMail(ANONYMOUS_USER_ID);
10700  $fd->copyAttachmentFile($file, "result_" . $active_id . ".xls");
10701  $file_names[] = "result_" . $active_id . ".xls";
10702 
10703  $mail->sendAdvancedNotification($owner_id, $this->getTitle(), $usr_data, $file_names);
10704 
10705  if(count($file_names))
10706  {
10707  $fd->unlinkFiles($file_names);
10708  unset($fd);
10709  @unlink($file);
10710  }
10711  }
static _getUserIdFromActiveId($active_id)
print $file
This class handles all operations on files (attachments) in directory ilias_data/mail.
Class ilTestMailNotification.
Export class for tests.
getOwner()
get object owner
getTitle()
get object title public
userLookupFullName($user_id, $overwrite_anonymity=FALSE, $sorted_order=FALSE, $suffix="")
Returns the full name of a test user according to the anonymity status.
+ Here is the call graph for this function:

◆ sendSimpleNotification()

ilObjTest::sendSimpleNotification (   $active_id)

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

References _getUserIdFromActiveId(), ilObject\getOwner(), ilObject\getTitle(), and userLookupFullName().

10665  {
10666  include_once "./Modules/Test/classes/class.ilTestMailNotification.php";
10667 
10668  $mail = new ilTestMailNotification();
10669  $owner_id = $this->getOwner();
10670  $usr_data = $this->userLookupFullName(ilObjTest::_getUserIdFromActiveId($active_id));
10671  $mail->sendSimpleNotification($owner_id, $this->getTitle(), $usr_data);
10672  }
static _getUserIdFromActiveId($active_id)
Class ilTestMailNotification.
getOwner()
get object owner
getTitle()
get object title public
userLookupFullName($user_id, $overwrite_anonymity=FALSE, $sorted_order=FALSE, $suffix="")
Returns the full name of a test user according to the anonymity status.
+ Here is the call graph for this function:

◆ setActivationEndingTime()

ilObjTest::setActivationEndingTime (   $ending_time = NULL)

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

References $ending_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11696  {
11697  $this->activation_ending_time = $ending_time;
11698  }
+ Here is the caller graph for this function:

◆ setActivationLimited()

ilObjTest::setActivationLimited (   $a_value)

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11172  {
11173  $this->activation_limited = (bool)$a_value;
11174  }
+ Here is the caller graph for this function:

◆ setActivationStartingTime()

ilObjTest::setActivationStartingTime (   $starting_time = NULL)

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

References $starting_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11691  {
11692  $this->activation_starting_time = $starting_time;
11693  }
+ Here is the caller graph for this function:

◆ setActivationVisibility()

ilObjTest::setActivationVisibility (   $a_value)

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11157  {
11158  $this->activation_visibility = (bool) $a_value;
11159  }
+ Here is the caller graph for this function:

◆ setAllowedUsers()

ilObjTest::setAllowedUsers (   $a_allowed_users)

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

9310  {
9311  $this->allowedUsers = $a_allowed_users;
9312  }
+ Here is the caller graph for this function:

◆ setAllowedUsersTimeGap()

ilObjTest::setAllowedUsersTimeGap (   $a_allowed_users_time_gap)

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

9320  {
9321  $this->allowedUsersTimeGap = $a_allowed_users_time_gap;
9322  }
+ 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) public

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

9543  {
9544  switch ($a_value)
9545  {
9546  case 1:
9547  $this->anonymity = 1;
9548  break;
9549  default:
9550  $this->anonymity = 0;
9551  break;
9552  }
9553  }
+ Here is the caller graph for this function:

◆ setAnswerFeedback()

ilObjTest::setAnswerFeedback (   $answer_feedback = 0)

Sets the generic feedback for the test Use setGenericAnswerFeedback instead.

Parameters
integer$answer_feedbackIf 1, answer specific feedback will be shown after answering a question public
See also
$answer_feedback

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

2433 {
2434  switch ($answer_feedback)
2435  {
2436  case 1:
2437  $this->answer_feedback = 1;
2438  break;
2439  default:
2440  $this->answer_feedback = 0;
2441  break;
2442  }
2443 }
+ 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 public
See also
$answer_feedback_points

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

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setScoringFeedbackOptionsByArray().

2472  {
2473  switch ($answer_feedback_points)
2474  {
2475  case 1:
2476  $this->answer_feedback_points = 1;
2477  break;
2478  default:
2479  $this->answer_feedback_points = 0;
2480  break;
2481  }
2482  }
+ 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 public
See also
$author

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

References $author.

Referenced by fromXML(), and loadFromDb().

7164  {
7165  $this->author = $author;
7166  }
+ Here is the caller graph for this function:

◆ setAutosave()

ilObjTest::setAutosave (   $autosave)

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

References $autosave.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11600  {
11601  $this->autosave = $autosave;
11602  }
+ Here is the caller graph for this function:

◆ setAutosaveIval()

ilObjTest::setAutosaveIval (   $autosave_ival)

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

References $autosave_ival.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11610  {
11611  $this->autosave_ival = $autosave_ival;
11612  }
+ 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) public

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

Referenced by loadFromDb().

9521  {
9522  $this->certificate_visibility = $a_value;
9523  }
+ Here is the caller graph for this function:

◆ setCharSelectorAvailability()

ilObjTest::setCharSelectorAvailability (   $availability)
Parameters
intavailability of the special character selector

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11942  {
11943  $this->char_selector_availability = (int) $availability;
11944  }
+ Here is the caller graph for this function:

◆ setCharSelectorDefinition()

ilObjTest::setCharSelectorDefinition (   $definition = '')
Parameters
stringdefinition of the special character selector

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11958  {
11959  $this->char_selector_definition = $definition;
11960  }
+ Here is the caller graph for this function:

◆ setClientIP()

ilObjTest::setClientIP (   $user_id,
  $client_ip 
)

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

References $ilDB, and getTestId().

7961  {
7962  global $ilDB;
7963 
7964  $affectedRows = $ilDB->manipulateF("UPDATE tst_invited_user SET clientip = %s, tstamp = %s WHERE test_fi=%s and user_fi=%s",
7965  array('text', 'integer', 'integer', 'integer'),
7966  array((strlen($client_ip)) ? $client_ip : NULL, time(), $this->getTestId(), $user_id)
7967  );
7968  }
getTestId()
Gets the database id of the additional test data.
global $ilDB
+ 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. public
See also
$count_system

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3297  {
3298  $this->count_system = $a_count_system;
3299  }
+ Here is the caller graph for this function:

◆ setCustomStyle()

ilObjTest::setCustomStyle (   $a_customStyle = NULL)

Set the custom style.

Parameters
string$a_customStyleThe custom style public
See also
$_customStyle

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

2161  {
2162  $this->_customStyle = $a_customStyle;
2163  }
+ Here is the caller graph for this function:

◆ setECTSFX()

ilObjTest::setECTSFX (   $a_ects_fx)

{

Parameters
float | null$ects_fx
}

Implements ilEctsGradesEnabled.

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

Referenced by _isComplete(), applyDefaults(), and loadFromDb().

2337  {
2338  $this->ects_fx = $a_ects_fx;
2339  }
+ Here is the caller graph for this function:

◆ setECTSGrades()

ilObjTest::setECTSGrades ( array  $a_ects_grades)

{

Parameters
array$grades
}

Implements ilEctsGradesEnabled.

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

Referenced by applyDefaults(), and loadFromDb().

2353  {
2354  $this->ects_grades = $a_ects_grades;
2355  }
+ Here is the caller graph for this function:

◆ setECTSOutput()

ilObjTest::setECTSOutput (   $a_ects_output)

{

Parameters
int | bool$status
}

Implements ilEctsGradesEnabled.

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

Referenced by applyDefaults(), loadFromDb(), and setReportingDate().

2321  {
2322  $this->ects_output = $a_ects_output ? 1 : 0;
2323  }
+ Here is the caller graph for this function:

◆ setEnableArchiving()

ilObjTest::setEnableArchiving (   $enable_archiving)
Parameters
boolean$enable_archiving
Returns
$this

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

References $enable_archiving.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11813  {
11814  $this->enable_archiving = $enable_archiving;
11815  return $this;
11816  }
+ Here is the caller graph for this function:

◆ setEnabledViewMode()

ilObjTest::setEnabledViewMode (   $mode)

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

Referenced by loadFromDb().

10893  {
10894  $this->enabled_view_mode = $mode;
10895  }
+ Here is the caller graph for this function:

◆ setEnableExamview()

ilObjTest::setEnableExamview (   $enable_examview)
Parameters
boolean$enable_examview

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

References $enable_examview.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11676  {
11677  $this->enable_examview = $enable_examview;
11678  }
+ 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 public
See also
$processing_time

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3262  {
3263  if ($enable) {
3264  $this->enable_processing_time = "1";
3265  } else {
3266  $this->enable_processing_time = "0";
3267  }
3268  }
+ 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. public
See also
$ending_time

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

References $ending_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3162  {
3163  $this->ending_time = $ending_time;
3164  }
+ Here is the caller graph for this function:

◆ setEndingTimeEnabled()

ilObjTest::setEndingTimeEnabled (   $ending_time_enabled)
Parameters
boolean$ending_time_enabled

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

References $ending_time_enabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3138  {
3139  $this->ending_time_enabled = $ending_time_enabled;
3140  }
+ Here is the caller graph for this function:

◆ setExportSettings()

ilObjTest::setExportSettings (   $a_settings)

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

10851  {
10852  if ($a_settings)
10853  {
10854  $this->exportsettings = $a_settings;
10855  }
10856  else
10857  {
10858  $this->exportsettings = 0;
10859  }
10860  }
+ Here is the caller graph for this function:

◆ setExportSettingsSingleChoiceShort()

ilObjTest::setExportSettingsSingleChoiceShort (   $a_settings)

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

References getExportSettingsSingleChoiceShort().

10875  {
10876  if ($a_settings)
10877  {
10878  $this->exportsettings = $this->exportsettings | 1;
10879  }
10880  else
10881  {
10883  {
10884  $this->exportsettings = $this->exportsettings ^ 1;
10885  }
10886  }
10887  }
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 public
See also
$_finalstatement

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

2125  {
2126  $this->_finalstatement = $a_statement;
2127  }
+ 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) public

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

9633  {
9634  switch ($a_value)
9635  {
9636  case 1:
9637  $this->fixed_participants = 1;
9638  break;
9639  default:
9640  $this->fixed_participants = 0;
9641  break;
9642  }
9643  }
+ 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 public
See also
$_forcejs

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

2149  {
2150  $this->_forcejs = ($a_js) ? 1 : 0;
2151  }
+ 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
Todo:
Rename "$this->answer_feedback to something more meaningful.

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

Referenced by setScoringFeedbackOptionsByArray().

2452 {
2453  switch ($generic_answer_feedback)
2454  {
2455  case 1:
2456  $this->answer_feedback = 1;
2457  break;
2458  default:
2459  $this->answer_feedback = 0;
2460  break;
2461  }
2462 }
+ 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 11249 of file class.ilObjTest.php.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11250  {
11251  $this->_highscore_achieved_ts = (bool)$a_achieved_ts;
11252  }
+ 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 11205 of file class.ilObjTest.php.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11206  {
11207  $this->_highscore_anon = (bool)$a_anon;
11208  }
+ 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 11183 of file class.ilObjTest.php.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11184  {
11185  $this->_highscore_enabled = (bool)$a_enabled;
11186  }
+ 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 11309 of file class.ilObjTest.php.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11310  {
11311  $this->_highscore_hints = (bool)$a_hints;
11312  }
+ Here is the caller graph for this function:

◆ setHighscoreMode()

ilObjTest::setHighscoreMode (   $mode)
Parameters
$modeint

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

References setHighscoreOwnTable(), and setHighscoreTopTable().

11440  {
11441  switch($mode)
11442  {
11443  case self::HIGHSCORE_SHOW_ALL_TABLES:
11444  $this->setHighscoreTopTable(1);
11445  $this->setHighscoreOwnTable(1);
11446  break;
11447 
11448  case self::HIGHSCORE_SHOW_TOP_TABLE:
11449  $this->setHighscoreTopTable(1);
11450  $this->setHighscoreOwnTable(0);
11451  break;
11452 
11453  case self::HIGHSCORE_SHOW_OWN_TABLE:
11454  default:
11455  $this->setHighscoreTopTable(0);
11456  $this->setHighscoreOwnTable(1);
11457  break;
11458  }
11459  }
setHighscoreTopTable($a_top_table)
Sets if the top-rankings table should be shown.
setHighscoreOwnTable($a_own_table)
Sets if the table with the own ranking should be shown.
+ 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 11349 of file class.ilObjTest.php.

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setHighscoreMode().

11350  {
11351  $this->_highscore_own_table = (bool)$a_own_table;
11352  }
+ 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 11289 of file class.ilObjTest.php.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11290  {
11291  $this->_highscore_percentage = (bool)$a_percentage;
11292  }
+ 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 11269 of file class.ilObjTest.php.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11270  {
11271  $this->_highscore_score = (bool)$a_score;
11272  }
+ 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 11390 of file class.ilObjTest.php.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11391  {
11392  $this->_highscore_top_num = (int)$a_top_num;
11393  }
+ 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 11369 of file class.ilObjTest.php.

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setHighscoreMode().

11370  {
11371  $this->_highscore_top_table = (bool)$a_top_table;
11372  }
+ 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 11329 of file class.ilObjTest.php.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11330  {
11331  $this->_highscore_wtime = (bool)$a_wtime;
11332  }
+ Here is the caller graph for this function:

◆ setInstantFeedbackAnswerFixationEnabled()

ilObjTest::setInstantFeedbackAnswerFixationEnabled (   $instantFeedbackAnswerFixationEnabled)

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

References $instantFeedbackAnswerFixationEnabled.

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setScoringFeedbackOptionsByArray().

12215  {
12216  $this->instantFeedbackAnswerFixationEnabled = $instantFeedbackAnswerFixationEnabled;
12217  }
$instantFeedbackAnswerFixationEnabled
+ Here is the caller 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 public
See also
$instant_verification

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

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setScoringFeedbackOptionsByArray().

2413  {
2414  switch ($instant_feedback)
2415  {
2416  case 1:
2417  $this->instant_verification = 1;
2418  break;
2419  default:
2420  $this->instant_verification = 0;
2421  break;
2422  }
2423  }
+ 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 public
See also
$introduction

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

References $introduction.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

2112  {
2113  $this->introduction = $introduction;
2114  }
+ Here is the caller graph for this function:

◆ setIntroductionEnabled()

ilObjTest::setIntroductionEnabled (   $introductionEnabled)
Parameters
boolean$introductionEnabled

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

References $introductionEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

2089  {
2090  $this->introductionEnabled = $introductionEnabled;
2091  }
+ 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. public
See also
$_kiosk

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

2754  {
2755  $this->_kiosk = $kiosk;
2756  }
+ 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 public
See also
$_kiosk

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

References getKioskMode().

2785  {
2786  if ($a_kiosk)
2787  {
2788  $this->_kiosk = $this->_kiosk | 1;
2789  }
2790  else
2791  {
2792  if ($this->getKioskMode())
2793  {
2794  $this->_kiosk = $this->_kiosk ^ 1;
2795  }
2796  }
2797  }
getKioskMode()
Returns the kiosk mode.
+ Here is the call graph for this function:

◆ setLimitUsersEnabled()

ilObjTest::setLimitUsersEnabled (   $limitUsersEnabled)
Parameters
boolean$limitUsersEnabled

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

References $limitUsersEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

9300  {
9301  $this->limitUsersEnabled = $limitUsersEnabled;
9302  }
+ 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 public

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

8797  {
8798  if ($a_value)
8799  {
8800  $this->show_summary = 1;
8801  }
8802  else
8803  {
8804  $this->show_summary = 0;
8805  }
8806  }

◆ 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 public

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

References getListOfQuestions(), and getListOfQuestionsDescription().

8911  {
8912  if ($a_value && $this->getListOfQuestions())
8913  {
8914  $this->show_summary = $this->show_summary | 8;
8915  }
8916  if (!$a_value && $this->getListOfQuestions())
8917  {
8918  if ($this->getListOfQuestionsDescription())
8919  {
8920  $this->show_summary = $this->show_summary ^ 8;
8921  }
8922  }
8923  }
getListOfQuestionsDescription()
Returns TRUE if the list of questions should be presented with the question descriptions.
getListOfQuestions()
Returns if the list of questions should be presented to the user or not.
+ 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 public

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

References getListOfQuestions(), and getListOfQuestionsEnd().

8872  {
8873  if ($a_value && $this->getListOfQuestions())
8874  {
8875  $this->show_summary = $this->show_summary | 4;
8876  }
8877  if (!$a_value && $this->getListOfQuestions())
8878  {
8879  if ($this->getListOfQuestionsEnd())
8880  {
8881  $this->show_summary = $this->show_summary ^ 4;
8882  }
8883  }
8884  }
getListOfQuestions()
Returns if the list of questions should be presented to the user or not.
getListOfQuestionsEnd()
Returns if the list of questions should be presented as the last page of the test.
+ 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 public

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

8768  {
8769  $this->show_summary = $a_value;
8770  }
+ 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 public

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

References getListOfQuestions(), and getListOfQuestionsStart().

8833  {
8834  if ($a_value && $this->getListOfQuestions())
8835  {
8836  $this->show_summary = $this->show_summary | 2;
8837  }
8838  if (!$a_value && $this->getListOfQuestions())
8839  {
8840  if ($this->getListOfQuestionsStart())
8841  {
8842  $this->show_summary = $this->show_summary ^ 2;
8843  }
8844  }
8845  }
getListOfQuestionsStart()
Returns if the list of questions should be presented as the first page of the test.
getListOfQuestions()
Returns if the list of questions should be presented to the user or not.
+ 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 10659 of file class.ilObjTest.php.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

10660  {
10661  $this->mailnotification = $a_notification;
10662  }
+ Here is the caller graph for this function:

◆ setMailNotificationType()

ilObjTest::setMailNotificationType (   $a_type)

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

10827  {
10828  if ($a_type == 1)
10829  {
10830  $this->mailnottype = 1;
10831  }
10832  else
10833  {
10834  $this->mailnottype = 0;
10835  }
10836  }
+ 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 public
See also
$mc_scoring

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3361  {
3362  $this->mc_scoring = $a_mc_scoring;
3363  }
+ 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. public
See also
$nr_of_tries

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

References $nr_of_tries.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3174  {
3175  $this->nr_of_tries = $nr_of_tries;
3176  }
+ Here is the caller graph for this function:

◆ setObligationsEnabled()

ilObjTest::setObligationsEnabled (   $obligationsEnabled = true)

sets obligations enabled/disabled

Parameters
boolean$obligationsEnabled

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

References $obligationsEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11492  {
11493  $this->obligationsEnabled = (bool)$obligationsEnabled;
11494  }
+ Here is the caller graph for this function:

◆ setOfferingQuestionHintsEnabled()

ilObjTest::setOfferingQuestionHintsEnabled (   $offeringQuestionHintsEnabled)

sets offering question hints enabled/disabled

Parameters
boolean$offeringQuestionHintsEnabled

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

References $offeringQuestionHintsEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11152  {
11153  $this->offeringQuestionHintsEnabled = (bool)$offeringQuestionHintsEnabled;
11154  }
+ Here is the caller graph for this function:

◆ setOnline()

ilObjTest::setOnline (   $a_online = true)

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

Referenced by loadFromDb().

11122  {
11123  $this->online = (bool)$a_online;
11124  }
+ Here is the caller graph for this function:

◆ setPassDeletionAllowed()

ilObjTest::setPassDeletionAllowed (   $passDeletionAllowed)

setter for the test setting passDeletionAllowed

Returns
integer

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

References $passDeletionAllowed.

Referenced by applyDefaults(), and loadFromDb().

11635  {
11636  $this->passDeletionAllowed = (bool)$passDeletionAllowed;
11637  }
+ 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 public
See also
$pass_scoring

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

References SCORE_BEST_PASS, and SCORE_LAST_PASS.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3373  {
3374  switch ($a_pass_scoring)
3375  {
3376  case SCORE_BEST_PASS:
3377  $this->pass_scoring = SCORE_BEST_PASS;
3378  break;
3379  default:
3380  $this->pass_scoring = SCORE_LAST_PASS;
3381  break;
3382  }
3383  }
const SCORE_LAST_PASS
const SCORE_BEST_PASS
+ 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 public
See also
$password

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3337  {
3338  $this->password = $a_password;
3339  }
+ Here is the caller graph for this function:

◆ setPasswordEnabled()

ilObjTest::setPasswordEnabled (   $passwordEnabled)
Parameters
boolean$passwordEnabled

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

References $passwordEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3313  {
3314  $this->passwordEnabled = $passwordEnabled;
3315  }
+ Here is the caller graph for this function:

◆ setPoolUsage()

ilObjTest::setPoolUsage (   $usage)

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

Referenced by applyDefaults(), and loadFromDb().

10995  {
10996  $this->poolUsage = (boolean)$usage;
10997  }
+ Here is the caller graph for this function:

◆ setPostponingEnabled()

ilObjTest::setPostponingEnabled (   $postponingEnabled)
Parameters
bool$postponingEnabled

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

References setSequenceSettings().

2389  {
2390  $this->setSequenceSettings((int)$postponingEnabled);
2391  }
setSequenceSettings($sequence_settings=0)
SEQUENCE SETTING = POSTPONING ENABLED !!
+ Here is the call graph for this function:

◆ setPrintBestSolutionWithResult()

ilObjTest::setPrintBestSolutionWithResult (   $status)

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11127  {
11128  $this->print_best_solution_with_result = (bool) $status;
11129  }
+ 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 public
See also
$processing_time

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

References $processing_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3244  :00:00")
3245  {
3246  $this->processing_time = $processing_time;
3247  }
+ Here is the caller graph for this function:

◆ setProcessingTimeByMinutes()

ilObjTest::setProcessingTimeByMinutes (   $minutes)

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

3250  {
3251  $this->processing_time = sprintf("%02d:%02d:00", floor($minutes/60), $minutes%60);
3252  }

◆ setQuestionOrderAndObligations()

ilObjTest::setQuestionOrderAndObligations (   $orders,
  $obligations 
)

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

References ilObject\$id, $ilDB, $query, and loadQuestions().

11000  {
11001  global $ilDB;
11002 
11003  asort($orders);
11004 
11005  $i = 0;
11006 
11007  foreach($orders as $id => $position)
11008  {
11009  $i++;
11010 
11011  $obligatory = (
11012  isset($obligations[$id]) && $obligations[$id] ? 1 : 0
11013  );
11014 
11015  $query = "
11016  UPDATE tst_test_question
11017  SET sequence = %s,
11018  obligatory = %s
11019  WHERE question_fi = %s
11020  ";
11021 
11022  $ilDB->manipulateF(
11023  $query, array('integer', 'integer', 'integer'), array($i, $obligatory, $id)
11024  );
11025  }
11026 
11027  $this->loadQuestions();
11028  }
loadQuestions($active_id="", $pass=NULL)
Load the test question id&#39;s from the database.
global $ilDB
+ 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 8004 of file class.ilObjTest.php.

References $ilDB, and getActiveIdOfUser().

8005  {
8006  global $ilDB;
8007 
8008  $active_id = $this->getActiveIdOfUser($user_id);
8009  $affectedRows = $ilDB->manipulateF("DELETE FROM tst_qst_solved WHERE active_fi = %s AND question_fi = %s",
8010  array('integer', 'integer'),
8011  array($active_id, $question_id)
8012  );
8013  $affectedRows = $ilDB->manipulateF("INSERT INTO tst_qst_solved (solved, question_fi, active_fi) VALUES (%s, %s, %s)",
8014  array('integer', 'integer', 'integer'),
8015  array($value, $question_id, $active_id)
8016  );
8017  }
getActiveIdOfUser($user_id="", $anonymous_id="")
Gets the active id of a given user.
global $ilDB
+ Here is the call graph for this function:

◆ setQuestionSetType()

ilObjTest::setQuestionSetType (   $questionSetType)

setter for question set type

Parameters
string$questionSetType

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

References $questionSetType.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11977  {
11978  $this->questionSetType = $questionSetType;
11979  }
+ Here is the caller graph for this function:

◆ setRedirectionMode()

ilObjTest::setRedirectionMode (   $redirection_mode = 0)

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

References $redirection_mode.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3198  {
3199  $this->redirection_mode = $redirection_mode;
3200  }
+ Here is the caller graph for this function:

◆ setRedirectionUrl()

ilObjTest::setRedirectionUrl (   $redirection_url = NULL)

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

References $redirection_url.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3206  {
3207  $this->redirection_url = $redirection_url;
3208  }
+ 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 2488 of file class.ilObjTest.php.

References $reporting_date, and setECTSOutput().

Referenced by applyDefaults(), fromXML(), and loadFromDb().

2489  {
2490  if(!$reporting_date)
2491  {
2492  $this->reporting_date = '';
2493  $this->setECTSOutput(false);
2494  }
2495  else
2496  {
2497  $this->reporting_date = $reporting_date;
2498  }
2499  }
setECTSOutput($a_ects_output)
{}
+ 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 public
See also
$processing_time

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3278  {
3279  if ($reset)
3280  {
3281  $this->reset_processing_time = 1;
3282  }
3283  else
3284  {
3285  $this->reset_processing_time = 0;
3286  }
3287  }
+ Here is the caller graph for this function:

◆ setResultFilterTaxIds()

ilObjTest::setResultFilterTaxIds (   $resultFilterTaxIds)

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

References $resultFilterTaxIds.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

12154  {
12155  $this->resultFilterTaxIds = $resultFilterTaxIds;
12156  }
+ 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 public

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

9083  {
9084  $this->results_presentation = $a_results_presentation;
9085  }
+ Here is the caller graph for this function:

◆ setResultsPresentationOptionsByArray()

ilObjTest::setResultsPresentationOptionsByArray (   $options)

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

References $options.

10971  {
10972  $setter = array(
10973  'pass_details' => 'setShowPassDetails',
10974  'solution_details' => 'setShowSolutionDetails',
10975  'solution_printview' => 'setShowSolutionPrintview',
10976  'solution_feedback' => 'setShowSolutionFeedback',
10977  'solution_answers_only' => 'setShowSolutionAnswersOnly',
10978  'solution_signature' => 'setShowSolutionSignature',
10979  'solution_suggested' => 'setShowSolutionSuggested',
10980  );
10981  foreach($setter as $key => $setter) {
10982  if (in_array($key, $options)) {
10983  $this->$setter(1);
10984  }
10985  else {
10986  $this->$setter(0);
10987  }
10988  }
10989  }
if(!is_array($argv)) $options

◆ 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 public
See also
$score_cutting

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3349  {
3350  $this->score_cutting = $a_score_cutting;
3351  }
+ 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 public
See also
$score_reporting

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

References $score_reporting.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

2401  {
2402  $this->score_reporting = $score_reporting;
2403  }
+ Here is the caller graph for this function:

◆ setScoringFeedbackOptionsByArray()

ilObjTest::setScoringFeedbackOptionsByArray (   $options)

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

References $options, setAnswerFeedbackPoints(), setGenericAnswerFeedback(), setInstantFeedbackAnswerFixationEnabled(), setInstantFeedbackSolution(), and setSpecificAnswerFeedback().

10952  {
10953  if (is_array($options))
10954  {
10955  $this->setGenericAnswerFeedback( in_array('instant_feedback_generic', $options) ? 1 : 0);
10956  $this->setSpecificAnswerFeedback( in_array('instant_feedback_specific', $options) ? 1 : 0);
10957  $this->setAnswerFeedbackPoints( in_array('instant_feedback_points', $options) ? 1 : 0);
10958  $this->setInstantFeedbackSolution( in_array('instant_feedback_solution', $options) ? 1 : 0);
10959  $this->setInstantFeedbackAnswerFixationEnabled( in_array('instant_feedback_answer_fixation', $options) ? true : false);
10960  }
10961  else
10962  {
10963  $this->setGenericAnswerFeedback(0);
10964  $this->setSpecificAnswerFeedback(0);
10965  $this->setAnswerFeedbackPoints(0);
10966  $this->setInstantFeedbackSolution(0);
10968  }
10969  }
setSpecificAnswerFeedback($specific_answer_feedback)
setAnswerFeedbackPoints($answer_feedback_points=0)
Sets the answer specific feedback of reached points for the test.
if(!is_array($argv)) $options
setInstantFeedbackSolution($instant_feedback=0)
Sets the instant feedback for the solution.
setGenericAnswerFeedback($generic_answer_feedback=0)
Sets if the generic feedback is to be shown in the test.
setInstantFeedbackAnswerFixationEnabled($instantFeedbackAnswerFixationEnabled)
+ Here is the call graph for this function:

◆ setSequenceSettings()

ilObjTest::setSequenceSettings (   $sequence_settings = 0)

SEQUENCE SETTING = POSTPONING ENABLED !!

Parameters
integer$sequence_settingsThe POSTPONING ENABLED status

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

References $sequence_settings.

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setPostponingEnabled().

2373  {
2374  $this->sequence_settings = $sequence_settings;
2375  }
+ 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) public

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

9573  {
9574  switch ($a_value)
9575  {
9576  case 1:
9577  $this->show_cancel = 1;
9578  break;
9579  default:
9580  $this->show_cancel = 0;
9581  break;
9582  }
9583  }
+ Here is the caller graph for this function:

◆ setShowExamIdInTestPassEnabled()

ilObjTest::setShowExamIdInTestPassEnabled (   $show_exam_id_in_test_pass_enabled)

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

References $show_exam_id_in_test_pass_enabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11897  {
11898  $this->show_exam_id_in_test_pass_enabled = $show_exam_id_in_test_pass_enabled;
11899  }
$show_exam_id_in_test_pass_enabled
+ 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 11909 of file class.ilObjTest.php.

References $show_exam_id_in_test_results_enabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11910  {
11911  $this->show_exam_id_in_test_results_enabled = $show_exam_id_in_test_results_enabled;
11912  }
$show_exam_id_in_test_results_enabled
+ Here is the caller graph for this function:

◆ setShowExamviewHtml()

ilObjTest::setShowExamviewHtml (   $show_examview_html)
Parameters
boolean$show_examview_html

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

References $show_examview_html.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11644  {
11645  $this->show_examview_html = $show_examview_html;
11646  }
+ Here is the caller graph for this function:

◆ setShowExamviewPdf()

ilObjTest::setShowExamviewPdf (   $show_examview_pdf)
Parameters
boolean$show_examview_pdf

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

References $show_examview_pdf.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11660  {
11661  $this->show_examview_pdf = $show_examview_pdf;
11662  }
+ 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 public
See also
$_finalstatement

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

2246  {
2247  $this->_showfinalstatement = ($show) ? 1 : 0;
2248  }
+ Here is the caller graph for this function:

◆ setShowGradingMarkEnabled()

ilObjTest::setShowGradingMarkEnabled (   $showGradingMarkEnabled)

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

References $showGradingMarkEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

12204  {
12205  $this->showGradingMarkEnabled = $showGradingMarkEnabled;
12206  }
+ Here is the caller graph for this function:

◆ setShowGradingStatusEnabled()

ilObjTest::setShowGradingStatusEnabled (   $showGradingStatusEnabled)

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

References $showGradingStatusEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

12194  {
12195  $this->showGradingStatusEnabled = $showGradingStatusEnabled;
12196  }
+ 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 public
See also
$_showinfo

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

2137  {
2138  $this->_showinfo = ($a_info) ? 1 : 0;
2139  }
+ 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 public

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

References getShowKioskModeParticipant().

2865  {
2866  if ($a_participant)
2867  {
2868  $this->_kiosk = $this->_kiosk | 4;
2869  }
2870  else
2871  {
2872  if ($this->getShowKioskModeParticipant())
2873  {
2874  $this->_kiosk = $this->_kiosk ^ 4;
2875  }
2876  }
2877  }
getShowKioskModeParticipant()
Returns the status of the kiosk mode participant.
+ 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 public

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

References getShowKioskModeTitle().

2825  {
2826  if ($a_title)
2827  {
2828  $this->_kiosk = $this->_kiosk | 2;
2829  }
2830  else
2831  {
2832  if ($this->getShowKioskModeTitle())
2833  {
2834  $this->_kiosk = $this->_kiosk ^ 2;
2835  }
2836  }
2837  }
getShowKioskModeTitle()
Returns the status of the kiosk mode title.
+ 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) public

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

9603  {
9604  switch ($a_value)
9605  {
9606  case 1:
9607  $this->show_marker = 1;
9608  break;
9609  default:
9610  $this->show_marker = 0;
9611  break;
9612  }
9613  }
+ 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 public

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

References getShowPassDetails().

Referenced by __construct().

9096  {
9097  if ($a_details)
9098  {
9099  $this->results_presentation = $this->results_presentation | 1;
9100  }
9101  else
9102  {
9103  if ($this->getShowPassDetails())
9104  {
9105  $this->results_presentation = $this->results_presentation ^ 1;
9106  }
9107  }
9108  }
getShowPassDetails()
Returns if the pass details should be shown when a test is not finished.
+ 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 public

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

References getShowSolutionAnswersOnly().

Referenced by __construct().

9191  {
9192  if ($a_full)
9193  {
9194  $this->results_presentation = $this->results_presentation | 16;
9195  }
9196  else
9197  {
9198  if ($this->getShowSolutionAnswersOnly())
9199  {
9200  $this->results_presentation = $this->results_presentation ^ 16;
9201  }
9202  }
9203  }
getShowSolutionAnswersOnly()
Returns if the full solution (including ILIAS content) should be presented to the solution or not...
+ 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 public

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

References getShowSolutionDetails().

Referenced by __construct(), and fromXML().

9117  {
9118  if ($a_details)
9119  {
9120  $this->results_presentation = $this->results_presentation | 2;
9121  }
9122  else
9123  {
9124  if ($this->getShowSolutionDetails())
9125  {
9126  $this->results_presentation = $this->results_presentation ^ 2;
9127  }
9128  }
9129  }
getShowSolutionDetails()
Returns if the solution details should be presented to the user or not.
+ 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 public

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

References getShowSolutionFeedback().

9170  {
9171  if ($a_feedback)
9172  {
9173  $this->results_presentation = $this->results_presentation | 8;
9174  }
9175  else
9176  {
9177  if ($this->getShowSolutionFeedback())
9178  {
9179  $this->results_presentation = $this->results_presentation ^ 8;
9180  }
9181  }
9182  }
getShowSolutionFeedback()
Returns if the feedback should be presented to the solution or not.
+ 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 9252 of file class.ilObjTest.php.

References getShowSolutionListComparison().

9253  {
9254  if($a_comparison)
9255  {
9256  $this->results_presentation = $this->results_presentation | 128;
9257  }
9258  else
9259  {
9260  if($this->getShowSolutionListComparison())
9261  {
9262  $this->results_presentation = $this->results_presentation ^ 128;
9263  }
9264  }
9265  }
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 public

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

References getShowSolutionPrintview().

Referenced by fromXML().

9149  {
9150  if ($a_printview)
9151  {
9152  $this->results_presentation = $this->results_presentation | 4;
9153  }
9154  else
9155  {
9156  if ($this->getShowSolutionPrintview())
9157  {
9158  $this->results_presentation = $this->results_presentation ^ 4;
9159  }
9160  }
9161  }
getShowSolutionPrintview()
Returns if the solution printview should be presented to the user or not.
+ 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 public

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

References getShowSolutionSignature().

Referenced by __construct().

9212  {
9213  if ($a_signature)
9214  {
9215  $this->results_presentation = $this->results_presentation | 32;
9216  }
9217  else
9218  {
9219  if ($this->getShowSolutionSignature())
9220  {
9221  $this->results_presentation = $this->results_presentation ^ 32;
9222  }
9223  }
9224  }
getShowSolutionSignature()
Returns if the signature field should be shown in the test results.
+ 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 public

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

References getShowSolutionSuggested().

9233  {
9234  if ($a_solution)
9235  {
9236  $this->results_presentation = $this->results_presentation | 64;
9237  }
9238  else
9239  {
9240  if ($this->getShowSolutionSuggested())
9241  {
9242  $this->results_presentation = $this->results_presentation ^ 64;
9243  }
9244  }
9245  }
+ 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 public

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

8734  {
8735  $this->shuffle_questions = ($a_shuffle) ? 1 : 0;
8736  }
+ Here is the caller graph for this function:

◆ setSignSubmission()

ilObjTest::setSignSubmission (   $sign_submission)
Parameters
boolean$sign_submission

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

References $sign_submission.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

11926  {
11927  $this->sign_submission = $sign_submission;
11928  }
+ Here is the caller graph for this function:

◆ setSkillServiceEnabled()

ilObjTest::setSkillServiceEnabled (   $skillServiceEnabled)

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

References $skillServiceEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

12144  {
12145  $this->skillServiceEnabled = $skillServiceEnabled;
12146  }
+ Here is the caller graph for this function:

◆ setSpecificAnswerFeedback()

ilObjTest::setSpecificAnswerFeedback (   $specific_answer_feedback)

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

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setScoringFeedbackOptionsByArray().

11463  {
11464  switch ($specific_answer_feedback)
11465  {
11466  case 1:
11467  $this->specific_answer_feedback = 1;
11468  break;
11469  default:
11470  $this->specific_answer_feedback = 0;
11471  break;
11472  }
11473  }
+ 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. public
See also
$starting_time

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

References $starting_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3122  {
3123  $this->starting_time = $starting_time;
3124  }
+ Here is the caller graph for this function:

◆ setStartingTimeEnabled()

ilObjTest::setStartingTimeEnabled (   $starting_time_enabled)
Parameters
boolean$starting_time_enabled

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

References $starting_time_enabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3098  {
3099  $this->starting_time_enabled = $starting_time_enabled;
3100  }
+ Here is the caller graph for this function:

◆ setTemplate()

ilObjTest::setTemplate (   $template_id)

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

References $template_id.

Referenced by ilLOEditorGUI\applySettingsTemplate(), and loadFromDb().

10897  {
10898  $this->template_id = (int)$template_id;
10899  }
+ Here is the caller graph for this function:

◆ setTestFinalBroken()

ilObjTest::setTestFinalBroken (   $testFinalBroken)
Parameters
boolean$testFinalBroken

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

References $testFinalBroken.

Referenced by loadFromDb().

12295  {
12296  $this->testFinalBroken = $testFinalBroken;
12297  }
+ 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 10348 of file class.ilObjTest.php.

Referenced by loadFromDb().

10349  {
10350  $this->test_id = $a_id;
10351  }
+ 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 public
See also
$title_output

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3222  {
3223  switch ($title_output)
3224  {
3225  case 1:
3226  $this->title_output = 1;
3227  break;
3228  case 2:
3229  $this->title_output = 2;
3230  break;
3231  default:
3232  $this->title_output = 0;
3233  break;
3234  }
3235  }
+ Here is the caller graph for this function:

◆ 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 public
See also
$use_previous_answers

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

3186  {
3188  {
3189  $this->use_previous_answers = 1;
3190  }
3191  else
3192  {
3193  $this->use_previous_answers = 0;
3194  }
3195  }
+ 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 public

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

References getStartingTime(), and isStartingTimeEnabled().

Referenced by isExecutable().

5727  {
5728  if( $this->isStartingTimeEnabled() && $this->getStartingTime() )
5729  {
5730  if (preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getStartingTime(), $matches))
5731  {
5732  $epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
5733  $now = mktime();
5734  if ($now < $epoch_time)
5735  {
5736  // starting time not reached
5737  return false;
5738  }
5739  }
5740  }
5741  return true;
5742  }
getStartingTime()
Returns the starting time of the test.
+ 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 public

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

References $ilDB, and $pass.

3999  {
4000  global $ilDB;
4001 
4002  $next_id = $ilDB->nextId('tst_times');
4003  $affectedRows = $ilDB->manipulateF("INSERT INTO tst_times (times_id, active_fi, started, finished, pass, tstamp) VALUES (%s, %s, %s, %s, %s, %s)",
4004  array('integer', 'integer', 'timestamp', 'timestamp', 'integer', 'integer'),
4005  array($next_id, $active_id, strftime("%Y-%m-%d %H:%M:%S"), strftime("%Y-%m-%d %H:%M:%S"), $pass, time())
4006  );
4007  return $next_id;
4008  }
global $ilDB

◆ toXML()

ilObjTest::toXML ( )

Returns a QTI xml representation of the test.

Returns
string The QTI xml representation of the test

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

References $data, _instanciateQuestion(), addQTIMaterial(), areObligationsEnabled(), 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(), getPassword(), getProcessingTime(), getQuestionSetType(), getRedirectionMode(), getRedirectionUrl(), getReportingDate(), getResetProcessingTime(), getResultFilterTaxIds(), getResultsPresentation(), getScoreCutting(), getScoreReporting(), getSequenceSettings(), getShowCancel(), getShowExamviewHtml(), getShowExamviewPdf(), getShowFinalStatement(), getShowInfo(), getShowMarker(), getShowSolutionDetails(), getShuffleQuestions(), getSignSubmission(), getSpecificAnswerFeedback(), getStartingTime(), ilObject\getTitle(), getTitleOutput(), getUsePreviousAnswers(), isActivationLimited(), isBestSolutionPrintedWithResult(), isInstantFeedbackAnswerFixationEnabled(), isOfferingQuestionHintsEnabled(), isShowExamIdInTestPassEnabled(), isShowExamIdInTestResultsEnabled(), isShowGradingMarkEnabled(), isShowGradingStatusEnabled(), isSkillServiceEnabled(), and ilXmlWriter\xmlHeader().

6288  {
6289  include_once("./Services/Xml/classes/class.ilXmlWriter.php");
6290  $a_xml_writer = new ilXmlWriter;
6291  // set xml header
6292  $a_xml_writer->xmlHeader();
6293  $a_xml_writer->xmlSetDtdDef("<!DOCTYPE questestinterop SYSTEM \"ims_qtiasiv1p2p1.dtd\">");
6294  $a_xml_writer->xmlStartTag("questestinterop");
6295 
6296  $attrs = array(
6297  "ident" => "il_".IL_INST_ID."_tst_".$this->getTestId(),
6298  "title" => $this->getTitle()
6299  );
6300  $a_xml_writer->xmlStartTag("assessment", $attrs);
6301  // add qti comment
6302  $a_xml_writer->xmlElement("qticomment", NULL, $this->getDescription());
6303 
6304  // add qti duration
6305  if ($this->enable_processing_time)
6306  {
6307  preg_match("/(\d+):(\d+):(\d+)/", $this->processing_time, $matches);
6308  $a_xml_writer->xmlElement("duration", NULL, sprintf("P0Y0M0DT%dH%dM%dS", $matches[1], $matches[2], $matches[3]));
6309  }
6310 
6311  // add the rest of the preferences in qtimetadata tags, because there is no correspondent definition in QTI
6312  $a_xml_writer->xmlStartTag("qtimetadata");
6313  $a_xml_writer->xmlStartTag("qtimetadatafield");
6314  $a_xml_writer->xmlElement("fieldlabel", NULL, "ILIAS_VERSION");
6315  $a_xml_writer->xmlElement("fieldentry", NULL, $this->ilias->getSetting("ilias_version"));
6316  $a_xml_writer->xmlEndTag("qtimetadatafield");
6317 
6318  // anonymity
6319  $a_xml_writer->xmlStartTag("qtimetadatafield");
6320  $a_xml_writer->xmlElement("fieldlabel", NULL, "anonymity");
6321  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getAnonymity()));
6322  $a_xml_writer->xmlEndTag("qtimetadatafield");
6323 
6324  // question set type (fixed, random, dynamic, ...)
6325  $a_xml_writer->xmlStartTag("qtimetadatafield");
6326  $a_xml_writer->xmlElement("fieldlabel", NULL, "question_set_type");
6327  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getQuestionSetType());
6328  $a_xml_writer->xmlEndTag("qtimetadatafield");
6329 
6330  // sequence settings
6331  $a_xml_writer->xmlStartTag("qtimetadatafield");
6332  $a_xml_writer->xmlElement("fieldlabel", NULL, "sequence_settings");
6333  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getSequenceSettings());
6334  $a_xml_writer->xmlEndTag("qtimetadatafield");
6335 
6336  // author
6337  $a_xml_writer->xmlStartTag("qtimetadatafield");
6338  $a_xml_writer->xmlElement("fieldlabel", NULL, "author");
6339  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getAuthor());
6340  $a_xml_writer->xmlEndTag("qtimetadatafield");
6341 
6342  // reset processing time
6343  $a_xml_writer->xmlStartTag("qtimetadatafield");
6344  $a_xml_writer->xmlElement("fieldlabel", NULL, "reset_processing_time");
6345  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getResetProcessingTime());
6346  $a_xml_writer->xmlEndTag("qtimetadatafield");
6347 
6348  // count system
6349  $a_xml_writer->xmlStartTag("qtimetadatafield");
6350  $a_xml_writer->xmlElement("fieldlabel", NULL, "count_system");
6351  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getCountSystem());
6352  $a_xml_writer->xmlEndTag("qtimetadatafield");
6353 
6354  // multiple choice scoring
6355  $a_xml_writer->xmlStartTag("qtimetadatafield");
6356  $a_xml_writer->xmlElement("fieldlabel", NULL, "mc_scoring");
6357  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getMCScoring());
6358  $a_xml_writer->xmlEndTag("qtimetadatafield");
6359 
6360  // multiple choice scoring
6361  $a_xml_writer->xmlStartTag("qtimetadatafield");
6362  $a_xml_writer->xmlElement("fieldlabel", NULL, "score_cutting");
6363  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getScoreCutting());
6364  $a_xml_writer->xmlEndTag("qtimetadatafield");
6365 
6366  // multiple choice scoring
6367  $a_xml_writer->xmlStartTag("qtimetadatafield");
6368  $a_xml_writer->xmlElement("fieldlabel", NULL, "password");
6369  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getPassword());
6370  $a_xml_writer->xmlEndTag("qtimetadatafield");
6371 
6372  // allowed users
6373  $a_xml_writer->xmlStartTag("qtimetadatafield");
6374  $a_xml_writer->xmlElement("fieldlabel", NULL, "allowedUsers");
6375  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getAllowedUsers());
6376  $a_xml_writer->xmlEndTag("qtimetadatafield");
6377 
6378  // allowed users time gap
6379  $a_xml_writer->xmlStartTag("qtimetadatafield");
6380  $a_xml_writer->xmlElement("fieldlabel", NULL, "allowedUsersTimeGap");
6381  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getAllowedUsersTimeGap());
6382  $a_xml_writer->xmlEndTag("qtimetadatafield");
6383 
6384  // pass scoring
6385  $a_xml_writer->xmlStartTag("qtimetadatafield");
6386  $a_xml_writer->xmlElement("fieldlabel", NULL, "pass_scoring");
6387  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getPassScoring());
6388  $a_xml_writer->xmlEndTag("qtimetadatafield");
6389 
6390  // score reporting date
6391  if ($this->getReportingDate())
6392  {
6393  $a_xml_writer->xmlStartTag("qtimetadatafield");
6394  $a_xml_writer->xmlElement("fieldlabel", NULL, "reporting_date");
6395  preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->reporting_date, $matches);
6396  $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]));
6397  $a_xml_writer->xmlEndTag("qtimetadatafield");
6398  }
6399  // number of tries
6400  $a_xml_writer->xmlStartTag("qtimetadatafield");
6401  $a_xml_writer->xmlElement("fieldlabel", NULL, "nr_of_tries");
6402  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getNrOfTries()));
6403  $a_xml_writer->xmlEndTag("qtimetadatafield");
6404 
6405  // kiosk
6406  $a_xml_writer->xmlStartTag("qtimetadatafield");
6407  $a_xml_writer->xmlElement("fieldlabel", NULL, "kiosk");
6408  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getKiosk()));
6409  $a_xml_writer->xmlEndTag("qtimetadatafield");
6410 
6411 
6412  //redirection_mode
6413  $a_xml_writer->xmlStartTag('qtimetadatafield');
6414  $a_xml_writer->xmlElement("fieldlabel", NULL, "redirection_mode");
6415  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getRedirectionMode());
6416  $a_xml_writer->xmlEndTag("qtimetadatafield");
6417 
6418  //redirection_url
6419  $a_xml_writer->xmlStartTag('qtimetadatafield');
6420  $a_xml_writer->xmlElement("fieldlabel", NULL, "redirection_url");
6421  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getRedirectionUrl());
6422  $a_xml_writer->xmlEndTag("qtimetadatafield");
6423 
6424  // use previous answers
6425  $a_xml_writer->xmlStartTag("qtimetadatafield");
6426  $a_xml_writer->xmlElement("fieldlabel", NULL, "use_previous_answers");
6427  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getUsePreviousAnswers());
6428  $a_xml_writer->xmlEndTag("qtimetadatafield");
6429 
6430  // hide title points
6431  $a_xml_writer->xmlStartTag("qtimetadatafield");
6432  $a_xml_writer->xmlElement("fieldlabel", NULL, "title_output");
6433  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getTitleOutput()));
6434  $a_xml_writer->xmlEndTag("qtimetadatafield");
6435 
6436  // results presentation
6437  $a_xml_writer->xmlStartTag("qtimetadatafield");
6438  $a_xml_writer->xmlElement("fieldlabel", NULL, "results_presentation");
6439  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getResultsPresentation()));
6440  $a_xml_writer->xmlEndTag("qtimetadatafield");
6441 
6442  // examid in test pass
6443  $a_xml_writer->xmlStartTag("qtimetadatafield");
6444  $a_xml_writer->xmlElement("fieldlabel", NULL, "examid_in_test_pass");
6445  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->isShowExamIdInTestPassEnabled()));
6446  $a_xml_writer->xmlEndTag("qtimetadatafield");
6447 
6448  // examid in kiosk
6449  $a_xml_writer->xmlStartTag("qtimetadatafield");
6450  $a_xml_writer->xmlElement("fieldlabel", NULL, "examid_in_test_res");
6451  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->isShowExamIdInTestResultsEnabled()));
6452  $a_xml_writer->xmlEndTag("qtimetadatafield");
6453 
6454  // solution details
6455  $a_xml_writer->xmlStartTag("qtimetadatafield");
6456  $a_xml_writer->xmlElement("fieldlabel", NULL, "show_summary");
6457  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getListOfQuestionsSettings()));
6458  $a_xml_writer->xmlEndTag("qtimetadatafield");
6459 
6460  // solution details
6461  $a_xml_writer->xmlStartTag("qtimetadatafield");
6462  $a_xml_writer->xmlElement("fieldlabel", NULL, "score_reporting");
6463  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getScoreReporting()));
6464  $a_xml_writer->xmlEndTag("qtimetadatafield");
6465 
6466  $a_xml_writer->xmlStartTag("qtimetadatafield");
6467  $a_xml_writer->xmlElement("fieldlabel", NULL, "solution_details");
6468  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getShowSolutionDetails());
6469  $a_xml_writer->xmlEndTag("qtimetadatafield");
6470  $a_xml_writer->xmlStartTag("qtimetadatafield");
6471  $a_xml_writer->xmlElement("fieldlabel", NULL, "print_bs_with_res");
6472  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getShowSolutionDetails() ? (int)$this->isBestSolutionPrintedWithResult() : 0);
6473  $a_xml_writer->xmlEndTag("qtimetadatafield");
6474 
6475  // solution details
6476  $a_xml_writer->xmlStartTag("qtimetadatafield");
6477  $a_xml_writer->xmlElement("fieldlabel", NULL, "instant_verification");
6478  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getInstantFeedbackSolution()));
6479  $a_xml_writer->xmlEndTag("qtimetadatafield");
6480 
6481  // answer specific feedback
6482  $a_xml_writer->xmlStartTag("qtimetadatafield");
6483  $a_xml_writer->xmlElement("fieldlabel", NULL, "answer_feedback");
6484  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getAnswerFeedback()));
6485  $a_xml_writer->xmlEndTag("qtimetadatafield");
6486 
6487  // answer specific feedback of reached points
6488  $a_xml_writer->xmlStartTag("qtimetadatafield");
6489  $a_xml_writer->xmlElement("fieldlabel", NULL, "answer_feedback_points");
6490  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getAnswerFeedbackPoints()));
6491  $a_xml_writer->xmlEndTag("qtimetadatafield");
6492 
6493  // highscore
6494  $highscore_metadata = array(
6495  'highscore_enabled' => array('value' => $this->getHighscoreEnabled()),
6496  'highscore_anon' => array('value' => $this->getHighscoreAnon()),
6497  'highscore_achieved_ts' => array('value' => $this->getHighscoreAchievedTS()),
6498  'highscore_score' => array('value' => $this->getHighscoreScore()),
6499  'highscore_percentage' => array('value' => $this->getHighscorePercentage()),
6500  'highscore_hints' => array('value' => $this->getHighscoreHints()),
6501  'highscore_wtime' => array('value' => $this->getHighscoreWTime()),
6502  'highscore_own_table' => array('value' => $this->getHighscoreOwnTable()),
6503  'highscore_top_table' => array('value' => $this->getHighscoreTopTable()),
6504  'highscore_top_num' => array('value' => $this->getHighscoreTopNum()),
6505  );
6506  foreach($highscore_metadata as $label => $data)
6507  {
6508  $a_xml_writer->xmlStartTag("qtimetadatafield");
6509  $a_xml_writer->xmlElement("fieldlabel", NULL, $label);
6510  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $data['value']));
6511  $a_xml_writer->xmlEndTag("qtimetadatafield");
6512  }
6513 
6514  // show cancel
6515  $a_xml_writer->xmlStartTag("qtimetadatafield");
6516  $a_xml_writer->xmlElement("fieldlabel", NULL, "show_cancel");
6517  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getShowCancel()));
6518  $a_xml_writer->xmlEndTag("qtimetadatafield");
6519 
6520  // show marker
6521  $a_xml_writer->xmlStartTag("qtimetadatafield");
6522  $a_xml_writer->xmlElement("fieldlabel", NULL, "show_marker");
6523  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getShowMarker()));
6524  $a_xml_writer->xmlEndTag("qtimetadatafield");
6525 
6526  // fixed participants
6527  $a_xml_writer->xmlStartTag("qtimetadatafield");
6528  $a_xml_writer->xmlElement("fieldlabel", NULL, "fixed_participants");
6529  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getFixedParticipants()));
6530  $a_xml_writer->xmlEndTag("qtimetadatafield");
6531 
6532  // show final statement
6533  $a_xml_writer->xmlStartTag("qtimetadatafield");
6534  $a_xml_writer->xmlElement("fieldlabel", NULL, "showfinalstatement");
6535  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", (($this->getShowFinalStatement()) ? "1" : "0")));
6536  $a_xml_writer->xmlEndTag("qtimetadatafield");
6537 
6538  // show introduction only
6539  $a_xml_writer->xmlStartTag("qtimetadatafield");
6540  $a_xml_writer->xmlElement("fieldlabel", NULL, "showinfo");
6541  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", (($this->getShowInfo()) ? "1" : "0")));
6542  $a_xml_writer->xmlEndTag("qtimetadatafield");
6543 
6544  // mail notification
6545  $a_xml_writer->xmlStartTag("qtimetadatafield");
6546  $a_xml_writer->xmlElement("fieldlabel", NULL, "mailnotification");
6547  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getMailNotification());
6548  $a_xml_writer->xmlEndTag("qtimetadatafield");
6549 
6550  // mail notification type
6551  $a_xml_writer->xmlStartTag("qtimetadatafield");
6552  $a_xml_writer->xmlElement("fieldlabel", NULL, "mailnottype");
6553  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getMailNotificationType());
6554  $a_xml_writer->xmlEndTag("qtimetadatafield");
6555 
6556  // export settings
6557  $a_xml_writer->xmlStartTag("qtimetadatafield");
6558  $a_xml_writer->xmlElement("fieldlabel", NULL, "exportsettings");
6559  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getExportSettings());
6560  $a_xml_writer->xmlEndTag("qtimetadatafield");
6561 
6562  // force JavaScript
6563  $a_xml_writer->xmlStartTag("qtimetadatafield");
6564  $a_xml_writer->xmlElement("fieldlabel", NULL, "forcejs");
6565  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", (($this->getForceJS()) ? "1" : "0")));
6566  $a_xml_writer->xmlEndTag("qtimetadatafield");
6567 
6568  // custom style
6569  $a_xml_writer->xmlStartTag("qtimetadatafield");
6570  $a_xml_writer->xmlElement("fieldlabel", NULL, "customstyle");
6571  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getCustomStyle());
6572  $a_xml_writer->xmlEndTag("qtimetadatafield");
6573 
6574  // shuffle questions
6575  $a_xml_writer->xmlStartTag("qtimetadatafield");
6576  $a_xml_writer->xmlElement("fieldlabel", NULL, "shuffle_questions");
6577  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getShuffleQuestions()));
6578  $a_xml_writer->xmlEndTag("qtimetadatafield");
6579 
6580  // processing time
6581  $a_xml_writer->xmlStartTag("qtimetadatafield");
6582  $a_xml_writer->xmlElement("fieldlabel", NULL, "processing_time");
6583  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getProcessingTime());
6584  $a_xml_writer->xmlEndTag("qtimetadatafield");
6585 
6586  // enable_examview
6587  $a_xml_writer->xmlStartTag("qtimetadatafield");
6588  $a_xml_writer->xmlElement("fieldlabel", NULL, "enable_examview");
6589  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getEnableExamview());
6590  $a_xml_writer->xmlEndTag("qtimetadatafield");
6591 
6592  // show_examview_html
6593  $a_xml_writer->xmlStartTag("qtimetadatafield");
6594  $a_xml_writer->xmlElement("fieldlabel", NULL, "show_examview_html");
6595  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getShowExamviewHtml());
6596  $a_xml_writer->xmlEndTag("qtimetadatafield");
6597 
6598  // show_examview_pdf
6599  $a_xml_writer->xmlStartTag("qtimetadatafield");
6600  $a_xml_writer->xmlElement("fieldlabel", NULL, "show_examview_pdf");
6601  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getShowExamviewPdf());
6602  $a_xml_writer->xmlEndTag("qtimetadatafield");
6603 
6604  // enable_archiving
6605  $a_xml_writer->xmlStartTag("qtimetadatafield");
6606  $a_xml_writer->xmlElement("fieldlabel", NULL, "enable_archiving");
6607  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getEnableArchiving());
6608  $a_xml_writer->xmlEndTag("qtimetadatafield");
6609 
6610  // sign_submission
6611  $a_xml_writer->xmlStartTag("qtimetadatafield");
6612  $a_xml_writer->xmlElement("fieldlabel", NULL, "sign_submission");
6613  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getSignSubmission());
6614  $a_xml_writer->xmlEndTag("qtimetadatafield");
6615 
6616  // char_selector_availability
6617  $a_xml_writer->xmlStartTag("qtimetadatafield");
6618  $a_xml_writer->xmlElement("fieldlabel", NULL, "char_selector_availability");
6619  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getCharSelectorAvailability()));
6620  $a_xml_writer->xmlEndTag("qtimetadatafield");
6621 
6622  // char_selector_definition
6623  $a_xml_writer->xmlStartTag("qtimetadatafield");
6624  $a_xml_writer->xmlElement("fieldlabel", NULL, "char_selector_definition");
6625  $a_xml_writer->xmlElement("fieldentry", NULL, $this->getCharSelectorDefinition());
6626  $a_xml_writer->xmlEndTag("qtimetadatafield");
6627 
6628  // skill_service
6629  $a_xml_writer->xmlStartTag("qtimetadatafield");
6630  $a_xml_writer->xmlElement("fieldlabel", NULL, "skill_service");
6631  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->isSkillServiceEnabled());
6632  $a_xml_writer->xmlEndTag("qtimetadatafield");
6633 
6634  // result_tax_filters
6635  $a_xml_writer->xmlStartTag("qtimetadatafield");
6636  $a_xml_writer->xmlElement("fieldlabel", NULL, "result_tax_filters");
6637  $a_xml_writer->xmlElement("fieldentry", NULL, serialize((array)$this->getResultFilterTaxIds()));
6638  $a_xml_writer->xmlEndTag("qtimetadatafield");
6639 
6640  // show_grading_status
6641  $a_xml_writer->xmlStartTag("qtimetadatafield");
6642  $a_xml_writer->xmlElement("fieldlabel", NULL, "show_grading_status");
6643  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->isShowGradingStatusEnabled());
6644  $a_xml_writer->xmlEndTag("qtimetadatafield");
6645 
6646  // show_grading_mark
6647  $a_xml_writer->xmlStartTag("qtimetadatafield");
6648  $a_xml_writer->xmlElement("fieldlabel", NULL, "show_grading_mark");
6649  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->isShowGradingMarkEnabled());
6650  $a_xml_writer->xmlEndTag("qtimetadatafield");
6651 
6652 
6653  // starting time
6654  if ($this->getStartingTime())
6655  {
6656  $a_xml_writer->xmlStartTag("qtimetadatafield");
6657  $a_xml_writer->xmlElement("fieldlabel", NULL, "starting_time");
6658  preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->starting_time, $matches);
6659  $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]));
6660  $a_xml_writer->xmlEndTag("qtimetadatafield");
6661  }
6662  // ending time
6663  if ($this->getEndingTime())
6664  {
6665  $a_xml_writer->xmlStartTag("qtimetadatafield");
6666  $a_xml_writer->xmlElement("fieldlabel", NULL, "ending_time");
6667  preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->ending_time, $matches);
6668  $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]));
6669  $a_xml_writer->xmlEndTag("qtimetadatafield");
6670  }
6671 
6672 
6673  //activation_limited
6674  $a_xml_writer->xmlStartTag("qtimetadatafield");
6675  $a_xml_writer->xmlElement("fieldlabel", NULL, "activation_limited");
6676  $a_xml_writer->xmlElement("fieldentry", NULL,(int)$this->isActivationLimited());
6677  $a_xml_writer->xmlEndTag("qtimetadatafield");
6678 
6679  //activation_start_time
6680  $a_xml_writer->xmlStartTag("qtimetadatafield");
6681  $a_xml_writer->xmlElement("fieldlabel", NULL, "activation_start_time");
6682  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getActivationStartingTime());
6683  $a_xml_writer->xmlEndTag("qtimetadatafield");
6684 
6685  //activation_end_time
6686  $a_xml_writer->xmlStartTag("qtimetadatafield");
6687  $a_xml_writer->xmlElement("fieldlabel", NULL, "activation_end_time");
6688  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getActivationEndingTime());
6689  $a_xml_writer->xmlEndTag("qtimetadatafield");
6690 
6691  //activation_visibility
6692  $a_xml_writer->xmlStartTag("qtimetadatafield");
6693  $a_xml_writer->xmlElement("fieldlabel", NULL, "activation_visibility");
6694  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getActivationVisibility());
6695  $a_xml_writer->xmlEndTag("qtimetadatafield");
6696 
6697  // autosave
6698  $a_xml_writer->xmlStartTag("qtimetadatafield");
6699  $a_xml_writer->xmlElement("fieldlabel", NULL, "autosave");
6700  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getAutosave());
6701  $a_xml_writer->xmlEndTag("qtimetadatafield");
6702 
6703  // autosave_ival
6704  $a_xml_writer->xmlStartTag("qtimetadatafield");
6705  $a_xml_writer->xmlElement("fieldlabel", NULL, "autosave_ival");
6706  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getAutosaveIval());
6707  $a_xml_writer->xmlEndTag("qtimetadatafield");
6708 
6709  //offer_question_hints
6710  $a_xml_writer->xmlStartTag("qtimetadatafield");
6711  $a_xml_writer->xmlElement("fieldlabel", NULL, "offer_question_hints");
6712  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->isOfferingQuestionHintsEnabled());
6713  $a_xml_writer->xmlEndTag("qtimetadatafield");
6714 
6715  //instant_feedback_specific
6716  $a_xml_writer->xmlStartTag("qtimetadatafield");
6717  $a_xml_writer->xmlElement("fieldlabel", NULL, "instant_feedback_specific");
6718  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getSpecificAnswerFeedback());
6719  $a_xml_writer->xmlEndTag("qtimetadatafield");
6720 
6721  //instant_feedback_answer_fixation
6722  $a_xml_writer->xmlStartTag("qtimetadatafield");
6723  $a_xml_writer->xmlElement("fieldlabel", NULL, "instant_feedback_answer_fixation");
6724  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->isInstantFeedbackAnswerFixationEnabled());
6725  $a_xml_writer->xmlEndTag("qtimetadatafield");
6726 
6727  //obligations_enabled
6728  $a_xml_writer->xmlStartTag("qtimetadatafield");
6729  $a_xml_writer->xmlElement("fieldlabel", NULL, "obligations_enabled");
6730  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->areObligationsEnabled());
6731  $a_xml_writer->xmlEndTag("qtimetadatafield");
6732 
6733  //enable_processing_time
6734  $a_xml_writer->xmlStartTag("qtimetadatafield");
6735  $a_xml_writer->xmlElement("fieldlabel", NULL, "enable_processing_time");
6736  $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getEnableProcessingTime());
6737  $a_xml_writer->xmlEndTag("qtimetadatafield");
6738 
6739  foreach ($this->mark_schema->mark_steps as $index => $mark)
6740  {
6741  // mark steps
6742  $a_xml_writer->xmlStartTag("qtimetadatafield");
6743  $a_xml_writer->xmlElement("fieldlabel", NULL, "mark_step_$index");
6744  $a_xml_writer->xmlElement("fieldentry", NULL, sprintf(
6745  "<short>%s</short><official>%s</official><percentage>%.2f</percentage><passed>%d</passed>",
6746  $mark->getShortName(), $mark->getOfficialName(), $mark->getMinimumLevel(), $mark->getPassed()
6747  ));
6748  $a_xml_writer->xmlEndTag("qtimetadatafield");
6749  }
6750  $a_xml_writer->xmlEndTag("qtimetadata");
6751 
6752  // add qti objectives
6753  $a_xml_writer->xmlStartTag("objectives");
6754  $this->addQTIMaterial($a_xml_writer, $this->getIntroduction());
6755  $a_xml_writer->xmlEndTag("objectives");
6756 
6757  // add qti assessmentcontrol
6758  if ($this->getInstantFeedbackSolution() == 1)
6759  {
6760  $attrs = array(
6761  "solutionswitch" => "Yes"
6762  );
6763  }
6764  else
6765  {
6766  $attrs = NULL;
6767  }
6768  $a_xml_writer->xmlElement("assessmentcontrol", $attrs, NULL);
6769 
6770  if (strlen($this->getFinalStatement()))
6771  {
6772  // add qti presentation_material
6773  $a_xml_writer->xmlStartTag("presentation_material");
6774  $a_xml_writer->xmlStartTag("flow_mat");
6775  $this->addQTIMaterial($a_xml_writer, $this->getFinalStatement());
6776  $a_xml_writer->xmlEndTag("flow_mat");
6777  $a_xml_writer->xmlEndTag("presentation_material");
6778  }
6779 
6780  $attrs = array(
6781  "ident" => "1"
6782  );
6783  $a_xml_writer->xmlElement("section", $attrs, NULL);
6784  $a_xml_writer->xmlEndTag("assessment");
6785  $a_xml_writer->xmlEndTag("questestinterop");
6786 
6787  $xml = $a_xml_writer->xmlDumpMem(FALSE);
6788 
6789  foreach ($this->questions as $question_id)
6790  {
6791  $question =& ilObjTest::_instanciateQuestion($question_id);
6792  $qti_question = $question->toXML(false);
6793  $qti_question = preg_replace("/<questestinterop>/", "", $qti_question);
6794  $qti_question = preg_replace("/<\/questestinterop>/", "", $qti_question);
6795  if (strpos($xml, "</section>") !== false)
6796  {
6797  $xml = str_replace("</section>", "$qti_question</section>", $xml);
6798  }
6799  else
6800  {
6801  $xml = str_replace("<section ident=\"1\"/>", "<section ident=\"1\">\n$qti_question</section>", $xml);
6802  }
6803  }
6804  return $xml;
6805  }
getScoreReporting()
Gets the score reporting of the ilObjTest object.
getHighscoreOwnTable()
Gets if the own rankings table should be shown.
getFixedParticipants()
Returns the fixed participants status.
getReportingDate()
Gets the reporting date of the ilObjTest object.
getCustomStyle()
Get the custom style.
getResultsPresentation()
Returns the combined results presentation value.
isShowExamIdInTestPassEnabled()
getMailNotification()
Get mail notification settings.
getEnableProcessingTime()
Returns the state of the processing time (enabled/disabled)
getHighscoreAchievedTS()
Returns if date and time of the scores achievement should be displayed.
getListOfQuestionsSettings()
Returns the settings for the list of questions options in the test properties This could contain one ...
getShowInfo()
Gets whether the complete information page is shown or the required data only.
& _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
XML writer class.
getAnonymity()
Returns the anonymity status of the test.
getShuffleQuestions()
Returns the status of the shuffle_questions variable.
isShowExamIdInTestResultsEnabled()
getShowSolutionDetails()
Returns if the solution details should be presented to the user or not.
getHighscoreWTime()
Gets if the column with the workingtime should be shown.
getHighscoreTopTable()
Gets, if the top-rankings table should be shown.
areObligationsEnabled()
returns the fact wether obligations are enabled or not
getSequenceSettings()
SEQUENCE SETTING = POSTPONING ENABLED !!
getHighscorePercentage()
Gets if the percentage column should be shown.
getCountSystem()
Gets the count system for the calculation of points.
getIntroduction()
Gets the introduction text of the ilObjTest object.
getHighscoreHints()
Gets, if the column with the number of requested hints should be shown.
getResetProcessingTime()
Returns wheather the processing time should be reset or not.
getHighscoreAnon()
Gets if the highscores should be anonymized per setting.
getShowMarker()
Returns wheather the marker button is shown or not.
getAnswerFeedback()
Returns 1 if generic answer feedback is activated.
getTitleOutput()
Returns the value of the title_output status.
getAuthor()
Gets the authors name of the ilObjTest object.
getUsePreviousAnswers()
Returns if the previous answers should be shown for a learner.
getShowFinalStatement()
Returns whether the final statement should be shown or not.
addQTIMaterial(&$a_xml_writer, $a_material)
Creates a QTI material tag from a plain text or xhtml text.
getTitle()
get object title public
getDescription()
get object description
getProcessingTime()
Returns the processing time for the test.
isOfferingQuestionHintsEnabled()
returns the fact wether offering hints is enabled or not
redirection script todo: (a better solution should control the processing via a xml file) ...
xmlHeader()
Writes xml header public.
isBestSolutionPrintedWithResult()
getAnswerFeedbackPoints()
Returns 1 if answer specific feedback as reached points is activated.
getStartingTime()
Returns the starting time of the test.
getInstantFeedbackSolution()
Returns 1 if the correct solution will be shown after answering a question.
getFinalStatement()
Gets the final statement.
isInstantFeedbackAnswerFixationEnabled()
getPassword()
Returns the password for test access.
getNrOfTries()
Returns the nr of tries for the test.
getQuestionSetType()
getter for question set type
getEndingTime()
Returns the ending time of the test.
getScoreCutting()
Determines if the score of a question should be cut at 0 points or the score of the whole test...
getShowCancel()
Returns wheather the cancel test button is shown or not.
getHighscoreScore()
Gets if the score column should be shown.
getMCScoring()
Gets the scoring type for multiple choice questions.
getHighscoreEnabled()
Gets the setting which determines if the highscore feature is enabled.
getKiosk()
Returns the kiosk mode.
getForceJS()
Gets whether JavaScript should be forced for tests.
getHighscoreTopNum($a_retval=10)
Gets the number of entries which are to be shown in the top-rankings table.
getPassScoring()
Gets the pass scoring type.
+ Here is the call graph for this function:

◆ update()

ilObjTest::update ( )

update object data

public

Returns
boolean

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

711  {
712  if (!parent::update())
713  {
714  return false;
715  }
716 
717  // put here object specific stuff
718 
719  return true;
720  }

◆ 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 public

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

References $ilDB.

4017  {
4018  global $ilDB;
4019 
4020  $affectedRows = $ilDB->manipulateF("UPDATE tst_times SET finished = %s, tstamp = %s WHERE times_id = %s",
4021  array('timestamp', 'integer', 'integer'),
4022  array(strftime("%Y-%m-%d %H:%M:%S"), time(), $times_id)
4023  );
4024  }
global $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 public
Deprecated:
: use ilTestParticipantData instead

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

References ilObjUser\_lookupName(), and getAnonymity().

Referenced by removeTestResultsByActiveIds(), removeTestResultsForUser(), sendAdvancedNotification(), and sendSimpleNotification().

9731  {
9732  if ($this->getAnonymity() && !$overwrite_anonymity)
9733  {
9734  return $this->lng->txt("anonymous") . $suffix;
9735  }
9736  else
9737  {
9738  include_once './Services/User/classes/class.ilObjUser.php';
9739  $uname = ilObjUser::_lookupName($user_id);
9740  if (strlen($uname["firstname"].$uname["lastname"]) == 0) $uname["firstname"] = $this->lng->txt("deleted_user");
9741  if ($sorted_order)
9742  {
9743  return trim($uname["lastname"] . ", " . $uname["firstname"]) . $suffix;
9744  }
9745  else
9746  {
9747  return trim($uname["firstname"] . " " . $uname["lastname"]) . $suffix;
9748  }
9749  }
9750  }
static _lookupName($a_user_id)
lookup user name
getAnonymity()
Returns the anonymity status of the test.
+ 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 451 of file class.ilObjTest.php.

◆ $_finalstatement

ilObjTest::$_finalstatement
private

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

◆ $_forcejs

ilObjTest::$_forcejs = TRUE
private

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

◆ $_kiosk

ilObjTest::$_kiosk
protected

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

◆ $_showfinalstatement

ilObjTest::$_showfinalstatement
private

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

◆ $_showinfo

ilObjTest::$_showinfo
private

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

◆ $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 353 of file class.ilObjTest.php.

◆ $allowedUsersTimeGap

ilObjTest::$allowedUsersTimeGap
protected

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

◆ $anonymity

ilObjTest::$anonymity

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

◆ $answer_feedback

ilObjTest::$answer_feedback

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

◆ $answer_feedback_points

ilObjTest::$answer_feedback_points

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

◆ $author

ilObjTest::$author

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

Referenced by 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().

◆ $certificate_visibility

ilObjTest::$certificate_visibility

Definition at line 367 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 286 of file class.ilObjTest.php.

◆ $ects_fx

ilObjTest::$ects_fx = NULL
protected

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

◆ $ects_grades

ilObjTest::$ects_grades = array()
protected

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

Referenced by getECTSGrades().

◆ $ects_output

ilObjTest::$ects_output = FALSE
protected

Definition at line 265 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 228 of file class.ilObjTest.php.

◆ $ending_time

ilObjTest::$ending_time
protected

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

Referenced by setActivationEndingTime(), and setEndingTime().

◆ $ending_time_enabled

ilObjTest::$ending_time_enabled
protected

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

Referenced by isEndingTimeEnabled(), and setEndingTimeEnabled().

◆ $evaluation_data

ilObjTest::$evaluation_data

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

◆ $exportsettings

ilObjTest::$exportsettings
protected

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

Referenced by getExportSettings().

◆ $fixed_participants

ilObjTest::$fixed_participants

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

◆ $instant_verification

ilObjTest::$instant_verification

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

◆ $instantFeedbackAnswerFixationEnabled

ilObjTest::$instantFeedbackAnswerFixationEnabled
protected

◆ $introduction

ilObjTest::$introduction
protected

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

Referenced by setIntroduction().

◆ $introductionEnabled

ilObjTest::$introductionEnabled
protected

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

Referenced by isIntroductionEnabled(), and setIntroductionEnabled().

◆ $invitation

ilObjTest::$invitation = INVITATION_OFF

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

◆ $isSkillManagementGloballyActivated

ilObjTest::$isSkillManagementGloballyActivated = null
staticprivate

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

◆ $limitUsersEnabled

ilObjTest::$limitUsersEnabled
protected

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

Referenced by isLimitUsersEnabled(), and setLimitUsersEnabled().

◆ $mailnotification

ilObjTest::$mailnotification
protected

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

Referenced by getMailNotification().

◆ $mailnottype

ilObjTest::$mailnottype
protected

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

Referenced by getMailNotificationType().

◆ $mark_schema

ilObjTest::$mark_schema

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

Referenced by _getAvailableTests(), and getMarkSchema().

◆ $mc_scoring

ilObjTest::$mc_scoring

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

◆ $metadata

ilObjTest::$metadata

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

◆ $nr_of_tries

ilObjTest::$nr_of_tries

Definition at line 196 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

◆ $online

bool ilObjTest::$online = null
private

the object's online status

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

Referenced by isOnline().

◆ $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 300 of file class.ilObjTest.php.

◆ $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 341 of file class.ilObjTest.php.

◆ $passwordEnabled

ilObjTest::$passwordEnabled
protected

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

Referenced by isPasswordEnabled(), and setPasswordEnabled().

◆ $poolUsage

ilObjTest::$poolUsage
protected

Definition at line 459 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 221 of file class.ilObjTest.php.

Referenced by setProcessingTime().

◆ $questions

ilObjTest::$questions

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

Referenced by getQuestions(), and getTestQuestions().

◆ $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 181 of file class.ilObjTest.php.

Referenced by setReportingDate().

◆ $reset_processing_time

ilObjTest::$reset_processing_time

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

◆ $resultFilterTaxIds

ilObjTest::$resultFilterTaxIds = array()
private

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

Referenced by getResultFilterTaxIds(), and setResultFilterTaxIds().

◆ $results_presentation

ilObjTest::$results_presentation

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

◆ $score_cutting

ilObjTest::$score_cutting

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

◆ $score_reporting

ilObjTest::$score_reporting

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

Referenced by setScoreReporting().

◆ $sequence_settings

ilObjTest::$sequence_settings

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

Referenced by setSequenceSettings().

◆ $show_cancel

ilObjTest::$show_cancel

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

◆ $show_exam_id_in_test_pass_enabled

ilObjTest::$show_exam_id_in_test_pass_enabled
protected

◆ $show_exam_id_in_test_results_enabled

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 388 of file class.ilObjTest.php.

◆ $show_summary

ilObjTest::$show_summary

Definition at line 322 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 308 of file class.ilObjTest.php.

◆ $sign_submission

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 65 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 240 of file class.ilObjTest.php.

Referenced by isStartingTimeEnabled(), and setStartingTimeEnabled().

◆ $template_id

ilObjTest::$template_id
private

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

Referenced by getTemplate(), and setTemplate().

◆ $test_id

ilObjTest::$test_id

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

Referenced by _getTestIDFromObjectID(), and getTestId().

◆ $testFinalBroken

ilObjTest::$testFinalBroken
protected

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

Referenced by isTestFinalBroken(), and setTestFinalBroken().

◆ $testSequence

ilObjTest::$testSequence

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

◆ $testSession

ilObjTest::$testSession

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

◆ $title_output

ilObjTest::$title_output

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

◆ $use_previous_answers

ilObjTest::$use_previous_answers

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

Referenced by _getUsePreviousAnswers().

◆ DEFAULT_PROCESSING_TIME_MINUTES

const ilObjTest::DEFAULT_PROCESSING_TIME_MINUTES = 90

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

◆ HIGHSCORE_SHOW_ALL_TABLES

const ilObjTest::HIGHSCORE_SHOW_ALL_TABLES = 3

◆ HIGHSCORE_SHOW_OWN_TABLE

◆ HIGHSCORE_SHOW_TOP_TABLE

◆ QUESTION_SET_TYPE_DYNAMIC

◆ QUESTION_SET_TYPE_FIXED

◆ QUESTION_SET_TYPE_RANDOM

◆ SCORE_REPORTING_DATE

const ilObjTest::SCORE_REPORTING_DATE = 3

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

Referenced by ilTestPassesSelector\isReportablePass().

◆ SCORE_REPORTING_DISABLED

const ilObjTest::SCORE_REPORTING_DISABLED = 0

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

◆ SCORE_REPORTING_FINISHED

const ilObjTest::SCORE_REPORTING_FINISHED = 1

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

Referenced by ilTestPassesSelector\isReportablePass().

◆ SCORE_REPORTING_IMMIDIATLY

const ilObjTest::SCORE_REPORTING_IMMIDIATLY = 2

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

Referenced by ilTestPassesSelector\isReportablePass().


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