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

Public Member Functions

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

Static Public Member Functions

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

Data Fields

const DEFAULT_PROCESSING_TIME_MINUTES = 90
 
const QUESTION_SET_TYPE_FIXED = 'FIXED_QUEST_SET'
 type setting value for fixed question set More...
 
const QUESTION_SET_TYPE_RANDOM = 'RANDOM_QUEST_SET'
 type setting value for random question set More...
 
const QUESTION_SET_TYPE_DYNAMIC = 'DYNAMIC_QUEST_SET'
 type setting value for dynamic question set (continues testing mode) More...
 
const HIGHSCORE_SHOW_OWN_TABLE = 1
 
const HIGHSCORE_SHOW_TOP_TABLE = 2
 
const HIGHSCORE_SHOW_ALL_TABLES = 3
 
 $test_id
 
 $invitation = INVITATION_OFF
 
 $author
 
 $metadata
 
 $questions
 
 $mark_schema
 
 $sequence_settings
 
 $score_reporting
 
 $instant_verification
 
 $answer_feedback_points
 
 $reporting_date
 
 $evaluation_data
 
 $nr_of_tries
 
 $use_previous_answers
 
 $title_output
 
 $processing_time
 
 $enable_processing_time
 
 $reset_processing_time
 
 $count_system
 
 $mc_scoring
 
 $pass_scoring
 
 $shuffle_questions
 
 $results_presentation
 
 $show_summary
 
 $score_cutting
 
 $certificate_visibility
 
 $anonymity
 
 $show_cancel
 
 $show_marker
 
 $fixed_participants
 
 $answer_feedback
 
 $testSession
 
 $testSequence
 
const SCORE_REPORTING_DISABLED = 0
 
const SCORE_REPORTING_FINISHED = 1
 
const SCORE_REPORTING_IMMIDIATLY = 2
 
const SCORE_REPORTING_DATE = 3
 
- 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
 

Protected Member Functions

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

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
 
 $oldOnlineStatus = null
 
 $print_best_solution_with_result = true
 
 $activation_visibility
 
 $activation_starting_time
 
 $activation_ending_time
 
 $autosave
 
 $autosave_ival
 
 $enable_examview
 
 $show_examview_html
 
 $show_examview_pdf
 
 $enable_archiving
 
 $show_exam_id_in_test_pass_enabled
 
 $show_exam_id_in_test_results_enabled
 
 $sign_submission
 
 $char_selector_availability
 
 $char_selector_definition
 
 $showGradingStatusEnabled
 
 $showGradingMarkEnabled
 
 $instantFeedbackAnswerFixationEnabled
 
 $forceInstantFeedbackEnabled
 
 $testFinalBroken
 
 $pass_waiting = "00:000:00:00:00"
 

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
 
 $tmpCopyWizardCopyId
 

Static Private Attributes

static $isSkillManagementGloballyActivated = null
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

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

Reimplemented from ilObject.

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

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ _buildName()

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

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

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

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

5390 {
5391 global $lng;
5392 $name = "";
5393 if (strlen($firstname.$lastname.$title) == 0)
5394 {
5395 $name = $lng->txt("deleted_user");
5396 }
5397 else
5398 {
5399 if ($user_id == ANONYMOUS_USER_ID)
5400 {
5401 $name = $lastname;
5402 }
5403 else
5404 {
5405 $name = trim($lastname . ", " . $firstname . " " . $title);
5406 }
5407 if ($is_anonymous)
5408 {
5409 $name = $lng->txt("anonymous");
5410 }
5411 }
5412 return $name;
5413 }

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

◆ _createImportDirectory()

static ilObjTest::_createImportDirectory ( )
static

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

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

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

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

Referenced by ilObjTestGUI\uploadTstObject().

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

◆ _evalResultsOverview()

& ilObjTest::_evalResultsOverview (   $test_id)

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

Returns
array An associated array containing the results @access public

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

5251 {
5252 global $ilDB;
5253
5254 $result = $ilDB->queryF("SELECT usr_data.usr_id, usr_data.firstname, usr_data.lastname, usr_data.title, usr_data.login, " .
5255 "tst_test_result.*, qpl_questions.original_id, qpl_questions.title questiontitle, " .
5256 "qpl_questions.points maxpoints " .
5257 "FROM tst_test_result, qpl_questions, tst_active " .
5258 "LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id " .
5259 "WHERE tst_active.active_id = tst_test_result.active_fi " .
5260 "AND qpl_questions.question_id = tst_test_result.question_fi " .
5261 "AND tst_active.test_fi = %s " .
5262 "ORDER BY tst_active.active_id, tst_test_result.pass, tst_test_result.tstamp",
5263 array('integer'),
5264 array($test_id)
5265 );
5266 $overview = array();
5267 while ($row = $ilDB->fetchAssoc($result))
5268 {
5269 if (!array_key_exists($row["active_fi"], $overview))
5270 {
5271 $overview[$row["active_fi"]] = array();
5272 $overview[$row["active_fi"]]["firstname"] = $row["firstname"];
5273 $overview[$row["active_fi"]]["lastname"] = $row["lastname"];
5274 $overview[$row["active_fi"]]["title"] = $row["title"];
5275 $overview[$row["active_fi"]]["login"] = $row["login"];
5276 $overview[$row["active_fi"]]["usr_id"] = $row["usr_id"];
5277 $overview[$row["active_fi"]]["started"] = $row["started"];
5278 $overview[$row["active_fi"]]["finished"] = $row["finished"];
5279 }
5280 if (!array_key_exists($row["pass"], $overview[$row["active_fi"]]))
5281 {
5282 $overview[$row["active_fi"]][$row["pass"]] = array();
5283 $overview[$row["active_fi"]][$row["pass"]]["reached"] = 0;
5284 $overview[$row["active_fi"]][$row["pass"]]["maxpoints"] = $row["maxpoints"];
5285 }
5286 array_push($overview[$row["active_fi"]][$row["pass"]], $row);
5287 $overview[$row["active_fi"]][$row["pass"]]["reached"] += $row["points"];
5288 }
5289 return $overview;
5290 }
$result
global $ilDB

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

Referenced by evalResultsOverview().

+ Here is the caller graph for this function:

◆ _getActiveIdOfUser()

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

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

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

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

4071 {
4072 global $ilDB;
4073 global $ilUser;
4074
4075 if (!$user_id) {
4076 $user_id = $ilUser->id;
4077 }
4078 if (!$test_id)
4079 {
4080 return "";
4081 }
4082 $result = $ilDB->queryF("SELECT tst_active.active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s",
4083 array('integer', 'integer'),
4084 array($user_id, $test_id)
4085 );
4086 if ($result->numRows())
4087 {
4088 $row = $ilDB->fetchAssoc($result);
4089 return $row["active_id"];
4090 }
4091 else
4092 {
4093 return "";
4094 }
4095 }

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

Referenced by ilLOUtils\getTestResultLinkForUser().

+ Here is the caller graph for this function:

◆ _getAvailableTests()

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

Returns the available tests for the active user.

Returns
array The available tests @access public

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

7204 {
7205 global $ilUser;
7206 global $ilDB;
7207
7208 $result_array = array();
7209 $tests = ilUtil::_getObjectsByOperations("tst","write", $ilUser->getId(), -1);
7210 if (count($tests))
7211 {
7212 $titles = ilObject::_prepareCloneSelection($tests, "tst");
7213 foreach ($tests as $ref_id)
7214 {
7215 if ($use_object_id)
7216 {
7218 $result_array[$obj_id] = $titles[$ref_id];
7219 }
7220 else
7221 {
7222 $result_array[$ref_id] = $titles[$ref_id];
7223 }
7224 }
7225 }
7226 return $result_array;
7227 }
static _lookupObjId($a_id)
static _prepareCloneSelection($a_ref_ids, $new_type, $show_path=true)
Prepare copy wizard object selection.
static _getObjectsByOperations($a_obj_type, $a_operation, $a_usr_id=0, $limit=0)
Get all objects of a specific type and check access This function is not recursive,...

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

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

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

◆ _getBestPass()

static ilObjTest::_getBestPass (   $active_id)
static

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

Parameters
int$active_id
Returns
int|mixed

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

8226 {
8227 global $ilDB;
8228
8229 $result = $ilDB->queryF("SELECT * FROM tst_pass_result WHERE active_fi = %s",
8230 array('integer'),
8231 array($active_id)
8232 );
8233 if ($result->numRows())
8234 {
8235 $bestrow = null;
8236 $bestfactor = 0;
8237 while ($row = $ilDB->fetchAssoc($result))
8238 {
8239 if($row["maxpoints"] > 0)
8240 {
8241 $factor = $row["points"] / $row["maxpoints"];
8242 }
8243 else
8244 {
8245 $factor = 0;
8246 }
8247
8248 if($factor > $bestfactor)
8249 {
8250 $bestrow = $row;
8251 $bestfactor = $factor;
8252 }
8253 }
8254 if (is_array($bestrow))
8255 {
8256 return $bestrow["pass"];
8257 }
8258 else
8259 {
8260 return 0;
8261 }
8262 }
8263 else
8264 {
8265 return 0;
8266 }
8267 }

References $ilDB, $result, and $row.

Referenced by _getResultPass().

+ Here is the caller graph for this function:

◆ _getCompleteWorkingTimeOfParticipants()

& ilObjTest::_getCompleteWorkingTimeOfParticipants (   $test_id)

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

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

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

4397 {
4398 global $ilDB;
4399
4400 $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",
4401 array('integer'),
4402 array($test_id)
4403 );
4404 $time = 0;
4405 $times = array();
4406 while ($row = $ilDB->fetchAssoc($result))
4407 {
4408 if (!array_key_exists($row["active_fi"], $times))
4409 {
4410 $times[$row["active_fi"]] = 0;
4411 }
4412 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
4413 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4414 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4415 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4416 $times[$row["active_fi"]] += ($epoch_2 - $epoch_1);
4417 }
4418 return $times;
4419 }

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

Referenced by getCompleteWorkingTimeOfParticipants().

+ Here is the caller graph for this function:

◆ _getCountSystem()

static ilObjTest::_getCountSystem (   $active_id)
static

Gets the count system for the calculation of points.

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

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

2582 {
2583 global $ilDB;
2584 $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",
2585 array('integer'),
2586 array($active_id)
2587 );
2588 if ($result->numRows())
2589 {
2590 $row = $ilDB->fetchAssoc($result);
2591 return $row["count_system"];
2592 }
2593 return FALSE;
2594 }

References $ilDB, $result, and $row.

Referenced by assQuestion\adjustReachedPointsByScoringOptions().

+ Here is the caller graph for this function:

◆ _getECTSGrade()

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

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

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

Implements ilEctsGradesEnabled.

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

6944 {
6945 include_once "./Modules/Test/classes/class.ilStatistics.php";
6946 // calculate the median
6947 $passed_statistics = new ilStatistics();
6948 $passed_statistics->setData($points_passed);
6949 $ects_percentiles = array
6950 (
6951 "A" => $passed_statistics->quantile($a),
6952 "B" => $passed_statistics->quantile($b),
6953 "C" => $passed_statistics->quantile($c),
6954 "D" => $passed_statistics->quantile($d),
6955 "E" => $passed_statistics->quantile($e)
6956 );
6957 if (count($points_passed) && ($reached_points >= $ects_percentiles["A"]))
6958 {
6959 return "A";
6960 }
6961 else if (count($points_passed) && ($reached_points >= $ects_percentiles["B"]))
6962 {
6963 return "B";
6964 }
6965 else if (count($points_passed) && ($reached_points >= $ects_percentiles["C"]))
6966 {
6967 return "C";
6968 }
6969 else if (count($points_passed) && ($reached_points >= $ects_percentiles["D"]))
6970 {
6971 return "D";
6972 }
6973 else if (count($points_passed) && ($reached_points >= $ects_percentiles["E"]))
6974 {
6975 return "E";
6976 }
6977 else if (strcmp($fx, "") != 0)
6978 {
6979 if ($max_points > 0)
6980 {
6981 $percentage = ($reached_points / $max_points) * 100.0;
6982 if ($percentage < 0) $percentage = 0.0;
6983 }
6984 else
6985 {
6986 $percentage = 0.0;
6987 }
6988 if ($percentage >= $fx)
6989 {
6990 return "FX";
6991 }
6992 else
6993 {
6994 return "F";
6995 }
6996 }
6997 else
6998 {
6999 return "F";
7000 }
7001 }
for($col=0; $col< 50; $col++) $d

References $d.

Referenced by getECTSGrade().

+ Here is the caller graph for this function:

◆ _getImportDirectory()

static ilObjTest::_getImportDirectory ( )
static

Get the import directory location of the test.

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

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

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

References $_SESSION.

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

+ Here is the caller graph for this function:

◆ _getLastAccess()

ilObjTest::_getLastAccess (   $active_id)

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

9376 {
9377 global $ilDB;
9378
9379 $result = $ilDB->queryF("SELECT finished FROM tst_times WHERE active_fi = %s ORDER BY finished DESC",
9380 array('integer'),
9381 array($active_id)
9382 );
9383 if ($result->numRows())
9384 {
9385 $row = $ilDB->fetchAssoc($result);
9386 return $row["finished"];
9387 }
9388 return "";
9389 }

References $ilDB, $result, and $row.

◆ _getMaxPass()

static ilObjTest::_getMaxPass (   $active_id)
static

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

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

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

8202 {
8203 global $ilDB;
8204 $result = $ilDB->queryF("SELECT MAX(pass) maxpass FROM tst_pass_result WHERE active_fi = %s",
8205 array('integer'),
8206 array($active_id)
8207 );
8208 if ($result->numRows())
8209 {
8210 $row = $ilDB->fetchAssoc($result);
8211 $max = $row["maxpass"];
8212 }
8213 else
8214 {
8215 $max = NULL;
8216 }
8217 return $max;
8218 }

References $ilDB, $result, and $row.

Referenced by _getResultPass().

+ Here is the caller graph for this function:

◆ _getMCScoring()

static ilObjTest::_getMCScoring (   $active_id)
static

Gets the scoring type for multiple choice questions.

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

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

2662 {
2663 global $ilDB;
2664 $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",
2665 array('integer'),
2666 array($active_id)
2667 );
2668 if ($result->numRows())
2669 {
2670 $row = $ilDB->fetchAssoc($result);
2671 return $row["mc_scoring"];
2672 }
2673 return FALSE;
2674 }

References $ilDB, $result, and $row.

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

+ Here is the caller graph for this function:

◆ _getObjectIDFromActiveID()

static ilObjTest::_getObjectIDFromActiveID (   $active_id)
static

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

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

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

7458 {
7459 global $ilDB;
7460 $object_id = FALSE;
7461 $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",
7462 array('integer'),
7463 array($active_id)
7464 );
7465 if ($result->numRows())
7466 {
7467 $row = $ilDB->fetchAssoc($result);
7468 $object_id = $row["obj_fi"];
7469 }
7470 return $object_id;
7471 }

References $ilDB, $result, and $row.

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

+ Here is the caller graph for this function:

◆ _getObjectIDFromTestID()

static ilObjTest::_getObjectIDFromTestID (   $test_id)
static

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

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

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

7435 {
7436 global $ilDB;
7437 $object_id = FALSE;
7438 $result = $ilDB->queryF("SELECT obj_fi FROM tst_tests WHERE test_id = %s",
7439 array('integer'),
7440 array($test_id)
7441 );
7442 if ($result->numRows())
7443 {
7444 $row = $ilDB->fetchAssoc($result);
7445 $object_id = $row["obj_fi"];
7446 }
7447 return $object_id;
7448 }

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

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

+ Here is the caller graph for this function:

◆ _getPass()

static ilObjTest::_getPass (   $active_id)
static

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

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

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

8175 {
8176 global $ilDB;
8177 $result = $ilDB->queryF("SELECT tries FROM tst_active WHERE active_id = %s",
8178 array('integer'),
8179 array($active_id)
8180 );
8181 if ($result->numRows())
8182 {
8183 $row = $ilDB->fetchAssoc($result);
8184 return $row["tries"];
8185 }
8186 else
8187 {
8188 return 0;
8189 }
8190 }

References $ilDB, $result, and $row.

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

+ Here is the caller graph for this function:

◆ _getPassScoring()

static ilObjTest::_getPassScoring (   $active_id)
static

Gets the pass scoring type.

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

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

2640 {
2641 global $ilDB;
2642 $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",
2643 array('integer'),
2644 array($active_id)
2645 );
2646 if ($result->numRows())
2647 {
2648 $row = $ilDB->fetchAssoc($result);
2649 return $row["pass_scoring"];
2650 }
2651 return 0;
2652 }

References $ilDB, $result, and $row.

Referenced by _getResultPass().

+ Here is the caller graph for this function:

◆ _getQuestionCountAndPointsForPassOfParticipant()

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

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

5130 {
5131 global $ilDB;
5132
5134
5135 switch( $questionSetType )
5136 {
5138
5139 $res = $ilDB->queryF("
5140 SELECT COUNT(qpl_questions.question_id) qcount,
5141 SUM(qpl_questions.points) qsum
5142 FROM tst_active
5143 INNER JOIN tst_tests
5144 ON tst_tests.test_id = tst_active.test_fi
5145 INNER JOIN tst_dyn_quest_set_cfg
5146 ON tst_dyn_quest_set_cfg.test_fi = tst_tests.test_id
5147 INNER JOIN qpl_questions
5148 ON qpl_questions.obj_fi = tst_dyn_quest_set_cfg.source_qpl_fi
5149 AND qpl_questions.original_id IS NULL
5150 AND qpl_questions.complete = %s
5151 WHERE tst_active.active_id = %s
5152 ",
5153 array('integer', 'integer'),
5154 array(1, $active_id)
5155 );
5156
5157 break;
5158
5160
5161 $res = $ilDB->queryF("
5162 SELECT tst_test_rnd_qst.pass,
5163 COUNT(tst_test_rnd_qst.question_fi) qcount,
5164 SUM(qpl_questions.points) qsum
5165
5166 FROM tst_test_rnd_qst,
5167 qpl_questions
5168
5169 WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id
5170 AND tst_test_rnd_qst.active_fi = %s
5171 AND pass = %s
5172
5173 GROUP BY tst_test_rnd_qst.active_fi,
5174 tst_test_rnd_qst.pass
5175 ",
5176 array('integer', 'integer'),
5177 array($active_id, $pass)
5178 );
5179
5180 break;
5181
5183
5184 $res = $ilDB->queryF("
5185 SELECT COUNT(tst_test_question.question_fi) qcount,
5186 SUM(qpl_questions.points) qsum
5187
5188 FROM tst_test_question,
5189 qpl_questions,
5190 tst_active
5191
5192 WHERE tst_test_question.question_fi = qpl_questions.question_id
5193 AND tst_test_question.test_fi = tst_active.test_fi
5194 AND tst_active.active_id = %s
5195
5196 GROUP BY tst_test_question.test_fi
5197 ",
5198 array('integer'),
5199 array($active_id)
5200 );
5201
5202 break;
5203
5204 default:
5205
5206 throw new ilTestException("not supported question set type: $questionSetType");
5207 }
5208
5209 $row = $ilDB->fetchAssoc($res);
5210
5211 if( is_array($row) )
5212 {
5213 return array("count" => $row["qcount"], "points" => $row["qsum"]);
5214 }
5215
5216 return array("count" => 0, "points" => 0);
5217 }
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
static lookupQuestionSetTypeByActiveId($active_id)
returns the question set type of test relating to passed active id
Base Exception for all Exceptions relating to Modules/Test.

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

Referenced by ilTestEvaluationData\generateOverview().

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

◆ _getResultPass()

static ilObjTest::_getResultPass (   $active_id)
static

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

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

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

8278 {
8279 $counted_pass = NULL;
8281 {
8282 $counted_pass = ilObjTest::_getBestPass($active_id);
8283 }
8284 else
8285 {
8286 $counted_pass = ilObjTest::_getMaxPass($active_id);
8287 }
8288 return $counted_pass;
8289 }
static _getPassScoring($active_id)
Gets the pass scoring type.
static _getMaxPass($active_id)
Retrieves the maximum pass of a given user for a given test in which the user answered at least one q...
static _getBestPass($active_id)
Retrieves the best pass of a given user for a given test.
const SCORE_BEST_PASS

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

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

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

◆ _getScoreCutting()

static ilObjTest::_getScoreCutting (   $active_id)
static

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

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

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

2684 {
2685 global $ilDB;
2686 $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",
2687 array('integer'),
2688 array($active_id)
2689 );
2690 if ($result->numRows())
2691 {
2692 $row = $ilDB->fetchAssoc($result);
2693 return $row["score_cutting"];
2694 }
2695 return FALSE;
2696 }

References $ilDB, $result, and $row.

Referenced by assQuestion\adjustReachedPointsByScoringOptions().

+ Here is the caller graph for this function:

◆ _getSolvedQuestions()

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

get solved questions

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

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

7942 {
7943 global $ilDB;
7944 if (is_numeric($question_fi))
7945 {
7946 $result = $ilDB->queryF("SELECT question_fi, solved FROM tst_qst_solved WHERE active_fi = %s AND question_fi=%s",
7947 array('integer', 'integer'),
7948 array($active_id, $question_fi)
7949 );
7950 }
7951 else
7952 {
7953 $result = $ilDB->queryF("SELECT question_fi, solved FROM tst_qst_solved WHERE active_fi = %s",
7954 array('integer'),
7955 array($active_id)
7956 );
7957 }
7958 $result_array = array();
7959 while ($row = $ilDB->fetchAssoc($result))
7960 {
7961 $result_array[$row["question_fi"]]= $row;
7962 }
7963 return $result_array;
7964 }

References $ilDB, $result, and $row.

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

+ Here is the caller graph for this function:

◆ _getTestDefaults()

static ilObjTest::_getTestDefaults (   $test_defaults_id)
static

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

9834 {
9835 global $ilDB;
9836
9837 $result = $ilDB->queryF("SELECT * FROM tst_test_defaults WHERE test_defaults_id = %s",
9838 array('integer'),
9839 array($test_defaults_id)
9840 );
9841 if ($result->numRows() == 1)
9842 {
9843 $row = $ilDB->fetchAssoc($result);
9844 return $row;
9845 }
9846 else
9847 {
9848 return NULL;
9849 }
9850 }

References $ilDB, $result, and $row.

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

+ Here is the caller graph for this function:

◆ _getTestIDFromObjectID()

static ilObjTest::_getTestIDFromObjectID (   $object_id)
static

Returns the ILIAS test id for a given object id.

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

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

7481 {
7482 global $ilDB;
7483 $test_id = FALSE;
7484 $result = $ilDB->queryF("SELECT test_id FROM tst_tests WHERE obj_fi = %s",
7485 array('integer'),
7486 array($object_id)
7487 );
7488 if ($result->numRows())
7489 {
7490 $row = $ilDB->fetchAssoc($result);
7491 $test_id = $row["test_id"];
7492 }
7493 return $test_id;
7494 }

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

Referenced by ilLOUtils\getTestResultLinkForUser().

+ Here is the caller graph for this function:

◆ _getTitleOutput()

ilObjTest::_getTitleOutput (   $active_id)

Returns the value of the title_output status.

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

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

2901 {
2902 global $ilDB;
2903
2904 $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",
2905 array('integer'),
2906 array($active_id)
2907 );
2908 if ($result->numRows())
2909 {
2910 $row = $ilDB->fetchAssoc($result);
2911 return $row["title_output"];
2912 }
2913 return 0;
2914 }

References $ilDB, $result, and $row.

◆ _getUsePreviousAnswers()

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

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

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

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

2934 {
2935 global $ilDB;
2936 global $ilUser;
2937
2939
2940 $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",
2941 array("integer"),
2942 array($active_id)
2943 );
2944 if ($result->numRows())
2945 {
2946 $row = $ilDB->fetchAssoc($result);
2947 $use_previous_answers = $row["use_previous_answers"];
2948 }
2949
2950 if ($use_previous_answers == 1)
2951 {
2952 if ($user_active_user_setting)
2953 {
2954 $res = $ilUser->getPref("tst_use_previous_answers");
2955 if ($res !== FALSE)
2956 {
2958 }
2959 }
2960 }
2961 return $use_previous_answers;
2962 }

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

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

+ Here is the caller graph for this function:

◆ _getUserIdFromActiveId()

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

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

9282 {
9283 global $ilDB;
9284 $result = $ilDB->queryF("SELECT user_fi FROM tst_active WHERE active_id = %s",
9285 array('integer'),
9286 array($active_id)
9287 );
9288 if ($result->numRows())
9289 {
9290 $row = $ilDB->fetchAssoc($result);
9291 return $row["user_fi"];
9292 }
9293 else
9294 {
9295 return -1;
9296 }
9297 }

References $ilDB, $result, and $row.

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

+ Here is the caller graph for this function:

◆ _getVisitTimeOfParticipant()

ilObjTest::_getVisitTimeOfParticipant (   $test_id,
  $active_id 
)

Returns the first and last visit of a participant.

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

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

4494 {
4495 global $ilDB;
4496
4497 $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",
4498 array('integer','integer'),
4499 array($test_id, $active_id)
4500 );
4501 $firstvisit = 0;
4502 $lastvisit = 0;
4503 while ($row = $ilDB->fetchAssoc($result))
4504 {
4505 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
4506 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4507 if ($firstvisit == 0 || $epoch_1 < $firstvisit) $firstvisit = $epoch_1;
4508 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4509 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4510 if ($epoch_2 > $lastvisit) $lastvisit = $epoch_2;
4511 }
4512 return array("firstvisit" => $firstvisit, "lastvisit" => $lastvisit);
4513 }

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

Referenced by getVisitTimeOfParticipant().

+ Here is the caller graph for this function:

◆ _getWorkingTimeOfParticipantForPass()

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

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

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

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

4454 {
4455 global $ilDB;
4456
4457 $result = $ilDB->queryF("SELECT * FROM tst_times WHERE active_fi = %s AND pass = %s ORDER BY started",
4458 array('integer','integer'),
4459 array($active_id, $pass)
4460 );
4461 $time = 0;
4462 while ($row = $ilDB->fetchAssoc($result))
4463 {
4464 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
4465 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4466 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4467 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4468 $time += ($epoch_2 - $epoch_1);
4469 }
4470 return $time;
4471 }

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

◆ _instanciateQuestion()

static ilObjTest::_instanciateQuestion (   $question_id)
static

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

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

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

5570 {
5571 if (strcmp($question_id, "") != 0)
5572 {
5573 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
5574 return assQuestion::_instanciateQuestion($question_id);
5575 }
5576 }
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.

References assQuestion\_instanciateQuestion().

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

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

◆ _isComplete()

ilObjTest::_isComplete (   $obj_id)

Returns true, if a test is complete for use.

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

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

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

References $ilDB, and $test.

◆ _lookupAnonymity()

static ilObjTest::_lookupAnonymity (   $a_obj_id)
static

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

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

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

9664 {
9665 global $ilDB;
9666
9667 $result = $ilDB->queryF("SELECT anonymity FROM tst_tests WHERE obj_fi = %s",
9668 array('integer'),
9669 array($a_obj_id)
9670 );
9671 while($row = $ilDB->fetchAssoc($result))
9672 {
9673 return $row['anonymity'];
9674 }
9675 return 0;
9676 }

References $ilDB, $result, and $row.

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

+ Here is the caller graph for this function:

◆ _lookupAuthor()

static ilObjTest::_lookupAuthor (   $obj_id)
static

Gets the authors name of the ilObjTest object.

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

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

7172 {
7173 $author = array();
7174 include_once "./Services/MetaData/classes/class.ilMD.php";
7175 $md = new ilMD($obj_id, 0, "tst");
7176 $md_life =& $md->getLifecycle();
7177 if ($md_life)
7178 {
7179 $ids =& $md_life->getContributeIds();
7180 foreach ($ids as $id)
7181 {
7182 $md_cont =& $md_life->getContribute($id);
7183 if (strcmp($md_cont->getRole(), "Author") == 0)
7184 {
7185 $entids =& $md_cont->getEntityIds();
7186 foreach ($entids as $entid)
7187 {
7188 $md_ent =& $md_cont->getEntity($entid);
7189 array_push($author, $md_ent->getEntity());
7190 }
7191 }
7192 }
7193 }
7194 return join($author, ",");
7195 }

References $author, and ilObject\$id.

Referenced by assQuestion\getInstances().

+ Here is the caller graph for this function:

◆ _lookupFinishedUserTests()

static ilObjTest::_lookupFinishedUserTests (   $a_user_id)
static

Gather all finished tests for user.

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

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

11108 {
11109 global $ilDB;
11110
11111 $result = $ilDB->queryF("SELECT test_fi,MAX(pass) AS pass FROM tst_active".
11112 " JOIN tst_pass_result ON (tst_pass_result.active_fi = tst_active.active_id)".
11113 " WHERE user_fi=%s".
11114 " GROUP BY test_fi",
11115 array('integer', 'integer'),
11116 array($a_user_id, 1)
11117 );
11118 $all = array();
11119 while($row = $ilDB->fetchAssoc($result))
11120 {
11121 $obj_id = self::_getObjectIDFromTestID($row["test_fi"]);
11122 $all[$obj_id] = (bool)$row["pass"];
11123 }
11124 return $all;
11125 }
static _getObjectIDFromTestID($test_id)
Returns the ILIAS test object id for a given test id.

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

+ Here is the call graph for this function:

◆ _lookupRandomTest()

static ilObjTest::_lookupRandomTest (   $a_obj_id)
static

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

Parameters
integer$a_obj_id
Returns
boolean $isRandomTest
Deprecated:

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

12083 {
12085 }
static lookupQuestionSetType($objId)
lookup-er for question set type

References lookupQuestionSetType(), and QUESTION_SET_TYPE_RANDOM.

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

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

◆ _lookupRandomTestFromActiveId()

ilObjTest::_lookupRandomTestFromActiveId (   $active_id)

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

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

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

9715 {
9716 throw new Exception(__METHOD__.' is deprecated ... use ilObjTest::lookupQuestionSetTypeByActiveId() instead!');
9717
9718 global $ilDB;
9719
9720 $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",
9721 array('integer'),
9722 array($active_id)
9723 );
9724 while($row = $ilDB->fetchAssoc($result))
9725 {
9726 return $row['random_test'];
9727 }
9728 return 0;
9729 }

References $ilDB, $result, and $row.

◆ _lookupTestObjIdForQuestionId()

static ilObjTest::_lookupTestObjIdForQuestionId (   $a_q_id)
static

Get test Object ID for question ID.

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

10408 {
10409 global $ilDB;
10410
10411 $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",
10412 array('integer'),
10413 array($a_q_id)
10414 );
10415 $rec = $ilDB->fetchAssoc($result);
10416 return $rec["obj_id"];
10417 }

References $ilDB, and $result.

Referenced by ilObjMediaObject\getParentObjectIdForUsage().

+ Here is the caller graph for this function:

◆ _setImportDirectory()

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

set import directory

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

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

References $_SESSION.

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

+ Here is the caller graph for this function:

◆ addDefaults()

ilObjTest::addDefaults (   $a_name)

Adds the defaults of this test to the test defaults.

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

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

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

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

+ Here is the call graph for this function:

◆ addExtraTime()

ilObjTest::addExtraTime (   $active_id,
  $minutes 
)

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

11787 {
11788 global $ilDB;
11789
11790 $participants = array();
11791 if ($active_id == 0)
11792 {
11793 $result = $ilDB->queryF("SELECT active_id FROM tst_active WHERE test_fi = %s",
11794 array('integer'),
11795 array($this->getTestId())
11796 );
11797 while ($row = $ilDB->fetchAssoc($result))
11798 {
11799 array_push($participants, $row['active_id']);
11800 }
11801 }
11802 else
11803 {
11804 array_push($participants, $active_id);
11805 }
11806 foreach ($participants as $active_id)
11807 {
11808 $result = $ilDB->queryF("SELECT active_fi FROM tst_addtime WHERE active_fi = %s",
11809 array('integer'),
11810 array($active_id)
11811 );
11812 if ($result->numRows() > 0)
11813 {
11814 $ilDB->manipulateF("DELETE FROM tst_addtime WHERE active_fi = %s",
11815 array('integer'),
11816 array($active_id)
11817 );
11818 }
11819
11820 $ilDB->manipulateF("UPDATE tst_active SET tries = %s, submitted = %s, submittimestamp = %s WHERE active_id = %s",
11821 array('integer','integer','timestamp','integer'),
11822 array(0, 0, NULL, $active_id)
11823 );
11824
11825 $ilDB->manipulateF("INSERT INTO tst_addtime (active_fi, additionaltime, tstamp) VALUES (%s, %s, %s)",
11826 array('integer','integer','integer'),
11827 array($active_id, $minutes, time())
11828 );
11829
11830 require_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
11832 {
11833 $this->logAction(sprintf($this->lng->txtlng("assessment", "log_added_extratime", ilObjAssessmentFolder::_getLogLanguage()), $minutes, $active_id));
11834 }
11835 }
11836 }
sprintf('%.4f', $callTime)
static _getLogLanguage()
retrieve the log language for assessment logging
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
getTestId()
Gets the database id of the additional test data.
logAction($logtext="", $question_id="")
Logs an action into the Test&Assessment log.

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

+ Here is the call graph for this function:

◆ addQTIMaterial()

ilObjTest::addQTIMaterial ( $a_xml_writer,
  $a_material 
)

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

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

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

9452 {
9453 include_once "./Services/RTE/classes/class.ilRTE.php";
9454 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
9455
9456 $a_xml_writer->xmlStartTag("material");
9457 $attrs = array(
9458 "texttype" => "text/plain"
9459 );
9460 if ($this->isHTML($a_material))
9461 {
9462 $attrs["texttype"] = "text/xhtml";
9463 }
9464 $a_xml_writer->xmlElement("mattext", $attrs, ilRTE::_replaceMediaObjectImageSrc($a_material, 0));
9465
9466 $mobs = ilObjMediaObject::_getMobsOfObject("tst:html", $this->getId());
9467 foreach ($mobs as $mob)
9468 {
9469 $moblabel = "il_" . IL_INST_ID . "_mob_" . $mob;
9470 if (strpos($a_material, "mm_$mob") !== FALSE)
9471 {
9472 if (ilObjMediaObject::_exists($mob))
9473 {
9474 $mob_obj = new ilObjMediaObject($mob);
9475 $imgattrs = array(
9476 "label" => $moblabel,
9477 "uri" => "objects/" . "il_" . IL_INST_ID . "_mob_" . $mob . "/" . $mob_obj->getTitle()
9478 );
9479 }
9480 $a_xml_writer->xmlElement("matimage", $imgattrs, NULL);
9481 }
9482 }
9483 $a_xml_writer->xmlEndTag("material");
9484 }
Class ilObjMediaObject.
static _getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
static _exists($a_id, $a_reference=false, $a_type=NULL)
checks wether a lm content object with specified id exists or not
isHTML($a_text)
Checks if a given string contains HTML or not.
getId()
get object id @access public
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
$mobs

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

Referenced by toXML().

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

◆ allObligationsAnswered()

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

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

@access public @global ilDBInterface $ilDB

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

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

11591 {
11592 global $ilDB;
11593
11594 $rset = $ilDB->queryF(
11595 'SELECT obligations_answered FROM tst_pass_result WHERE active_fi = %s AND pass = %s',
11596 array('integer', 'integer'),
11597 array($active_id, $pass)
11598 );
11599
11600 if( $row = $ilDB->fetchAssoc($rset) )
11601 {
11602 return (bool)$row['obligations_answered'];
11603 }
11604
11606 }
static hasObligations($test_id)
returns the fact wether the test with given test id contains questions markes as obligatory or not

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

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

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

◆ applyDefaults()

ilObjTest::applyDefaults (   $test_defaults)

Applies given test defaults to this test.

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

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

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

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

+ Here is the call graph for this function:

◆ areObligationsEnabled()

ilObjTest::areObligationsEnabled ( )

returns the fact wether obligations are enabled or not

Returns
boolean

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

11533 {
11534 return (bool)$this->obligationsEnabled;
11535 }

References $obligationsEnabled.

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

+ Here is the caller graph for this function:

◆ buildExamId()

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

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

11906 {
11907 global $ilSetting;
11908
11909 $inst_id = $ilSetting->get( 'inst_id', null );
11910
11911 if($test_obj_id === null)
11912 {
11913 $obj_id = self::_getObjectIDFromActiveID($active_id);
11914 }
11915 else
11916 {
11917 $obj_id = $test_obj_id;
11918 }
11919
11920 $examId = 'I' . $inst_id . '_T' . $obj_id . '_A' . $active_id . '_P' . $pass;
11921
11922 return $examId;
11923 }
static _getObjectIDFromActiveID($active_id)
Returns the ILIAS test object id for a given active id.
global $ilSetting
Definition: privfeed.php:17

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

Referenced by ilTestPlayerAbstractGUI\getKioskHead().

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

◆ buildIso8601PeriodFromUnixtimeForExportCompatibility()

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

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

6717 {
6718 $date_time_unix = new ilDateTime($unix_timestamp, IL_CAL_UNIX);
6719 $date_time = $date_time_unix->get(IL_CAL_DATETIME);
6720 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $date_time, $matches);
6721 $iso8601_period = sprintf("P%dY%dM%dDT%dH%dM%dS", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]);
6722 return $iso8601_period;
6723 }
const IL_CAL_UNIX
const IL_CAL_DATETIME
@classDescription Date and time handling

References IL_CAL_DATETIME, IL_CAL_UNIX, and sprintf.

Referenced by toXML().

+ Here is the caller graph for this function:

◆ buildName()

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

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

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

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

5353 {
5354 $name = "";
5355 if (strlen($firstname.$lastname.$title) == 0)
5356 {
5357 $name = $this->lng->txt("deleted_user");
5358 }
5359 else
5360 {
5361 if ($user_id == ANONYMOUS_USER_ID)
5362 {
5363 $name = $lastname;
5364 }
5365 else
5366 {
5367 $name = trim($lastname . ", " . $firstname . " " . $title);
5368 }
5369 if ($this->getAnonymity())
5370 {
5371 $name = $this->lng->txt("anonymous");
5372 }
5373 }
5374 return $name;
5375 }

References ilObject\$title, and getAnonymity().

+ Here is the call graph for this function:

◆ canEditEctsGrades()

ilObjTest::canEditEctsGrades ( )

{

Returns
boolean
}

Implements ilEctsGradesEnabled.

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

6920 {
6921 return $this->canShowEctsGrades() && $this->canEditMarks();
6922 }
canShowEctsGrades()
{boolean}

References canEditMarks(), and canShowEctsGrades().

+ Here is the call graph for this function:

◆ canEditMarks()

ilObjTest::canEditMarks ( )
Returns
{}

Implements ilMarkSchemaAware.

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

7052 {
7053 $total = $this->evalTotalPersons();
7054 if($total > 0)
7055 {
7056 if($this->getReportingDate())
7057 {
7058 if(preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getReportingDate(), $matches))
7059 {
7060 $epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
7061 $now = time();
7062 if($now < $epoch_time)
7063 {
7064 return true;
7065 }
7066 }
7067 }
7068 return false;
7069 }
7070 else
7071 {
7072 return true;
7073 }
7074 }
$total
Definition: Utf8Test.php:87
evalTotalPersons()
Returns the number of persons who started the test.

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

Referenced by canEditEctsGrades().

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

◆ canShowCertificate()

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

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

@access public

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

10465 {
10466 if ($this->canShowTestResults($testSession))
10467 {
10468 include_once "./Services/Certificate/classes/class.ilCertificate.php";
10469 include_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
10470 $cert = new ilCertificate(new ilTestCertificateAdapter($this));
10471 if ($cert->isComplete())
10472 {
10473 $vis = $this->getCertificateVisibility();
10474 $showcert = FALSE;
10475 switch ($vis)
10476 {
10477 case 0:
10478 $showcert = TRUE;
10479 break;
10480 case 1:
10481 if ($this->getPassed($active_id))
10482 {
10483 $showcert = TRUE;
10484 }
10485 break;
10486 case 2:
10487 $showcert = FALSE;
10488 break;
10489 }
10490 if ($showcert)
10491 {
10492 return TRUE;
10493 }
10494 else
10495 {
10496 return FALSE;
10497 }
10498 }
10499 else
10500 {
10501 return FALSE;
10502 }
10503 }
10504 else
10505 {
10506 return FALSE;
10507 }
10508 }
Create PDF certificates.
getPassed($active_id)
canShowTestResults($testSession)
getCertificateVisibility()
Returns the visibility settings of the certificate.

References canShowTestResults(), getCertificateVisibility(), and getPassed().

+ Here is the call graph for this function:

◆ canShowEctsGrades()

ilObjTest::canShowEctsGrades ( )

{

Returns
boolean
}

Implements ilEctsGradesEnabled.

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

6928 {
6929 return $this->getReportingDate();
6930 }

References getReportingDate().

Referenced by canEditEctsGrades().

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

◆ canShowSolutionPrintview()

ilObjTest::canShowSolutionPrintview (   $user_id = NULL)

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

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

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

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

References getShowSolutionPrintview().

+ Here is the call graph for this function:

◆ canShowTestResults()

ilObjTest::canShowTestResults (   $testSession)

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

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

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

Referenced by canShowCertificate().

+ 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 @access public
Deprecated:
use class ilTestPassesSelector instead

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

8497 {
8498 // this logic was implemented before, it got stabled only for now
8499 // this method is not as exact as it's required, it's to be replaced in the long time
8500
8501 switch( $this->getScoreReporting() )
8502 {
8504 case self::SCORE_REPORTING_FINISHED: // this isn't excact enough
8505
8506 return true;
8507
8509
8510 if (!$this->getReportingDate())
8511 {
8512 return false;
8513 }
8514
8515 if (preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getReportingDate(), $matches))
8516 {
8517 $epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
8518 $now = time();
8519 if ($now < $epoch_time)
8520 {
8521 return false;
8522 }
8523 }
8524
8525 return true;
8526 }
8527
8528 return false;
8529 }
const SCORE_REPORTING_IMMIDIATLY
const SCORE_REPORTING_FINISHED
const SCORE_REPORTING_DATE

References getReportingDate(), getScoreReporting(), SCORE_REPORTING_DATE, SCORE_REPORTING_FINISHED, and SCORE_REPORTING_IMMIDIATLY.

Referenced by canShowTestResults().

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

7007 {
7008 return $this->mark_schema->checkMarks();
7009 }

◆ checkMaximumAllowedUsers()

ilObjTest::checkMaximumAllowedUsers ( )

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

9336 {
9337 global $ilDB;
9338
9339 $nr_of_users = $this->getAllowedUsers();
9340 $time_gap = ($this->getAllowedUsersTimeGap()) ? $this->getAllowedUsersTimeGap() : 60;
9341 if (($nr_of_users > 0) && ($time_gap > 0))
9342 {
9343 $now = time();
9344 $time_border = $now - $time_gap;
9345 $str_time_border = strftime("%Y%m%d%H%M%S", $time_border);
9346 $query = "
9347 SELECT DISTINCT tst_times.active_fi
9348 FROM tst_times
9349 INNER JOIN tst_active
9350 ON tst_times.active_fi = tst_active.active_id
9351 AND (
9352 tst_times.pass > tst_active.last_finished_pass OR tst_active.last_finished_pass IS NULL
9353 )
9354 WHERE tst_times.tstamp > %s
9355 AND tst_active.test_fi = %s
9356 ";
9357 $result = $ilDB->queryF($query, array('integer', 'integer'), array($time_border, $this->getTestId()));
9358 if ($result->numRows() >= $nr_of_users)
9359 {
9360 include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
9362 {
9363 $this->logAction($this->lng->txtlng("assessment", "log_could_not_enter_test_due_to_simultaneous_users", ilObjAssessmentFolder::_getLogLanguage()));
9364 }
9365 return FALSE;
9366 }
9367 else
9368 {
9369 return TRUE;
9370 }
9371 }
9372 return TRUE;
9373 }

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

+ Here is the call graph for this function:

◆ checkQuestionParent()

ilObjTest::checkQuestionParent (   $questionId)

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

8669 {
8670 global $DIC; /* @var ILIAS\DI\Container $DIC */
8671
8672 $row = $DIC->database()->fetchAssoc($DIC->database()->queryF(
8673 "SELECT COUNT(question_id) cnt FROM qpl_questions WHERE question_id = %s AND obj_fi = %s",
8674 array('integer', 'integer'), array($questionId, $this->getId())
8675 ));
8676
8677 return (bool)$row['cnt'];
8678 }
global $DIC

References $DIC, $row, and ilObject\getId().

+ Here is the call graph for this function:

◆ cleanupMediaobjectUsage()

ilObjTest::cleanupMediaobjectUsage ( )

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

@access private

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

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

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

Referenced by saveToDb().

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

◆ create()

ilObjTest::create ( )

create test object

Reimplemented from ilObject.

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

739 {
740 parent::create();
741
742 // meta data will be created by
743 // import parser
744 if (!$a_upload)
745 {
746 $this->createMetaData();
747 }
748 }
createMetaData()
Create meta data entry.

References createMetaData().

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

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

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

+ Here is the call graph for this function:

◆ createMetaData()

ilObjTest::createMetaData ( )

Create meta data entry.

@access public

Reimplemented from ilObject.

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

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

References saveAuthorToMetadata().

Referenced by create().

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

◆ createQuestionGUI()

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

Creates a question GUI instance of a given question type.

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

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

5524 {
5525 if ((!$question_type) and ($question_id > 0))
5526 {
5527 $question_type = $this->getQuestionType($question_id);
5528 }
5529
5530 if (!strlen($question_type)) return null;
5531
5532 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
5533 assQuestion::_includeClass($question_type, 1);
5534
5535 $question_type_gui = assQuestion::getGuiClassNameByQuestionType($question_type);
5536 $question = new $question_type_gui();
5537
5538 if ($question_id > 0)
5539 {
5540 $question->object->loadFromDb($question_id);
5541
5542 global $ilCtrl, $ilDB, $ilUser, $lng;
5543
5544 $feedbackObjectClassname = assQuestion::getFeedbackClassNameByQuestionType($question_type);
5545 $question->object->feedbackOBJ = new $feedbackObjectClassname($question->object, $ilCtrl, $ilDB, $lng);
5546
5547 $assSettings = new ilSetting('assessment');
5548 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockerFactory.php';
5549 $processLockerFactory = new ilAssQuestionProcessLockerFactory($assSettings, $ilDB);
5550 $processLockerFactory->setQuestionId($question->object->getId());
5551 $processLockerFactory->setUserId($ilUser->getId());
5552 include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
5553 $processLockerFactory->setAssessmentLogEnabled(ilObjAssessmentFolder::_enabledAssessmentLogging());
5554 $question->object->setProcessLocker($processLockerFactory->getLocker());
5555 }
5556
5557 return $question;
5558 }
static getFeedbackClassNameByQuestionType($questionType)
static getGuiClassNameByQuestionType($questionType)
static _includeClass($question_type, $gui=0)
Include the php class file for a given question type.
getQuestionType($question_id)
Returns the question type of a question with a given id.
ILIAS Setting Class.
global $ilCtrl
Definition: ilias.php:18

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

+ Here is the call graph for this function:

◆ createRandomSolutions()

ilObjTest::createRandomSolutions (   $number)

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

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

References $data, $ilDB, $pass, $query, $result, $testSequence, $testSession, ilObjAssessmentFolder\_enabledAssessmentLogging(), _instanciateQuestion(), date, getNrOfTries(), getQuestionCount(), ilObject\getRefId(), getTestId(), isRandomTest(), and sprintf.

+ Here is the call graph for this function:

◆ createTestSequence()

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

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

10331 {
10332 include_once "./Modules/Test/classes/class.ilTestSequence.php";
10333 $this->testSequence = new ilTestSequence($active_id, $pass, $this->isRandomTest());
10334 }

References $pass, and isRandomTest().

+ Here is the call graph for this function:

◆ delete()

ilObjTest::delete ( )

delete object and all related data

@access public

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

Reimplemented from ilObject.

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

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

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

+ Here is the call graph for this function:

◆ deleteDefaults()

ilObjTest::deleteDefaults (   $test_default_id)

Deletes the defaults for a test.

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

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

9859 {
9860 global $ilDB;
9861 $affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_defaults WHERE test_defaults_id = %s",
9862 array('integer'),
9863 array($test_default_id)
9864 );
9865 }

References $ilDB.

◆ deleteTest()

ilObjTest::deleteTest ( )

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

@access public

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

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

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

Referenced by delete().

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

◆ deliverPDFfromFO()

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

Delivers a PDF file from a XSL-FO string.

Parameters
string$foThe XSL-FO string @access public

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

10219 {
10220 global $ilLog;
10221
10222 include_once "./Services/Utilities/classes/class.ilUtil.php";
10223 $fo_file = ilUtil::ilTempnam() . ".fo";
10224 $fp = fopen($fo_file, "w"); fwrite($fp, $fo); fclose($fp);
10225
10226 include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
10227 try
10228 {
10229 $pdf_base64 = ilRpcClientFactory::factory('RPCTransformationHandler')->ilFO2PDF($fo);
10230 $filename = (strlen($title)) ? $title : $this->getTitle();
10231 ilUtil::deliverData($pdf_base64->scalar, ilUtil::getASCIIFilename($filename) . ".pdf", "application/pdf", false, true);
10232 return true;
10233 }
10234 catch(Exception $e)
10235 {
10236 $ilLog->write(__METHOD__.': '.$e->getMessage());
10237 return false;
10238 }
10239 }
getTitle()
get object title @access public
static factory($a_package, $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename

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

Referenced by deliverPDFfromHTML().

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

◆ deliverPDFfromHTML()

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

Delivers a PDF file from XHTML.

Parameters
string$htmlThe XHTML string @access public

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

10176 {
10177 $content = preg_replace("/href=\".*?\"/", "", $content);
10178 $printbody = new ilTemplate("tpl.il_as_tst_print_body.html", TRUE, TRUE, "Modules/Test");
10179 $printbody->setVariable("TITLE", ilUtil::prepareFormOutput($this->getTitle()));
10180 $printbody->setVariable("ADM_CONTENT", $content);
10181 $printbody->setCurrentBlock("css_file");
10182 $printbody->setVariable("CSS_FILE", $this->getTestStyleLocation("filesystem"));
10183 $printbody->parseCurrentBlock();
10184 $printbody->setCurrentBlock("css_file");
10185 $printbody->setVariable("CSS_FILE", ilUtil::getStyleSheetLocation("filesystem", "delos.css"));
10186 $printbody->parseCurrentBlock();
10187 $printoutput = $printbody->get();
10188 $html = str_replace("href=\"./", "href=\"" . ILIAS_HTTP_PATH . "/", $printoutput);
10189 $html = preg_replace("/<div id=\"dontprint\">.*?<\\/div>/ims", "", $html);
10190 if (extension_loaded("tidy"))
10191 {
10192 $config = array(
10193 "indent" => false,
10194 "output-xml" => true,
10195 "numeric-entities" => true
10196 );
10197 $tidy = new tidy();
10198 $tidy->parseString($html, $config, 'utf8');
10199 $tidy->cleanRepair();
10200 $html = tidy_get_output($tidy);
10201 $html = preg_replace("/^.*?(<html)/", "\\1", $html);
10202 }
10203 else
10204 {
10205 $html = str_replace("&nbsp;", "&#160;", $html);
10206 $html = str_replace("&otimes;", "X", $html);
10207 }
10208 $html = preg_replace("/src=\".\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $html);
10210 }
processPrintoutput2FO($print_output)
Convert a print output to XSL-FO.
deliverPDFfromFO($fo, $title=null)
Delivers a PDF file from a XSL-FO string.
getTestStyleLocation($mode="output")
get full style sheet file name (path inclusive) of current user
special template class to simplify handling of ITX/PEAR
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
$html
Definition: example_001.php:87

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

+ Here is the call graph for this function:

◆ disinviteUser()

ilObjTest::disinviteUser (   $user_id)

Disinvites a user from a test.

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

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

7896 {
7897 global $ilDB;
7898
7899 $affectedRows = $ilDB->manipulateF("DELETE FROM tst_invited_user WHERE test_fi = %s AND user_fi = %s",
7900 array('integer', 'integer'),
7901 array($this->getTestId(), $user_id)
7902 );
7903 }

References $ilDB, and getTestId().

+ Here is the call graph for this function:

◆ duplicateQuestionForTest()

ilObjTest::duplicateQuestionForTest (   $question_id)

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

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

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

3654 {
3655 global $ilUser;
3656 $question =& ilObjTest::_instanciateQuestion($question_id);
3657 $duplicate_id = $question->duplicate(true, null, null, null, $this->getId());
3658
3659 return $duplicate_id;
3660 }

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

Referenced by insertQuestion().

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

◆ endingTimeReached()

ilObjTest::endingTimeReached ( )

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

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

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

5653 {
5654 if( $this->isEndingTimeEnabled() && $this->getEndingTime() != 0 )
5655 {
5656 $now = time();
5657 if ($now > $this->getEndingTime())
5658 {
5659 return true;
5660 }
5661 }
5662 return false;
5663 }

References getEndingTime(), and isEndingTimeEnabled().

Referenced by canShowTestResults(), and isExecutable().

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

◆ ensureParticipantsLastActivePassFinished()

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

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

12270 {
12271 global $ilDB, $lng, $ilPluginAdmin;
12272
12273 /* @var ilObjTest $testOBJ */
12274
12275 $testOBJ = ilObjectFactory::getInstanceByRefId($testObjId,false);
12276
12277 $activeId = $testOBJ->getActiveIdOfUser($userId);
12278
12279 require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
12280 $testSessionFactory = new ilTestSessionFactory($testOBJ);
12281
12282 require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
12283 $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $testOBJ);
12284
12285 $testSession = $testSessionFactory->getSession($activeId);
12286 $testSequence = $testSequenceFactory->getSequenceByActiveIdAndPass($activeId, $testSession->getPass());
12287 $testSequence->loadFromDb();
12288
12289 // begin-patch lok changed smeyer
12290 if($a_force_new_run)
12291 {
12292 if( $testSequence->hasSequence() )
12293 {
12294 $testSession->increasePass();
12295 }
12296 $testSession->setLastSequence(0);
12297 $testSession->saveToDb();
12298 }
12299 // end-patch lok
12300 }
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id

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

+ Here is the call graph for this function:

◆ evalResultsOverview()

& ilObjTest::evalResultsOverview ( )

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

Returns
array An associated array containing the results @access public

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

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

References _evalResultsOverview(), and getTestId().

+ Here is the call graph for this function:

◆ evalResultsOverviewOfParticipant()

& ilObjTest::evalResultsOverviewOfParticipant (   $active_id)

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

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

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

5300 {
5301 global $ilDB;
5302
5303 $result = $ilDB->queryF("SELECT usr_data.usr_id, usr_data.firstname, usr_data.lastname, usr_data.title, usr_data.login, " .
5304 "tst_test_result.*, qpl_questions.original_id, qpl_questions.title questiontitle, " .
5305 "qpl_questions.points maxpoints " .
5306 "FROM tst_test_result, qpl_questions, tst_active " .
5307 "LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id " .
5308 "WHERE tst_active.active_id = tst_test_result.active_fi " .
5309 "AND qpl_questions.question_id = tst_test_result.question_fi " .
5310 "AND tst_active.test_fi = %s AND tst_active.active_id = %s" .
5311 "ORDER BY tst_active.active_id, tst_test_result.pass, tst_test_result.tstamp",
5312 array('integer', 'integer'),
5313 array($this->getTestId(), $active_id)
5314 );
5315 $overview = array();
5316 while ($row = $ilDB->fetchAssoc($result))
5317 {
5318 if (!array_key_exists($row["active_fi"], $overview))
5319 {
5320 $overview[$row["active_fi"]] = array();
5321 $overview[$row["active_fi"]]["firstname"] = $row["firstname"];
5322 $overview[$row["active_fi"]]["lastname"] = $row["lastname"];
5323 $overview[$row["active_fi"]]["title"] = $row["title"];
5324 $overview[$row["active_fi"]]["login"] = $row["login"];
5325 $overview[$row["active_fi"]]["usr_id"] = $row["usr_id"];
5326 $overview[$row["active_fi"]]["started"] = $row["started"];
5327 $overview[$row["active_fi"]]["finished"] = $row["finished"];
5328 }
5329 if (!array_key_exists($row["pass"], $overview[$row["active_fi"]]))
5330 {
5331 $overview[$row["active_fi"]][$row["pass"]] = array();
5332 $overview[$row["active_fi"]][$row["pass"]]["reached"] = 0;
5333 $overview[$row["active_fi"]][$row["pass"]]["maxpoints"] = $row["maxpoints"];
5334 }
5335 array_push($overview[$row["active_fi"]][$row["pass"]], $row);
5336 $overview[$row["active_fi"]][$row["pass"]]["reached"] += $row["points"];
5337 }
5338 return $overview;
5339 }

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

+ Here is the call graph for this function:

◆ evalStatistical()

& ilObjTest::evalStatistical (   $active_id)

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

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

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

4522 {
4523 global $ilDB;
4524// global $ilBench;
4525 $pass = ilObjTest::_getResultPass($active_id);
4526 $test_result =& $this->getTestResult($active_id, $pass);
4527 $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",
4528 array('integer'),
4529 array($active_id)
4530 );
4531 $times = array();
4532 $first_visit = 0;
4533 $last_visit = 0;
4534 while ($row = $ilDB->fetchObject($result))
4535 {
4536 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->started, $matches);
4537 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4538 if (!$first_visit) {
4539 $first_visit = $epoch_1;
4540 }
4541 if ($epoch_1 < $first_visit) {
4542 $first_visit = $epoch_1;
4543 }
4544 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->finished, $matches);
4545 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4546 if (!$last_visit) {
4547 $last_visit = $epoch_2;
4548 }
4549 if ($epoch_2 > $last_visit) {
4550 $last_visit = $epoch_2;
4551 }
4552 $times[$row->active_fi] += ($epoch_2 - $epoch_1);
4553 }
4554 $max_time = 0;
4555 foreach ($times as $key => $value) {
4556 $max_time += $value;
4557 }
4558 if ((!$test_result["test"]["total_reached_points"]) or (!$test_result["test"]["total_max_points"]))
4559 {
4560 $percentage = 0.0;
4561 }
4562 else
4563 {
4564 $percentage = ($test_result["test"]["total_reached_points"] / $test_result["test"]["total_max_points"]) * 100.0;
4565 if ($percentage < 0) $percentage = 0.0;
4566 }
4567 $mark_obj = $this->mark_schema->getMatchingMark($percentage);
4568 $first_date = getdate($first_visit);
4569 $last_date = getdate($last_visit);
4570 $qworkedthrough = 0;
4571 foreach ($test_result as $key => $value)
4572 {
4573 if (preg_match("/\d+/", $key))
4574 {
4575 $qworkedthrough += $value["workedthrough"];
4576 }
4577 }
4578 if (!$qworkedthrough)
4579 {
4580 $atimeofwork = 0;
4581 }
4582 else
4583 {
4584 $atimeofwork = $max_time / $qworkedthrough;
4585 }
4586
4587 $obligationsAnswered = $test_result["test"]["obligations_answered"];
4588
4589 $result_mark = "";
4590 $passed = "";
4591
4592 if ($mark_obj)
4593 {
4594 $result_mark = $mark_obj->getShortName();
4595
4596 if( $mark_obj->getPassed() && $obligationsAnswered )
4597 {
4598 $passed = 1;
4599 }
4600 else
4601 {
4602 $passed = 0;
4603 }
4604 }
4605 $percent_worked_through = 0;
4606 if (count($this->questions))
4607 {
4608 $percent_worked_through = $qworkedthrough / count($this->questions);
4609 }
4610 $result_array = array(
4611 "qworkedthrough" => $qworkedthrough,
4612 "qmax" => count($this->questions),
4613 "pworkedthrough" => $percent_worked_through,
4614 "timeofwork" => $max_time,
4615 "atimeofwork" => $atimeofwork,
4616 "firstvisit" => $first_date,
4617 "lastvisit" => $last_date,
4618 "resultspoints" => $test_result["test"]["total_reached_points"],
4619 "maxpoints" => $test_result["test"]["total_max_points"],
4620 "resultsmarks" => $result_mark,
4621 "passed" => $passed,
4622 "distancemedian" => "0"
4623 );
4624 foreach ($test_result as $key => $value)
4625 {
4626 if (preg_match("/\d+/", $key))
4627 {
4628 $result_array[$key] = $value;
4629 }
4630 }
4631 return $result_array;
4632 }
static _getResultPass($active_id)
Retrieves the pass number that should be counted for a given user.
& getTestResult($active_id, $pass=NULL, $ordered_sequence=FALSE, $considerHiddenQuestions=true, $considerOptionalQuestions=true)
Calculates the results of a test for a given user and returns an array with all test results.

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

+ 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 @access public

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

4807 {
4808 global $ilDB;
4809
4810 $result = $ilDB->queryF("SELECT COUNT(active_id) total FROM tst_active WHERE test_fi = %s AND submitted = %s",
4811 array('integer', 'integer'),
4812 array($this->getTestId(), 1)
4813 );
4814 $row = $ilDB->fetchAssoc($result);
4815 return $row["total"];
4816 }

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

Referenced by getAggregatedResultsData().

+ 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 @access public

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

4765 {
4766 global $ilDB;
4767 $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),
4768 array('integer'),
4769 array($this->getTestId())
4770 );
4771 $persons_array = array();
4772 while ($row = $ilDB->fetchAssoc($result))
4773 {
4774 if ($this->getAnonymity())
4775 {
4776 $persons_array[$row["active_id"]] = array("name" => $this->lng->txt("anonymous"));
4777 }
4778 else
4779 {
4780 if (strlen($row["firstname"].$row["lastname"].$row["title"]) == 0)
4781 {
4782 $persons_array[$row["active_id"]] = array("name" => $this->lng->txt("deleted_user"));
4783 }
4784 else
4785 {
4786 if ($row["user_fi"] == ANONYMOUS_USER_ID)
4787 {
4788 $persons_array[$row["active_id"]] = array("name" => $row["lastname"]);
4789 }
4790 else
4791 {
4792 $persons_array[$row["active_id"]] = array("name" => trim($row["lastname"] . ", " . $row["firstname"] . " " . $row["title"]), "login" => $row["login"]);
4793 }
4794 }
4795 }
4796 }
4797 return $persons_array;
4798 }

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

Referenced by getTotalPointsPassedArray().

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

◆ evalTotalPersons()

ilObjTest::evalTotalPersons ( )

Returns the number of persons who started the test.

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

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

4341 {
4342 global $ilDB;
4343
4344 $result = $ilDB->queryF("SELECT COUNT(active_id) total FROM tst_active WHERE test_fi = %s",
4345 array('integer'),
4346 array($this->getTestId())
4347 );
4348 $row = $ilDB->fetchAssoc($result);
4349 return $row["total"];
4350 }

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

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

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

◆ evalTotalPersonsArray()

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

Returns all persons who started the test.

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

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

4723 {
4724 global $ilDB;
4725 $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),
4726 array('integer'),
4727 array($this->getTestId())
4728 );
4729 $persons_array = array();
4730 while ($row = $ilDB->fetchAssoc($result))
4731 {
4732 if ($this->getAnonymity())
4733 {
4734 $persons_array[$row["active_id"]] = $this->lng->txt("anonymous");
4735 }
4736 else
4737 {
4738 if (strlen($row["firstname"].$row["lastname"].$row["title"]) == 0)
4739 {
4740 $persons_array[$row["active_id"]] = $this->lng->txt("deleted_user");
4741 }
4742 else
4743 {
4744 if ($row["user_fi"] == ANONYMOUS_USER_ID)
4745 {
4746 $persons_array[$row["active_id"]] = $row["lastname"];
4747 }
4748 else
4749 {
4750 $persons_array[$row["active_id"]] = trim($row["lastname"] . ", " . $row["firstname"] . " " . $row["title"]);
4751 }
4752 }
4753 }
4754 }
4755 return $persons_array;
4756 }

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

+ 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 @access public

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

5422 {
5423 global $ilDB;
5424
5425 $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",
5426 array('integer'),
5427 array($this->getTestId())
5428 );
5429 $times = array();
5430 while ($row = $ilDB->fetchObject($result))
5431 {
5432 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->started, $matches);
5433 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
5434 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->finished, $matches);
5435 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
5436 $times[$row->active_fi] += ($epoch_2 - $epoch_1);
5437 }
5438 $max_time = 0;
5439 $counter = 0;
5440 foreach ($times as $key => $value)
5441 {
5442 $max_time += $value;
5443 $counter++;
5444 }
5445 if ($counter)
5446 {
5447 $average_time = round($max_time / $counter);
5448 }
5449 else
5450 {
5451 $average_time = 0;
5452 }
5453 return $average_time;
5454 }
$counter

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

Referenced by getAggregatedResultsData().

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

6888 {
6889 include_once "./Modules/File/classes/class.ilObjFile.php";
6890
6891 foreach ($this->file_ids as $file_id)
6892 {
6893 $expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
6894 $file_obj = new ilObjFile($file_id, false);
6895 $file_obj->export($a_target_dir);
6896 unset($file_obj);
6897 }
6898 }
Class ilObjFile.

References date.

Referenced by exportPagesXML().

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

6732 {
6733 global $ilBench;
6734
6735 $this->mob_ids = array();
6736 $this->file_ids = array();
6737
6738 // MetaData
6739 $this->exportXMLMetaData($a_xml_writer);
6740
6741 // PageObjects
6742 $expLog->write(date("[y-m-d H:i:s] ")."Start Export Page Objects");
6743 $ilBench->start("ContentObjectExport", "exportPageObjects");
6744 $this->exportXMLPageObjects($a_xml_writer, $a_inst, $expLog);
6745 $ilBench->stop("ContentObjectExport", "exportPageObjects");
6746 $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Page Objects");
6747
6748 // MediaObjects
6749 $expLog->write(date("[y-m-d H:i:s] ")."Start Export Media Objects");
6750 $ilBench->start("ContentObjectExport", "exportMediaObjects");
6751 $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
6752 $ilBench->stop("ContentObjectExport", "exportMediaObjects");
6753 $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Media Objects");
6754
6755 // FileItems
6756 $expLog->write(date("[y-m-d H:i:s] ")."Start Export File Items");
6757 $ilBench->start("ContentObjectExport", "exportFileItems");
6758 $this->exportFileItems($a_target_dir, $expLog);
6759 $ilBench->stop("ContentObjectExport", "exportFileItems");
6760 $expLog->write(date("[y-m-d H:i:s] ")."Finished Export File Items");
6761 }
exportXMLPageObjects(&$a_xml_writer, $a_inst, &$expLog)
export page objects 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)
exportXMLMetaData(&$a_xml_writer)
export content objects meta data to xml (see ilias_co.dtd)
exportFileItems($a_target_dir, &$expLog)
export files of file itmes
global $ilBench
Definition: ilias.php:18

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

+ Here is the call graph for this function:

◆ exportXMLMediaObjects()

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

export media objects to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

6867 {
6868 include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
6869
6870 foreach ($this->mob_ids as $mob_id)
6871 {
6872 $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
6873 if (ilObjMediaObject::_exists($mob_id))
6874 {
6875 $media_obj = new ilObjMediaObject($mob_id);
6876 $media_obj->exportXML($a_xml_writer, $a_inst);
6877 $media_obj->exportFiles($a_target_dir);
6878 unset($media_obj);
6879 }
6880 }
6881 }

References ilObjMediaObject\_exists(), and date.

Referenced by exportPagesXML().

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

◆ exportXMLMetaData()

ilObjTest::exportXMLMetaData ( $a_xml_writer)

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

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

6770 {
6771 include_once "./Services/MetaData/classes/class.ilMD2XML.php";
6772 $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
6773 $md2xml->setExportMode(true);
6774 $md2xml->startExport();
6775 $a_xml_writer->appendXML($md2xml->getXML());
6776 }

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

Referenced by exportPagesXML().

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

◆ exportXMLPageObjects()

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

export page objects to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

6802 {
6803 global $ilBench;
6804
6805 include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
6806
6807 foreach ($this->questions as $question_id)
6808 {
6809 $ilBench->start("ContentObjectExport", "exportPageObject");
6810 $expLog->write(date("[y-m-d H:i:s] ")."Page Object ".$question_id);
6811
6812 $attrs = array();
6813 $a_xml_writer->xmlStartTag("PageObject", $attrs);
6814
6815
6816 // export xml to writer object
6817 $ilBench->start("ContentObjectExport", "exportPageObject_XML");
6818 include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
6819 $page_object = new ilAssQuestionPage($question_id);
6820 $page_object->buildDom();
6821 $page_object->insertInstIntoIDs($a_inst);
6822 $mob_ids = $page_object->collectMediaObjects(false);
6823 require_once 'Services/COPage/classes/class.ilPCFileList.php';
6824 $file_ids = ilPCFileList::collectFileItems($page_object, $page_object->getDomDoc());
6825 $xml = $page_object->getXMLFromDom(false, false, false, "", true);
6826 $xml = str_replace("&","&amp;", $xml);
6827 $a_xml_writer->appendXML($xml);
6828 $page_object->freeDom();
6829 unset ($page_object);
6830
6831 $ilBench->stop("ContentObjectExport", "exportPageObject_XML");
6832
6833 // collect media objects
6834 $ilBench->start("ContentObjectExport", "exportPageObject_CollectMedia");
6835 //$mob_ids = $page_obj->getMediaObjectIDs();
6836 foreach($mob_ids as $mob_id)
6837 {
6838 $this->mob_ids[$mob_id] = $mob_id;
6839 }
6840 $ilBench->stop("ContentObjectExport", "exportPageObject_CollectMedia");
6841
6842 // collect all file items
6843 $ilBench->start("ContentObjectExport", "exportPageObject_CollectFileItems");
6844 //$file_ids = $page_obj->getFileItemIds();
6845 foreach($file_ids as $file_id)
6846 {
6847 $this->file_ids[$file_id] = $file_id;
6848 }
6849 $ilBench->stop("ContentObjectExport", "exportPageObject_CollectFileItems");
6850
6851 $a_xml_writer->xmlEndTag("PageObject");
6852 //unset($page_obj);
6853
6854 $ilBench->stop("ContentObjectExport", "exportPageObject");
6855
6856
6857 }
6858 }
Question page object.
static collectFileItems($a_page, $a_domdoc)
Get all file items that are used within the page.

References $ilBench, ilPCFileList\collectFileItems(), and date.

Referenced by exportPagesXML().

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

◆ fromXML()

ilObjTest::fromXML ( ilQTIAssessment  $assessment)

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

Parameters
ilQTIAssessment$assessment

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

5771 {
5772 unset($_SESSION["import_mob_xhtml"]);
5773
5774 $this->setDescription($assessment->getComment());
5775 $this->setTitle($assessment->getTitle());
5776
5777 $this->setIntroductionEnabled(false);
5778 foreach ($assessment->objectives as $objectives)
5779 {
5780 foreach ($objectives->materials as $material)
5781 {
5782 $intro = $this->QTIMaterialToString($material);
5783 $this->setIntroduction($intro);
5784 $this->setIntroductionEnabled(strlen($intro) > 0);
5785 }
5786 }
5787
5788 if(
5789 $assessment->getPresentationMaterial() &&
5790 $assessment->getPresentationMaterial()->getFlowMat(0) &&
5791 $assessment->getPresentationMaterial()->getFlowMat(0)->getMaterial(0)
5792 )
5793 {
5794 $this->setFinalStatement($this->QTIMaterialToString($assessment->getPresentationMaterial()->getFlowMat(0)->getMaterial(0)));
5795 }
5796
5797 foreach ($assessment->assessmentcontrol as $assessmentcontrol)
5798 {
5799 switch ($assessmentcontrol->getSolutionswitch())
5800 {
5801 case "Yes":
5803 break;
5804 default:
5806 break;
5807 }
5808 }
5809
5810 $this->setStartingTimeEnabled(false);
5811 $this->setEndingTimeEnabled(false);
5812 $this->setPasswordEnabled(false);
5813 $this->setLimitUsersEnabled(false);
5814
5815 foreach ($assessment->qtimetadata as $metadata)
5816 {
5817 switch ($metadata["label"])
5818 {
5819 case "test_type":
5820 // for old tests with a test type
5821 $type = $metadata["entry"];
5822 switch ($type)
5823 {
5824 case 1:
5825 // assessment
5826 $this->setAnonymity(1);
5827 break;
5828 case 2:
5829 // self assessment
5830 break;
5831 case 4:
5832 // online exam
5833 $this->setFixedParticipants(1);
5835 $this->setShowSolutionPrintview(1);
5836 break;
5837 case 5:
5838 // varying random test
5839 break;
5840 }
5841 break;
5842 case "sequence_settings":
5843 $this->setSequenceSettings($metadata["entry"]);
5844 break;
5845 case "solution_details":
5846 $this->setShowSolutionDetails((int)$metadata["entry"]);
5847 break;
5848 case "print_bs_with_res":
5849 $this->setPrintBestSolutionWithResult((int)$metadata["entry"]);
5850 break;
5851 case "author":
5852 $this->setAuthor($metadata["entry"]);
5853 break;
5854 case "nr_of_tries":
5855 $this->setNrOfTries($metadata["entry"]);
5856 break;
5857 case "pass_waiting":
5858 $this->setPassWaiting($metadata["entry"]);
5859 break;
5860 case "kiosk":
5861 $this->setKiosk($metadata["entry"]);
5862 break;
5863 case "showfinalstatement":
5864 $this->setShowFinalStatement($metadata["entry"]);
5865 break;
5866 case "showinfo":
5867 $this->setShowInfo($metadata["entry"]);
5868 break;
5869 case "forcejs":
5870 $this->setForceJS($metadata["entry"]);
5871 break;
5872 case "customstyle":
5873 $this->setCustomStyle($metadata["entry"]);
5874 break;
5875
5876 case "highscore_enabled":
5877 $this->setHighscoreEnabled($metadata["entry"]);
5878 break;
5879
5880 case "highscore_anon":
5881 $this->setHighscoreAnon($metadata["entry"]);
5882 break;
5883
5884 case "highscore_achieved_ts":
5885 $this->setHighscoreAchievedTS($metadata["entry"]);
5886 break;
5887
5888 case "highscore_score":
5889 $this->setHighscoreScore($metadata["entry"]);
5890 break;
5891
5892 case "highscore_percentage":
5893 $this->setHighscorePercentage($metadata["entry"]);
5894 break;
5895
5896 case "highscore_hints":
5897 $this->setHighscoreHints($metadata["entry"]);
5898 break;
5899
5900 case "highscore_wtime":
5901 $this->setHighscoreWTime($metadata["entry"]);
5902 break;
5903
5904 case "highscore_own_table":
5905 $this->setHighscoreOwnTable($metadata["entry"]);
5906 break;
5907
5908 case "highscore_top_table":
5909 $this->setHighscoreTopTable($metadata["entry"]);
5910 break;
5911
5912 case "highscore_top_num":
5913 $this->setHighscoreTopNum($metadata["entry"]);
5914 break;
5915
5916 case "hide_previous_results":
5917 if ($metadata["entry"] == 0)
5918 {
5919 $this->setUsePreviousAnswers(1);
5920 }
5921 else
5922 {
5923 $this->setUsePreviousAnswers(0);
5924 }
5925 break;
5926 case "use_previous_answers":
5927 $this->setUsePreviousAnswers($metadata["entry"]);
5928 break;
5929 case "answer_feedback":
5930 $this->setAnswerFeedback($metadata["entry"]);
5931 break;
5932 case "hide_title_points":
5933 $this->setTitleOutput($metadata["entry"]);
5934 break;
5935 case "title_output":
5936 $this->setTitleOutput($metadata["entry"]);
5937 break;
5938 case "question_set_type":
5939 $this->setQuestionSetType($metadata["entry"]);
5940 break;
5941 case "random_test":
5942 if( $metadata["entry"] )
5943 {
5944 $this->setQuestionSetType(self::QUESTION_SET_TYPE_RANDOM);
5945 }
5946 else
5947 {
5948 $this->setQuestionSetType(self::QUESTION_SET_TYPE_FIXED);
5949 }
5950 break;
5951 case "results_presentation":
5952 $this->setResultsPresentation($metadata["entry"]);
5953 break;
5954 case "reset_processing_time":
5955 $this->setResetProcessingTime($metadata["entry"]);
5956 break;
5957 case "instant_verification":
5958 $this->setInstantFeedbackSolution($metadata["entry"]);
5959 break;
5960 case "instant_feedback_answer_fixation":
5961 $this->setInstantFeedbackAnswerFixationEnabled((bool)$metadata["entry"]);
5962 break;
5963 case "force_instant_feedback":
5964 $this->setForceInstantFeedbackEnabled((bool)$metadata["entry"]);
5965 break;
5966 case "answer_feedback_points":
5967 $this->setAnswerFeedbackPoints($metadata["entry"]);
5968 break;
5969 case "anonymity":
5970 $this->setAnonymity($metadata["entry"]);
5971 break;
5972 case "use_pool":
5973 $this->setPoolUsage((int)$metadata["entry"]);
5974 break;
5975 case "show_cancel":
5976 $this->setShowCancel($metadata["entry"]);
5977 break;
5978 case "show_marker":
5979 $this->setShowMarker($metadata["entry"]);
5980 break;
5981 case "fixed_participants":
5982 $this->setFixedParticipants($metadata["entry"]);
5983 break;
5984 case "score_reporting":
5985 $this->setScoreReporting($metadata["entry"]);
5986 break;
5987 case "shuffle_questions":
5988 $this->setShuffleQuestions($metadata["entry"]);
5989 break;
5990 case "count_system":
5991 $this->setCountSystem($metadata["entry"]);
5992 break;
5993 case "mc_scoring":
5994 $this->setMCScoring($metadata["entry"]);
5995 break;
5996 case "mailnotification":
5997 $this->setMailNotification($metadata["entry"]);
5998 break;
5999 case "mailnottype":
6000 $this->setMailNotificationType($metadata["entry"]);
6001 break;
6002 case "exportsettings":
6003 $this->setExportSettings($metadata['entry']);
6004 break;
6005 case "score_cutting":
6006 $this->setScoreCutting($metadata["entry"]);
6007 break;
6008 case "password":
6009 $this->setPassword($metadata["entry"]);
6010 $this->setPasswordEnabled(strlen($metadata["entry"]) > 0);
6011 break;
6012 case "allowedUsers":
6013 $this->setAllowedUsers($metadata["entry"]);
6014 $this->setLimitUsersEnabled((int)$metadata["entry"] > 0);
6015 break;
6016 case "allowedUsersTimeGap":
6017 $this->setAllowedUsersTimeGap($metadata["entry"]);
6018 break;
6019 case "pass_scoring":
6020 $this->setPassScoring($metadata["entry"]);
6021 break;
6022 case 'pass_deletion_allowed':
6023 $this->setPassDeletionAllowed((int)$metadata['entry']);
6024 break;
6025 case "show_summary":
6026 $this->setListOfQuestionsSettings($metadata["entry"]);
6027 break;
6028 case "reporting_date":
6029 $iso8601period = $metadata["entry"];
6030 if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $iso8601period, $matches))
6031 {
6032 $this->setReportingDate(sprintf("%02d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
6033 }
6034 break;
6035 case 'enable_processing_time':
6036 $this->setEnableProcessingTime($metadata['entry']);
6037 break;
6038 case "processing_time":
6039 $this->setProcessingTime($metadata['entry']);
6040 break;
6041 case "starting_time":
6042 $iso8601period = $metadata["entry"];
6043 if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $iso8601period, $matches))
6044 {
6045 $date_time = new ilDateTime(sprintf("%02d-%02d-%02d %02d:%02d:%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]), IL_CAL_DATETIME);
6046 $this->setStartingTime($date_time->get(IL_CAL_UNIX));
6047 $this->setStartingTimeEnabled(true);
6048 }
6049 break;
6050 case "ending_time":
6051 $iso8601period = $metadata["entry"];
6052 if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $iso8601period, $matches))
6053 {
6054 $date_time = new ilDateTime(sprintf("%02d-%02d-%02d %02d:%02d:%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]), IL_CAL_DATETIME);
6055 $this->setEndingTime($date_time->get(IL_CAL_UNIX));
6056 $this->setEndingTimeEnabled(true);
6057 }
6058 break;
6059 case "enable_examview":
6060 $this->setEnableExamview($metadata["entry"]);
6061 break;
6062 case 'show_examview_html':
6063 $this->setShowExamviewHtml($metadata['entry']);
6064 break;
6065 case 'show_examview_pdf':
6066 $this->setShowExamviewPdf($metadata['entry']);
6067 break;
6068 case 'redirection_mode':
6069 $this->setRedirectionMode($metadata['entry']);
6070 break;
6071 case 'redirection_url':
6072 $this->setRedirectionUrl($metadata['entry']);
6073 break;
6074 case 'examid_in_kiosk':
6075 case 'examid_in_test_pass':
6076 $this->setShowExamIdInTestPassEnabled($metadata['entry']);
6077 break;
6078 case 'show_exam_id':
6079 case 'examid_in_test_res':
6080 $this->setShowExamIdInTestResultsEnabled($metadata['entry']);
6081 break;
6082 case 'enable_archiving':
6083 $this->setEnableArchiving($metadata['entry']);
6084 break;
6085 case 'sign_submission':
6086 $this->setSignSubmission($metadata['entry']);
6087 break;
6088 case 'char_selector_availability':
6089 $this->setCharSelectorAvailability($metadata['entry']);
6090 break;
6091 case 'char_selector_definition':
6092 $this->setCharSelectorDefinition($metadata['entry']);
6093 break;
6094 case 'skill_service':
6095 $this->setSkillServiceEnabled((bool)$metadata['entry']);
6096 break;
6097 case 'result_tax_filters':
6098 $this->setResultFilterTaxIds(strlen($metadata['entry']) ? unserialize($metadata['entry']) : array());
6099 break;
6100 case 'show_grading_status':
6101 $this->setShowGradingStatusEnabled((bool)$metadata['entry']);
6102 break;
6103 case 'show_grading_mark':
6104 $this->setShowGradingMarkEnabled((bool)$metadata['entry']);
6105 break;
6106 case 'activation_limited':
6107 $this->setActivationLimited($metadata['entry']);
6108 break;
6109 case 'activation_start_time':
6110 $this->setActivationStartingTime($metadata['entry']);
6111 break;
6112 case 'activation_end_time':
6113 $this->setActivationEndingTime($metadata['entry']);
6114 break;
6115 case 'activation_visibility':
6116 $this->setActivationVisibility($metadata['entry']);
6117 break;
6118 case 'autosave':
6119 $this->setAutosave($metadata['entry']);
6120 break;
6121 case 'autosave_ival':
6122 $this->setAutosaveIval($metadata['entry']);
6123 break;
6124 case 'offer_question_hints':
6125 $this->setOfferingQuestionHintsEnabled($metadata['entry']);
6126 break;
6127 case 'instant_feedback_specific':
6128 $this->setSpecificAnswerFeedback($metadata['entry']);
6129 break;
6130 case 'obligations_enabled':
6131 $this->setObligationsEnabled($metadata['entry']);
6132 break;
6133 }
6134 if (preg_match("/mark_step_\d+/", $metadata["label"]))
6135 {
6136 $xmlmark = $metadata["entry"];
6137 preg_match("/<short>(.*?)<\/short>/", $xmlmark, $matches);
6138 $mark_short = $matches[1];
6139 preg_match("/<official>(.*?)<\/official>/", $xmlmark, $matches);
6140 $mark_official = $matches[1];
6141 preg_match("/<percentage>(.*?)<\/percentage>/", $xmlmark, $matches);
6142 $mark_percentage = $matches[1];
6143 preg_match("/<passed>(.*?)<\/passed>/", $xmlmark, $matches);
6144 $mark_passed = $matches[1];
6145 $this->mark_schema->addMarkStep($mark_short, $mark_official, $mark_percentage, $mark_passed);
6146 }
6147 }
6148 // handle the import of media objects in XHTML code
6149 if (is_array($_SESSION["import_mob_xhtml"]))
6150 {
6151 include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
6152 include_once "./Services/RTE/classes/class.ilRTE.php";
6153 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
6154 foreach ($_SESSION["import_mob_xhtml"] as $mob)
6155 {
6156 $importfile = ilObjTest::_getImportDirectory() . '/' . $_SESSION["tst_import_subdir"] . '/' . $mob["uri"];
6157 if (file_exists($importfile))
6158 {
6159 $media_object =& ilObjMediaObject::_saveTempFileAsMediaObject(basename($importfile), $importfile, FALSE);
6160 ilObjMediaObject::_saveUsage($media_object->getId(), "tst:html", $this->getId());
6161 $this->setIntroduction(ilRTE::_replaceMediaObjectImageSrc(str_replace("src=\"" . $mob["mob"] . "\"", "src=\"" . "il_" . IL_INST_ID . "_mob_" . $media_object->getId() . "\"", $this->getIntroduction()), 1));
6162 $this->setFinalStatement(ilRTE::_replaceMediaObjectImageSrc(str_replace("src=\"" . $mob["mob"] . "\"", "src=\"" . "il_" . IL_INST_ID . "_mob_" . $media_object->getId() . "\"", $this->getFinalStatement()), 1));
6163 }
6164 else
6165 {
6166 global $ilLog;
6167 $ilLog->write("Error: Could not open XHTML mob file for test introduction during test import. File $importfile does not exist!");
6168 }
6169 }
6170 $this->saveToDb();
6171 }
6172 }
static _saveUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
Save usage of mob within another container (e.g.
static _saveTempFileAsMediaObject($name, $tmp_name, $upload=TRUE)
Create new media object and update page in db and return new media object.
QTIMaterialToString($a_material)
Reads an QTI material tag an creates a text string.
setShowSolutionPrintview($a_printview=1)
Sets if the the solution printview should be presented to the user or not.
setAuthor($author="")
Sets the authors name of the ilObjTest object.
static _getImportDirectory()
Get the import directory location of the test.
setTitle($a_title)
set object title
setDescription($a_desc)
set object description
getPresentationMaterial()
{ilQTIPresentationMaterial|null}

References $_SESSION, $ilLog, $metadata, ilObject\$type, _getImportDirectory(), ilRTE\_replaceMediaObjectImageSrc(), ilObjMediaObject\_saveTempFileAsMediaObject(), ilObjMediaObject\_saveUsage(), ilQTIAssessment\getComment(), ilQTIAssessment\getPresentationMaterial(), ilQTIAssessment\getTitle(), IL_CAL_DATETIME, IL_CAL_UNIX, 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(), setForceInstantFeedbackEnabled(), setForceJS(), setHighscoreAchievedTS(), setHighscoreAnon(), setHighscoreEnabled(), setHighscoreHints(), setHighscoreOwnTable(), setHighscorePercentage(), setHighscoreScore(), setHighscoreTopNum(), setHighscoreTopTable(), setHighscoreWTime(), setInstantFeedbackAnswerFixationEnabled(), setInstantFeedbackSolution(), setIntroduction(), setIntroductionEnabled(), setKiosk(), setLimitUsersEnabled(), setListOfQuestionsSettings(), setMailNotification(), setMailNotificationType(), setMCScoring(), setNrOfTries(), setObligationsEnabled(), setOfferingQuestionHintsEnabled(), setPassDeletionAllowed(), setPassScoring(), setPassWaiting(), setPassword(), setPasswordEnabled(), setPoolUsage(), setPrintBestSolutionWithResult(), setProcessingTime(), setQuestionSetType(), setRedirectionMode(), setRedirectionUrl(), setReportingDate(), setResetProcessingTime(), setResultFilterTaxIds(), setResultsPresentation(), setScoreCutting(), setScoreReporting(), setSequenceSettings(), setShowCancel(), setShowExamIdInTestPassEnabled(), setShowExamIdInTestResultsEnabled(), setShowExamviewHtml(), setShowExamviewPdf(), setShowFinalStatement(), setShowGradingMarkEnabled(), setShowGradingStatusEnabled(), setShowInfo(), setShowMarker(), setShowSolutionDetails(), setShowSolutionPrintview(), setShuffleQuestions(), setSignSubmission(), setSkillServiceEnabled(), setSpecificAnswerFeedback(), setStartingTime(), setStartingTimeEnabled(), ilObject\setTitle(), setTitleOutput(), setUsePreviousAnswers(), and sprintf.

+ Here is the call graph for this function:

◆ getActivationEndingTime()

ilObjTest::getActivationEndingTime ( )

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

11737 {
11738 return (strlen($this->activation_ending_time)) ? $this->activation_ending_time : NULL;
11739 }

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

+ Here is the caller graph for this function:

◆ getActivationStartingTime()

ilObjTest::getActivationStartingTime ( )

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

11732 {
11733 return (strlen($this->activation_starting_time)) ? $this->activation_starting_time : NULL;
11734 }

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

+ Here is the caller graph for this function:

◆ getActivationVisibility()

ilObjTest::getActivationVisibility ( )

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

11193 {
11195 }

References $activation_visibility.

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

+ Here is the caller graph for this function:

◆ getActiveIdOfUser()

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

Gets the active id of a given user.

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

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

4021 {
4022 global $ilDB;
4023 global $ilUser;
4024
4025 if (!$user_id) $user_id = $ilUser->getId();
4026 if (($GLOBALS['DIC']['ilUser']->getId() == ANONYMOUS_USER_ID) && (strlen($_SESSION["tst_access_code"][$this->getTestId()])))
4027 {
4028 $result = $ilDB->queryF("SELECT active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
4029 array('integer','integer','text'),
4030 array($user_id, $this->test_id, $_SESSION["tst_access_code"][$this->getTestId()])
4031 );
4032 }
4033 else if (strlen($anonymous_id))
4034 {
4035 $result = $ilDB->queryF("SELECT active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
4036 array('integer','integer','text'),
4037 array($user_id, $this->test_id, $anonymous_id)
4038 );
4039 }
4040 else
4041 {
4042 if ($GLOBALS['DIC']['ilUser']->getId() == ANONYMOUS_USER_ID)
4043 {
4044 return NULL;
4045 }
4046 $result = $ilDB->queryF("SELECT active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s",
4047 array('integer','integer'),
4048 array($user_id, $this->test_id)
4049 );
4050 }
4051 if ($result->numRows())
4052 {
4053 $row = $ilDB->fetchAssoc($result);
4054 return $row["active_id"];
4055 }
4056 else
4057 {
4058 return 0;
4059 }
4060 }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

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

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

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

◆ getAggregatedResultsData()

ilObjTest::getAggregatedResultsData ( )

Returns the aggregated test results.

@access public

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

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

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

+ Here is the call graph for this function:

◆ getAllowedUsers()

ilObjTest::getAllowedUsers ( )

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

9316 {
9317 return ($this->allowedUsers) ? $this->allowedUsers : 0;
9318 }

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

+ Here is the caller graph for this function:

◆ getAllowedUsersTimeGap()

ilObjTest::getAllowedUsersTimeGap ( )

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

9326 {
9327 return ($this->allowedUsersTimeGap) ? $this->allowedUsersTimeGap : 0;
9328 }

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

+ Here is the caller graph for this function:

◆ getAllQuestions()

& ilObjTest::getAllQuestions (   $pass = NULL)

Returns all questions of a test in test order.

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

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

3981 {
3982 global $ilUser;
3983 global $ilDB;
3984
3985 $result_array = array();
3986 if ($this->isRandomTest())
3987 {
3988 $active_id = $this->getActiveIdOfUser($ilUser->getId());
3989 $this->loadQuestions($active_id, $pass);
3990 if (count($this->questions) == 0) return $result_array;
3991 if (is_null($pass))
3992 {
3993 $pass = self::_getPass($active_id);
3994 }
3995 $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'),
3996 array('integer','integer'),
3997 array($active_id, $pass)
3998 );
3999 }
4000 else
4001 {
4002 if (count($this->questions) == 0) return $result_array;
4003 $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'));
4004 }
4005 while ($row = $ilDB->fetchAssoc($result))
4006 {
4007 $result_array[$row["question_id"]] = $row;
4008 }
4009 return $result_array;
4010 }
loadQuestions($active_id="", $pass=NULL)
Load the test question id's from the database.
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
getActiveIdOfUser($user_id="", $anonymous_id="")
Gets the active id of a given user.

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

+ Here is the call graph for this function:

◆ getAllRTEContent()

ilObjTest::getAllRTEContent ( )

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

@access private

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

1202 {
1203 $result = array();
1204 array_push($result, $this->getIntroduction());
1205 array_push($result, $this->getFinalStatement());
1206 return $result;
1207 }

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

Referenced by cleanupMediaobjectUsage().

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

◆ getAllTestResults()

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

returns all test results for all participants

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

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

8046 {
8047 $results = array();
8048 $row = array(
8049 "user_id" => $this->lng->txt("user_id"),
8050 "matriculation" => $this->lng->txt("matriculation"),
8051 "lastname" => $this->lng->txt("lastname"),
8052 "firstname" => $this->lng->txt("firstname"),
8053 "login" =>$this->lng->txt("login"),
8054 "reached_points" => $this->lng->txt("tst_reached_points"),
8055 "max_points" => $this->lng->txt("tst_maximum_points"),
8056 "percent_value" => $this->lng->txt("tst_percent_solved"),
8057 "mark" => $this->lng->txt("tst_mark"),
8058 "ects" => $this->lng->txt("ects_grade")
8059 );
8060 $results[] = $row;
8061 if (count($participants))
8062 {
8063 if($this->getECTSOutput())
8064 {
8065 $passed_array =& $this->getTotalPointsPassedArray();
8066 }
8067 foreach ($participants as $active_id => $user_rec)
8068 {
8069 $mark = $ects_mark = '';
8070 $row = array();
8071 $reached_points = 0;
8072 $max_points = 0;
8073 foreach ($this->questions as $value)
8074 {
8075 $question =& ilObjTest::_instanciateQuestion($value);
8076 if (is_object($question))
8077 {
8078 $max_points += $question->getMaximumPoints();
8079 $reached_points += $question->getReachedPoints($active_id);
8080 }
8081 }
8082 if ($max_points > 0)
8083 {
8084 $percentvalue = $reached_points / $max_points;
8085 if ($percentvalue < 0) $percentvalue = 0.0;
8086 }
8087 else
8088 {
8089 $percentvalue = 0;
8090 }
8091 $mark_obj = $this->mark_schema->getMatchingMark($percentvalue * 100);
8092 $passed = "";
8093 if ($mark_obj)
8094 {
8095 $mark = $mark_obj->getOfficialName();
8096 if($this->getECTSOutput())
8097 {
8098 $ects_mark = $this->getECTSGrade($passed_array, $reached_points, $max_points);
8099 }
8100 }
8101 if ($this->getAnonymity())
8102 {
8103 $user_rec['firstname'] = "";
8104 $user_rec['lastname'] = $this->lng->txt("anonymous");
8105 }
8106 $row = array(
8107 "user_id"=>$user_rec['usr_id'],
8108 "matriculation" => $user_rec['matriculation'],
8109 "lastname" => $user_rec['lastname'],
8110 "firstname" => $user_rec['firstname'],
8111 "login"=>$user_rec['login'],
8112 "reached_points" => $reached_points,
8113 "max_points" => $max_points,
8114 "percent_value" => $percentvalue,
8115 "mark" => $mark,
8116 "ects" => $ects_mark
8117 );
8118 $results[] = $prepareForCSV ? $this->processCSVRow ($row, true) : $row;
8119 }
8120 }
8121 return $results;
8122 }
& getTotalPointsPassedArray()
Returns an array with the total points of all users who passed the test This array could be used for ...
& processCSVRow($row, $quoteAll=FALSE, $separator=";")
Processes an array as a CSV row and converts the array values to correct CSV values.
getECTSGrade($passed_array, $reached_points, $max_points)
{Returns the ECTS grade for a number of reached points.string The ECTS grade short description}

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

+ Here is the call graph for this function:

◆ getAnonymity()

ilObjTest::getAnonymity ( )

Returns the anonymity status of the test.

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

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

9543 {
9544 return ($this->anonymity) ? 1 : 0;
9545 }

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

+ Here is the caller graph for this function:

◆ getAnsweredQuestionCount()

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

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

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

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

8301 {
8302 if( $this->isDynamicTest() )
8303 {
8304 global $tree, $ilDB, $lng, $ilPluginAdmin;
8305
8306 require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
8307 $testSessionFactory = new ilTestSessionFactory($this);
8308 $testSession = $testSessionFactory->getSession($active_id);
8309
8310 require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
8311 $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this);
8312 $testSequence = $testSequenceFactory->getSequenceByTestSession($testSession);
8313
8314 require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
8315 $dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this);
8316 $dynamicQuestionSetConfig->loadFromDb();
8317
8318 $testSequence->loadFromDb($dynamicQuestionSetConfig);
8319 $testSequence->loadQuestions($dynamicQuestionSetConfig, new ilTestDynamicQuestionSetFilterSelection());
8320
8321 return $testSequence->getTrackedQuestionCount();
8322 }
8323
8324 if ($this->isRandomTest())
8325 {
8326 $this->loadQuestions($active_id, $pass);
8327 }
8328 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
8329 $workedthrough = 0;
8330 foreach ($this->questions as $value)
8331 {
8332 if (assQuestion::_isWorkedThrough($active_id, $value, $pass))
8333 {
8334 $workedthrough += 1;
8335 }
8336 }
8337 return $workedthrough;
8338 }
static _isWorkedThrough($active_id, $question_id, $pass=NULL)
Returns true if the question was worked through in the given pass Worked through means that the user ...
isDynamicTest()
Returns the fact wether this test is a dynamic question set test or not.

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

+ Here is the call graph for this function:

◆ getAnswerFeedback()

ilObjTest::getAnswerFeedback ( )

Returns 1 if generic answer feedback is activated.

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

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

2535 {
2536 return ($this->answer_feedback) ? $this->answer_feedback : 0;
2537 }

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

+ Here is the caller graph for this function:

◆ getAnswerFeedbackPoints()

ilObjTest::getAnswerFeedbackPoints ( )

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

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

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

2558{
2559 return ($this->answer_feedback_points) ? $this->answer_feedback_points : 0;
2560}

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

+ Here is the caller graph for this function:

◆ getAuthor()

ilObjTest::getAuthor ( )

Gets the authors name of the ilObjTest object.

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

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

7139 {
7140 $author = array();
7141 include_once "./Services/MetaData/classes/class.ilMD.php";
7142 $md = new ilMD($this->getId(), 0, $this->getType());
7143 $md_life =& $md->getLifecycle();
7144 if ($md_life)
7145 {
7146 $ids =& $md_life->getContributeIds();
7147 foreach ($ids as $id)
7148 {
7149 $md_cont =& $md_life->getContribute($id);
7150 if (strcmp($md_cont->getRole(), "Author") == 0)
7151 {
7152 $entids =& $md_cont->getEntityIds();
7153 foreach ($entids as $entid)
7154 {
7155 $md_ent =& $md_cont->getEntity($entid);
7156 array_push($author, $md_ent->getEntity());
7157 }
7158 }
7159 }
7160 }
7161 return join($author, ",");
7162 }

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

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

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

◆ getAutosave()

ilObjTest::getAutosave ( )

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

11636 {
11637 return $this->autosave;
11638 }

References $autosave.

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

+ Here is the caller graph for this function:

◆ getAutosaveIval()

ilObjTest::getAutosaveIval ( )

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

11646 {
11647 return $this->autosave_ival;
11648 }

References $autosave_ival.

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

+ Here is the caller graph for this function:

◆ getAvailableQuestionpools()

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

Returns the available question pools for the active user.

Returns
array The available question pools @access public

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

5463 {
5464 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
5465 return ilObjQuestionPool::_getAvailableQuestionpools($use_object_id, $equal_points, $could_be_offline, $show_path, $with_questioncount, $permission);
5466 }
static _getAvailableQuestionpools($use_object_id=FALSE, $equal_points=FALSE, $could_be_offline=FALSE, $showPath=FALSE, $with_questioncount=FALSE, $permission="read", $usr_id="")
Returns the available question pools for the active user.

References ilObjQuestionPool\_getAvailableQuestionpools().

+ Here is the call graph for this function:

◆ getAvailableQuestions()

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

Calculates the available questions for a test.

@access public

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

5671 {
5672 $pluginAdmin = $GLOBALS['DIC'] ? $GLOBALS['DIC']['ilPluginAdmin'] : $GLOBALS['ilPluginAdmin'];
5673 $lng = $GLOBALS['DIC'] ? $GLOBALS['DIC']['lng'] : $GLOBALS['lng'];
5674 global $ilUser;
5675 global $ilDB;
5676
5677 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
5678 $available_pools = array_keys(ilObjQuestionPool::_getAvailableQuestionpools($use_object_id = TRUE, $equal_points = FALSE, $could_be_offline = FALSE, $showPath = FALSE, $with_questioncount = FALSE));
5679 $available = "";
5680 if (count($available_pools))
5681 {
5682 $available = " AND " . $ilDB->in('qpl_questions.obj_fi', $available_pools, false, 'integer');
5683 }
5684 else
5685 {
5686 return array();
5687 }
5688 if ($completeonly)
5689 {
5690 $available .= " AND qpl_questions.complete = " . $ilDB->quote("1", 'text');
5691 }
5692
5693 $where = "";
5694 if (is_array($arrFilter))
5695 {
5696 if (array_key_exists('title', $arrFilter) && strlen($arrFilter['title']))
5697 {
5698 $where .= " AND " . $ilDB->like('qpl_questions.title', 'text', "%%" . $arrFilter['title'] . "%%");
5699 }
5700 if (array_key_exists('description', $arrFilter) && strlen($arrFilter['description']))
5701 {
5702 $where .= " AND " . $ilDB->like('qpl_questions.description', 'text', "%%" . $arrFilter['description'] . "%%");
5703 }
5704 if (array_key_exists('author', $arrFilter) && strlen($arrFilter['author']))
5705 {
5706 $where .= " AND " . $ilDB->like('qpl_questions.author', 'text', "%%" . $arrFilter['author'] . "%%");
5707 }
5708 if (array_key_exists('type', $arrFilter) && strlen($arrFilter['type']))
5709 {
5710 $where .= " AND qpl_qst_type.type_tag = " . $ilDB->quote($arrFilter['type'], 'text');
5711 }
5712 if (array_key_exists('qpl', $arrFilter) && strlen($arrFilter['qpl']))
5713 {
5714 $where .= " AND " . $ilDB->like('object_data.title', 'text', "%%" . $arrFilter['qpl'] . "%%");
5715 }
5716 }
5717
5718 $original_ids =& $this->getExistingQuestions();
5719 $original_clause = " qpl_questions.original_id IS NULL";
5720 if (count($original_ids))
5721 {
5722 $original_clause = " qpl_questions.original_id IS NULL AND " . $ilDB->in('qpl_questions.question_id', $original_ids, true, 'integer');
5723 }
5724
5725 $query_result = $ilDB->query("
5726 SELECT qpl_questions.*, qpl_questions.tstamp,
5727 qpl_qst_type.type_tag, qpl_qst_type.plugin, qpl_qst_type.plugin_name,
5728 object_data.title parent_title
5729 FROM qpl_questions, qpl_qst_type, object_data
5730 WHERE $original_clause $available
5731 AND object_data.obj_id = qpl_questions.obj_fi
5732 AND qpl_questions.tstamp > 0
5733 AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id
5734 $where
5735 ");
5736 $rows = array();
5737 $types = $this->getQuestionTypeTranslations();
5738 if ($query_result->numRows())
5739 {
5740 while ($row = $ilDB->fetchAssoc($query_result))
5741 {
5743
5744 if( !$row['plugin'] )
5745 {
5746 $row[ 'ttype' ] = $lng->txt($row[ "type_tag" ]);
5747
5748 $rows[] = $row;
5749 continue;
5750 }
5751
5752 if( !$pluginAdmin->isActive(IL_COMP_MODULE, 'TestQuestionPool', 'qst', $row['plugin_name']) )
5753 {
5754 continue;
5755 }
5756
5757 $pl = ilPlugin::getPluginObject(IL_COMP_MODULE, 'TestQuestionPool', 'qst', $row['plugin_name']);
5758 $row[ 'ttype' ] = $pl->getQuestionTypeTranslation();
5759
5760 $rows[] = $row;
5761 }
5762 }
5763 return $rows;
5764 }
const IL_COMP_MODULE
static completeMissingPluginName($questionTypeData)
& getExistingQuestions($pass=NULL)
Get the id's of the questions which are already part of the test.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.

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

+ Here is the call graph for this function:

◆ getCertificateVisibility()

ilObjTest::getCertificateVisibility ( )

Returns the visibility settings of the certificate.

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

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

9521 {
9522 return (strlen($this->certificate_visibility)) ? $this->certificate_visibility : 0;
9523 }

Referenced by canShowCertificate(), and saveToDb().

+ Here is the caller graph for this function:

◆ getCharSelectorAvailability()

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

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

11979 {
11981 }

References $char_selector_availability.

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

+ Here is the caller graph for this function:

◆ getCharSelectorDefinition()

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

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

11995 {
11997 }

References $char_selector_definition.

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

+ Here is the caller graph for this function:

◆ getCompleteEvaluationData()

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

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

5220 {
5221 include_once "./Modules/Test/classes/class.ilTestEvaluationData.php";
5222 include_once "./Modules/Test/classes/class.ilTestEvaluationPassData.php";
5223 include_once "./Modules/Test/classes/class.ilTestEvaluationUserData.php";
5224 $data = $this->getUnfilteredEvaluationData();
5225 if ($withStatistics)
5226 {
5227 $data->calculateStatistics();
5228 }
5229 $data->setFilter($filterby, $filtertext);
5230 return $data;
5231 }

References $data.

Referenced by getAggregatedResultsData().

+ 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 @access public

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

4359 {
4360 global $ilDB;
4361
4362 $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",
4363 array('integer','integer'),
4364 array($this->getTestId(), $user_id)
4365 );
4366 $time = 0;
4367 while ($row = $ilDB->fetchAssoc($result))
4368 {
4369 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
4370 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4371 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4372 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4373 $time += ($epoch_2 - $epoch_1);
4374 }
4375 return $time;
4376 }

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

+ Here is the call graph for this function:

◆ getCompleteWorkingTimeOfParticipant()

ilObjTest::getCompleteWorkingTimeOfParticipant (   $active_id)

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

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

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

4428 {
4429 global $ilDB;
4430
4431 $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",
4432 array('integer','integer'),
4433 array($this->getTestId(), $active_id)
4434 );
4435 $time = 0;
4436 while ($row = $ilDB->fetchAssoc($result))
4437 {
4438 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
4439 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4440 preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
4441 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
4442 $time += ($epoch_2 - $epoch_1);
4443 }
4444 return $time;
4445 }

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

+ Here is the call graph for this function:

◆ getCompleteWorkingTimeOfParticipants()

& ilObjTest::getCompleteWorkingTimeOfParticipants ( )

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

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

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

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

References _getCompleteWorkingTimeOfParticipants(), and getTestId().

+ Here is the call graph for this function:

◆ getCountSystem()

ilObjTest::getCountSystem ( )

Gets the count system for the calculation of points.

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

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

2570 {
2571 return ($this->count_system) ? $this->count_system : 0;
2572 }

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

+ Here is the caller graph for this function:

◆ getCustomStyle()

ilObjTest::getCustomStyle ( )

Get the custom style.

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

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

2165 {
2166 return (strlen($this->_customStyle)) ? $this->_customStyle : NULL;
2167 }

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

+ 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 @access public
See also
$_customStyle

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

2177 {
2178 $css_path = ilUtil::getStyleSheetLocation("filesystem", "ta.css", "Modules/Test");
2179 $css_path = str_replace("ta.css", "customstyles", $css_path) . "/";
2180 $customstyles = array();
2181 if (is_dir($css_path))
2182 {
2183 $results = array();
2184 include_once "./Services/Utilities/classes/class.ilFileUtils.php";
2186 if (is_array($results["file"]))
2187 {
2188 foreach ($results["file"] as $filename)
2189 {
2190 if (strpos($filename, ".css"))
2191 {
2192 array_push($customstyles, $filename);
2193 }
2194 }
2195 }
2196 }
2197 return $customstyles;
2198 }
static recursive_dirscan($dir, &$arr)
Recursively scans a given directory and writes path and filename into referenced array.

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

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

10355 {
10356 $results = array();
10357 if (count($participants))
10358 {
10359 foreach ($participants as $active_id => $user_rec)
10360 {
10361 $row = array();
10362 $reached_points = 0;
10363 $max_points = 0;
10364 foreach ($this->questions as $value)
10365 {
10366 $question =& ilObjTest::_instanciateQuestion($value);
10367 if (is_object($question))
10368 {
10369 $max_points += $question->getMaximumPoints();
10370 $reached_points += $question->getReachedPoints($active_id);
10371 if ($max_points > 0)
10372 {
10373 $percentvalue = $reached_points / $max_points;
10374 if ($percentvalue < 0) $percentvalue = 0.0;
10375 }
10376 else
10377 {
10378 $percentvalue = 0;
10379 }
10380 if ($this->getAnonymity())
10381 {
10382 $user_rec['firstname'] = "";
10383 $user_rec['lastname'] = $this->lng->txt("anonymous");
10384 }
10385 $row = array(
10386 "user_id"=>$user_rec['usr_id'],
10387 "matriculation" => $user_rec['matriculation'],
10388 "lastname" => $user_rec['lastname'],
10389 "firstname" => $user_rec['firstname'],
10390 "login"=>$user_rec['login'],
10391 "question_id" => $question->getId(),
10392 "question_title" => $question->getTitle(),
10393 "reached_points" => $reached_points,
10394 "max_points" => $max_points
10395 );
10396 $results[] = $row;
10397 }
10398 }
10399 }
10400 }
10401 return $results;
10402 }

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

+ Here is the call graph for this function:

◆ getECTSFX()

ilObjTest::getECTSFX ( )

{

Returns
float|null
}

Implements ilEctsGradesEnabled.

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

2321 {
2322 return (strlen($this->ects_fx)) ? $this->ects_fx : NULL;
2323 }

Referenced by addDefaults(), and saveToDb().

+ Here is the caller graph for this function:

◆ getECTSGrade()

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

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

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

Implements ilEctsGradesEnabled.

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

6936 {
6937 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);
6938 }
static _getECTSGrade($points_passed, $reached_points, $max_points, $a, $b, $c, $d, $e, $fx)
{Returns the ECTS grade for a number of reached points.string The ECTS grade short description}

References _getECTSGrade().

Referenced by getAllTestResults().

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

◆ getECTSGrades()

ilObjTest::getECTSGrades ( )

{

Returns
array
}

Implements ilEctsGradesEnabled.

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

2337 {
2338 return $this->ects_grades;
2339 }

References $ects_grades.

Referenced by addDefaults().

+ Here is the caller graph for this function:

◆ getECTSOutput()

ilObjTest::getECTSOutput ( )

{

Returns
int|bool
}

Implements ilEctsGradesEnabled.

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

2305 {
2306 return ($this->ects_output) ? 1 : 0;
2307 }

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

+ Here is the caller graph for this function:

◆ getEnableArchiving()

ilObjTest::getEnableArchiving ( )
Returns
boolean

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

11853 {
11855 }

References $enable_archiving.

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

+ Here is the caller graph for this function:

◆ getEnabledViewMode()

ilObjTest::getEnabledViewMode ( )

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

10889 {
10890 return $this->enabled_view_mode;
10891 }

Referenced by saveToDb().

+ Here is the caller graph for this function:

◆ getEnableExamview()

ilObjTest::getEnableExamview ( )
Returns
boolean

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

11715 {
11717 }

References $enable_examview.

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

+ Here is the caller graph for this function:

◆ getEnableProcessingTime()

ilObjTest::getEnableProcessingTime ( )

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

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

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

3067 {
3068 return ($this->enable_processing_time) ? $this->enable_processing_time : 0;
3069 }

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

+ Here is the caller graph for this function:

◆ getEndingTime()

ilObjTest::getEndingTime ( )

Returns the ending time of the test.

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

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

3147 {
3148 return ($this->ending_time != 0) ? $this->ending_time : 0;
3149 }

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

+ Here is the caller graph for this function:

◆ getEstimatedWorkingTime()

ilObjTest::getEstimatedWorkingTime ( )

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

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

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

5475 {
5476 $time_in_seconds = 0;
5477 foreach ($this->questions as $question_id)
5478 {
5479 $question =& ilObjTest::_instanciateQuestion($question_id);
5480 $est_time = $question->getEstimatedWorkingTime();
5481 $time_in_seconds += $est_time["h"] * 3600 + $est_time["m"] * 60 + $est_time["s"];
5482 }
5483 $hours = (int)($time_in_seconds / 3600) ;
5484 $time_in_seconds = $time_in_seconds - ($hours * 3600);
5485 $minutes = (int)($time_in_seconds / 60);
5486 $time_in_seconds = $time_in_seconds - ($minutes * 60);
5487 $result = array("hh" => $hours, "mm" => $minutes, "ss" => $time_in_seconds);
5488 return $result;
5489 }

References $result, and _instanciateQuestion().

Referenced by getProcessingTimeAsArray().

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

◆ getEvaluationAdditionalFields()

ilObjTest::getEvaluationAdditionalFields ( )

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

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

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

10676 {
10677 include_once "./Modules/Test/classes/class.ilObjTestGUI.php";
10678 include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
10679 $table_gui = new ilEvaluationAllTableGUI(new ilObjTestGUI(''), 'outEvaluation', $this->getAnonymity());
10680 return $table_gui->getSelectedColumns();
10681 }
TableGUI class for evaluation of all users.
Class ilObjTestGUI.

References getAnonymity().

+ Here is the call graph for this function:

◆ getExistingQuestions()

& ilObjTest::getExistingQuestions (   $pass = NULL)

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

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

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

3833 {
3834 global $ilUser;
3835 global $ilDB;
3836
3837 $existing_questions = array();
3838 $active_id = $this->getActiveIdOfUser($ilUser->getId());
3839 if ($this->isRandomTest())
3840 {
3841 if (is_null($pass)) $pass = 0;
3842 $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",
3843 array('integer','integer'),
3844 array($active_id, $pass)
3845 );
3846 }
3847 else
3848 {
3849 $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",
3850 array('integer'),
3851 array($this->getTestId())
3852 );
3853 }
3854 while ($data = $ilDB->fetchObject($result))
3855 {
3856 if( $data->original_id === null )
3857 {
3858 continue;
3859 }
3860
3861 array_push($existing_questions, $data->original_id);
3862 }
3863 return $existing_questions;
3864 }

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

Referenced by getAvailableQuestions().

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

◆ getExportDirectory()

ilObjTest::getExportDirectory ( )

Get the location of the export directory for the test.

@access public

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

902 {
903 include_once "./Services/Utilities/classes/class.ilUtil.php";
904 $export_dir = ilUtil::getDataDir()."/tst_data"."/tst_".$this->getId()."/export";
905 return $export_dir;
906 }

References ilUtil\getDataDir().

+ Here is the call graph for this function:

◆ getExportSettings()

ilObjTest::getExportSettings ( )

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

10839 {
10840 if ($this->exportsettings)
10841 {
10842 return $this->exportsettings;
10843 }
10844 else
10845 {
10846 return 0;
10847 }
10848 }

References $exportsettings.

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

+ Here is the caller graph for this function:

◆ getExportSettingsSingleChoiceShort()

ilObjTest::getExportSettingsSingleChoiceShort ( )

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

10863 {
10864 if (($this->exportsettings & 1) > 0)
10865 {
10866 return true;
10867 }
10868 else
10869 {
10870 return false;
10871 }
10872 }

Referenced by setExportSettingsSingleChoiceShort().

+ Here is the caller graph for this function:

◆ getExtraTime()

ilObjTest::getExtraTime (   $active_id)

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

11771 {
11772 global $ilDB;
11773
11774 $result = $ilDB->queryF("SELECT additionaltime FROM tst_addtime WHERE active_fi = %s",
11775 array('integer'),
11776 array($active_id)
11777 );
11778 if ($result->numRows() > 0)
11779 {
11780 $row = $ilDB->fetchAssoc($result);
11781 return $row['additionaltime'];
11782 }
11783 return 0;
11784 }

References $ilDB, $result, and $row.

Referenced by getProcessingTimeInSeconds().

+ Here is the caller graph for this function:

◆ getFinalStatement()

ilObjTest::getFinalStatement ( )

Gets the final statement.

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

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

2249 {
2250 return (strlen($this->_finalstatement)) ? $this->_finalstatement : NULL;
2251 }

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

+ Here is the caller graph for this function:

◆ getFixedParticipants()

ilObjTest::getFixedParticipants ( )

Returns the fixed participants status.

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

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

9633 {
9634 return ($this->fixed_participants) ? 1 : 0;
9635 }

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

+ 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 @access public
See also
$_forcejs

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

2273 {
2274 return ($this->_forcejs) ? 1 : 0;
2275 }

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

+ Here is the caller graph for this function:

◆ getGenericAnswerFeedback()

ilObjTest::getGenericAnswerFeedback ( )

Returns 1 if generic answer feedback is to be shown.

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

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

2546 {
2547 return ($this->answer_feedback) ? $this->answer_feedback : 0;
2548 }

Referenced by saveToDb().

+ Here is the caller graph for this function:

◆ getGroupData()

& ilObjTest::getGroupData (   $ids)

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

7829 {
7830 if (!is_array($ids) || count($ids) ==0) return array();
7831 $result = array();
7832 foreach ($ids as $ref_id)
7833 {
7835 $result[$ref_id] = array("ref_id" => $ref_id, "title" => ilObject::_lookupTitle($obj_id), "description" => ilObject::_lookupDescription($obj_id));
7836 }
7837 return $result;
7838 }
static _lookupTitle($a_id)
lookup object title
static _lookupDescription($a_id)
lookup object description

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

+ Here is the call graph for this function:

◆ getHighscoreAchievedTS()

ilObjTest::getHighscoreAchievedTS ( )

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

Returns
bool True, if column should be shown.

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

11291 {
11292 return (bool) $this->_highscore_achieved_ts;
11293 }

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

+ Here is the caller graph for this function:

◆ getHighscoreAnon()

ilObjTest::getHighscoreAnon ( )

Gets if the highscores should be anonymized per setting.

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

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

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

11251 {
11252 return (bool) $this->_highscore_anon;
11253 }

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

+ Here is the caller graph for this function:

◆ getHighscoreEnabled()

ilObjTest::getHighscoreEnabled ( )

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

Returns
bool True, if highscore is enabled.

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

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

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

+ Here is the caller graph for this function:

◆ getHighscoreHints()

ilObjTest::getHighscoreHints ( )

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

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

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

11351 {
11352 return (bool) $this->_highscore_hints;
11353 }

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

+ Here is the caller graph for this function:

◆ getHighscoreMode()

ilObjTest::getHighscoreMode ( )
Returns
int

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

11449 {
11450 switch(true)
11451 {
11452 case $this->getHighscoreOwnTable() && $this->getHighscoreTopTable():
11453 return self::HIGHSCORE_SHOW_ALL_TABLES;
11454 break;
11455
11456 case $this->getHighscoreTopTable():
11457 return self::HIGHSCORE_SHOW_TOP_TABLE;
11458 break;
11459
11460 case $this->getHighscoreOwnTable():
11461 default:
11462 return self::HIGHSCORE_SHOW_OWN_TABLE;
11463 break;
11464 }
11465 }
const HIGHSCORE_SHOW_ALL_TABLES
const HIGHSCORE_SHOW_OWN_TABLE
const HIGHSCORE_SHOW_TOP_TABLE

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

+ Here is the call graph for this function:

◆ getHighscoreOwnTable()

ilObjTest::getHighscoreOwnTable ( )

Gets if the own rankings table should be shown.

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

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

11391 {
11392 return (bool) $this->_highscore_own_table;
11393 }

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

+ Here is the caller graph for this function:

◆ getHighscorePercentage()

ilObjTest::getHighscorePercentage ( )

Gets if the percentage column should be shown.

Returns
bool True, if percentage column should be shown.

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

11331 {
11332 return (bool) $this->_highscore_percentage;
11333 }

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

+ Here is the caller graph for this function:

◆ getHighscoreScore()

ilObjTest::getHighscoreScore ( )

Gets if the score column should be shown.

Returns
bool True, if score column should be shown.

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

11311 {
11312 return (bool) $this->_highscore_score;
11313 }

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

+ Here is the caller graph for this function:

◆ getHighscoreTopNum()

ilObjTest::getHighscoreTopNum (   $a_retval = 10)

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

Default: 10 entries

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

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

11435 {
11436 $retval = $a_retval;
11437 if ( (int) $this->_highscore_top_num != 0)
11438 {
11439 $retval = $this->_highscore_top_num;
11440 }
11441
11442 return $retval;
11443 }

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

+ Here is the caller graph for this function:

◆ getHighscoreTopTable()

ilObjTest::getHighscoreTopTable ( )

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

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

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

11411 {
11412 return (bool) $this->_highscore_top_table;
11413 }

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

+ Here is the caller graph for this function:

◆ getHighscoreWTime()

ilObjTest::getHighscoreWTime ( )

Gets if the column with the workingtime should be shown.

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

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

11371 {
11372 return (bool) $this->_highscore_wtime;
11373 }

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

+ Here is the caller graph for this function:

◆ getImagePath()

ilObjTest::getImagePath ( )

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

@access public

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

5498 {
5499 return CLIENT_WEB_DIR . "/assessment/" . $this->getId() . "/images/";
5500 }

References ilObject\getId().

+ Here is the call graph for this function:

◆ getImagePathWeb()

ilObjTest::getImagePathWeb ( )

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

@access public

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

5509 {
5510 include_once "./Services/Utilities/classes/class.ilUtil.php";
5511 $webdir = ilUtil::removeTrailingPathSeparators(CLIENT_WEB_DIR) . "/assessment/" . $this->getId() . "/images/";
5512 return str_replace(ilUtil::removeTrailingPathSeparators(ILIAS_ABSOLUTE_PATH), ilUtil::removeTrailingPathSeparators(ILIAS_HTTP_PATH), $webdir);
5513 }
static removeTrailingPathSeparators($path)

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

+ Here is the call graph for this function:

◆ getImportDirectory()

ilObjTest::getImportDirectory ( )

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

972 {
974 }

References _getImportDirectory().

+ Here is the call graph for this function:

◆ getImportMapping()

ilObjTest::getImportMapping ( )

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

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

6905 {
6906 if (!is_array($this->import_mapping))
6907 {
6908 return array();
6909 }
6910 else
6911 {
6912 return $this->import_mapping;
6913 }
6914 }

◆ getInstantFeedbackSolution()

ilObjTest::getInstantFeedbackSolution ( )

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

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

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

2522 {
2523 return ($this->instant_verification) ? $this->instant_verification : 0;
2524 }

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

+ Here is the caller graph for this function:

◆ getIntroduction()

ilObjTest::getIntroduction ( )

Gets the introduction text of the ilObjTest object.

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

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

2092 {
2093 return (strlen($this->introduction)) ? $this->introduction : NULL;
2094 }

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

+ 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 @access public

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

7563 {
7564 global $ilDB;
7565
7566 $result_array = array();
7567
7568 if ($this->getAnonymity())
7569 {
7570 if (is_numeric($user_id))
7571 {
7572 $result = $ilDB->queryF("SELECT tst_active.active_id, tst_active.tries, usr_id, %s login, %s lastname, %s firstname, tst_invited_user.clientip, " .
7573 "tst_active.submitted test_finished, matriculation, COALESCE(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass unfinished_passes FROM usr_data, tst_invited_user " .
7574 "LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
7575 "WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id AND usr_data.usr_id=%s " .
7576 "ORDER BY $order",
7577 array('text', 'text', 'text', 'integer', 'integer'),
7578 array("", $this->lng->txt("anonymous"), "", $this->getTestId(), $user_id)
7579 );
7580 }
7581 else
7582 {
7583 $result = $ilDB->queryF("SELECT tst_active.active_id, usr_id, %s login, %s lastname, %s firstname, tst_invited_user.clientip, " .
7584 "tst_active.submitted test_finished, matriculation, COALESCE(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass unfinished_passes FROM usr_data, tst_invited_user " .
7585 "LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
7586 "WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id " .
7587 "ORDER BY $order",
7588 array('text', 'text', 'text', 'integer'),
7589 array("", $this->lng->txt("anonymous"), "", $this->getTestId())
7590 );
7591 }
7592 }
7593 else
7594 {
7595 if (is_numeric($user_id))
7596 {
7597 $result = $ilDB->queryF("SELECT tst_active.active_id, tst_active.tries, usr_id, login, lastname, firstname, tst_invited_user.clientip, " .
7598 "tst_active.submitted test_finished, matriculation, COALESCE(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass unfinished_passes FROM usr_data, tst_invited_user " .
7599 "LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
7600 "WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id AND usr_data.usr_id=%s " .
7601 "ORDER BY $order",
7602 array('integer', 'integer'),
7603 array($this->getTestId(), $user_id)
7604 );
7605 }
7606 else
7607 {
7608 $result = $ilDB->queryF("SELECT tst_active.active_id, tst_active.tries, usr_id, login, lastname, firstname, tst_invited_user.clientip, " .
7609 "tst_active.submitted test_finished, matriculation, COALESCE(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass unfinished_passes FROM usr_data, tst_invited_user " .
7610 "LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
7611 "WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id " .
7612 "ORDER BY $order",
7613 array('integer'),
7614 array($this->getTestId())
7615 );
7616 }
7617 }
7618 $result_array = array();
7619 while ($row = $ilDB->fetchAssoc($result))
7620 {
7621 $result_array[$row['usr_id']]= $row;
7622 }
7623 return $result_array;
7624 }

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

+ 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 @access public

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

10320 {
10321 return TRUE;
10322
10323// global $ilUser;
10324// if (strcmp($_GET["tst_javascript"], "0") == 0) return FALSE;
10325// if ($this->getForceJS()) return TRUE;
10326// $assessmentSetting = new ilSetting("assessment");
10327// return ($ilUser->getPref("tst_javascript") === FALSE) ? $assessmentSetting->get("use_javascript") : $ilUser->getPref("tst_javascript");
10328 }

◆ getKiosk()

ilObjTest::getKiosk ( )

Returns the kiosk mode.

Returns
integer Kiosk mode @access public
See also
$_kiosk

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

2730 {
2731 return ($this->_kiosk) ? $this->_kiosk : 0;
2732 }

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

+ Here is the caller graph for this function:

◆ getKioskMode()

ilObjTest::getKioskMode ( )

Returns the kiosk mode.

Returns
boolean Kiosk mode @access public
See also
$_kiosk

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

2755 {
2756 if (($this->_kiosk & 1) > 0)
2757 {
2758 return TRUE;
2759 }
2760 else
2761 {
2762 return FALSE;
2763 }
2764 }

Referenced by setKioskMode().

+ Here is the caller graph for this function:

◆ getListOfQuestions()

ilObjTest::getListOfQuestions ( )

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

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

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

8790 {
8791 if (($this->show_summary & 1) > 0)
8792 {
8793 return TRUE;
8794 }
8795 else
8796 {
8797 return FALSE;
8798 }
8799 }

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

+ Here is the caller graph for this function:

◆ getListOfQuestionsDescription()

ilObjTest::getListOfQuestionsDescription ( )

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

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

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

8904 {
8905 if (($this->show_summary & 8) > 0)
8906 {
8907 return TRUE;
8908 }
8909 else
8910 {
8911 return FALSE;
8912 }
8913 }

Referenced by setListOfQuestionsDescription().

+ Here is the caller graph for this function:

◆ getListOfQuestionsEnd()

ilObjTest::getListOfQuestionsEnd ( )

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

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

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

8865 {
8866 if (($this->show_summary & 4) > 0)
8867 {
8868 return TRUE;
8869 }
8870 else
8871 {
8872 return FALSE;
8873 }
8874 }

Referenced by setListOfQuestionsEnd().

+ Here is the caller graph for this function:

◆ getListOfQuestionsSettings()

ilObjTest::getListOfQuestionsSettings ( )

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

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

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

8762 {
8763 return ($this->show_summary) ? $this->show_summary : 0;
8764 }

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

+ Here is the caller graph for this function:

◆ getListOfQuestionsStart()

ilObjTest::getListOfQuestionsStart ( )

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

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

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

8826 {
8827 if (($this->show_summary & 2) > 0)
8828 {
8829 return TRUE;
8830 }
8831 else
8832 {
8833 return FALSE;
8834 }
8835 }

Referenced by setListOfQuestionsStart().

+ Here is the caller graph for this function:

◆ getMailNotification()

ilObjTest::getMailNotification ( )

Get mail notification settings.

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

10646 {
10648 }

References $mailnotification.

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

+ Here is the caller graph for this function:

◆ getMailNotificationType()

ilObjTest::getMailNotificationType ( )

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

10815 {
10816 if ($this->mailnottype == 1)
10817 {
10818 return $this->mailnottype;
10819 }
10820 else
10821 {
10822 return 0;
10823 }
10824 }

References $mailnottype.

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

+ Here is the caller graph for this function:

◆ getManualFeedback()

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

Retrieves the 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 @access public

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

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

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

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

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

◆ getMarkSchema()

ilObjTest::getMarkSchema ( )

{

Returns
ASS_MarkSchema
}

Implements ilMarkSchemaAware.

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

7015 {
7016 return $this->mark_schema;
7017 }

References $mark_schema.

◆ getMarkSchemaForeignId()

ilObjTest::getMarkSchemaForeignId ( )

{

Returns
int
}

Implements ilMarkSchemaAware.

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

7023 {
7024 return $this->getTestId();
7025 }

References getTestId().

+ Here is the call graph for this function:

◆ getMCScoring()

ilObjTest::getMCScoring ( )

Gets the scoring type for multiple choice questions.

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

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

2604 {
2605 return ($this->mc_scoring) ? $this->mc_scoring : 0;
2606 }

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

+ Here is the caller graph for this function:

◆ getNrOfResultsForPass()

ilObjTest::getNrOfResultsForPass (   $active_id,
  $pass 
)

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

@access private

Deprecated:
: still in use?

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

1843 {
1844 global $ilDB;
1845
1846 $result = $ilDB->queryF("SELECT test_result_id FROM tst_test_result WHERE active_fi = %s AND pass = %s",
1847 array('integer','integer'),
1848 array($active_id, $pass)
1849 );
1850 return $result->numRows();
1851 }

References $ilDB, $pass, and $result.

Referenced by getStartTestLabel().

+ Here is the caller graph for this function:

◆ getNrOfTries()

ilObjTest::getNrOfTries ( )

Returns the nr of tries for the test.

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

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

2718 {
2719 return ($this->nr_of_tries) ? $this->nr_of_tries : 0;
2720 }

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

+ Here is the caller graph for this function:

◆ getOldOnlineStatus()

ilObjTest::getOldOnlineStatus ( )
Returns
null

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

11145 {
11147 }

References $oldOnlineStatus.

Referenced by saveToDb().

+ Here is the caller graph for this function:

◆ getParticipants()

& ilObjTest::getParticipants ( )

Returns all persons who started the test.

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

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

4672 {
4673 global $ilDB;
4674 $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",
4675 array('integer'),
4676 array($this->getTestId())
4677 );
4678 $persons_array = array();
4679 while ($row = $ilDB->fetchAssoc($result))
4680 {
4681 $name = $this->lng->txt("anonymous");
4682 $fullname = $this->lng->txt("anonymous");
4683 $login = "";
4684 if (!$this->getAnonymity())
4685 {
4686 if (strlen($row["firstname"].$row["lastname"].$row["title"]) == 0)
4687 {
4688 $name = $this->lng->txt("deleted_user");
4689 $fullname = $this->lng->txt("deleted_user");
4690 $login = $this->lng->txt("unknown");
4691 }
4692 else
4693 {
4694 $login = $row["login"];
4695 if ($row["user_fi"] == ANONYMOUS_USER_ID)
4696 {
4697 $name = $this->lng->txt("anonymous");
4698 $fullname = $this->lng->txt("anonymous");
4699 }
4700 else
4701 {
4702 $name = trim($row["lastname"] . ", " . $row["firstname"] . " " . $row["title"]);
4703 $fullname = trim($row["title"] . " " . $row["firstname"] . " " . $row["lastname"]);
4704 }
4705 }
4706 }
4707 $persons_array[$row["active_id"]] = array(
4708 "name" => $name,
4709 "fullname" => $fullname,
4710 "login" => $login
4711 );
4712 }
4713 return $persons_array;
4714 }

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

+ Here is the call graph for this function:

◆ getPassed()

ilObjTest::getPassed (   $active_id)

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

10439 {
10440 global $ilDB;
10441
10442 $result = $ilDB->queryF("SELECT passed FROM tst_result_cache WHERE active_fi = %s",
10443 array('integer'),
10444 array($active_id)
10445 );
10446 if ($result->numRows())
10447 {
10448 $row = $ilDB->fetchAssoc($result);
10449 return $row['passed'];
10450 }
10451 else
10452 {
10453 $counted_pass = ilObjTest::_getResultPass($active_id);
10454 $result_array =& $this->getTestResult($active_id, $counted_pass);
10455 return $result_array["test"]["passed"];
10456 }
10457 }

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

Referenced by canShowCertificate().

+ 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 @access public

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

8350 {
8351 global $ilDB;
8352
8353 if (is_null($pass))
8354 {
8355 $pass = 0;
8356 }
8357
8358 $query = "
8359 SELECT tst_pass_result.tstamp pass_res_tstamp,
8360 tst_test_result.tstamp quest_res_tstamp
8361
8362 FROM tst_pass_result
8363
8364 LEFT JOIN tst_test_result
8365 ON tst_test_result.active_fi = tst_pass_result.active_fi
8366 AND tst_test_result.pass = tst_pass_result.pass
8367
8368 WHERE tst_pass_result.active_fi = %s
8369 AND tst_pass_result.pass = %s
8370
8371 ORDER BY tst_test_result.tstamp DESC
8372 ";
8373
8374 $result = $ilDB->queryF($query,
8375 array('integer', 'integer'),
8376 array($active_id, $pass)
8377 );
8378
8379 while( $row = $ilDB->fetchAssoc($result) )
8380 {
8381 if( $row['qres_tstamp'] )
8382 {
8383 return $row['quest_res_tstamp'];
8384 }
8385
8386 return $row['pass_res_tstamp'];
8387 }
8388
8389 return 0;
8390 }

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

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

+ Here is the caller graph for this function:

◆ getPassScoring()

ilObjTest::getPassScoring ( )

Gets the pass scoring type.

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

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

2628 {
2629 return ($this->pass_scoring) ? $this->pass_scoring : 0;
2630 }

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

+ Here is the caller graph for this function:

◆ getPassWaiting()

ilObjTest::getPassWaiting ( )
Returns
string

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

3386 {
3387 return $this->pass_waiting;
3388 }

References $pass_waiting.

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

+ Here is the caller graph for this function:

◆ getPassword()

ilObjTest::getPassword ( )

Returns the password for test access.

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

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

3322 {
3323 return (strlen($this->password)) ? $this->password : NULL;
3324 }

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

+ Here is the caller graph for this function:

◆ getPoolQuestionChangeListeners()

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

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

12138 {
12139 require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
12140
12141 $questionChangeListeners = array(
12143 );
12144
12145 return $questionChangeListeners;
12146 }
static getPoolQuestionChangeListener(ilDBInterface $db, $poolObjId)

References ilObjTestDynamicQuestionSetConfig\getPoolQuestionChangeListener().

Referenced by ilObjQuestionPool\addQuestionChangeListeners().

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

◆ getPoolUsage()

ilObjTest::getPoolUsage ( )

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

10989 {
10990 return (boolean) $this->poolUsage;
10991 }

References $poolUsage.

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

+ Here is the caller graph for this function:

◆ getProcessingTime()

ilObjTest::getProcessingTime ( )

Returns the processing time for the test.

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

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

2972 {
2973 return (strlen($this->processing_time)) ? $this->processing_time : NULL;
2974 }

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

+ Here is the caller graph for this function:

◆ getProcessingTimeAsArray()

ilObjTest::getProcessingTimeAsArray ( )

Returns the processing time for the test.

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

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

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

References getEstimatedWorkingTime().

+ Here is the call graph for this function:

◆ getProcessingTimeAsMinutes()

ilObjTest::getProcessingTimeAsMinutes ( )

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

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

References DEFAULT_PROCESSING_TIME_MINUTES.

◆ getProcessingTimeInSeconds()

ilObjTest::getProcessingTimeInSeconds (   $active_id = "")

Returns the processing time for the test in seconds.

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

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

3026 {
3027 if (preg_match("/(\d{2}):(\d{2}):(\d{2})/", $this->getProcessingTime(), $matches))
3028 {
3029 $extratime = $this->getExtraTime($active_id) * 60;
3030 return ($matches[1] * 3600) + ($matches[2] * 60) + $matches[3] + $extratime;
3031 }
3032 else
3033 {
3034 return 0;
3035 }
3036 }
getExtraTime($active_id)

References getExtraTime(), and getProcessingTime().

Referenced by isMaxProcessingTimeReached().

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

◆ getQuestionCount()

ilObjTest::getQuestionCount ( )

Returns the number of questions in the test.

Returns
integer The number of questions @access public

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

7366 {
7367 $num = 0;
7368
7369 if( $this->isRandomTest() )
7370 {
7371 global $tree, $ilDB, $ilPluginAdmin;
7372
7373 $questionSetConfig = new ilTestRandomQuestionSetConfig(
7374 $tree, $ilDB, $ilPluginAdmin, $this
7375 );
7376
7377 $questionSetConfig->loadFromDb();
7378
7379 if( $questionSetConfig->isQuestionAmountConfigurationModePerPool() )
7380 {
7381 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
7382 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetBuilderWithAmountPerPool.php';
7383 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
7384
7385 $sourcePoolDefinitionList = new ilTestRandomQuestionSetSourcePoolDefinitionList(
7387 );
7388
7389 $sourcePoolDefinitionList->loadDefinitions();
7390
7391 $num = $sourcePoolDefinitionList->getQuestionAmount();
7392 }
7393 else
7394 {
7395 $num = $questionSetConfig->getQuestionAmountPerTest();
7396 }
7397 }
7398 else
7399 {
7400 $num = count($this->questions);
7401 }
7402
7403 return $num;
7404 }

References $ilDB, and isRandomTest().

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

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

◆ getQuestionDataset()

ilObjTest::getQuestionDataset (   $question_id)

Returns the dataset for a given question id.

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

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

3815 {
3816 global $ilDB;
3817
3818 $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",
3819 array('integer'),
3820 array($question_id)
3821 );
3822 $row = $ilDB->fetchObject($result);
3823 return $row;
3824 }

References $ilDB, $result, and $row.

◆ getQuestions()

ilObjTest::getQuestions ( )

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

11127 {
11128 return $this->questions;
11129 }

References $questions.

◆ getQuestionSetType()

ilObjTest::getQuestionSetType ( )

getter for question set type

Returns
string $questionSetType

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

12016 {
12018 }

References $questionSetType.

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

+ Here is the caller graph for this function:

◆ getQuestionSetTypeTranslation()

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

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

12088 {
12089 switch( $questionSetType )
12090 {
12092 return $lng->txt('tst_question_set_type_fixed');
12093
12095 return $lng->txt('tst_question_set_type_random');
12096
12098 return $lng->txt('tst_question_set_type_dynamic');
12099 }
12100
12101 throw new ilTestException('invalid question set type value given: '.$questionSetType);
12102 }

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

◆ getQuestionsOfPass()

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

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

Returns
array An associated array containing the questions @access public

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

4868 {
4869 global $ilDB;
4870 if ($this->isRandomTest())
4871 {
4872 $ilDB->setLimit($this->getQuestionCount(), 0);
4873 $result = $ilDB->queryF("SELECT tst_test_rnd_qst.sequence, tst_test_rnd_qst.question_fi, " .
4874 "qpl_questions.points " .
4875 "FROM tst_test_rnd_qst, qpl_questions " .
4876 "WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id " .
4877 "AND tst_test_rnd_qst.active_fi = %s AND tst_test_rnd_qst.pass = %s " .
4878 "ORDER BY tst_test_rnd_qst.sequence",
4879 array('integer', 'integer'),
4880 array($active_id, $pass)
4881 );
4882 }
4883 else
4884 {
4885 $result = $ilDB->queryF("SELECT tst_test_question.sequence, tst_test_question.question_fi, " .
4886 "qpl_questions.points " .
4887 "FROM tst_test_question, tst_active, qpl_questions " .
4888 "WHERE tst_test_question.question_fi = qpl_questions.question_id " .
4889 "AND tst_active.active_id = %s AND tst_active.test_fi = tst_test_question.test_fi",
4890 array('integer'),
4891 array($active_id)
4892 );
4893 }
4894 $qpass = array();
4895 if ($result->numRows())
4896 {
4897 while ($row = $ilDB->fetchAssoc($result))
4898 {
4899 array_push($qpass, $row);
4900 }
4901 }
4902 return $qpass;
4903 }

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

+ Here is the call graph for this function:

◆ getQuestionsOfTest()

& ilObjTest::getQuestionsOfTest (   $active_id)

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

Returns
array An associated array containing the questions @access public

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

4825 {
4826 global $ilDB;
4827 if ($this->isRandomTest())
4828 {
4829 $ilDB->setLimit($this->getQuestionCount(), 0);
4830 $result = $ilDB->queryF("SELECT tst_test_rnd_qst.sequence, tst_test_rnd_qst.question_fi, " .
4831 "tst_test_rnd_qst.pass, qpl_questions.points " .
4832 "FROM tst_test_rnd_qst, qpl_questions " .
4833 "WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id " .
4834 "AND tst_test_rnd_qst.active_fi = %s ORDER BY tst_test_rnd_qst.sequence",
4835 array('integer'),
4836 array($active_id)
4837 );
4838 }
4839 else
4840 {
4841 $result = $ilDB->queryF("SELECT tst_test_question.sequence, tst_test_question.question_fi, " .
4842 "qpl_questions.points " .
4843 "FROM tst_test_question, tst_active, qpl_questions " .
4844 "WHERE tst_test_question.question_fi = qpl_questions.question_id " .
4845 "AND tst_active.active_id = %s AND tst_active.test_fi = tst_test_question.test_fi",
4846 array('integer'),
4847 array($active_id)
4848 );
4849 }
4850 $qtest = array();
4851 if ($result->numRows())
4852 {
4853 while ($row = $ilDB->fetchAssoc($result))
4854 {
4855 array_push($qtest, $row);
4856 }
4857 }
4858 return $qtest;
4859 }

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

+ Here is the call graph for this function:

◆ getQuestiontext()

ilObjTest::getQuestiontext (   $question_id)

Returns the question text for a given question.

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

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

7537 {
7538 global $ilDB;
7539
7540 $res = "";
7541 if ($question_id)
7542 {
7543 $result = $ilDB->queryF("SELECT question_text FROM qpl_questions WHERE question_id = %s",
7544 array('integer'),
7545 array($question_id)
7546 );
7547 if ($result->numRows() == 1)
7548 {
7549 $row = $ilDB->fetchAssoc($result);
7550 $res = $row["question_text"];
7551 }
7552 }
7553 return $res;
7554 }

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

◆ getQuestionTitle()

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

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

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

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

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

3780 {
3781 if ($this->getTitleOutput() == 2)
3782 {
3783 if( $this->getQuestionSetType() == self::QUESTION_SET_TYPE_DYNAMIC )
3784 {
3785 // avoid legacy setting combination: ctm without question titles
3786 return $title;
3787 }
3788 else
3789 if (isset($nr))
3790 {
3791 return $this->lng->txt("ass_question"). ' ' . $nr;
3792 }
3793 else
3794 {
3795 return $this->lng->txt("ass_question");
3796 }
3797
3798 }
3799 else
3800 {
3801 return $title;
3802 }
3803 }

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

+ Here is the call graph for this function:

◆ getQuestionTitles()

& ilObjTest::getQuestionTitles ( )

Returns the titles of the test questions in question sequence.

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

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

3727 {
3728 $titles = array();
3729 if ($this->getQuestionSetType() == self::QUESTION_SET_TYPE_FIXED)
3730 {
3731 global $ilDB;
3732 $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",
3733 array('integer'),
3734 array($this->getTestId())
3735 );
3736 while ($row = $ilDB->fetchAssoc($result))
3737 {
3738 array_push($titles, $row["title"]);
3739 }
3740 }
3741 return $titles;
3742 }

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

+ Here is the call graph for this function:

◆ getQuestionTitlesAndIndexes()

& ilObjTest::getQuestionTitlesAndIndexes ( )

Returns the titles of the test questions in question sequence.

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

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

3752 {
3753 $titles = array();
3754 if ($this->getQuestionSetType() == self::QUESTION_SET_TYPE_FIXED)
3755 {
3756 global $ilDB;
3757 $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",
3758 array('integer'),
3759 array($this->getTestId())
3760 );
3761 while ($row = $ilDB->fetchAssoc($result))
3762 {
3763 $titles[$row['question_id']] = $row["title"];
3764 }
3765 }
3766 return $titles;
3767 }

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

Referenced by hasQuestionsWithoutQuestionpool().

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

◆ getQuestionType()

ilObjTest::getQuestionType (   $question_id)

Returns the question type of a question with a given id.

Parameters
integer$question_idThe database id of the question
Returns
string The question type string @access private

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

3874 {
3875 global $ilDB;
3876
3877 if ($question_id < 1) return -1;
3878 $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",
3879 array('integer'),
3880 array($question_id)
3881 );
3882 if ($result->numRows() == 1)
3883 {
3884 $data = $ilDB->fetchObject($result);
3885 return $data->type_tag;
3886 }
3887 else
3888 {
3889 return "";
3890 }
3891 }

References $data, $ilDB, and $result.

Referenced by createQuestionGUI().

+ Here is the caller graph for this function:

◆ getRedirectionMode()

ilObjTest::getRedirectionMode ( )

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

3199 {
3201 }

References $redirection_mode.

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

+ Here is the caller graph for this function:

◆ getRedirectionUrl()

ilObjTest::getRedirectionUrl ( )

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

3207 {
3209 }

References $redirection_url.

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

+ Here is the caller graph for this function:

◆ getReportingDate()

ilObjTest::getReportingDate ( )

Gets the reporting date of the ilObjTest object.

Returns
string The reporting date of the test of an empty string (=FALSE) if no reporting date is set @access public
See also
$reporting_date

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

2706 {
2707 return (strlen($this->reporting_date)) ? $this->reporting_date : NULL;
2708 }

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

+ Here is the caller graph for this function:

◆ getResetProcessingTime()

ilObjTest::getResetProcessingTime ( )

Returns wheather the processing time should be reset or not.

Returns
integer 0 for no reset, 1 for a reset @access public
See also
$reset_processing_time

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

3079 {
3080 return ($this->reset_processing_time) ? $this->reset_processing_time : 0;
3081 }

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

+ Here is the caller graph for this function:

◆ getResultFilterTaxIds()

ilObjTest::getResultFilterTaxIds ( )

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

12188 {
12190 }

References $resultFilterTaxIds.

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

+ Here is the caller graph for this function:

◆ getResultsForActiveId()

ilObjTest::getResultsForActiveId (   $active_id)

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

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 }
static _updateTestResultCache($active_id, ilAssQuestionProcessLocker $processLocker=null)
@TODO Move this to a proper place.

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

Referenced by getTestResult().

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

◆ getResultsPresentation()

ilObjTest::getResultsPresentation ( )

Returns the combined results presentation value.

Returns
integer The combined results presentation value @access public

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

8943 {
8944 return ($this->results_presentation) ? $this->results_presentation : 0;
8945 }

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

+ Here is the caller graph for this function:

◆ getRoleData()

& ilObjTest::getRoleData (   $ids)

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

7841 {
7842 if (!is_array($ids) || count($ids) ==0) return array();
7843 $result = array();
7844 foreach ($ids as $obj_id)
7845 {
7846 $result[$obj_id] = array("obj_id" => $obj_id, "title" => ilObject::_lookupTitle($obj_id), "description" => ilObject::_lookupDescription($obj_id));
7847 }
7848 return $result;
7849 }

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

+ Here is the call graph for this function:

◆ getScoreCutting()

ilObjTest::getScoreCutting ( )

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

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

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

2616 {
2617 return ($this->score_cutting) ? $this->score_cutting : 0;
2618 }

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

+ Here is the caller graph for this function:

◆ getScoreReporting()

ilObjTest::getScoreReporting ( )

Gets the score reporting of the ilObjTest object.

Returns
integer The score reporting of the test @access public
See also
$score_reporting

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

2505 {
2506 return ($this->score_reporting) ? $this->score_reporting : 0;
2507 }

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

+ Here is the caller graph for this function:

◆ getSecondsUntilEndingTime()

ilObjTest::getSecondsUntilEndingTime ( )

Returns the seconds left from the actual time until the ending time.

Returns
integer The seconds left until the ending time is reached @access public
See also
$ending_time

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

3046 {
3047 if ($this->getEndingTime() != 0)
3048 {
3049 $ending = $this->getEndingTime();
3050 $now = time();
3051 return $ending - $now;
3052 }
3053 else
3054 {
3055 return 0;
3056 }
3057 }

References getEndingTime().

+ Here is the call graph for this function:

◆ getSequenceSettings()

ilObjTest::getSequenceSettings ( )

SEQUENCE SETTING = POSTPONING ENABLED !!

Returns
integer The POSTPONING ENABLED status

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

2355 {
2356 return ($this->sequence_settings) ? $this->sequence_settings : 0;
2357 }

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

+ Here is the caller graph for this function:

◆ getShowCancel()

ilObjTest::getShowCancel ( )

Returns wheather the cancel test button is shown or not.

Returns
integer The value for the show cancel status (0 = don't show, 1 = show) @access public

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

9573 {
9574 return ($this->show_cancel) ? 1 : 0;
9575 }

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

+ Here is the caller graph for this function:

◆ getShowExamviewHtml()

ilObjTest::getShowExamviewHtml ( )
Returns
boolean

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

11683 {
11685 }

References $show_examview_html.

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

+ Here is the caller graph for this function:

◆ getShowExamviewPdf()

ilObjTest::getShowExamviewPdf ( )
Returns
boolean

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

11699 {
11701 }

References $show_examview_pdf.

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

+ Here is the caller graph for this function:

◆ getShowFinalStatement()

ilObjTest::getShowFinalStatement ( )

Returns whether the final statement should be shown or not.

Returns
integer 0 if false, 1 if true @access public
See also
$_showfinalstatement

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

2285 {
2286 return ($this->_showfinalstatement) ? 1 : 0;
2287 }

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

+ Here is the caller graph for this function:

◆ getShowInfo()

ilObjTest::getShowInfo ( )

Gets whether the complete information page is shown or the required data only.

Returns
integer 1 for the complete information, 0 otherwise @access public
See also
$_showinfo

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

2261 {
2262 return ($this->_showinfo) ? 1 : 0;
2263 }

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

+ Here is the caller graph for this function:

◆ getShowKioskModeParticipant()

ilObjTest::getShowKioskModeParticipant ( )

Returns the status of the kiosk mode participant.

Returns
boolean Kiosk mode participant @access public
See also
$_kiosk

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

2836 {
2837 if (($this->_kiosk & 4) > 0)
2838 {
2839 return TRUE;
2840 }
2841 else
2842 {
2843 return FALSE;
2844 }
2845 }

Referenced by setShowKioskModeParticipant().

+ Here is the caller graph for this function:

◆ getShowKioskModeTitle()

ilObjTest::getShowKioskModeTitle ( )

Returns the status of the kiosk mode title.

Returns
boolean Kiosk mode title @access public
See also
$_kiosk

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

2796 {
2797 if (($this->_kiosk & 2) > 0)
2798 {
2799 return TRUE;
2800 }
2801 else
2802 {
2803 return FALSE;
2804 }
2805 }

Referenced by setShowKioskModeTitle().

+ Here is the caller graph for this function:

◆ getShowMarker()

ilObjTest::getShowMarker ( )

Returns wheather the marker button is shown or not.

Returns
integer The value for the marker status (0 = don't show, 1 = show) @access public

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

9603 {
9604 return ($this->show_marker) ? 1 : 0;
9605 }

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

+ Here is the caller graph for this function:

◆ getShowPassDetails()

ilObjTest::getShowPassDetails ( )

Returns if the pass details should be shown when a test is not finished.

Returns
boolean TRUE if the pass details should be shown, FALSE otherwise @access public

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

8954 {
8955 if (($this->results_presentation & 1) > 0)
8956 {
8957 return TRUE;
8958 }
8959 else
8960 {
8961 return FALSE;
8962 }
8963 }

Referenced by setShowPassDetails().

+ Here is the caller graph for this function:

◆ getShowSolutionAnswersOnly()

ilObjTest::getShowSolutionAnswersOnly ( )

Returns if the full solution (including ILIAS content) should be presented to the solution or not.

Returns
boolean TRUE if the full solution should be presented in the solution output, FALSE otherwise @access public

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

9026 {
9027 if (($this->results_presentation & 16) > 0)
9028 {
9029 return TRUE;
9030 }
9031 else
9032 {
9033 return FALSE;
9034 }
9035 }

Referenced by setShowSolutionAnswersOnly().

+ Here is the caller graph for this function:

◆ getShowSolutionDetails()

ilObjTest::getShowSolutionDetails ( )

Returns if the solution details should be presented to the user or not.

Returns
boolean TRUE if the solution details should be presented, FALSE otherwise @access public

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

8972 {
8973 if (($this->results_presentation & 2) > 0)
8974 {
8975 return TRUE;
8976 }
8977 else
8978 {
8979 return FALSE;
8980 }
8981 }

Referenced by setShowSolutionDetails(), and toXML().

+ Here is the caller graph for this function:

◆ getShowSolutionFeedback()

ilObjTest::getShowSolutionFeedback ( )

Returns if the feedback should be presented to the solution or not.

Returns
boolean TRUE if the feedback should be presented in the solution, FALSE otherwise @access public

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

9008 {
9009 if (($this->results_presentation & 8) > 0)
9010 {
9011 return TRUE;
9012 }
9013 else
9014 {
9015 return FALSE;
9016 }
9017 }

Referenced by setShowSolutionFeedback().

+ Here is the caller graph for this function:

◆ getShowSolutionListComparison()

ilObjTest::getShowSolutionListComparison ( )
Returns
boolean TRUE if the results should be compared with the correct results in the list of answers, FALSE otherwise @access public

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

9076 {
9077 if(($this->results_presentation & 128) > 0)
9078 {
9079 return TRUE;
9080 }
9081 else
9082 {
9083 return FALSE;
9084 }
9085 }

Referenced by setShowSolutionListComparison().

+ Here is the caller graph for this function:

◆ getShowSolutionPrintview()

ilObjTest::getShowSolutionPrintview ( )

Returns if the solution printview should be presented to the user or not.

Returns
boolean TRUE if the solution printview should be presented, FALSE otherwise @access public

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

8990 {
8991 if (($this->results_presentation & 4) > 0)
8992 {
8993 return TRUE;
8994 }
8995 else
8996 {
8997 return FALSE;
8998 }
8999 }

Referenced by canShowSolutionPrintview(), and setShowSolutionPrintview().

+ Here is the caller graph for this function:

◆ getShowSolutionSignature()

ilObjTest::getShowSolutionSignature ( )

Returns if the signature field should be shown in the test results.

Returns
boolean TRUE if the signature field should be shown, FALSE otherwise @access public

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

9044 {
9045 if (($this->results_presentation & 32) > 0)
9046 {
9047 return TRUE;
9048 }
9049 else
9050 {
9051 return FALSE;
9052 }
9053 }

Referenced by setShowSolutionSignature().

+ Here is the caller graph for this function:

◆ getShowSolutionSuggested()

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

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

9060 {
9061 if (($this->results_presentation & 64) > 0)
9062 {
9063 return TRUE;
9064 }
9065 else
9066 {
9067 return FALSE;
9068 }
9069 }

Referenced by setShowSolutionSuggested().

+ Here is the caller graph for this function:

◆ getShuffleQuestions()

ilObjTest::getShuffleQuestions ( )

Returns the status of the shuffle_questions variable.

Returns
integer 0 if the test questions are not shuffled, 1 if the test questions are shuffled @access public

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

8734 {
8735 return ($this->shuffle_questions) ? 1 : 0;
8736 }

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

+ Here is the caller graph for this function:

◆ getSignSubmission()

ilObjTest::getSignSubmission ( )
Returns
boolean

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

11963 {
11965 }

References $sign_submission.

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

+ Here is the caller graph for this function:

◆ getSpecificAnswerFeedback()

ilObjTest::getSpecificAnswerFeedback ( )

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

11507 {
11508 switch ($this->specific_answer_feedback)
11509 {
11510 case 1:
11511 return 1;
11512 default:
11513 return 0;
11514 }
11515 }

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

+ Here is the caller graph for this function:

◆ getStartingTime()

ilObjTest::getStartingTime ( )

Returns the starting time of the test.

Returns
string The starting time of the test @access public
See also
$starting_time

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

3107 {
3108 return ($this->starting_time != 0) ? $this->starting_time : 0;
3109 }

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

+ Here is the caller graph for this function:

◆ getStartingTimeOfParticipants()

ilObjTest::getStartingTimeOfParticipants ( )

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

11742 {
11743 global $ilDB;
11744
11745 $times = array();
11746 $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");
11747 while ($row = $ilDB->fetchAssoc($result))
11748 {
11749 $times[$row['active_fi']] = $row['started'];
11750 }
11751 return $times;
11752 }

References $ilDB, $result, and $row.

◆ getStartingTimeOfUser()

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

Returns the unix timestamp of the time a user started a test.

Parameters
integer$active_idThe active id of the user
Returns
mixed The unix timestamp if the user started the test, FALSE otherwise @access public

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

8564 {
8565 global $ilDB;
8566
8567 if ($active_id < 1) return FALSE;
8568 if($pass === null)
8569 {
8570 $pass = ($this->getResetProcessingTime()) ? self::_getPass($active_id) : 0;
8571 }
8572 $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",
8573 array('integer', 'integer'),
8574 array($active_id, $pass)
8575 );
8576 if ($result->numRows())
8577 {
8578 $row = $ilDB->fetchAssoc($result);
8579 if (preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches))
8580 {
8581 return mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
8582 }
8583 else
8584 {
8585 return time();
8586 }
8587 }
8588 else
8589 {
8590 return time();
8591 }
8592 }

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

Referenced by canShowTestResults(), and isExecutable().

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

◆ getStartTestLabel()

ilObjTest::getStartTestLabel (   $active_id)

Returns the "Start the Test" label for the Info page.

Parameters
int$active_idThe active id of the current user
Returns
string The "Start the Test" label @access public

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

9771 {
9772 if ($this->getNrOfTries() == 1)
9773 {
9774 return $this->lng->txt("tst_start_test");
9775 }
9776 $active_pass = self::_getPass($active_id);
9777 $res = $this->getNrOfResultsForPass($active_id, $active_pass);
9778 if ($res == 0)
9779 {
9780 if ($active_pass == 0)
9781 {
9782 return $this->lng->txt("tst_start_test");
9783 }
9784 else
9785 {
9786 return $this->lng->txt("tst_start_new_test_pass");
9787 }
9788 }
9789 else
9790 {
9791 return $this->lng->txt("tst_resume_test");
9792 }
9793 }
getNrOfResultsForPass($active_id, $pass)
Calculates the number of user results for a specific test pass.

References $res, _getPass(), getNrOfResultsForPass(), and getNrOfTries().

+ Here is the call graph for this function:

◆ getTemplate()

ilObjTest::getTemplate ( )

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

10901 {
10902 return $this->template_id;
10903 }

References $template_id.

Referenced by saveToDb().

+ Here is the caller graph for this function:

◆ getTestDefaults()

& ilObjTest::getTestDefaults (   $test_defaults_id)

Returns the test defaults for a given id.

Parameters
integer$test_defaults_idThe database id of a test defaults dataset
Returns
array An array containing the test defaults @access public

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

9829 {
9830 return self::_getTestDefaults($test_defaults_id);
9831 }
static _getTestDefaults($test_defaults_id)

References _getTestDefaults().

+ Here is the call graph for this function:

◆ getTestId()

ilObjTest::getTestId ( )

Gets the database id of the additional test data.

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

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

2297 {
2298 return $this->test_id;
2299 }

References $test_id.

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

+ Here is the caller graph for this function:

◆ getTestObjIdsWithActiveForUserId()

static ilObjTest::getTestObjIdsWithActiveForUserId (   $userId)
static

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

12149 {
12150 global $ilDB;
12151
12152 $query = "
12153 SELECT obj_fi
12154 FROM tst_active
12155 INNER JOIN tst_tests
12156 ON test_id = test_fi
12157 WHERE user_fi = %s
12158 ";
12159
12160 $res = $ilDB->queryF($query, array('integer'), array($userId));
12161
12162 $objIds = array();
12163
12164 while( $row = $ilDB->fetchAssoc($res) )
12165 {
12166 $objIds[] = (int)$row['obj_fi'];
12167 }
12168
12169 return $objIds;
12170 }

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

Referenced by ilTestVerificationTableGUI\getItems().

+ 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 @access public

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

7633 {
7634 global $ilDB;
7635
7636 if ($this->getAnonymity())
7637 {
7638 $query = "
7639 SELECT tst_active.active_id,
7640 tst_active.tries,
7641 tst_active.user_fi usr_id,
7642 %s login,
7643 %s lastname,
7644 %s firstname,
7645 tst_active.submitted test_finished,
7646 usr_data.matriculation,
7647 usr_data.active,
7648 tst_active.lastindex,
7649 COALESCE(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass unfinished_passes
7650 FROM tst_active
7651 LEFT JOIN usr_data
7652 ON tst_active.user_fi = usr_data.usr_id
7653 WHERE tst_active.test_fi = %s
7654 ORDER BY usr_data.lastname
7655 ";
7656 $result = $ilDB->queryF($query,
7657 array('text', 'text', 'text', 'integer'),
7658 array("", $this->lng->txt("anonymous"), "", $this->getTestId())
7659 );
7660 }
7661 else
7662 {
7663 $query = "
7664 SELECT tst_active.active_id,
7665 tst_active.tries,
7666 tst_active.user_fi usr_id,
7667 usr_data.login,
7668 usr_data.lastname,
7669 usr_data.firstname,
7670 tst_active.submitted test_finished,
7671 usr_data.matriculation,
7672 usr_data.active,
7673 tst_active.lastindex,
7674 COALESCE(tst_active.last_finished_pass, -1) <> tst_active.last_started_pass unfinished_passes
7675 FROM tst_active
7676 LEFT JOIN usr_data
7677 ON tst_active.user_fi = usr_data.usr_id
7678 WHERE tst_active.test_fi = %s
7679 ORDER BY usr_data.lastname
7680 ";
7681 $result = $ilDB->queryF(
7682 $query, array('integer'), array($this->getTestId())
7683 );
7684 }
7685 $data = array();
7686 while ($row = $ilDB->fetchAssoc($result))
7687 {
7688 $data[$row['active_id']] = $row;
7689 }
7690 foreach ($data as $index => $participant)
7691 {
7692 if (strlen(trim($participant["firstname"].$participant["lastname"])) == 0)
7693 {
7694 $data[$index]["lastname"] = $this->lng->txt("deleted_user");
7695 }
7696 }
7697 return $data;
7698 }

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

Referenced by getTestParticipantsForManualScoring().

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

◆ getTestParticipantsForManualScoring()

ilObjTest::getTestParticipantsForManualScoring (   $filter = NULL)

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

7701 {
7702 global $ilDB;
7703
7704 include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
7706 if (count($scoring) == 0) return array();
7707
7708 $participants =& $this->getTestParticipants();
7709 $filtered_participants = array();
7710 foreach ($participants as $active_id => $participant)
7711 {
7712 $qstType_IN_manScoreableQstTypes = $ilDB->in('qpl_questions.question_type_fi', $scoring, false, 'integer');
7713
7714 $queryString = "
7715 SELECT tst_test_result.manual
7716
7717 FROM tst_test_result
7718
7719 INNER JOIN qpl_questions
7720 ON tst_test_result.question_fi = qpl_questions.question_id
7721
7722 WHERE tst_test_result.active_fi = %s
7723 AND $qstType_IN_manScoreableQstTypes
7724 ";
7725
7726 $result = $ilDB->queryF(
7727 $queryString, array("integer"), array($active_id)
7728 );
7729
7730 $count = $result->numRows();
7731
7732 if ($count > 0)
7733 {
7734 switch ($filter)
7735 {
7736 case 1: // only active users
7737 if ($participant->active) $filtered_participants[$active_id] = $participant;
7738 break;
7739 case 2: // only inactive users
7740 if (!$participant->active) $filtered_participants[$active_id] = $participant;
7741 break;
7742 case 3: // all users
7743 $filtered_participants[$active_id] = $participant;
7744 break;
7745 case 4:
7746 // already scored participants
7747 //$found = 0;
7748 //while ($row = $ilDB->fetchAssoc($result))
7749 //{
7750 // if ($row["manual"]) $found++;
7751 //}
7752 //if ($found == $count)
7753 //{
7754 //$filtered_participants[$active_id] = $participant;
7755 //}
7756 //else
7757 //{
7758 $assessmentSetting = new ilSetting("assessment");
7759 $manscoring_done = $assessmentSetting->get("manscoring_done_" . $active_id);
7760 if ($manscoring_done) $filtered_participants[$active_id] = $participant;
7761 //}
7762 break;
7763 case 5:
7764 // unscored participants
7765 //$found = 0;
7766 //while ($row = $ilDB->fetchAssoc($result))
7767 //{
7768 // if ($row["manual"]) $found++;
7769 //}
7770 //if ($found == 0)
7771 //{
7772 $assessmentSetting = new ilSetting("assessment");
7773 $manscoring_done = $assessmentSetting->get("manscoring_done_" . $active_id);
7774 if (!$manscoring_done) $filtered_participants[$active_id] = $participant;
7775 //}
7776 break;
7777 case 6:
7778 // partially scored participants
7779 $found = 0;
7780 while ($row = $ilDB->fetchAssoc($result))
7781 {
7782 if ($row["manual"]) $found++;
7783 }
7784 if (($found > 0) && ($found < $count)) $filtered_participants[$active_id] = $participant;
7785 break;
7786 default:
7787 $filtered_participants[$active_id] = $participant;
7788 break;
7789 }
7790 }
7791 }
7792 return $filtered_participants;
7793 }
static _getManualScoring()
Retrieve the manual scoring settings.
& getTestParticipants()
Returns a list of all participants in a test.

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

+ Here is the call graph for this function:

◆ getTestQuestions()

& ilObjTest::getTestQuestions ( )

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

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

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

+ Here is the call graph for this function:

◆ getTestResult()

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

Calculates the results of a test for a given user and returns an array with all test results.

Returns
array An array containing the test results for the given user @access public

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

4123 {
4124 global $tree, $ilDB, $lng, $ilPluginAdmin;
4125
4126 $results = $this->getResultsForActiveId($active_id);
4127
4128 if( is_null($pass) )
4129 {
4130 $pass = $results['pass'];
4131 }
4132
4133 require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
4134 $testSessionFactory = new ilTestSessionFactory($this);
4135 $testSession = $testSessionFactory->getSession($active_id);
4136
4137 require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
4138 $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this);
4139 $testSequence = $testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
4140
4141 if( $this->isDynamicTest() )
4142 {
4143 require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
4144 $dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this);
4145 $dynamicQuestionSetConfig->loadFromDb();
4146
4147 $testSequence->loadFromDb($dynamicQuestionSetConfig);
4148 $testSequence->loadQuestions($dynamicQuestionSetConfig, new ilTestDynamicQuestionSetFilterSelection());
4149
4150 $sequence = $testSequence->getUserSequenceQuestions();
4151 }
4152 else
4153 {
4154 $testSequence->setConsiderHiddenQuestionsEnabled($considerHiddenQuestions);
4155 $testSequence->setConsiderOptionalQuestionsEnabled($considerOptionalQuestions);
4156
4157 $testSequence->loadFromDb();
4158 $testSequence->loadQuestions();
4159
4160 if( $ordered_sequence )
4161 {
4162 $sequence = $testSequence->getOrderedSequenceQuestions();
4163 }
4164 else
4165 {
4166 $sequence = $testSequence->getUserSequenceQuestions();
4167 }
4168 }
4169
4170 $arrResults = array();
4171
4172 $query = "
4173 SELECT tst_test_result.question_fi,
4174 tst_test_result.points reached,
4175 tst_test_result.hint_count requested_hints,
4176 tst_test_result.hint_points hint_points,
4177 tst_test_result.answered answered
4178
4179 FROM tst_test_result
4180
4181 LEFT JOIN tst_solutions
4182 ON tst_solutions.active_fi = tst_test_result.active_fi
4183 AND tst_solutions.question_fi = tst_test_result.question_fi
4184
4185 WHERE tst_test_result.active_fi = %s
4186 AND tst_test_result.pass = %s
4187 ";
4188
4189 $solutionresult = $ilDB->queryF(
4190 $query, array('integer', 'integer'), array($active_id, $pass)
4191 );
4192
4193 while( $row = $ilDB->fetchAssoc($solutionresult) )
4194 {
4195 $arrResults[ $row['question_fi'] ] = $row;
4196 }
4197
4198 $numWorkedThrough = count($arrResults);
4199
4200 require_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
4201
4202 $IN_question_ids = $ilDB->in('qpl_questions.question_id', $sequence, false, 'integer');
4203
4204 $query = "
4205 SELECT qpl_questions.*,
4206 qpl_qst_type.type_tag,
4207 qpl_sol_sug.question_fi has_sug_sol
4208
4209 FROM qpl_qst_type,
4210 qpl_questions
4211
4212 LEFT JOIN qpl_sol_sug
4213 ON qpl_sol_sug.question_fi = qpl_questions.question_id
4214
4215 WHERE qpl_qst_type.question_type_id = qpl_questions.question_type_fi
4216 AND $IN_question_ids
4217 ";
4218
4219 $result = $ilDB->query($query);
4220
4221 $unordered = array();
4222
4223 $key = 1;
4224
4225 $obligationsAnswered = true;
4226
4227 while( $row = $ilDB->fetchAssoc($result) )
4228 {
4229 $percentvalue = (
4230 $row['points'] ? $arrResults[ $row['question_id'] ]['reached'] / $row['points'] : 0
4231 );
4232
4233 if( $percentvalue < 0 ) $percentvalue = 0.0;
4234
4235 $data = array(
4236 "nr" => "$key",
4237 "title" => ilUtil::prepareFormOutput($row['title']),
4238 "max" => round($row['points'], 2),
4239 "reached" => round($arrResults[$row['question_id']]['reached'],2),
4240 'requested_hints' => $arrResults[$row['question_id']]['requested_hints'],
4241 'hint_points' => $arrResults[$row['question_id']]['hint_points'],
4242 "percent" => sprintf("%2.2f ", ($percentvalue) * 100) . "%",
4243 "solution" => ($row['has_sug_sol']) ? assQuestion::_getSuggestedSolutionOutput($row['question_id']) : '',
4244 "type" => $row["type_tag"],
4245 "qid" => $row['question_id'],
4246 "original_id" => $row["original_id"],
4247 "workedthrough" => isset($arrResults[$row['question_id']]) ? 1 : 0,
4248 'answered' => $arrResults[$row['question_id']]['answered']
4249 );
4250
4251 if( !$arrResults[ $row['question_id'] ]['answered'] )
4252 {
4253 $obligationsAnswered = false;
4254 }
4255
4256 $unordered[ $row['question_id'] ] = $data;
4257
4258 $key++;
4259 }
4260
4261 $numQuestionsTotal = count($unordered);
4262
4263 $pass_max = 0;
4264 $pass_reached = 0;
4265 $pass_requested_hints = 0;
4266 $pass_hint_points = 0;
4267 $key = 1;
4268
4269 $found = array();
4270
4271 foreach( $sequence as $qid )
4272 {
4273 // building pass point sums based on prepared data
4274 // for question that exists in users qst sequence
4275 $pass_max += round($unordered[$qid]['max'], 2);
4276 $pass_reached += round($unordered[$qid]['reached'], 2);
4277 $pass_requested_hints += $unordered[$qid]['requested_hints'];
4278 $pass_hint_points += $unordered[$qid]['hint_points'];
4279
4280 // pickup prepared data for question
4281 // that exists in users qst sequence
4282 $unordered[$qid]['nr'] = $key;
4283 array_push($found, $unordered[$qid]);
4284
4285 // increment key counter
4286 $key++;
4287 }
4288
4289 $unordered = null;
4290
4291 if( $this->getScoreCutting() == 1 )
4292 {
4293 if( $results['reached_points'] < 0 )
4294 {
4295 $results['reached_points'] = 0;
4296 }
4297
4298 if( $pass_reached < 0 ) $pass_reached = 0;
4299 }
4300
4301 $found['pass']['total_max_points'] = $pass_max;
4302 $found['pass']['total_reached_points'] = $pass_reached;
4303 $found['pass']['total_requested_hints'] = $pass_requested_hints;
4304 $found['pass']['total_hint_points'] = $pass_hint_points;
4305 $found['pass']['percent'] = ($pass_max > 0) ? $pass_reached / $pass_max : 0;
4306 $found['pass']['obligationsAnswered'] = $obligationsAnswered;
4307 $found['pass']['num_workedthrough'] = $numWorkedThrough;
4308 $found['pass']['num_questions_total'] = $numQuestionsTotal;
4309
4310 $found["test"]["total_max_points"] = $results['max_points'];
4311 $found["test"]["total_reached_points"] = $results['reached_points'];
4312 $found["test"]["total_requested_hints"] = $results['hint_count'];
4313 $found["test"]["total_hint_points"] = $results['hint_points'];
4314 $found["test"]["result_pass"] = $results['pass'];
4315 $found['test']['result_tstamp'] = $results['tstamp'];
4316 $found['test']['obligations_answered'] = $results['obligations_answered'];
4317
4318 if( (!$total_reached_points) or (!$total_max_points) )
4319 {
4320 $percentage = 0.0;
4321 }
4322 else
4323 {
4324 $percentage = ($total_reached_points / $total_max_points) * 100.0;
4325
4326 if( $percentage < 0 ) $percentage = 0.0;
4327 }
4328
4329 $found["test"]["passed"] = $results['passed'];
4330
4331 return $found;
4332 }
static _getSuggestedSolutionOutput($question_id)
Returns the output of the suggested solution.
getResultsForActiveId($active_id)

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

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

+ 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 @access public

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

2208 {
2209 if (strlen($this->getCustomStyle()))
2210 {
2211 $default = ilUtil::getStyleSheetLocation("filesystem", "ta.css", "Modules/Test");
2212 $custom = str_replace("ta.css", "customstyles/" . $this->getCustomStyle(), $default);
2213 if (file_exists($custom))
2214 {
2215 $custom = ilUtil::getStyleSheetLocation($mode, "ta.css", "Modules/Test");
2216 $custom = str_replace("ta.css", "customstyles/" . $this->getCustomStyle(), $custom);
2217 return $custom;
2218 }
2219 else
2220 {
2221 return ilUtil::getStyleSheetLocation($mode, "ta.css", "Modules/Test");
2222 }
2223 }
2224 else
2225 {
2226 return ilUtil::getStyleSheetLocation($mode, "ta.css", "Modules/Test");
2227 }
2228 }

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

Referenced by deliverPDFfromHTML().

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

◆ getTextAnswer()

ilObjTest::getTextAnswer (   $active_id,
  $question_id,
  $pass = NULL 
)

Returns the text answer of a given user for a given question.

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

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

7505 {
7506 global $ilDB;
7507
7508 $res = "";
7509 if (($active_id) && ($question_id))
7510 {
7511 if (is_null($pass))
7512 {
7513 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
7514 $pass = assQuestion::_getSolutionMaxPass($question_id, $active_id);
7515 }
7516 $result = $ilDB->queryF("SELECT value1 FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
7517 array('integer', 'integer', 'integer'),
7518 array($active_id, $question_id, $pass)
7519 );
7520 if ($result->numRows() == 1)
7521 {
7522 $row = $ilDB->fetchAssoc($result);
7523 $res = $row["value1"];
7524 }
7525 }
7526 return $res;
7527 }
static _getSolutionMaxPass($question_id, $active_id)
Returns the maximum pass a users question solution.

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

+ Here is the call graph for this function:

◆ getTimeExtensionsOfParticipants()

ilObjTest::getTimeExtensionsOfParticipants ( )

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

11755 {
11756 global $ilDB;
11757
11758 $times = array();
11759 $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",
11760 array('integer'),
11761 array($this->getTestId())
11762 );
11763 while ($row = $ilDB->fetchAssoc($result))
11764 {
11765 $times[$row['active_fi']] = $row['additionaltime'];
11766 }
11767 return $times;
11768 }

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

+ Here is the call graph for this function:

◆ getTitleFilenameCompliant()

ilObjTest::getTitleFilenameCompliant ( )

returns the object title prepared to be used as a filename

Returns
string

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

714 {
715 require_once 'Services/Utilities/classes/class.ilUtil.php';
716 return ilUtil::getASCIIFilename($this->getTitle());
717 }

References ilUtil\getASCIIFilename(), and ilObject\getTitle().

+ Here is the call graph for this function:

◆ getTitleOutput()

ilObjTest::getTitleOutput ( )

Returns the value of the title_output status.

Returns
integer 0 for full title, 1 for title without points, 2 for no title @access public
See also
$title_output

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

2888 {
2889 return ($this->title_output) ? $this->title_output : 0;
2890 }

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

+ Here is the caller graph for this function:

◆ getTmpCopyWizardCopyId()

ilObjTest::getTmpCopyWizardCopyId ( )
Returns
int

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

723 {
725 }

References $tmpCopyWizardCopyId.

Referenced by ilTestFixedQuestionSetConfig\cloneQuestionSetRelatedData(), and ilTestRandomQuestionSetConfig\registerClonedSourcePoolDefinitionIdMapping().

+ Here is the caller graph for this function:

◆ getTotalPointsPassedArray()

& ilObjTest::getTotalPointsPassedArray ( )

Returns an array with the total points of all users who passed the test This array could be used for statistics.

Returns
array The total point values @access public

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

4642 {
4643 $totalpoints_array = array();
4644 $all_users =& $this->evalTotalParticipantsArray();
4645 foreach ($all_users as $active_id => $user_name)
4646 {
4647 $test_result =& $this->getTestResult($active_id);
4648 $reached = $test_result["test"]["total_reached_points"];
4649 $total = $test_result["test"]["total_max_points"];
4650 $percentage = $total != 0 ? $reached/$total : 0;
4651 $mark = $this->mark_schema->getMatchingMark($percentage*100.0);
4652
4653 $obligationsAnswered = $test_result["test"]["obligations_answered"];
4654
4655 if ($mark)
4656 {
4657 if( $mark->getPassed() && $obligationsAnswered )
4658 {
4659 array_push($totalpoints_array, $test_result["test"]["total_reached_points"]);
4660 }
4661 }
4662 }
4663 return $totalpoints_array;
4664 }
& evalTotalParticipantsArray($name_sort_order="asc")
Returns all participants who started the test.

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

Referenced by getAllTestResults().

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

◆ getUsePreviousAnswers()

ilObjTest::getUsePreviousAnswers ( )

Returns if the previous answers should be shown for a learner.

Returns
integer 1 if the previous answers should be shown, 0 otherwise @access public
See also
$use_previous_answers

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

2876 {
2877 return ($this->use_previous_answers) ? $this->use_previous_answers : 0;
2878 }

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

+ Here is the caller graph for this function:

◆ getUserData()

& ilObjTest::getUserData (   $ids)

Returns a data of all users specified by id list.

Parameters
$usr_idskommaseparated list of ids
Returns
array The user data "usr_id, login, lastname, firstname, clientip" of the users with id as key @access public

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

7803 {
7804 global $ilDB;
7805
7806 if (!is_array($ids) || count($ids) ==0) return array();
7807
7808 if ($this->getAnonymity())
7809 {
7810 $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",
7811 array('text', 'text', 'text'),
7812 array("", $this->lng->txt("anonymous"), "")
7813 );
7814 }
7815 else
7816 {
7817 $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");
7818 }
7819
7820 $result_array = array();
7821 while ($row = $ilDB->fetchAssoc($result))
7822 {
7823 $result_array[$row["usr_id"]]= $row;
7824 }
7825 return $result_array;
7826 }

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

+ Here is the call graph for this function:

◆ getVisitTimeOfParticipant()

ilObjTest::getVisitTimeOfParticipant (   $active_id)

Returns the first and last visit of a participant.

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

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

4481 {
4482 return ilObjTest::_getVisitTimeOfParticipant($this->getTestId(), $active_id);
4483 }
_getVisitTimeOfParticipant($test_id, $active_id)
Returns the first and last visit of a participant.

References _getVisitTimeOfParticipant(), and getTestId().

+ Here is the call graph for this function:

◆ getWorkedQuestions()

& ilObjTest::getWorkedQuestions (   $active_id,
  $pass = NULL 
)

Gets the id's of all questions a user already worked through.

Returns
array The question id's of the questions already worked through @access public

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

3934 {
3935 global $ilUser;
3936 global $ilDB;
3937
3938 if (is_null($pass))
3939 {
3940 $result = $ilDB->queryF("SELECT question_fi FROM tst_solutions WHERE active_fi = %s AND pass = %s GROUP BY question_fi",
3941 array('integer','integer'),
3942 array($active_id, 0)
3943 );
3944 }
3945 else
3946 {
3947 $result = $ilDB->queryF("SELECT question_fi FROM tst_solutions WHERE active_fi = %s AND pass = %s GROUP BY question_fi",
3948 array('integer','integer'),
3949 array($active_id, $pass)
3950 );
3951 }
3952 $result_array = array();
3953 while ($row = $ilDB->fetchAssoc($result))
3954 {
3955 array_push($result_array, $row["question_fi"]);
3956 }
3957 return $result_array;
3958 }

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

◆ getXMLZip()

ilObjTest::getXMLZip ( )

Get zipped xml file for test.

Reimplemented from ilObject.

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

10635 {
10636 require_once 'Modules/Test/classes/class.ilTestExportFactory.php';
10637 $expFactory = new ilTestExportFactory($this);
10638 $test_exp = $expFactory->getExporter('xml');
10639 return $test_exp->buildExportFile();
10640 }

◆ hasNrOfTriesRestriction()

ilObjTest::hasNrOfTriesRestriction ( )

returns if the numbers of tries have to be checked

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

8021 {
8022 return $this->getNrOfTries() != 0;
8023 }

References getNrOfTries().

Referenced by isExecutable().

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

◆ hasObligations()

static ilObjTest::hasObligations (   $test_id)
static

returns the fact wether the test with given test id contains questions markes as obligatory or not

@global ilDBInterface $ilDB

Parameters
integer$test_id
Returns
boolean $hasObligations

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

11617 {
11618 global $ilDB;
11619
11620 $rset = $ilDB->queryF(
11621 'SELECT count(*) cnt FROM tst_test_question WHERE test_fi = %s AND obligatory = 1',
11622 array('integer'), array($test_id)
11623 );
11624
11625 $row = $ilDB->fetchAssoc($rset);
11626
11627 return (bool)$row['cnt'] > 0;
11628 }

References $ilDB, $row, and $test_id.

Referenced by allObligationsAnswered().

+ Here is the caller graph for this function:

◆ hasQuestionsWithoutQuestionpool()

ilObjTest::hasQuestionsWithoutQuestionpool ( )

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

11075 {
11076 global $ilDB;
11077
11079
11080 $IN_questions = $ilDB->in('q1.question_id', array_keys($questions), false, 'integer');
11081
11082 $query = "
11083 SELECT count(q1.question_id) cnt
11084
11085 FROM qpl_questions q1
11086
11087 INNER JOIN qpl_questions q2
11088 ON q2.question_id = q1.original_id
11089
11090 WHERE $IN_questions
11091 AND q1.obj_fi = q2.obj_fi
11092 ";
11093
11094 $rset = $ilDB->query($query);
11095
11096 $row = $ilDB->fetchAssoc($rset);
11097
11098 return $row['cnt'] > 0;
11099 }
& getQuestionTitlesAndIndexes()
Returns the titles of the test questions in question sequence.

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

+ Here is the call graph for this function:

◆ hasRandomQuestionsForPass()

ilObjTest::hasRandomQuestionsForPass (   $active_id,
  $pass 
)

Checkes wheather a random test has already created questions for a given pass or not.

@access private

Parameters
$active_idActive id of the test
$passPass of the test
Returns
boolean TRUE if the test already contains questions, FALSE otherwise
Deprecated:
: still in use?

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

1864 {
1865 global $ilDB;
1866 $result = $ilDB->queryF("SELECT test_random_question_id FROM tst_test_rnd_qst WHERE active_fi = %s AND pass = %s",
1867 array('integer','integer'),
1868 array($active_id, $pass)
1869 );
1870 return ($result->numRows() > 0) ? true : false;
1871 }

References $ilDB, $pass, and $result.

◆ hasSingleChoiceQuestions()

ilObjTest::hasSingleChoiceQuestions ( )

Returns TRUE if the test contains single choice results.

Returns
boolean @access public

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

1015 {
1016 global $ilDB;
1017
1018 $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",
1019 array('integer'),
1020 array($this->getTestId())
1021 );
1022 $hasSC = false;
1023 while ($row = $ilDB->fetchAssoc($result))
1024 {
1025 if (strcmp($row['foundtypes'], 'assSingleChoice') == 0)
1026 {
1027 $hasSC = true;
1028 }
1029 }
1030 return $hasSC;
1031 }

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

Referenced by isSingleChoiceTestWithoutShuffle().

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

3671 {
3672 global $ilDB;
3673#var_dump($question_id);
3674 if ($linkOnly)
3675 {
3676 $duplicate_id = $question_id;
3677 }
3678 else
3679 {
3680 $duplicate_id = $this->duplicateQuestionForTest($question_id);
3681 }
3682
3683 // get maximum sequence index in test
3684 $result = $ilDB->queryF("SELECT MAX(sequence) seq FROM tst_test_question WHERE test_fi=%s",
3685 array('integer'),
3686 array($this->getTestId())
3687 );
3688 $sequence = 1;
3689
3690 if ($result->numRows() == 1)
3691 {
3692 $data = $ilDB->fetchObject($result);
3693 $sequence = $data->seq + 1;
3694 }
3695
3696 $next_id = $ilDB->nextId('tst_test_question');
3697 $affectedRows = $ilDB->manipulateF("INSERT INTO tst_test_question (test_question_id, test_fi, question_fi, sequence, tstamp) VALUES (%s, %s, %s, %s, %s)",
3698 array('integer', 'integer','integer','integer','integer'),
3699 array($next_id, $this->getTestId(), $duplicate_id, $sequence, time())
3700 );
3701 if ($affectedRows == 1)
3702 {
3703 include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3705 {
3706 $this->logAction($this->lng->txtlng("assessment", "log_question_added", ilObjAssessmentFolder::_getLogLanguage()) . ": " . $sequence, $duplicate_id);
3707 }
3708 }
3709 // remove test_active entries, because test has changed
3710 $affectedRows = $ilDB->manipulateF("DELETE FROM tst_active WHERE test_fi = %s",
3711 array('integer'),
3712 array($this->getTestId())
3713 );
3714 $this->loadQuestions();
3715 $this->saveCompleteStatus($testQuestionSetConfig);
3716 return $duplicate_id;
3717 }
saveCompleteStatus(ilTestQuestionSetConfig $testQuestionSetConfig)
Checks if the test is complete and saves the status in the database.
duplicateQuestionForTest($question_id)
Takes a question and creates a copy of the question for use in the test.

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

+ Here is the call graph for this function:

◆ inviteGroup()

ilObjTest::inviteGroup (   $group_id)

Invites all users of a group to a test.

Parameters
integer$group_idThe database id of the invited group @access public

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

7859 {
7860 include_once "./Modules/Group/classes/class.ilObjGroup.php";
7861 $group = new ilObjGroup($group_id);
7862 $members = $group->getGroupMemberIds();
7863 include_once './Services/User/classes/class.ilObjUser.php';
7864 foreach ($members as $user_id)
7865 {
7866 $this->inviteUser($user_id, ilObjUser::_lookupClientIP($user_id));
7867 }
7868 }
Class ilObjGroup.
inviteUser($user_id, $client_ip="")
Invites a user to a test.
static _lookupClientIP($a_user_id)
Lookup client ip.

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

+ Here is the call graph for this function:

◆ inviteRole()

ilObjTest::inviteRole (   $role_id)

Invites all users of a role to a test.

Parameters
integer$group_idThe database id of the invited group @access public

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

7877 {
7878 global $rbacreview;
7879 $members = $rbacreview->assignedUsers($role_id);
7880 include_once './Services/User/classes/class.ilObjUser.php';
7881 foreach ($members as $user_id)
7882 {
7883 $this->inviteUser($user_id, ilObjUser::_lookupClientIP($user_id));
7884 }
7885 }

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

+ Here is the call graph for this function:

◆ inviteUser()

ilObjTest::inviteUser (   $user_id,
  $client_ip = "" 
)

Invites a user to a test.

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

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

7912 {
7913 global $ilDB;
7914
7915 $affectedRows = $ilDB->manipulateF("DELETE FROM tst_invited_user WHERE test_fi = %s AND user_fi = %s",
7916 array('integer', 'integer'),
7917 array($this->getTestId(), $user_id)
7918 );
7919 $affectedRows = $ilDB->manipulateF("INSERT INTO tst_invited_user (test_fi, user_fi, clientip, tstamp) VALUES (%s, %s, %s, %s)",
7920 array('integer', 'integer', 'text', 'integer'),
7921 array($this->getTestId(), $user_id, (strlen($client_ip)) ? $client_ip : NULL, time())
7922 );
7923 }

References $ilDB, and getTestId().

Referenced by inviteGroup(), and inviteRole().

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

◆ isActivationLimited()

ilObjTest::isActivationLimited ( )

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

11198 {
11199 return (bool)$this->activation_limited;
11200 }

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

+ Here is the caller graph for this function:

◆ isActiveTestSubmitted()

ilObjTest::isActiveTestSubmitted (   $user_id = null)

returns if the active for user_id has been submitted

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

8003 {
8004 global $ilUser;
8005 global $ilDB;
8006
8007 if (!is_numeric($user_id))
8008 $user_id = $ilUser->getId();
8009
8010 $result = $ilDB->queryF("SELECT submitted FROM tst_active WHERE test_fi=%s AND user_fi=%s AND submitted=%s",
8011 array('integer', 'integer', 'integer'),
8012 array($this->getTestId(), $user_id, 1)
8013 );
8014 return $result->numRows() == 1;
8015 }

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

+ Here is the call graph for this function:

◆ isBestSolutionPrintedWithResult()

ilObjTest::isBestSolutionPrintedWithResult ( )

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

11163 {
11165 }
$print_best_solution_with_result

References $print_best_solution_with_result.

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

+ Here is the caller graph for this function:

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

1106 {
1107 if( !count($this->mark_schema->mark_steps) )
1108 {
1109 return false;
1110 }
1111
1112 if( !$testQuestionSetConfig->isQuestionSetConfigured() )
1113 {
1114 return false;
1115 }
1116
1117 return true;
1118 }

References ilTestQuestionSetConfig\isQuestionSetConfigured().

Referenced by saveCompleteStatus(), and saveToDb().

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

◆ isDynamicTest()

ilObjTest::isDynamicTest ( )

Returns the fact wether this test is a dynamic question set test or not.

Returns
boolean $isDynamicTest

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

12071 {
12073 }

References getQuestionSetType(), and QUESTION_SET_TYPE_DYNAMIC.

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

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

◆ isEndingTimeEnabled()

ilObjTest::isEndingTimeEnabled ( )
Returns
boolean

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

3127 {
3129 }

References $ending_time_enabled.

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

+ Here is the caller graph for this function:

◆ isExecutable()

ilObjTest::isExecutable (   $testSession,
  $user_id,
  $allowPassIncrease = FALSE 
)

Checks if the test is executable by the given user.

Parameters
ilTestSession|ilTestSessionDynamicQuestionSet
integer$user_idThe user id
Returns
array Result array @access public

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

8401 {
8402 $result = array(
8403 "executable" => true,
8404 "errormessage" => ""
8405 );
8406 if (!$this->startingTimeReached())
8407 {
8408 $result["executable"] = false;
8409 $result["errormessage"] = sprintf($this->lng->txt("detail_starting_time_not_reached"), ilDatePresentation::formatDate(new ilDateTime($this->getStartingTime(), IL_CAL_UNIX)));
8410 return $result;
8411 }
8412 if ($this->endingTimeReached())
8413 {
8414 $result["executable"] = false;
8415 $result["errormessage"] = sprintf($this->lng->txt("detail_ending_time_reached"), ilDatePresentation::formatDate(new ilDateTime($this->getEndingTime(), IL_CAL_UNIX)));
8416 return $result;
8417 }
8418
8419 $active_id = $this->getActiveIdOfUser($user_id);
8420
8421 if ($this->getEnableProcessingTime())
8422 {
8423 if ($active_id > 0)
8424 {
8425 $starting_time = $this->getStartingTimeOfUser($active_id);
8426 if ($starting_time !== FALSE)
8427 {
8428 if ($this->isMaxProcessingTimeReached($starting_time, $active_id))
8429 {
8430 if ($allowPassIncrease && $this->getResetProcessingTime() && (($this->getNrOfTries() == 0) || ($this->getNrOfTries() > (self::_getPass($active_id)+1))))
8431 {
8432 // a test pass was quitted because the maximum processing time was reached, but the time
8433 // will be resetted for future passes, so if there are more passes allowed, the participant may
8434 // start the test again.
8435 // This code block is only called when $allowPassIncrease is TRUE which only happens when
8436 // the test info page is opened. Otherwise this will lead to unexpected results!
8437 $testSession->increasePass();
8438 $testSession->setLastSequence(0);
8439 $testSession->saveToDb();
8440 }
8441 else
8442 {
8443 $result["executable"] = false;
8444 $result["errormessage"] = $this->lng->txt("detail_max_processing_time_reached");
8445 }
8446 return $result;
8447 }
8448 }
8449 }
8450 }
8451 require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
8452 $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this);
8453 $testPassesSelector->setActiveId($active_id);
8454 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
8455
8456 if ($this->hasNrOfTriesRestriction() && ($active_id > 0))
8457 {
8458 $closedPasses = $testPassesSelector->getClosedPasses();
8459
8460 if( count($closedPasses) >= $this->getNrOfTries() )
8461 {
8462 $result["executable"] = false;
8463 $result["errormessage"] = $this->lng->txt("maximum_nr_of_tries_reached");
8464 return $result;
8465 }
8466 }
8467 if($this->isPassWaitingEnabled() && $testPassesSelector->getLastFinishedPass() !== null)
8468 {
8469 $lastPass = $testPassesSelector->getLastFinishedPassTimestamp();
8470 if($lastPass && strlen($this->getPassWaiting()))
8471 {
8472 $pass_waiting_string = $this->getPassWaiting();
8473 $time_values = explode(":", $pass_waiting_string);
8474 $next_pass_allowed = strtotime('+ ' . $time_values[0] . ' Months + ' . $time_values[1] . ' Days + ' . $time_values[2] . ' Hours' . $time_values[3] . ' Minutes', $lastPass);
8475
8476 if(time() < $next_pass_allowed)
8477 {
8478 $date = ilDatePresentation::formatDate(new ilDateTime($next_pass_allowed, IL_CAL_UNIX));
8479
8480 $result["executable"] = false;
8481 $result["errormessage"] = sprintf($this->lng->txt('wait_for_next_pass_hint_msg'), $date);
8482 return $result;
8483 }
8484 }
8485 }
8486 return $result;
8487 }
static formatDate(ilDateTime $date)
Format a date @access public.
startingTimeReached()
Returns true if the starting time of a test is reached A starting time is not available for self asse...
hasNrOfTriesRestriction()
returns if the numbers of tries have to be checked

References $GLOBALS, $result, $starting_time, $testSession, endingTimeReached(), ilDatePresentation\formatDate(), getActiveIdOfUser(), getEnableProcessingTime(), getEndingTime(), getNrOfTries(), getPassWaiting(), getResetProcessingTime(), getStartingTime(), getStartingTimeOfUser(), hasNrOfTriesRestriction(), IL_CAL_UNIX, isMaxProcessingTimeReached(), isPassWaitingEnabled(), sprintf, and startingTimeReached().

+ Here is the call graph for this function:

◆ isFixedTest()

ilObjTest::isFixedTest ( )

Returns the fact wether this test is a fixed question set test or not.

Returns
boolean $isFixedTest

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

12051 {
12053 }

References getQuestionSetType(), and QUESTION_SET_TYPE_FIXED.

+ Here is the call graph for this function:

◆ isForceInstantFeedbackEnabled()

ilObjTest::isForceInstantFeedbackEnabled ( )
Returns
boolean

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

12257 {
12259 }

References $forceInstantFeedbackEnabled.

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

+ Here is the caller graph for this function:

◆ isHighscoreAnon()

ilObjTest::isHighscoreAnon ( )

Gets if the highscores should be displayed anonymized.

Note: This method considers the global anonymity switch. If you need access to the users setting,

See also
getHighscoreAnon()
Returns
boolean True, if output is anonymized.

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

11264 {
11265 if ($this->getAnonymity() == 1)
11266 {
11267 return true;
11268 }
11269 else
11270 {
11271 return (bool)$this->getHighscoreAnon();
11272 }
11273 }

References getAnonymity(), and getHighscoreAnon().

+ Here is the call graph for this function:

◆ isHTML()

ilObjTest::isHTML (   $a_text)

Checks if a given string contains HTML or not.

Parameters
string$a_textText which should be checked
Returns
boolean @access public

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

9399 {
9400 if (preg_match("/<[^>]*?>/", $a_text))
9401 {
9402 return TRUE;
9403 }
9404 else
9405 {
9406 return FALSE;
9407 }
9408 }

Referenced by addQTIMaterial().

+ Here is the caller graph for this function:

◆ isInstantFeedbackAnswerFixationEnabled()

ilObjTest::isInstantFeedbackAnswerFixationEnabled ( )

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

12249 {
12251 }
$instantFeedbackAnswerFixationEnabled

References $instantFeedbackAnswerFixationEnabled.

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

+ Here is the caller graph for this function:

◆ isIntroductionEnabled()

ilObjTest::isIntroductionEnabled ( )
Returns
boolean

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

2073 {
2075 }

References $introductionEnabled.

Referenced by addDefaults(), and saveToDb().

+ Here is the caller graph for this function:

◆ isLimitUsersEnabled()

ilObjTest::isLimitUsersEnabled ( )
Returns
boolean

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

9303 {
9305 }

References $limitUsersEnabled.

Referenced by addDefaults(), and saveToDb().

+ Here is the caller graph for this function:

◆ isMaxProcessingTimeReached()

ilObjTest::isMaxProcessingTimeReached (   $starting_time,
  $active_id 
)

Returns whether the maximum processing time for a test is reached or not.

Parameters
long$starting_timeThe unix timestamp of the starting time of the test
Returns
boolean TRUE if the maxium processing time is reached, FALSE if the maximum processing time is not reached or no maximum processing time is given @access public

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

8603 {
8604 if ($this->getEnableProcessingTime())
8605 {
8606 $processing_time = $this->getProcessingTimeInSeconds($active_id);
8607 $now = time();
8608 if ($now > ($starting_time + $processing_time))
8609 {
8610 return TRUE;
8611 }
8612 else
8613 {
8614 return FALSE;
8615 }
8616 }
8617 else
8618 {
8619 return FALSE;
8620 }
8621 }
getProcessingTimeInSeconds($active_id="")
Returns the processing time for the test in seconds.

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

Referenced by canShowTestResults(), and isExecutable().

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

◆ isNewRandomTest()

ilObjTest::isNewRandomTest ( )
protected

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

Deprecated:
--> old school random test

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

1721 {
1722 global $ilDB;
1723 $result = $ilDB->queryF('SELECT copy_id FROM tst_rnd_cpy WHERE tst_fi = %s',
1724 array('integer'),
1725 array($this->getTestId())
1726 );
1727 return $result->numRows() > 0;
1728 }

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

+ Here is the call graph for this function:

◆ isNrOfTriesReached()

ilObjTest::isNrOfTriesReached (   $tries)

returns if number of tries are reached

Deprecated:
: tries field differs per situation, outside a pass it's the number of tries, inside a pass it's the current pass number.

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

8032 {
8033 return $tries >= (int) $this->getNrOfTries();
8034 }

References getNrOfTries().

+ Here is the call graph for this function:

◆ isOfferingQuestionHintsEnabled()

ilObjTest::isOfferingQuestionHintsEnabled ( )

returns the fact wether offering hints is enabled or not

Returns
boolean

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

11173 {
11175 }

References $offeringQuestionHintsEnabled.

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

+ Here is the caller graph for this function:

◆ isOnline()

ilObjTest::isOnline ( )

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

11132 {
11133 return $this->online;
11134 }
$online
the object's online status

References $online.

Referenced by saveToDb().

+ Here is the caller graph for this function:

◆ isParticipantsLastPassActive()

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

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

12303 {
12304 global $ilDB, $lng, $ilPluginAdmin;
12305
12306 /* @var ilObjTest $testOBJ */
12307
12308 $testOBJ = ilObjectFactory::getInstanceByRefId($testRefId,false);
12309
12310
12311 $activeId = $testOBJ->getActiveIdOfUser($userId);
12312
12313 require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
12314 $testSessionFactory = new ilTestSessionFactory($testOBJ);
12315 // Added temporarily bugfix smeyer
12316 $testSessionFactory->reset();
12317
12318 require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
12319 $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $testOBJ);
12320
12321 $testSession = $testSessionFactory->getSession($activeId);
12322 $testSequence = $testSequenceFactory->getSequenceByActiveIdAndPass($activeId, $testSession->getPass());
12323 $testSequence->loadFromDb();
12324
12325 return $testSequence->hasSequence();
12326 }

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

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

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

◆ isPassDeletionAllowed()

ilObjTest::isPassDeletionAllowed ( )

getter for the test setting passDeletionAllowed

Returns
integer

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

11656 {
11658 }

References $passDeletionAllowed.

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

+ Here is the caller graph for this function:

◆ isPassWaitingEnabled()

ilObjTest::isPassWaitingEnabled ( )
Returns
bool

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

3401 {
3402 if(array_sum(explode(':', $this->getPassWaiting())) > 0)
3403 {
3404 return true;
3405 }
3406 return false;
3407 }

References getPassWaiting().

Referenced by isExecutable().

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

◆ isPasswordEnabled()

ilObjTest::isPasswordEnabled ( )
Returns
boolean

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

3302 {
3304 }

References $passwordEnabled.

Referenced by addDefaults(), and saveToDb().

+ Here is the caller graph for this function:

◆ isPluginActive()

ilObjTest::isPluginActive (   $a_pname)

Checks wheather or not a question plugin with a given name is active.

Parameters
string$a_pnameThe plugin name @access public

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

10426 {
10427 global $ilPluginAdmin;
10428 if ($ilPluginAdmin->isActive(IL_COMP_MODULE, "TestQuestionPool", "qst", $a_pname))
10429 {
10430 return TRUE;
10431 }
10432 else
10433 {
10434 return FALSE;
10435 }
10436 }

References IL_COMP_MODULE.

◆ isPostponingEnabled()

ilObjTest::isPostponingEnabled ( )
Returns
bool $postponingEnabled

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

2373 {
2374 return (bool)$this->getSequenceSettings();
2375 }

References getSequenceSettings().

+ Here is the call graph for this function:

◆ isPreviousSolutionReuseEnabled()

ilObjTest::isPreviousSolutionReuseEnabled (   $activeId)

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

2918 {
2919 // checks if allowed in general and if enabled by participant
2920 return self::_getUsePreviousAnswers($activeId, true);
2921 }
static _getUsePreviousAnswers($active_id, $user_active_user_setting=false)
Returns if the previous results should be hidden for a learner.

References _getUsePreviousAnswers().

+ Here is the call graph for this function:

◆ isQuestionObligationPossible()

static ilObjTest::isQuestionObligationPossible (   $questionId)
static

checks wether the obligation for question with given id is possible or not

Parameters
integer$questionId
Returns
boolean $obligationPossible

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

11544 {
11545 require_once('Modules/TestQuestionPool/classes/class.assQuestion.php');
11546
11547 $classConcreteQuestion = assQuestion::_getQuestionType($questionId);
11548
11549 assQuestion::_includeClass($classConcreteQuestion, 0);
11550
11551 // static binder is not at work yet (in PHP < 5.3)
11552 //$obligationPossible = $classConcreteQuestion::isObligationPossible();
11553 $obligationPossible = call_user_func(array($classConcreteQuestion, 'isObligationPossible'), $questionId);
11554
11555 return $obligationPossible;
11556 }
static _getQuestionType($question_id)
Returns the question type of a question with a given id.

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

Referenced by getTestQuestions(), and ilObjTestGUI\saveOrderAndObligationsObject().

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

◆ isQuestionObligatory()

static ilObjTest::isQuestionObligatory (   $question_id)
static

checks wether the question with given id is marked as obligatory or not

Parameters
integer$questionId
Returns
boolean $obligatory

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

11565 {
11566 global $ilDB;
11567
11568 $rset = $ilDB->queryF('SELECT obligatory FROM tst_test_question WHERE question_fi = %s', array('integer'), array($question_id));
11569
11570 if( $row = $ilDB->fetchAssoc($rset) )
11571 {
11572 return (bool) $row['obligatory'];
11573 }
11574
11575 return false;
11576 }

References $ilDB, and $row.

Referenced by assQuestion\calculateResultsFromSolution(), ilTestSequence\getSequenceSummary(), ilTestSequenceDynamicQuestionSet\getSequenceSummary(), ilTestOutputGUI\showQuestionCmd(), and ilTestPlayerDynamicQuestionSetGUI\showQuestionCmd().

+ Here is the caller graph for this function:

◆ isRandomTest()

ilObjTest::isRandomTest ( )

Returns the fact wether this test is a random questions test or not.

Returns
boolean $isRandomTest

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

12061 {
12063 }

References getQuestionSetType(), and QUESTION_SET_TYPE_RANDOM.

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

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

◆ isScoreReportingAvailable()

ilObjTest::isScoreReportingAvailable ( )

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

12115 {
12116 if ($this->getScoreReporting() == 4)
12117 {
12118 return false;
12119 }
12120
12121 if ($this->getScoreReporting() == 3 && $this->getReportingDate() > time())
12122 {
12123 return false;
12124 }
12125
12126 return true;
12127 }

References getReportingDate(), and getScoreReporting().

+ Here is the call graph for this function:

◆ isScoreReportingEnabled()

ilObjTest::isScoreReportingEnabled ( )

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

2510 {
2511 return $this->getScoreReporting() > 0 && $this->getScoreReporting() < 4;
2512 }

References getScoreReporting().

+ Here is the call graph for this function:

◆ isShowExamIdInTestPassEnabled()

ilObjTest::isShowExamIdInTestPassEnabled ( )

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

11931 {
11933 }
$show_exam_id_in_test_pass_enabled

References $show_exam_id_in_test_pass_enabled.

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

+ Here is the caller graph for this function:

◆ isShowExamIdInTestResultsEnabled()

ilObjTest::isShowExamIdInTestResultsEnabled ( )
Returns
boolean

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

11947 {
11949 }
$show_exam_id_in_test_results_enabled

References $show_exam_id_in_test_results_enabled.

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

+ Here is the caller graph for this function:

◆ isShowGradingMarkEnabled()

ilObjTest::isShowGradingMarkEnabled ( )

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

12239 {
12241 }

References $showGradingMarkEnabled.

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

+ Here is the caller graph for this function:

◆ isShowGradingStatusEnabled()

ilObjTest::isShowGradingStatusEnabled ( )

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

12228 {
12230 }

References $showGradingStatusEnabled.

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

+ Here is the caller graph for this function:

◆ isSingleChoiceTest()

ilObjTest::isSingleChoiceTest ( )

Returns TRUE if the test contains single choice results only.

Returns
boolean @access public

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

1040 {
1041 global $ilDB;
1042
1043 $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",
1044 array('integer'),
1045 array($this->getTestId())
1046 );
1047 if ($result->numRows() == 1)
1048 {
1049 $row = $ilDB->fetchAssoc($result);
1050 if (strcmp($row['foundtypes'], 'assSingleChoice') == 0)
1051 {
1052 return TRUE;
1053 }
1054 else
1055 {
1056 return false;
1057 }
1058 }
1059 return FALSE;
1060 }

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

+ Here is the call graph for this function:

◆ isSingleChoiceTestWithoutShuffle()

ilObjTest::isSingleChoiceTestWithoutShuffle ( )

Returns TRUE if the test contains single choice results and no shuffle only.

Returns
boolean @access public

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

1069 {
1070 global $ilDB;
1071
1072 if (!$this->hasSingleChoiceQuestions()) return false;
1073
1074 $result = $ilDB->queryF("
1075 SELECT DISTINCT(qpl_qst_sc.shuffle) foundshuffles
1076 FROM qpl_questions,
1077 qpl_qst_sc,
1078 tst_test_result,
1079 qpl_qst_type,
1080 tst_active
1081 WHERE tst_test_result.question_fi = qpl_questions.question_id
1082 AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id
1083 AND tst_test_result.active_fi = tst_active.active_id
1084 AND qpl_questions.question_id = qpl_qst_sc.question_fi
1085 AND tst_active.test_fi = %s
1086 AND qpl_qst_type.type_tag = %s
1087 ",
1088 array('integer', 'text'),
1089 array($this->getTestId(), 'assSingleChoice')
1090 );
1091 if ($result->numRows() == 1)
1092 {
1093 $row = $ilDB->fetchAssoc($result);
1094 return ($row['foundshuffles'] == 0);
1095 }
1096 return FALSE;
1097 }
hasSingleChoiceQuestions()
Returns TRUE if the test contains single choice results.

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

+ Here is the call graph for this function:

◆ isSkillManagementGloballyActivated()

static ilObjTest::isSkillManagementGloballyActivated ( )
static

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

12210 {
12211 if( self::$isSkillManagementGloballyActivated === null )
12212 {
12213 include_once 'Services/Skill/classes/class.ilSkillManagementSettings.php';
12214 $skmgSet = new ilSkillManagementSettings();
12215
12216 self::$isSkillManagementGloballyActivated = $skmgSet->isActivated();
12217 }
12218
12220 }
static $isSkillManagementGloballyActivated

References $isSkillManagementGloballyActivated.

Referenced by ilObjTestSettingsGeneralGUI\buildForm(), ilObjTestGUI\getTabs(), ilTestSkillAdministrationGUI\isAccessDenied(), ilObjTestSettingsGeneralGUI\isSkillServiceSettingToBeAdjusted(), and ilObjTestSettingsGeneralGUI\performSaveForm().

+ Here is the caller graph for this function:

◆ isSkillServiceEnabled()

ilObjTest::isSkillServiceEnabled ( )

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

12178 {
12180 }

References $skillServiceEnabled.

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

+ Here is the caller graph for this function:

◆ isSkillServiceToBeConsidered()

ilObjTest::isSkillServiceToBeConsidered ( )

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

12193 {
12194 if( !$this->isSkillServiceEnabled() )
12195 {
12196 return false;
12197 }
12198
12199 if( !self::isSkillManagementGloballyActivated() )
12200 {
12201 return false;
12202 }
12203
12204 return true;
12205 }

References isSkillServiceEnabled().

+ Here is the call graph for this function:

◆ isStartingTimeEnabled()

ilObjTest::isStartingTimeEnabled ( )
Returns
boolean

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

3087 {
3089 }

References $starting_time_enabled.

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

+ Here is the caller graph for this function:

◆ isTestFinalBroken()

ilObjTest::isTestFinalBroken ( )
Returns
boolean

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

12332 {
12334 }

References $testFinalBroken.

Referenced by saveToDb().

+ Here is the caller graph for this function:

◆ isTestFinished()

ilObjTest::isTestFinished (   $active_id)

returns if the active for user_id has been submitted

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

7989 {
7990 global $ilDB;
7991
7992 $result = $ilDB->queryF("SELECT submitted FROM tst_active WHERE active_id=%s AND submitted=%s",
7993 array('integer', 'integer'),
7994 array($active_id, 1)
7995 );
7996 return $result->numRows() == 1;
7997 }

References $ilDB, and $result.

Referenced by isTestFinishedToViewResults().

+ Here is the caller graph for this function:

◆ isTestFinishedToViewResults()

ilObjTest::isTestFinishedToViewResults (   $active_id,
  $currentpass 
)

Returns true if an active user completed a test pass and did not start a new pass.

Parameters
integer$active_idThe active id of the user
integer$currentpassThe current test pass of the user
Returns
boolean true if an active user completed a test pass and did not start a new pass, false otherwise @access public

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

3969 {
3970 $num = $this->getPassFinishDate($active_id, $currentpass);
3971 return ((($currentpass > 0) && ($num == 0)) || $this->isTestFinished($active_id)) ? true : false;
3972 }
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.

References getPassFinishDate(), and isTestFinished().

Referenced by canShowTestResults().

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

1877 {
1878 global $ilDB;
1879
1880 $result = $ilDB->queryF("SELECT * FROM tst_tests WHERE obj_fi = %s",
1881 array('integer'),
1882 array($this->getId())
1883 );
1884 if ($result->numRows() == 1)
1885 {
1886 $data = $ilDB->fetchObject($result);
1887 $this->setTestId($data->test_id);
1888 if (strlen($this->getAuthor()) == 0)
1889 {
1890 $this->saveAuthorToMetadata($data->author);
1891 }
1892 $this->setAuthor($data->author);
1893 include_once("./Services/RTE/classes/class.ilRTE.php");
1894 $this->setIntroductionEnabled($data->intro_enabled);
1896 $this->setShowInfo($data->showinfo);
1898 $this->setForceJS($data->forcejs);
1899 $this->setCustomStyle($data->customstyle);
1900 $this->setShowFinalStatement($data->showfinalstatement);
1901 $this->setSequenceSettings($data->sequence_settings);
1902 $this->setScoreReporting($data->score_reporting);
1903 $this->setInstantFeedbackSolution($data->instant_verification);
1904 $this->setAnswerFeedbackPoints($data->answer_feedback_points);
1905 $this->setAnswerFeedback($data->answer_feedback);
1906 $this->setAnonymity($data->anonymity);
1907 $this->setShowCancel($data->show_cancel);
1908 $this->setShowMarker($data->show_marker);
1909 $this->setFixedParticipants($data->fixed_participants);
1910 $this->setNrOfTries($data->nr_of_tries);
1911 $this->setKiosk($data->kiosk);
1912 $this->setUsePreviousAnswers($data->use_previous_answers);
1913 $this->setRedirectionMode($data->redirection_mode);
1914 $this->setRedirectionUrl($data->redirection_url);
1915 $this->setTitleOutput($data->title_output);
1916 $this->setProcessingTime($data->processing_time);
1917 $this->setEnableProcessingTime($data->enable_processing_time);
1918 $this->setResetProcessingTime($data->reset_processing_time);
1919 $this->setReportingDate($data->reporting_date);
1920 $this->setShuffleQuestions($data->shuffle_questions);
1921 $this->setResultsPresentation($data->results_presentation);
1922 $this->setStartingTimeEnabled($data->starting_time_enabled);
1923 $this->setStartingTime($data->starting_time);
1924 $this->setEndingTimeEnabled($data->ending_time_enabled);
1925 $this->setEndingTime($data->ending_time);
1926 $this->setListOfQuestionsSettings($data->show_summary);
1927 $this->setECTSOutput($data->ects_output);
1928 $this->setECTSGrades(
1929 array(
1930 "A" => $data->ects_a,
1931 "B" => $data->ects_b,
1932 "C" => $data->ects_c,
1933 "D" => $data->ects_d,
1934 "E" => $data->ects_e
1935 )
1936 );
1937 $this->setECTSFX($data->ects_fx);
1938 $this->mark_schema->flush();
1939 $this->mark_schema->loadFromDb($this->getTestId());
1940 $this->setCountSystem($data->count_system);
1941 $this->setMCScoring($data->mc_scoring);
1942 $this->setMailNotification($data->mailnotification);
1943 $this->setMailNotificationType($data->mailnottype);
1944 $this->setExportSettings($data->exportsettings);
1945 $this->setScoreCutting($data->score_cutting);
1946 $this->setPasswordEnabled($data->password_enabled);
1947 $this->setPassword($data->password);
1948 $this->setLimitUsersEnabled($data->limit_users_enabled);
1949 $this->setAllowedUsers($data->allowedusers);
1950 $this->setAllowedUsersTimeGap($data->alloweduserstimegap);
1951 $this->setPassScoring($data->pass_scoring);
1952 $this->setObligationsEnabled($data->obligations_enabled);
1953 $this->setOfferingQuestionHintsEnabled($data->offer_question_hints);
1954 $this->setCertificateVisibility($data->certificate_visibility);
1955 $this->setEnabledViewMode($data->enabled_view_mode);
1956 $this->setTemplate($data->template_id);
1957 $this->setPoolUsage($data->pool_usage);
1958 $this->setPrintBestSolutionWithResult((bool) $data->print_bs_with_res);
1959 $this->setHighscoreEnabled((bool) $data->highscore_enabled);
1960 $this->setHighscoreAnon((bool) $data->highscore_anon);
1961 $this->setHighscoreAchievedTS((bool) $data->highscore_achieved_ts);
1962 $this->setHighscoreScore((bool) $data->highscore_score);
1963 $this->setHighscorePercentage((bool) $data->highscore_percentage);
1964 $this->setHighscoreHints((bool) $data->highscore_hints);
1965 $this->setHighscoreWTime((bool) $data->highscore_wtime);
1966 $this->setHighscoreOwnTable((bool) $data->highscore_own_table);
1967 $this->setHighscoreTopTable((bool) $data->highscore_top_table);
1968 $this->setHighscoreTopNum((int) $data->highscore_top_num);
1969 $this->setOnline((bool) $data->online_status);
1970 $this->setOldOnlineStatus((bool) $data->online_status);
1971 $this->setSpecificAnswerFeedback((int) $data->specific_feedback);
1972 $this->setAutosave((bool)$data->autosave);
1973 $this->setAutosaveIval((int)$data->autosave_ival);
1974 $this->setPassDeletionAllowed($data->pass_deletion_allowed);
1975 $this->setEnableExamview((bool)$data->enable_examview);
1976 $this->setShowExamviewHtml((bool)$data->show_examview_html);
1977 $this->setShowExamviewPdf((bool)$data->show_examview_pdf);
1978 $this->setEnableArchiving((bool)$data->enable_archiving);
1979 $this->setShowExamIdInTestPassEnabled( (bool)$data->examid_in_test_pass);
1980 $this->setShowExamIdInTestResultsEnabled( (bool)$data->examid_in_test_res);
1981 $this->setSignSubmission( (bool)$data->sign_submission );
1982 $this->setQuestionSetType($data->question_set_type);
1983 $this->setCharSelectorAvailability((int)$data->char_selector_availability);
1984 $this->setCharSelectorDefinition($data->char_selector_definition);
1985 $this->setSkillServiceEnabled((bool)$data->skill_service);
1986 $this->setResultFilterTaxIds(strlen($data->result_tax_filters) ? unserialize($data->result_tax_filters) : array());
1987 $this->setShowGradingStatusEnabled((bool)$data->show_grading_status);
1988 $this->setShowGradingMarkEnabled((bool)$data->show_grading_mark);
1989 $this->setInstantFeedbackAnswerFixationEnabled((bool)$data->inst_fb_answer_fixation);
1990 $this->setForceInstantFeedbackEnabled((bool)$data->force_inst_fb);
1991 $this->setTestFinalBroken((bool)$data->broken);
1992 $this->setPassWaiting($data->pass_waiting);
1993 $this->loadQuestions();
1994 }
1995
1996 // moved activation to ilObjectActivation
1997 if($this->ref_id)
1998 {
1999 include_once "./Services/Object/classes/class.ilObjectActivation.php";
2000 $activation = ilObjectActivation::getItem($this->ref_id);
2001 switch($activation["timing_type"])
2002 {
2004 $this->setActivationLimited(true);
2005 $this->setActivationStartingTime($activation["timing_start"]);
2006 $this->setActivationEndingTime($activation["timing_end"]);
2007 $this->setActivationVisibility($activation["visible"]);
2008 break;
2009
2010 default:
2011 $this->setActivationLimited(false);
2012 break;
2013 }
2014 }
2015 }
setTestId($a_id)
Sets the test ID.
setOnline($a_online=true)
setTemplate($template_id)
setOldOnlineStatus($oldOnlineStatus)
getAuthor()
Gets the authors name of the ilObjTest object.
setCertificateVisibility($a_value)
Sets the visibility settings of the certificate.
setTestFinalBroken($testFinalBroken)
setEnabledViewMode($mode)
static getItem($a_ref_id)
Get item data.

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(), setForceInstantFeedbackEnabled(), setForceJS(), setHighscoreAchievedTS(), setHighscoreAnon(), setHighscoreEnabled(), setHighscoreHints(), setHighscoreOwnTable(), setHighscorePercentage(), setHighscoreScore(), setHighscoreTopNum(), setHighscoreTopTable(), setHighscoreWTime(), setInstantFeedbackAnswerFixationEnabled(), setInstantFeedbackSolution(), setIntroduction(), setIntroductionEnabled(), setKiosk(), setLimitUsersEnabled(), setListOfQuestionsSettings(), setMailNotification(), setMailNotificationType(), setMCScoring(), setNrOfTries(), setObligationsEnabled(), setOfferingQuestionHintsEnabled(), setOldOnlineStatus(), setOnline(), setPassDeletionAllowed(), setPassScoring(), setPassWaiting(), setPassword(), setPasswordEnabled(), setPoolUsage(), setPrintBestSolutionWithResult(), setProcessingTime(), setQuestionSetType(), setRedirectionMode(), setRedirectionUrl(), setReportingDate(), setResetProcessingTime(), setResultFilterTaxIds(), setResultsPresentation(), setScoreCutting(), setScoreReporting(), setSequenceSettings(), setShowCancel(), setShowExamIdInTestPassEnabled(), setShowExamIdInTestResultsEnabled(), setShowExamviewHtml(), setShowExamviewPdf(), setShowFinalStatement(), setShowGradingMarkEnabled(), setShowGradingStatusEnabled(), setShowInfo(), setShowMarker(), setShuffleQuestions(), setSignSubmission(), setSkillServiceEnabled(), setSpecificAnswerFeedback(), setStartingTime(), setStartingTimeEnabled(), setTemplate(), setTestFinalBroken(), setTestId(), setTitleOutput(), setUsePreviousAnswers(), and ilObjectActivation\TIMINGS_ACTIVATION.

Referenced by read().

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

◆ loadQuestions()

ilObjTest::loadQuestions (   $active_id = "",
  $pass = NULL 
)

Load the test question id's from the database.

Parameters
integer$user_idThe user id of the test user (necessary for random tests) @access public

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

2024{
2025 global $ilUser;
2026 global $ilDB;
2027
2028 $this->questions = array();
2029 if ($this->isRandomTest())
2030 {
2031 if (strcmp($active_id, "") == 0)
2032 {
2033 $active_id = $this->getActiveIdOfUser($ilUser->getId());
2034 }
2035 if (is_null($pass))
2036 {
2037 $pass = self::_getPass($active_id);
2038 }
2039 $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",
2040 array('integer', 'integer'),
2041 array($active_id, $pass)
2042 );
2043 // The following is a fix for random tests prior to ILIAS 3.8. If someone started a random test in ILIAS < 3.8, there
2044 // is only one test pass (pass = 0) in tst_test_rnd_qst while with ILIAS 3.8 there are questions for every test pass.
2045 // To prevent problems with tests started in an older version and continued in ILIAS 3.8, the first pass should be taken if
2046 // no questions are present for a newer pass.
2047 if ($result->numRows() == 0)
2048 {
2049 $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",
2050 array('integer'),
2051 array($active_id)
2052 );
2053 }
2054 }
2055 else
2056 {
2057 $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",
2058 array('integer'),
2059 array($this->test_id)
2060 );
2061 }
2062 $index = 1;
2063 while ($data = $ilDB->fetchAssoc($result))
2064 {
2065 $this->questions[$index++] = $data["question_fi"];
2066 }
2067}

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

Referenced by getAllQuestions(), getAnsweredQuestionCount(), insertQuestion(), loadFromDb(), questionMoveDown(), questionMoveUp(), reindexFixedQuestionOrdering(), and setQuestionOrderAndObligations().

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

◆ logAction()

ilObjTest::logAction (   $logtext = "",
  $question_id = "" 
)

Logs an action into the Test&Assessment log.

Parameters
string$logtextThe log text
integer$question_idIf given, saves the question id to the database @access public

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

7414 {
7415 global $ilUser;
7416
7417 $original_id = "";
7418 if (strcmp($question_id, "") != 0)
7419 {
7420 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
7421 $original_id = assQuestion::_getOriginalId($question_id);
7422 }
7423 include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
7424 ilObjAssessmentFolder::_addLog($ilUser->getId(), $this->getId(), $logtext, $question_id, $original_id, TRUE, $this->getRefId());
7425 }
static _getOriginalId($question_id)
Returns the original id of a question.
static _addLog($user_id, $object_id, $logtext, $question_id="", $original_id="", $test_only=FALSE, $test_ref_id=NULL)
Add an assessment log entry.

References $ilUser, ilObjAssessmentFolder\_addLog(), and assQuestion\_getOriginalId().

Referenced by addExtraTime(), checkMaximumAllowedUsers(), insertQuestion(), questionMoveDown(), questionMoveUp(), removeQuestion(), removeTestResultsByActiveIds(), saveQuestionsToDb(), and saveToDb().

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

◆ lookupExamId()

static ilObjTest::lookupExamId (   $active_id,
  $pass 
)
static
Parameters
$active_id
$pass
Returns
array

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

11881 {
11882 global $ilDB;
11883
11884 $exam_id_query = 'SELECT exam_id FROM tst_pass_result WHERE active_fi = %s AND pass = %s';
11885 $exam_id_result = $ilDB->queryF( $exam_id_query, array( 'integer', 'integer' ), array( $active_id, $pass ) );
11886 if ($ilDB->numRows( $exam_id_result ) == 1)
11887 {
11888 $exam_id_row = $ilDB->fetchAssoc( $exam_id_result );
11889
11890 if ($exam_id_row['exam_id'] != null)
11891 {
11892 return $exam_id_row['exam_id'];
11893 }
11894 }
11895
11896 return null;
11897 }

References $ilDB, and $pass.

Referenced by ilTestServiceGUI\getResultsOfUserOutput(), ilTestEvaluationGUI\outUserListOfAnswerPasses(), ilTestEvaluationGUI\outUserPassDetails(), and ilTestPlayerAbstractGUI\prepareTestPage().

+ Here is the caller graph for this function:

◆ lookupQuestionSetType()

static ilObjTest::lookupQuestionSetType (   $objId)
static

lookup-er for question set type

@global ilDBInterface $ilDB

Parameters
integer$objId
Returns
string $questionSetType

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

12028 {
12029 global $ilDB;
12030
12031 $query = "SELECT question_set_type FROM tst_tests WHERE obj_fi = %s";
12032
12033 $res = $ilDB->queryF($query, array('integer'), array($objId));
12034
12035 $questionSetType = null;
12036
12037 while( $row = $ilDB->fetchAssoc($res) )
12038 {
12039 $questionSetType = $row['question_set_type'];
12040 }
12041
12042 return $questionSetType;
12043 }

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

Referenced by _lookupRandomTest().

+ Here is the caller graph for this function:

◆ lookupQuestionSetTypeByActiveId()

static ilObjTest::lookupQuestionSetTypeByActiveId (   $active_id)
static

returns the question set type of test relating to passed active id

Parameters
integer$activeId
Returns
string $questionSetType

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

9685 {
9686 global $ilDB;
9687
9688 $query = "
9689 SELECT tst_tests.question_set_type
9690 FROM tst_active
9691 INNER JOIN tst_tests
9692 ON tst_active.test_fi = tst_tests.test_id
9693 WHERE tst_active.active_id = %s
9694 ";
9695
9696 $res = $ilDB->queryF( $query, array('integer'), array($active_id) );
9697
9698 while($row = $ilDB->fetchAssoc($res))
9699 {
9700 return $row['question_set_type'];
9701 }
9702
9703 return null;
9704 }

References $ilDB, $query, $res, and $row.

Referenced by _getQuestionCountAndPointsForPassOfParticipant().

+ Here is the caller graph for this function:

◆ modifyExportIdentifier()

ilObjTest::modifyExportIdentifier (   $a_tag,
  $a_param,
  $a_value 
)

Returns the installation id for a given identifier.

@access private

Definition at line 6783 of file class.ilObjTest.php.

6784 {
6785 if ($a_tag == "Identifier" && $a_param == "Entry")
6786 {
6787 include_once "./Services/Utilities/classes/class.ilUtil.php";
6788 $a_value = ilUtil::insertInstIntoID($a_value);
6789 }
6790
6791 return $a_value;
6792 }
static insertInstIntoID($a_value)
inserts installation id into ILIAS id

References ilUtil\insertInstIntoID().

+ Here is the call graph for this function:

◆ moveQuestionAfter()

ilObjTest::moveQuestionAfter (   $question_to_move,
  $question_before 
)

Definition at line 11044 of file class.ilObjTest.php.

11044 {
11045 global $ilDB;
11046 //var_dump(func_get_args());
11047 if ($question_before) {
11048 $query = 'SELECT sequence, test_fi FROM tst_test_question WHERE question_fi = %s';
11049 $types = array('integer');
11050 $values = array($question_before);
11051 $rset = $ilDB->queryF($query, $types, $values);
11052 }
11053
11054 if (!$question_before || ($rset && !($row = $ilDB->fetchAssoc($rset)))) {
11055 $row = array(
11056 'sequence' => 0,
11057 'test_fi' => $this->getTestId(),
11058 );
11059 }
11060
11061 $update = 'UPDATE tst_test_question SET sequence = sequence + 1 WHERE sequence > %s AND test_fi = %s';
11062 $types = array('integer', 'integer');
11063 $values = array($row['sequence'], $row['test_fi']);
11064 $ilDB->manipulateF($update, $types, $values);
11065
11066 $update = 'UPDATE tst_test_question SET sequence = %s WHERE question_fi = %s';
11067 $types = array('integer', 'integer');
11068 $values = array($row['sequence'] + 1, $question_to_move);
11069 $ilDB->manipulateF($update, $types, $values);
11070
11072 }
reindexFixedQuestionOrdering()

References $ilDB, $query, $row, getTestId(), and reindexFixedQuestionOrdering().

+ 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.

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 }

References $ilDB, $query, $res, $row, and getTestId().

+ Here is the call graph for this function:

◆ moveQuestions()

ilObjTest::moveQuestions (   $move_questions,
  $target_index,
  $insert_mode 
)

Move questions to another position.

Parameters
array$move_questionsAn array with the question id's of the questions to move
integer$target_indexThe question id of the target position
integer$insert_mode0, if insert before the target position, 1 if insert after the target position @access public

Definition at line 5586 of file class.ilObjTest.php.

5587 {
5588 $this->questions = array_values($this->questions);
5589 $array_pos = array_search($target_index, $this->questions);
5590 if ($insert_mode == 0)
5591 {
5592 $part1 = array_slice($this->questions, 0, $array_pos);
5593 $part2 = array_slice($this->questions, $array_pos);
5594 }
5595 else if ($insert_mode == 1)
5596 {
5597 $part1 = array_slice($this->questions, 0, $array_pos + 1);
5598 $part2 = array_slice($this->questions, $array_pos + 1);
5599 }
5600 foreach ($move_questions as $question_id)
5601 {
5602 if (!(array_search($question_id, $part1) === FALSE))
5603 {
5604 unset($part1[array_search($question_id, $part1)]);
5605 }
5606 if (!(array_search($question_id, $part2) === FALSE))
5607 {
5608 unset($part2[array_search($question_id, $part2)]);
5609 }
5610 }
5611 $part1 = array_values($part1);
5612 $part2 = array_values($part2);
5613 $new_array = array_values(array_merge($part1, $move_questions, $part2));
5614 $this->questions = array();
5615 $counter = 1;
5616 foreach ($new_array as $question_id)
5617 {
5618 $this->questions[$counter] = $question_id;
5619 $counter++;
5620 }
5621 $this->saveQuestionsToDb();
5622 }
saveQuestionsToDb()
Saves the test questions to the database.

References $counter, and saveQuestionsToDb().

+ Here is the call graph for this function:

◆ participantDataExist()

ilObjTest::participantDataExist ( )

Definition at line 12104 of file class.ilObjTest.php.

12105 {
12106 if( $this->participantDataExist === null )
12107 {
12108 $this->participantDataExist = (bool)$this->evalTotalPersons();
12109 }
12110
12112 }
$participantDataExist
holds the fact wether participant data exists or not DO NOT USE TIS PROPERTY DRIRECTLY ALWAYS USE ilO...

References $participantDataExist, evalTotalPersons(), and participantDataExist().

Referenced by participantDataExist().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pcArrayShuffle()

ilObjTest::pcArrayShuffle (   $array)

Shuffles the values of a given array.

Parameters
array$arrayAn array which should be shuffled @access public

Definition at line 4103 of file class.ilObjTest.php.

4104 {
4105 $keys = array_keys($array);
4106 shuffle($keys);
4107 $result = array();
4108 foreach ($keys as $key)
4109 {
4110 $result[$key] = $array[$key];
4111 }
4112 return $result;
4113 }

References $result.

◆ prepareTextareaOutput()

ilObjTest::prepareTextareaOutput (   $txt_output,
  $prepare_for_latex_output = FALSE,
  $omitNl2BrWhenTextArea = false 
)

Prepares a string for a text area output in tests.

Parameters
string$txt_outputString which should be prepared for output @access public

Definition at line 9492 of file class.ilObjTest.php.

9493 {
9494 include_once "./Services/Utilities/classes/class.ilUtil.php";
9495 return ilUtil::prepareTextareaOutput($txt_output, $prepare_for_latex_output, $omitNl2BrWhenTextArea);
9496 }
static prepareTextareaOutput($txt_output, $prepare_for_latex_output=FALSE, $omitNl2BrWhenTextArea=false)
Prepares a string for a text area output where latex code may be in it If the text is HTML-free,...

References ilUtil\prepareTextareaOutput().

+ Here is the call graph for this function:

◆ processCSVRow()

& ilObjTest::processCSVRow (   $row,
  $quoteAll = FALSE,
  $separator = ";" 
)

Processes an array as a CSV row and converts the array values to correct CSV values.

The "converted" array is returned

Parameters
array$rowThe array containing the values for a CSV row
string$quoteAllIndicates to quote every value (=TRUE) or only values containing quotes and separators (=FALSE, default)
string$separatorThe value separator in the CSV row (used for quoting) (; = default)
Returns
array The converted array ready for CSV use @access public

Definition at line 8134 of file class.ilObjTest.php.

8135 {
8136 $resultarray = array();
8137 foreach ($row as $rowindex => $entry)
8138 {
8139 $surround = FALSE;
8140 if ($quoteAll)
8141 {
8142 $surround = TRUE;
8143 }
8144 if (strpos($entry, "\"") !== FALSE)
8145 {
8146 $entry = str_replace("\"", "\"\"", $entry);
8147 $surround = TRUE;
8148 }
8149 if (strpos($entry, $separator) !== FALSE)
8150 {
8151 $surround = TRUE;
8152 }
8153 // replace all CR LF with LF (for Excel for Windows compatibility
8154 $entry = str_replace(chr(13).chr(10), chr(10), $entry);
8155
8156 if ($surround)
8157 {
8158 $entry = "\"" . $entry . "\"";
8159 }
8160
8161 $resultarray[$rowindex] = $entry;
8162 }
8163 return $resultarray;
8164 }

References $row.

Referenced by getAllTestResults().

+ Here is the caller graph for this function:

◆ processPrintoutput2FO()

ilObjTest::processPrintoutput2FO (   $print_output)

Convert a print output to XSL-FO.

Parameters
string$print_outputThe print output
Returns
string XSL-FO code @access public

Definition at line 10131 of file class.ilObjTest.php.

10132 {
10133 if (extension_loaded("tidy"))
10134 {
10135 $config = array(
10136 "indent" => false,
10137 "output-xml" => true,
10138 "numeric-entities" => true
10139 );
10140 $tidy = new tidy();
10141 $tidy->parseString($print_output, $config, 'utf8');
10142 $tidy->cleanRepair();
10143 $print_output = tidy_get_output($tidy);
10144 $print_output = preg_replace("/^.*?(<html)/", "\\1", $print_output);
10145 }
10146 else
10147 {
10148 $print_output = str_replace("&nbsp;", "&#160;", $print_output);
10149 $print_output = str_replace("&otimes;", "X", $print_output);
10150 }
10151 $xsl = file_get_contents("./Modules/Test/xml/question2fo.xsl");
10152
10153 // additional font support
10154 $xsl = str_replace(
10155 'font-family="Helvetica, unifont"',
10156 'font-family="'.$GLOBALS['ilSetting']->get('rpc_pdf_font','Helvetica, unifont').'"',
10157 $xsl
10158 );
10159
10160 $args = array( '/_xml' => $print_output, '/_xsl' => $xsl );
10161 $xh = xslt_create();
10162 $params = array();
10163 $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params);
10164 xslt_error($xh);
10165 xslt_free($xh);
10166 return $output;
10167 }
$params
Definition: example_049.php:96
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\s+" &#(? foreach( $entity_files as $file) $output
xslt_error(&$proc)
xslt_free(&$proc)
xslt_create()

References $config, $GLOBALS, $output, $params, xslt_create(), xslt_error(), and xslt_free().

Referenced by deliverPDFfromHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ QTIMaterialToString()

ilObjTest::QTIMaterialToString (   $a_material)

Reads an QTI material tag an creates a text string.

Parameters
string$a_materialQTI material tag
Returns
string text or xhtml string @access public

Definition at line 9417 of file class.ilObjTest.php.

9418 {
9419 $result = "";
9420 for ($i = 0; $i < $a_material->getMaterialCount(); $i++)
9421 {
9422 $material = $a_material->getMaterial($i);
9423 if (strcmp($material["type"], "mattext") == 0)
9424 {
9425 $result .= $material["material"]->getContent();
9426 }
9427 if (strcmp($material["type"], "matimage") == 0)
9428 {
9429 $matimage = $material["material"];
9430 if (preg_match("/(il_([0-9]+)_mob_([0-9]+))/", $matimage->getLabel(), $matches))
9431 {
9432 // import an mediaobject which was inserted using tiny mce
9433 if (!is_array($_SESSION["import_mob_xhtml"])) $_SESSION["import_mob_xhtml"] = array();
9434 array_push($_SESSION["import_mob_xhtml"], array("mob" => $matimage->getLabel(), "uri" => $matimage->getUri()));
9435 }
9436 }
9437 }
9438 global $ilLog;
9439 $ilLog->write(print_r($_SESSION["import_mob_xhtml"], true));
9440 return $result;
9441 }

References $_SESSION, $ilLog, and $result.

Referenced by fromXML().

+ Here is the caller graph for this function:

◆ questionMoveDown()

ilObjTest::questionMoveDown (   $question_id)

Moves a question down in order.

Parameters
integer$question_idThe database id of the question to be moved down @access public
See also
$test_id

Definition at line 3609 of file class.ilObjTest.php.

3610 {
3611 global $ilDB;
3612
3613 // Move a question down in sequence
3614 $result = $ilDB->queryF("SELECT * FROM tst_test_question WHERE test_fi=%s AND question_fi=%s",
3615 array('integer','integer'),
3616 array($this->getTestId(), $question_id)
3617 );
3618 $data = $ilDB->fetchObject($result);
3619 $result = $ilDB->queryF("SELECT * FROM tst_test_question WHERE test_fi=%s AND sequence=%s",
3620 array('integer','integer'),
3621 array($this->getTestId(), $data->sequence + 1)
3622 );
3623 if ($result->numRows() == 1)
3624 {
3625 // OK, it's not the last question, so move it down
3626 $data_next = $ilDB->fetchObject($result);
3627 // change next dataset
3628 $affectedRows = $ilDB->manipulateF("UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
3629 array('integer','integer'),
3630 array($data->sequence, $data_next->test_question_id)
3631 );
3632 // move actual dataset down
3633 $affectedRows = $ilDB->manipulateF("UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
3634 array('integer','integer'),
3635 array($data->sequence + 1, $data->test_question_id)
3636 );
3637 include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3639 {
3640 $this->logAction($this->lng->txtlng("assessment", "log_question_position_changed", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($data->sequence) . " => " . ($data->sequence+1), $question_id);
3641 }
3642 }
3643 $this->loadQuestions();
3644 }

References $data, $ilDB, $result, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), getTestId(), loadQuestions(), and logAction().

+ Here is the call graph for this function:

◆ questionMoveUp()

ilObjTest::questionMoveUp (   $question_id)

Moves a question up in order.

Parameters
integer$question_idThe database id of the question to be moved up @access public
See also
$test_id

Definition at line 3565 of file class.ilObjTest.php.

3566 {
3567 global $ilDB;
3568
3569 // Move a question up in sequence
3570 $result = $ilDB->queryF("SELECT * FROM tst_test_question WHERE test_fi=%s AND question_fi=%s",
3571 array('integer', 'integer'),
3572 array($this->getTestId(), $question_id)
3573 );
3574 $data = $ilDB->fetchObject($result);
3575 if ($data->sequence > 1)
3576 {
3577 // OK, it's not the top question, so move it up
3578 $result = $ilDB->queryF("SELECT * FROM tst_test_question WHERE test_fi=%s AND sequence=%s",
3579 array('integer','integer'),
3580 array($this->getTestId(), $data->sequence - 1)
3581 );
3582 $data_previous = $ilDB->fetchObject($result);
3583 // change previous dataset
3584 $affectedRows = $ilDB->manipulateF("UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
3585 array('integer','integer'),
3586 array($data->sequence, $data_previous->test_question_id)
3587 );
3588 // move actual dataset up
3589 $affectedRows = $ilDB->manipulateF("UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
3590 array('integer','integer'),
3591 array($data->sequence - 1, $data->test_question_id)
3592 );
3593 include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3595 {
3596 $this->logAction($this->lng->txtlng("assessment", "log_question_position_changed", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($data->sequence) . " => " . ($data->sequence-1), $question_id);
3597 }
3598 }
3599 $this->loadQuestions();
3600 }

References $data, $ilDB, $result, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), getTestId(), loadQuestions(), and logAction().

+ Here is the call graph for this function:

◆ randomSelectQuestions()

ilObjTest::randomSelectQuestions (   $nr_of_questions,
  $questionpool,
  $use_obj_id = 0,
  $qpls = "",
  $pass = NULL 
)

Returns a random selection of questions.

Parameters
integer$nr_of_questionsNumber of questions to return
integer$questionpoolID of questionpool to choose the questions from (0 = all available questionpools)
boolean$user_obj_idUse the object id instead of the reference id when set to true
array$qplsAn array of questionpool id's if the random questions should only be chose from the contained questionpools
Returns
array A random selection of questions @access public
Deprecated:
--> old school random test

Definition at line 1742 of file class.ilObjTest.php.

1743 {
1744 global $rbacsystem;
1745 global $ilDB;
1746
1747 // retrieve object id instead of ref id if necessary
1748 if (($questionpool != 0) && (!$use_obj_id)) $questionpool = ilObject::_lookupObjId($questionpool);
1749
1750 // get original ids of all existing questions in the test
1751 $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",
1752 array("integer"),
1753 array($this->getTestId())
1754 );
1755 $original_ids = array();
1756 $paramtypes = array();
1757 $paramvalues = array();
1758 while ($row = $ilDB->fetchAssoc($result))
1759 {
1760 array_push($original_ids, $row['original_id']);
1761 }
1762
1763 $available = "";
1764 // get a list of all available questionpools
1765 if (($questionpool == 0) && (!is_array($qpls)))
1766 {
1767 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
1768 $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())));
1769 if (count($available_pools))
1770 {
1771 $available = " AND " . $ilDB->in('obj_fi', $available_pools, false, 'integer');
1772 }
1773 else
1774 {
1775 return array();
1776 }
1777 }
1778
1779 $constraint_qpls = "";
1780 $result_array = array();
1781 if ($questionpool == 0)
1782 {
1783 if (is_array($qpls))
1784 {
1785 if (count($qpls) > 0)
1786 {
1787 $constraint_qpls = " AND " . $ilDB->in('obj_fi', $qpls, false, 'integer');
1788 }
1789 }
1790 }
1791
1792 $original_clause = "";
1793 if (count($original_ids))
1794 {
1795 $original_clause = " AND " . $ilDB->in('question_id', $original_ids, true, 'integer');
1796 }
1797
1798 if ($questionpool == 0)
1799 {
1800 $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",
1801 array('integer', 'text'),
1802 array(0, "1")
1803 );
1804 }
1805 else
1806 {
1807 $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",
1808 array('integer','integer', 'text'),
1809 array($questionpool, 0, "1")
1810 );
1811 }
1812 $found_ids = array();
1813 while ($row = $ilDB->fetchAssoc($result))
1814 {
1815 array_push($found_ids, $row['question_id']);
1816 }
1817 $nr_of_questions = ($nr_of_questions > count($found_ids)) ? count($found_ids) : $nr_of_questions;
1818 if ($nr_of_questions == 0) return array();
1819 $rand_keys = array_rand($found_ids, $nr_of_questions);
1820 $result = array();
1821 if (is_array($rand_keys))
1822 {
1823 foreach ($rand_keys as $key)
1824 {
1825 $result[$found_ids[$key]] = $found_ids[$key];
1826 }
1827 }
1828 else
1829 {
1830 $result[$found_ids[$rand_keys]] = $found_ids[$rand_keys];
1831 }
1832 return $result;
1833 }
static _lookupOwner($a_id)
lookup object owner

References $ilDB, $result, $row, ilObjQuestionPool\_getAvailableQuestionpools(), ilObject\_lookupObjId(), ilObject\_lookupOwner(), ilObject\getId(), and getTestId().

+ Here is the call graph for this function:

◆ read()

ilObjTest::read ( )

read object data from db into object

Parameters
boolean@access public

Reimplemented from ilObject.

Definition at line 773 of file class.ilObjTest.php.

774 {
775 parent::read();
776 $this->loadFromDb();
777 }
loadFromDb()
Loads a ilObjTest object from a database.

References loadFromDb().

+ Here is the call graph for this function:

◆ recalculateScores()

ilObjTest::recalculateScores (   $preserve_manscoring = false)

Definition at line 12129 of file class.ilObjTest.php.

12130 {
12131 require_once 'class.ilTestScoring.php';
12132 $scoring = new ilTestScoring($this);
12133 $scoring->setPreserveManualScores($preserve_manscoring);
12134 $scoring->recalculateSolutions();
12135 }
Class ilTestScoring.

◆ reindexFixedQuestionOrdering()

ilObjTest::reindexFixedQuestionOrdering ( )

Definition at line 10997 of file class.ilObjTest.php.

10998 {
10999 $tree = isset($GLOBALS['DIC']) ? $GLOBALS['DIC']['tree'] : $GLOBALS['tree'];
11000 $db = isset($GLOBALS['DIC']) ? $GLOBALS['DIC']['ilDB'] : $GLOBALS['ilDB'];
11001 $pluginAdmin = isset($GLOBALS['DIC']) ? $GLOBALS['DIC']['ilPluginAdmin'] : $GLOBALS['ilPluginAdmin'];
11002
11003 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
11004 $qscFactory = new ilTestQuestionSetConfigFactory($tree, $db, $pluginAdmin, $this);
11005 $questionSetConfig = $qscFactory->getQuestionSetConfig();
11006
11007 /* @var ilTestFixedQuestionSetConfig $questionSetConfig */
11008 $questionSetConfig->reindexQuestionOrdering();
11009
11010 $this->loadQuestions();
11011 }

References $GLOBALS, and loadQuestions().

Referenced by moveQuestionAfter(), and removeQuestions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeQuestion()

ilObjTest::removeQuestion (   $question_id)

Removes a question from the test object.

Parameters
integer$question_idThe database id of the question to be removed @access public
See also
$test_id

Definition at line 3428 of file class.ilObjTest.php.

3429 {
3430 $question =& ilObjTest::_instanciateQuestion($question_id);
3431 include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3433 {
3434 $this->logAction($this->lng->txtlng("assessment", "log_question_removed", ilObjAssessmentFolder::_getLogLanguage()), $question_id);
3435 }
3436 $question->delete($question_id);
3437 }

References ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), _instanciateQuestion(), and logAction().

Referenced by removeQuestions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeQuestions()

ilObjTest::removeQuestions (   $removeQuestionIds)
Parameters
array$removeQuestionIds

Definition at line 3412 of file class.ilObjTest.php.

3413 {
3414 foreach ($removeQuestionIds as $value) {
3415 $this->removeQuestion($value);
3416 }
3417
3419 }
removeQuestion($question_id)
Removes a question from the test object.

References reindexFixedQuestionOrdering(), and removeQuestion().

+ Here is the call graph for this function:

◆ removeTestActives()

ilObjTest::removeTestActives (   $activeIds)

Definition at line 3550 of file class.ilObjTest.php.

3551 {
3552 global $ilDB;
3553
3554 $IN_activeIds = $ilDB->in('active_id', $activeIds, false, 'integer');
3555 $ilDB->manipulate("DELETE FROM tst_active WHERE $IN_activeIds");
3556 }

References $ilDB.

Referenced by removeTestResults(), removeTestResultsFromSoapLpAdministration(), and ilCourseObjectiveResult\resetTestForUser().

+ Here is the caller graph for this function:

◆ removeTestResults()

ilObjTest::removeTestResults ( ilTestParticipantData  $participantData)

Definition at line 3462 of file class.ilObjTest.php.

3463 {
3464 if( count($participantData->getAnonymousActiveIds()) )
3465 {
3466 $this->removeTestResultsByActiveIds($participantData->getAnonymousActiveIds());
3467 }
3468
3469 if( count($participantData->getUserIds()) )
3470 {
3471 /* @var ilTestLP $testLP */
3472 require_once 'Services/Object/classes/class.ilObjectLP.php';
3473 $testLP = ilObjectLP::getInstance($this->getId());
3474 $testLP->setTestObject($this);
3475 $testLP->resetLPDataForUserIds($participantData->getUserIds(), false);
3476 }
3477
3478 if( count($participantData->getActiveIds()) )
3479 {
3480 $this->removeTestActives($participantData->getActiveIds());
3481 }
3482 }
removeTestResultsByActiveIds($activeIds)
removeTestActives($activeIds)
static getInstance($a_obj_id)

References ilTestParticipantData\getActiveIds(), ilTestParticipantData\getAnonymousActiveIds(), ilObject\getId(), ilObjectLP\getInstance(), ilTestParticipantData\getUserIds(), removeTestActives(), and removeTestResultsByActiveIds().

Referenced by deleteTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeTestResultsByActiveIds()

ilObjTest::removeTestResultsByActiveIds (   $activeIds)

Definition at line 3504 of file class.ilObjTest.php.

3505 {
3506 global $ilDB;
3507
3508 $IN_activeIds = $ilDB->in('active_fi', $activeIds, false, 'integer');
3509
3510 $ilDB->manipulate("DELETE FROM tst_solutions WHERE $IN_activeIds");
3511 $ilDB->manipulate("DELETE FROM tst_qst_solved WHERE $IN_activeIds");
3512 $ilDB->manipulate("DELETE FROM tst_test_result WHERE $IN_activeIds");
3513 $ilDB->manipulate("DELETE FROM tst_pass_result WHERE $IN_activeIds");
3514 $ilDB->manipulate("DELETE FROM tst_result_cache WHERE $IN_activeIds");
3515 $ilDB->manipulate("DELETE FROM tst_sequence WHERE $IN_activeIds");
3516 $ilDB->manipulate("DELETE FROM tst_times WHERE $IN_activeIds");
3517
3518 if( $this->isRandomTest() )
3519 {
3520 $ilDB->manipulate("DELETE FROM tst_test_rnd_qst WHERE $IN_activeIds");
3521 }
3522 elseif( $this->isDynamicTest() )
3523 {
3524 $ilDB->manipulate("DELETE FROM tst_seq_qst_tracking WHERE $IN_activeIds");
3525 $ilDB->manipulate("DELETE FROM tst_seq_qst_answstatus WHERE $IN_activeIds");
3526 $ilDB->manipulate("DELETE FROM tst_seq_qst_postponed WHERE $IN_activeIds");
3527 $ilDB->manipulate("DELETE FROM tst_seq_qst_checked WHERE $IN_activeIds");
3528 }
3529
3530 include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
3531
3532 foreach ($activeIds as $active_id)
3533 {
3534 // remove file uploads
3535 if (@is_dir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId() . "/$active_id"))
3536 {
3537 ilUtil::delDir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId() . "/$active_id");
3538 }
3539
3541 {
3542 $this->logAction(sprintf($this->lng->txtlng("assessment", "log_selected_user_data_removed", ilObjAssessmentFolder::_getLogLanguage()), $this->userLookupFullName($this->_getUserIdFromActiveId($active_id))));
3543 }
3544 }
3545
3546 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
3548 }
static deleteRequestsByActiveIds($activeIds)
Deletes all hint requests relating to a testactive included in given active ids.

References $ilDB, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilUtil\delDir(), ilAssQuestionHintTracking\deleteRequestsByActiveIds(), getTestId(), isDynamicTest(), isRandomTest(), logAction(), and sprintf.

Referenced by removeTestResults(), and removeTestResultsByUserIds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeTestResultsByUserIds()

ilObjTest::removeTestResultsByUserIds (   $userIds)

Definition at line 3484 of file class.ilObjTest.php.

3485 {
3486 global $ilDB, $lng;
3487
3488 require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
3489 $participantData = new ilTestParticipantData($ilDB, $lng);
3490 $participantData->setUserIds($userIds);
3491 $participantData->load($this->getTestId());
3492
3493 $IN_userIds = $ilDB->in('usr_id', $participantData->getUserIds(), false, 'integer');
3494 $ilDB->manipulateF("DELETE FROM usr_pref WHERE $IN_userIds AND keyword = %s",
3495 array('text'), array("tst_password_".$this->getTestId())
3496 );
3497
3498 if( count($participantData->getActiveIds()) )
3499 {
3500 $this->removeTestResultsByActiveIds($participantData->getActiveIds());
3501 }
3502 }

References $ilDB, ilObject\$lng, getTestId(), and removeTestResultsByActiveIds().

Referenced by removeTestResultsFromSoapLpAdministration().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeTestResultsFromSoapLpAdministration()

ilObjTest::removeTestResultsFromSoapLpAdministration (   $userIds)

this method should only be used from non refactored soap context i think

Parameters
$userIds

Definition at line 3447 of file class.ilObjTest.php.

3448 {
3449 $this->removeTestResultsByUserIds($userIds);
3450
3451 $ilDB = isset($GLOBALS['DIC']) ? $GLOBALS['DIC']['ilDB'] : $GLOBALS['ilDB'];
3452 $lng = isset($GLOBALS['DIC']) ? $GLOBALS['DIC']['lng'] : $GLOBALS['lng'];
3453
3454 require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
3455 $participantData = new ilTestParticipantData($ilDB, $lng);
3456 $participantData->setUserIds($userIds);
3457 $participantData->load($this->getTestId());
3458
3459 $this->removeTestActives($participantData->getActiveIds());
3460 }
removeTestResultsByUserIds($userIds)

References $GLOBALS, $ilDB, ilObject\$lng, getTestId(), removeTestActives(), and removeTestResultsByUserIds().

+ Here is the call graph for this function:

◆ saveAuthorToMetadata()

ilObjTest::saveAuthorToMetadata (   $a_author = "")

Saves an authors name into the lifecycle metadata if no lifecycle metadata exists This will only be called for conversion of "old" tests where the author hasn't been stored in the lifecycle metadata.

Parameters
string$a_authorA string containing the name of the test author @access private
See also
$author

Definition at line 7097 of file class.ilObjTest.php.

7098 {
7099 $md = new ilMD($this->getId(), 0, $this->getType());
7100 $md_life =& $md->getLifecycle();
7101 if (!$md_life)
7102 {
7103 if (strlen($a_author) == 0)
7104 {
7105 global $ilUser;
7106 $a_author = $ilUser->getFullname();
7107 }
7108
7109 $md_life =& $md->addLifecycle();
7110 $md_life->save();
7111 $con =& $md_life->addContribute();
7112 $con->setRole("Author");
7113 $con->save();
7114 $ent =& $con->addEntity();
7115 $ent->setEntity($a_author);
7116 $ent->save();
7117 }
7118 }

References $ilUser, ilObject\getId(), and ilObject\getType().

Referenced by createMetaData(), and loadFromDb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveCertificateVisibility()

ilObjTest::saveCertificateVisibility (   $a_value)

Saves the visibility settings of the certificate.

Parameters
integer$a_valueThe value for the visibility settings (0 = always, 1 = only passed, 2 = never) @access private

Definition at line 9504 of file class.ilObjTest.php.

9505 {
9506 global $ilDB;
9507
9508 $affectedRows = $ilDB->manipulateF("UPDATE tst_tests SET certificate_visibility = %s, tstamp = %s WHERE test_id = %s",
9509 array('text', 'integer', 'integer'),
9510 array($a_value, time(), $this->getTestId())
9511 );
9512 }

References $ilDB, and getTestId().

+ Here is the call graph for this function:

◆ saveCompleteStatus()

ilObjTest::saveCompleteStatus ( ilTestQuestionSetConfig  $testQuestionSetConfig)

Checks if the test is complete and saves the status in the database.

Parameters
ilTestQuestionSetConfig$testQuestionSetConfig

Definition at line 1177 of file class.ilObjTest.php.

1178 {
1179 global $ilDB;
1180
1181 $complete = 0;
1182 if($this->isComplete($testQuestionSetConfig))
1183 {
1184 $complete = 1;
1185 }
1186 if($this->getTestId() > 0)
1187 {
1188 $ilDB->manipulateF(
1189 "UPDATE tst_tests SET complete = %s WHERE test_id = %s",
1190 array('text', 'integer'),
1191 array($complete, $this->test_id)
1192 );
1193 }
1194 }
isComplete(ilTestQuestionSetConfig $testQuestionSetConfig)
Returns true, if a test is complete for use and can be set online.

References $ilDB, getTestId(), and isComplete().

Referenced by insertQuestion().

+ 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.

@access public

See also
$questions

Definition at line 1623 of file class.ilObjTest.php.

1624 {
1625 global $ilDB;
1626
1627 $oldquestions = array();
1628 include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
1630 {
1631 $result = $ilDB->queryF("SELECT question_fi FROM tst_test_question WHERE test_fi = %s ORDER BY sequence",
1632 array('integer'),
1633 array($this->getTestId())
1634 );
1635 if ($result->numRows() > 0)
1636 {
1637 while ($row = $ilDB->fetchAssoc($result))
1638 {
1639 array_push($oldquestions, $row["question_fi"]);
1640 }
1641 }
1642 }
1643 // workaround for lost obligations
1644 // this method is called if a question is removed
1645 $currentQuestionsObligationsQuery = 'SELECT question_fi, obligatory FROM tst_test_question WHERE test_fi = %s';
1646 $rset = $ilDB->queryF($currentQuestionsObligationsQuery, array('integer'), array($this->getTestId()));
1647 while ($row = $ilDB->fetchAssoc($rset)) {
1648 $obligatoryQuestionState[$row['question_fi']] = $row['obligatory'];
1649 }
1650 // delete existing category relations
1651 $affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_question WHERE test_fi = %s",
1652 array('integer'),
1653 array($this->getTestId())
1654 );
1655 // create new category relations
1656 foreach ($this->questions as $key => $value)
1657 {
1658 // workaround for import witout obligations information
1659 if( !isset($obligatoryQuestionState[$value]) || is_null($obligatoryQuestionState[$value]) )
1660 {
1661 $obligatoryQuestionState[$value] = 0;
1662 }
1663
1664 // insert question
1665 $next_id = $ilDB->nextId('tst_test_question');
1666 $ilDB->insert('tst_test_question', array(
1667 'test_question_id' => array('integer', $next_id),
1668 'test_fi' => array('integer', $this->getTestId()),
1669 'question_fi' => array('integer', $value),
1670 'sequence' => array('integer', $key),
1671 'obligatory' => array('integer', $obligatoryQuestionState[$value]),
1672 'tstamp' => array('integer', time())
1673 ));
1674 }
1675 include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
1677 {
1678 $result = $ilDB->queryF("SELECT question_fi FROM tst_test_question WHERE test_fi = %s ORDER BY sequence",
1679 array('integer'),
1680 array($this->getTestId())
1681 );
1682 $newquestions = array();
1683 if ($result->numRows() > 0)
1684 {
1685 while ($row = $ilDB->fetchAssoc($result))
1686 {
1687 array_push($newquestions, $row["question_fi"]);
1688 }
1689 }
1690 foreach ($oldquestions as $index => $question_id)
1691 {
1692 if (strcmp($newquestions[$index], $question_id) != 0)
1693 {
1694 $pos = array_search($question_id, $newquestions);
1695 if ($pos === FALSE)
1696 {
1697 $this->logAction($this->lng->txtlng("assessment", "log_question_removed", ilObjAssessmentFolder::_getLogLanguage()), $question_id);
1698 }
1699 else
1700 {
1701 $this->logAction($this->lng->txtlng("assessment", "log_question_position_changed", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($index+1) . " => " . ($pos+1), $question_id);
1702 }
1703 }
1704 }
1705 foreach ($newquestions as $index => $question_id)
1706 {
1707 if (array_search($question_id, $oldquestions) === FALSE)
1708 {
1709 $this->logAction($this->lng->txtlng("assessment", "log_question_added", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($index+1), $question_id);
1710 }
1711 }
1712 }
1713 }

References $ilDB, $result, $row, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), getTestId(), and logAction().

Referenced by moveQuestions(), and saveToDb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveToDb()

ilObjTest::saveToDb (   $properties_only = FALSE)

Saves a ilObjTest object to a database.

Parameters
bool$properties_only

Definition at line 1231 of file class.ilObjTest.php.

1232 {
1233 global $tree, $ilDB, $ilPluginAdmin;
1234
1235 // moved online_status to ilObjectActivation (see below)
1236
1237 // cleanup RTE images
1238 $this->cleanupMediaobjectUsage();
1239
1240 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
1241 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this);
1242 $testQuestionSetConfig = $testQuestionSetConfigFactory->getQuestionSetConfig();
1243
1244 include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
1245 if ($this->test_id == -1)
1246 {
1247 // Create new dataset
1248 $next_id = $ilDB->nextId('tst_tests');
1249
1250 $ilDB->insert('tst_tests', array(
1251 'test_id' => array('integer', $next_id),
1252 'obj_fi' => array('integer', $this->getId()),
1253 'author' => array('text', $this->getAuthor()),
1254 'intro_enabled' => array('integer', (int)$this->isIntroductionEnabled()),
1255 'introduction' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getIntroduction(), 0)),
1256 'finalstatement' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getFinalStatement(), 0)),
1257 'showinfo' => array('integer', $this->getShowInfo()),
1258 'forcejs' => array('integer', $this->getForceJS()),
1259 'customstyle' => array('text', $this->getCustomStyle()),
1260 'showfinalstatement' => array('integer', $this->getShowFinalStatement()),
1261 'sequence_settings' => array('integer', $this->getSequenceSettings()),
1262 'score_reporting' => array('integer', $this->getScoreReporting()),
1263 'instant_verification' => array('text', $this->getInstantFeedbackSolution()),
1264 'answer_feedback_points' => array('text', $this->getAnswerFeedbackPoints()),
1265 'answer_feedback' => array('text', $this->getAnswerFeedback()),
1266 'anonymity' => array('text', $this->getAnonymity()),
1267 'show_cancel' => array('text', $this->getShowCancel()),
1268 'show_marker' => array('integer', $this->getShowMarker()),
1269 'fixed_participants' => array('text', $this->getFixedParticipants()),
1270 'nr_of_tries' => array('integer', $this->getNrOfTries()),
1271 'kiosk' => array('integer', $this->getKiosk()),
1272 'use_previous_answers' => array('text', $this->getUsePreviousAnswers()),
1273 'title_output' => array('text', $this->getTitleOutput()),
1274 'processing_time' => array('text', $this->getProcessingTime()),
1275 'enable_processing_time' => array('text', $this->getEnableProcessingTime()),
1276 'reset_processing_time' => array('integer', $this->getResetProcessingTime()),
1277 'reporting_date' => array('text', $this->getReportingDate()),
1278 'starting_time_enabled' => array('integer', $this->isStartingTimeEnabled()),
1279 'starting_time' => array('integer', $this->getStartingTime()),
1280 'ending_time_enabled' => array('integer', $this->isEndingTimeEnabled()),
1281 'ending_time' => array('integer', $this->getEndingTime()),
1282 'complete' => array('text', $this->isComplete($testQuestionSetConfig)),
1283 'ects_output' => array('text', $this->getECTSOutput()),
1284 'ects_a' => array('float', strlen($this->ects_grades["A"]) ? $this->ects_grades["A"] : NULL),
1285 'ects_b' => array('float', strlen($this->ects_grades["B"]) ? $this->ects_grades["B"] : NULL),
1286 'ects_c' => array('float', strlen($this->ects_grades["C"]) ? $this->ects_grades["C"] : NULL),
1287 'ects_d' => array('float', strlen($this->ects_grades["D"]) ? $this->ects_grades["D"] : NULL),
1288 'ects_e' => array('float', strlen($this->ects_grades["E"]) ? $this->ects_grades["E"] : NULL),
1289 'ects_fx' => array('float', $this->getECTSFX()),
1290 'count_system' => array('text', $this->getCountSystem()),
1291 'mc_scoring' => array('text', $this->getMCScoring()),
1292 'score_cutting' => array('text', $this->getScoreCutting()),
1293 'pass_scoring' => array('text', $this->getPassScoring()),
1294 'shuffle_questions' => array('text', $this->getShuffleQuestions()),
1295 'results_presentation' => array('integer', $this->getResultsPresentation()),
1296 'show_summary' => array('integer', $this->getListOfQuestionsSettings()),
1297 'password_enabled' => array('integer', (int)$this->isPasswordEnabled()),
1298 'password' => array('text', $this->getPassword()),
1299 'limit_users_enabled' => array('integer', (int)$this->isLimitUsersEnabled()),
1300 'allowedusers' => array('integer', $this->getAllowedUsers()),
1301 'alloweduserstimegap' => array('integer', $this->getAllowedUsersTimeGap()),
1302 'mailnottype' => array('integer', $this->getMailNotificationType()),
1303 'exportsettings' => array('integer', $this->getExportSettings()),
1304 'certificate_visibility' => array('text', $this->getCertificateVisibility()),
1305 'mailnotification' => array('integer', $this->getMailNotification()),
1306 'created' => array('integer', time()),
1307 'tstamp' => array('integer', time()),
1308 'enabled_view_mode' => array('text', $this->getEnabledViewMode()),
1309 'template_id' => array('integer', $this->getTemplate()),
1310 'pool_usage' => array('integer', $this->getPoolUsage()),
1311 'print_bs_with_res' => array('integer', (int)$this->isBestSolutionPrintedWithResult()),
1312 'obligations_enabled' => array('integer', (int)$this->areObligationsEnabled()),
1313 'offer_question_hints' => array('integer', (int)$this->isOfferingQuestionHintsEnabled()),
1314 'highscore_enabled' => array('integer', (int)$this->getHighscoreEnabled()),
1315 'highscore_anon' => array('integer', (int)$this->getHighscoreAnon()),
1316 'highscore_achieved_ts' => array('integer', (int)$this->getHighscoreAchievedTS()),
1317 'highscore_score' => array('integer', (int)$this->getHighscoreScore()),
1318 'highscore_percentage' => array('integer', (int)$this->getHighscorePercentage()),
1319 'highscore_hints' => array('integer', (int)$this->getHighscoreHints()),
1320 'highscore_wtime' => array('integer', (int)$this->getHighscoreWTime()),
1321 'highscore_own_table' => array('integer', (int)$this->getHighscoreOwnTable()),
1322 'highscore_top_table' => array('integer', (int)$this->getHighscoreTopTable()),
1323 'highscore_top_num' => array('integer', (int)$this->getHighscoreTopNum()),
1324 'online_status' => array('integer', (int)$this->isOnline()),
1325 'specific_feedback' => array('integer', (int)$this->getSpecificAnswerFeedback()),
1326 'autosave' => array('integer', (int)$this->getAutosave()),
1327 'autosave_ival' => array('integer', (int)$this->getAutosaveIval()),
1328 'pass_deletion_allowed' => array('integer', (int)$this->isPassDeletionAllowed()),
1329 'enable_examview' => array('integer', (int)$this->getEnableExamview()),
1330 'show_examview_html' => array('integer', (int)$this->getShowExamviewHtml()),
1331 'show_examview_pdf' => array('integer', (int)$this->getShowExamviewPdf()),
1332 'redirection_mode' => array('integer', (int)$this->getRedirectionMode()),
1333 'redirection_url' => array('text', (string)$this->getRedirectionUrl()),
1334 'enable_archiving' => array('integer', (int)$this->getEnableArchiving()),
1335 'examid_in_test_pass' => array('integer', (int)$this->isShowExamIdInTestPassEnabled()),
1336 'examid_in_test_res' => array('integer', (int)$this->isShowExamIdInTestResultsEnabled()),
1337 'sign_submission' => array('integer', (int)$this->getSignSubmission()),
1338 'question_set_type' => array('text', $this->getQuestionSetType()),
1339 'char_selector_availability' => array('integer', (int)$this->getCharSelectorAvailability()),
1340 'char_selector_definition' => array('text', (string)$this->getCharSelectorDefinition()),
1341 'skill_service' => array('integer', (int)$this->isSkillServiceEnabled()),
1342 'result_tax_filters' => array('text', serialize((array)$this->getResultFilterTaxIds())),
1343 'show_grading_status' => array('integer', (int)$this->isShowGradingStatusEnabled()),
1344 'show_grading_mark' => array('integer', (int)$this->isShowGradingMarkEnabled()),
1345 'inst_fb_answer_fixation' => array('integer', (int)$this->isInstantFeedbackAnswerFixationEnabled()),
1346 'force_inst_fb' => array('integer', (int)$this->isForceInstantFeedbackEnabled()),
1347 'broken' => array('integer', (int)$this->isTestFinalBroken()),
1348 'pass_waiting' => array('text', (string)$this->getPassWaiting())
1349 ));
1350
1351 $this->test_id = $next_id;
1352
1354 {
1355 $this->logAction($this->lng->txtlng("assessment", "log_create_new_test", ilObjAssessmentFolder::_getLogLanguage()));
1356 }
1357 }
1358 else
1359 {
1360 // Modify existing dataset
1361 $oldrow = array();
1363 {
1364 $result = $ilDB->queryF("SELECT * FROM tst_tests WHERE test_id = %s",
1365 array('integer'),
1366 array($this->test_id)
1367 );
1368 if ($result->numRows() == 1)
1369 {
1370 $oldrow = $ilDB->fetchAssoc($result);
1371 }
1372 }
1373
1374 $ilDB->update('tst_tests',
1375 array(
1376 'author' => array('text', $this->getAuthor()),
1377 'intro_enabled' => array('integer', (int)$this->isIntroductionEnabled()),
1378 'introduction' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getIntroduction(), 0)),
1379 'finalstatement' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getFinalStatement(), 0)),
1380 'showinfo' => array('integer', $this->getShowInfo()),
1381 'forcejs' => array('integer', $this->getForceJS()),
1382 'customstyle' => array('text', $this->getCustomStyle()),
1383 'showfinalstatement' => array('integer', $this->getShowFinalStatement()),
1384 'sequence_settings' => array('integer', $this->getSequenceSettings()),
1385 'score_reporting' => array('integer', $this->getScoreReporting()),
1386 'instant_verification' => array('text', $this->getInstantFeedbackSolution()),
1387 'answer_feedback_points' => array('text', $this->getAnswerFeedbackPoints()),
1388 'answer_feedback' => array('text', $this->getGenericAnswerFeedback()),
1389 'anonymity' => array('text', $this->getAnonymity()),
1390 'show_cancel' => array('text', $this->getShowCancel()),
1391 'show_marker' => array('integer', $this->getShowMarker()),
1392 'fixed_participants' => array('text', $this->getFixedParticipants()),
1393 'nr_of_tries' => array('integer', $this->getNrOfTries()),
1394 'kiosk' => array('integer', $this->getKiosk()),
1395 'use_previous_answers' => array('text', $this->getUsePreviousAnswers()),
1396 'title_output' => array('text', $this->getTitleOutput()),
1397 'processing_time' => array('text', $this->getProcessingTime()),
1398 'enable_processing_time' => array('text', $this->getEnableProcessingTime()),
1399 'reset_processing_time' => array('integer', $this->getResetProcessingTime()),
1400 'reporting_date' => array('text', $this->getReportingDate()),
1401 'starting_time_enabled' => array('integer', $this->isStartingTimeEnabled()),
1402 'starting_time' => array('integer', $this->getStartingTime()),
1403 'ending_time_enabled' => array('integer', $this->isEndingTimeEnabled()),
1404 'ending_time' => array('integer', $this->getEndingTime()),
1405 'complete' => array('text', $this->isComplete($testQuestionSetConfig)),
1406 'ects_output' => array('text', $this->getECTSOutput()),
1407 'ects_a' => array('float', strlen($this->ects_grades["A"]) ? $this->ects_grades["A"] : NULL),
1408 'ects_b' => array('float', strlen($this->ects_grades["B"]) ? $this->ects_grades["B"] : NULL),
1409 'ects_c' => array('float', strlen($this->ects_grades["C"]) ? $this->ects_grades["C"] : NULL),
1410 'ects_d' => array('float', strlen($this->ects_grades["D"]) ? $this->ects_grades["D"] : NULL),
1411 'ects_e' => array('float', strlen($this->ects_grades["E"]) ? $this->ects_grades["E"] : NULL),
1412 'ects_fx' => array('float', $this->getECTSFX()),
1413 'count_system' => array('text', $this->getCountSystem()),
1414 'mc_scoring' => array('text', $this->getMCScoring()),
1415 'score_cutting' => array('text', $this->getScoreCutting()),
1416 'pass_scoring' => array('text', $this->getPassScoring()),
1417 'shuffle_questions' => array('text', $this->getShuffleQuestions()),
1418 'results_presentation' => array('integer', $this->getResultsPresentation()),
1419 'show_summary' => array('integer', $this->getListOfQuestionsSettings()),
1420 'password_enabled' => array('integer', (int)$this->isPasswordEnabled()),
1421 'password' => array('text', $this->getPassword()),
1422 'limit_users_enabled' => array('integer', (int)$this->isLimitUsersEnabled()),
1423 'allowedusers' => array('integer', $this->getAllowedUsers()),
1424 'alloweduserstimegap' => array('integer', $this->getAllowedUsersTimeGap()),
1425 'mailnottype' => array('integer', $this->getMailNotificationType()),
1426 'exportsettings' => array('integer', $this->getExportSettings()),
1427 'certificate_visibility' => array('text', $this->getCertificateVisibility()),
1428 'mailnotification' => array('integer', $this->getMailNotification()),
1429 'tstamp' => array('integer', time()),
1430 'enabled_view_mode' => array('text', $this->getEnabledViewMode()),
1431 'template_id' => array('integer', $this->getTemplate()),
1432 'pool_usage' => array('integer', $this->getPoolUsage()),
1433 'print_bs_with_res' => array('integer', (int)$this->isBestSolutionPrintedWithResult()),
1434 'obligations_enabled' => array('integer', (int)$this->areObligationsEnabled()),
1435 'offer_question_hints' => array('integer', (int)$this->isOfferingQuestionHintsEnabled()),
1436 'highscore_enabled' => array('integer', (int)$this->getHighscoreEnabled()),
1437 'highscore_anon' => array('integer', (int)$this->getHighscoreAnon()),
1438 'highscore_achieved_ts' => array('integer', (int)$this->getHighscoreAchievedTS()),
1439 'highscore_score' => array('integer', (int)$this->getHighscoreScore()),
1440 'highscore_percentage' => array('integer', (int)$this->getHighscorePercentage()),
1441 'highscore_hints' => array('integer', (int)$this->getHighscoreHints()),
1442 'highscore_wtime' => array('integer', (int)$this->getHighscoreWTime()),
1443 'highscore_own_table' => array('integer', (int)$this->getHighscoreOwnTable()),
1444 'highscore_top_table' => array('integer', (int)$this->getHighscoreTopTable()),
1445 'highscore_top_num' => array('integer', (int)$this->getHighscoreTopNum()),
1446 'online_status' => array('integer', (int)$this->isOnline()),
1447 'specific_feedback' => array('integer', (int)$this->getSpecificAnswerFeedback()),
1448 'autosave' => array('integer', (int)$this->getAutosave()),
1449 'autosave_ival' => array('integer', (int)$this->getAutosaveIval()),
1450 'pass_deletion_allowed' => array('integer', (int)$this->isPassDeletionAllowed()),
1451 'enable_examview' => array('integer', (int)$this->getEnableExamview()),
1452 'show_examview_html' => array('integer', (int)$this->getShowExamviewHtml()),
1453 'show_examview_pdf' => array('integer', (int)$this->getShowExamviewPdf()),
1454 'redirection_mode' => array('integer', (int)$this->getRedirectionMode()),
1455 'redirection_url' => array('text', (string)$this->getRedirectionUrl()),
1456 'enable_archiving' => array('integer', (int)$this->getEnableArchiving()),
1457 'examid_in_test_pass' => array('integer', (int)$this->isShowExamIdInTestPassEnabled()),
1458 'examid_in_test_res' => array('integer', (int)$this->isShowExamIdInTestResultsEnabled()),
1459 'sign_submission' => array('integer', (int)$this->getSignSubmission()),
1460 'question_set_type' => array('text', $this->getQuestionSetType()),
1461 'char_selector_availability' => array('integer', (int)$this->getCharSelectorAvailability()),
1462 'char_selector_definition' => array('text', (string)$this->getCharSelectorDefinition()),
1463 'skill_service' => array('integer', (int)$this->isSkillServiceEnabled()),
1464 'result_tax_filters' => array('text', serialize((array)$this->getResultFilterTaxIds())),
1465 'show_grading_status' => array('integer', (int)$this->isShowGradingStatusEnabled()),
1466 'show_grading_mark' => array('integer', (int)$this->isShowGradingMarkEnabled()),
1467 'inst_fb_answer_fixation' => array('integer', (int)$this->isInstantFeedbackAnswerFixationEnabled()),
1468 'force_inst_fb' => array('integer', (int)$this->isForceInstantFeedbackEnabled()),
1469 'broken' => array('integer', (int)$this->isTestFinalBroken()),
1470 'pass_waiting' => array('text', (string)$this->getPassWaiting())
1471 ),
1472 array(
1473 'test_id' => array('integer', (int)$this->getTestId())
1474 )
1475 );
1476
1477 include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
1479 {
1480 $logresult = $ilDB->queryF("SELECT * FROM tst_tests WHERE test_id = %s",
1481 array('integer'),
1482 array($this->getTestId())
1483 );
1484 $newrow = array();
1485 if ($logresult->numRows() == 1)
1486 {
1487 $newrow = $ilDB->fetchAssoc($logresult);
1488 }
1489 $changed_fields = array();
1490 foreach ($oldrow as $key => $value)
1491 {
1492 if (strcmp($oldrow[$key], $newrow[$key]) != 0)
1493 {
1494 array_push($changed_fields, "$key: " . $oldrow[$key] . " => " . $newrow[$key]);
1495 }
1496 }
1497 $changes = join($changed_fields, ", ");
1498 if (count($changed_fields) > 0)
1499 {
1500 $this->logAction($this->lng->txtlng("assessment", "log_modified_test", ilObjAssessmentFolder::_getLogLanguage()) . " [".$changes."]");
1501 }
1502 }
1503 if ($this->evalTotalPersons() > 0)
1504 {
1505 // reset the finished status of participants if the nr of test passes did change
1506 if ($this->getNrOfTries() > 0)
1507 {
1508 // set all unfinished tests with nr of passes >= allowed passes finished
1509 $aresult = $ilDB->queryF("SELECT active_id FROM tst_active WHERE test_fi = %s AND tries >= %s AND submitted = %s",
1510 array('integer', 'integer', 'integer'),
1511 array($this->getTestId(), $this->getNrOfTries(), 0)
1512 );
1513 while ($row = $ilDB->fetchAssoc($aresult))
1514 {
1515 $ilDB->manipulateF("UPDATE tst_active SET submitted = %s, submittimestamp = %s WHERE active_id = %s",
1516 array('integer', 'timestamp', 'integer'),
1517 array(1, date('Y-m-d H:i:s'), $row["active_id"])
1518 );
1519 }
1520
1521 // set all finished tests with nr of passes < allowed passes not finished
1522 $aresult = $ilDB->queryF("SELECT active_id FROM tst_active WHERE test_fi = %s AND tries < %s AND submitted = %s",
1523 array('integer', 'integer', 'integer'),
1524 array($this->getTestId(), $this->getNrOfTries()-1, 1)
1525 );
1526 while ($row = $ilDB->fetchAssoc($aresult))
1527 {
1528 $ilDB->manipulateF("UPDATE tst_active SET submitted = %s, submittimestamp = %s WHERE active_id = %s",
1529 array('integer', 'timestamp', 'integer'),
1530 array(0, NULL, $row["active_id"])
1531 );
1532 }
1533 }
1534 else
1535 {
1536 // set all finished tests with nr of passes >= allowed passes not finished
1537 $aresult = $ilDB->queryF("SELECT active_id FROM tst_active WHERE test_fi = %s AND submitted = %s",
1538 array('integer', 'integer'),
1539 array($this->getTestId(), 1)
1540 );
1541 while ($row = $ilDB->fetchAssoc($aresult))
1542 {
1543 $ilDB->manipulateF("UPDATE tst_active SET submitted = %s, submittimestamp = %s WHERE active_id = %s",
1544 array('integer', 'timestamp', 'integer'),
1545 array(0, NULL, $row["active_id"])
1546 );
1547 }
1548 }
1549 }
1550 }
1551
1552 // news item creation/update/deletion
1553 include_once 'Services/News/classes/class.ilNewsItem.php';
1554 if( !$this->getOldOnlineStatus() && $this->isOnline() )
1555 {
1556 global $ilUser;
1557 $newsItem = new ilNewsItem();
1558 $newsItem->setContext($this->getId(), 'tst');
1559 $newsItem->setPriority(NEWS_NOTICE);
1560 $newsItem->setTitle('new_test_online');
1561 $newsItem->setContentIsLangVar(true);
1562 $newsItem->setContent('');
1563 $newsItem->setUserId($ilUser->getId());
1564 $newsItem->setVisibility(NEWS_USERS);
1565 $newsItem->create();
1566 }
1567 elseif( $this->getOldOnlineStatus() && !$this->isOnline() )
1568 {
1569 ilNewsItem::deleteNewsOfContext($this->getId(), 'tst');
1570 }
1571 elseif( $this->isOnline() )
1572 {
1573 $newsId = ilNewsItem::getFirstNewsIdForContext($this->getId(), 'tst');
1574 if($newsId > 0)
1575 {
1576 $newsItem = new ilNewsItem($newsId);
1577 $newsItem->setTitle('new_test_online');
1578 $newsItem->setContentIsLangVar(true);
1579 $newsItem->setContent('');
1580 $newsItem->update();
1581 }
1582 }
1583
1584 // moved activation to ilObjectActivation
1585 if($this->ref_id)
1586 {
1587 include_once "./Services/Object/classes/class.ilObjectActivation.php";
1588 ilObjectActivation::getItem($this->ref_id);
1589
1590 $item = new ilObjectActivation;
1591 if(!$this->isActivationLimited())
1592 {
1594 }
1595 else
1596 {
1597 $item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);
1598 $item->setTimingStart($this->getActivationStartingTime());
1599 $item->setTimingEnd($this->getActivationEndingTime());
1600 $item->toggleVisible($this->getActivationVisibility());
1601 }
1602
1603 $item->update($this->ref_id);
1604 }
1605
1606 if (!$properties_only)
1607 {
1608 if ($this->getQuestionSetType() == self::QUESTION_SET_TYPE_FIXED)
1609 {
1610 $this->saveQuestionsToDb();
1611 }
1612
1613 $this->mark_schema->saveToDb($this->test_id);
1614 }
1615 }
const NEWS_USERS
const NEWS_NOTICE
static getFirstNewsIdForContext($a_context_obj_id, $a_context_obj_type, $a_context_sub_obj_id="", $a_context_sub_obj_type="")
Get first new id of news set related to a certain context.
static deleteNewsOfContext($a_context_obj_id, $a_context_obj_type, $a_context_sub_obj_id=0, $a_context_sub_obj_type="")
Delete all news of a context.
getGenericAnswerFeedback()
Returns 1 if generic answer feedback is to be shown.
cleanupMediaobjectUsage()
Cleans up the media objects for all text fields in a test which are using an RTE field.
Class ilObjectActivation.
setTimingType($a_type)
Set timing type.

References $ilDB, $ilUser, $result, $row, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilRTE\_replaceMediaObjectImageSrc(), areObligationsEnabled(), cleanupMediaobjectUsage(), date, ilNewsItem\deleteNewsOfContext(), evalTotalPersons(), getActivationEndingTime(), getActivationStartingTime(), getActivationVisibility(), getAllowedUsers(), getAllowedUsersTimeGap(), getAnonymity(), getAnswerFeedback(), getAnswerFeedbackPoints(), getAuthor(), getAutosave(), getAutosaveIval(), getCertificateVisibility(), getCharSelectorAvailability(), getCharSelectorDefinition(), getCountSystem(), getCustomStyle(), getECTSFX(), getECTSOutput(), getEnableArchiving(), getEnabledViewMode(), getEnableExamview(), getEnableProcessingTime(), getEndingTime(), getExportSettings(), getFinalStatement(), ilNewsItem\getFirstNewsIdForContext(), getFixedParticipants(), getForceJS(), getGenericAnswerFeedback(), getHighscoreAchievedTS(), getHighscoreAnon(), getHighscoreEnabled(), getHighscoreHints(), getHighscoreOwnTable(), getHighscorePercentage(), getHighscoreScore(), getHighscoreTopNum(), getHighscoreTopTable(), getHighscoreWTime(), ilObject\getId(), getInstantFeedbackSolution(), getIntroduction(), ilObjectActivation\getItem(), getKiosk(), getListOfQuestionsSettings(), getMailNotification(), getMailNotificationType(), getMCScoring(), getNrOfTries(), getOldOnlineStatus(), getPassScoring(), getPassWaiting(), getPassword(), getPoolUsage(), getProcessingTime(), getQuestionSetType(), getRedirectionMode(), getRedirectionUrl(), getReportingDate(), getResetProcessingTime(), getResultFilterTaxIds(), getResultsPresentation(), getScoreCutting(), getScoreReporting(), getSequenceSettings(), getShowCancel(), getShowExamviewHtml(), getShowExamviewPdf(), getShowFinalStatement(), getShowInfo(), getShowMarker(), getShuffleQuestions(), getSignSubmission(), getSpecificAnswerFeedback(), getStartingTime(), getTemplate(), getTestId(), getTitleOutput(), getUsePreviousAnswers(), isActivationLimited(), isBestSolutionPrintedWithResult(), isComplete(), isEndingTimeEnabled(), isForceInstantFeedbackEnabled(), isInstantFeedbackAnswerFixationEnabled(), isIntroductionEnabled(), isLimitUsersEnabled(), isOfferingQuestionHintsEnabled(), isOnline(), isPassDeletionAllowed(), isPasswordEnabled(), isShowExamIdInTestPassEnabled(), isShowExamIdInTestResultsEnabled(), isShowGradingMarkEnabled(), isShowGradingStatusEnabled(), isSkillServiceEnabled(), isStartingTimeEnabled(), isTestFinalBroken(), logAction(), NEWS_NOTICE, NEWS_USERS, saveQuestionsToDb(), ilObjectActivation\setTimingType(), ilObjectActivation\TIMINGS_ACTIVATION, and ilObjectActivation\TIMINGS_DEACTIVATED.

Referenced by applyDefaults(), and fromXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendAdvancedNotification()

ilObjTest::sendAdvancedNotification (   $active_id)

Definition at line 10683 of file class.ilObjTest.php.

10684 {
10685 include_once "./Modules/Test/classes/class.ilTestMailNotification.php";
10686
10687 $mail = new ilTestMailNotification();
10688 $owner_id = $this->getOwner();
10689 $usr_data = $this->userLookupFullName(ilObjTest::_getUserIdFromActiveId($active_id));
10690
10691 require_once 'Modules/Test/classes/class.ilTestExportFactory.php';
10692 $expFactory = new ilTestExportFactory($this);
10693 $exportObj = $expFactory->getExporter('results');
10694 $file = $exportObj->exportToExcel($deliver = FALSE, 'active_id', $active_id, $passedonly = FALSE);
10695 include_once "./Services/Mail/classes/class.ilFileDataMail.php";
10696 $fd = new ilFileDataMail(ANONYMOUS_USER_ID);
10697 $fd->copyAttachmentFile($file, "result_" . $active_id . ".xls");
10698 $file_names[] = "result_" . $active_id . ".xls";
10699
10700 $mail->sendAdvancedNotification($owner_id, $this->getTitle(), $usr_data, $file_names);
10701
10702 if(count($file_names))
10703 {
10704 $fd->unlinkFiles($file_names);
10705 unset($fd);
10706 @unlink($file);
10707 }
10708 }
This class handles all operations on files (attachments) in directory ilias_data/mail.
static _getUserIdFromActiveId($active_id)
userLookupFullName($user_id, $overwrite_anonymity=FALSE, $sorted_order=FALSE, $suffix="")
Returns the full name of a test user according to the anonymity status.
getOwner()
get object owner
Class ilTestMailNotification.
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

References $file, _getUserIdFromActiveId(), ilObject\getOwner(), ilObject\getTitle(), and userLookupFullName().

+ Here is the call graph for this function:

◆ sendSimpleNotification()

ilObjTest::sendSimpleNotification (   $active_id)

Definition at line 10660 of file class.ilObjTest.php.

10661 {
10662 include_once "./Modules/Test/classes/class.ilTestMailNotification.php";
10663
10664 $mail = new ilTestMailNotification();
10665 $owner_id = $this->getOwner();
10666 $usr_data = $this->userLookupFullName(ilObjTest::_getUserIdFromActiveId($active_id));
10667 $mail->sendSimpleNotification($owner_id, $this->getTitle(), $usr_data);
10668 }

References _getUserIdFromActiveId(), ilObject\getOwner(), ilObject\getTitle(), and userLookupFullName().

+ Here is the call graph for this function:

◆ setActivationEndingTime()

ilObjTest::setActivationEndingTime (   $ending_time = NULL)

Definition at line 11726 of file class.ilObjTest.php.

11727 {
11728 $this->activation_ending_time = $ending_time;
11729 }

References $ending_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setActivationLimited()

ilObjTest::setActivationLimited (   $a_value)

Definition at line 11202 of file class.ilObjTest.php.

11203 {
11204 $this->activation_limited = (bool)$a_value;
11205 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setActivationStartingTime()

ilObjTest::setActivationStartingTime (   $starting_time = NULL)

Definition at line 11721 of file class.ilObjTest.php.

11722 {
11723 $this->activation_starting_time = $starting_time;
11724 }

References $starting_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setActivationVisibility()

ilObjTest::setActivationVisibility (   $a_value)

Definition at line 11187 of file class.ilObjTest.php.

11188 {
11189 $this->activation_visibility = (bool) $a_value;
11190 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setAllowedUsers()

ilObjTest::setAllowedUsers (   $a_allowed_users)

Definition at line 9320 of file class.ilObjTest.php.

9321 {
9322 $this->allowedUsers = $a_allowed_users;
9323 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setAllowedUsersTimeGap()

ilObjTest::setAllowedUsersTimeGap (   $a_allowed_users_time_gap)

Definition at line 9330 of file class.ilObjTest.php.

9331 {
9332 $this->allowedUsersTimeGap = $a_allowed_users_time_gap;
9333 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setAnonymity()

ilObjTest::setAnonymity (   $a_value = 0)

Sets the anonymity status of the test.

Parameters
integer$a_valueThe value for the anonymity status (0 = personalized, 1 = anonymized) @access public

Definition at line 9553 of file class.ilObjTest.php.

9554 {
9555 switch ($a_value)
9556 {
9557 case 1:
9558 $this->anonymity = 1;
9559 break;
9560 default:
9561 $this->anonymity = 0;
9562 break;
9563 }
9564 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setAnswerFeedback()

ilObjTest::setAnswerFeedback (   $answer_feedback = 0)

Sets the generic feedback for the test @deprecate Use setGenericAnswerFeedback instead.

Parameters
integer$answer_feedbackIf 1, answer specific feedback will be shown after answering a question @access public
See also
$answer_feedback

Definition at line 2424 of file class.ilObjTest.php.

2425{
2426 switch ($answer_feedback)
2427 {
2428 case 1:
2429 $this->answer_feedback = 1;
2430 break;
2431 default:
2432 $this->answer_feedback = 0;
2433 break;
2434 }
2435}

References $answer_feedback.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setAnswerFeedbackPoints()

ilObjTest::setAnswerFeedbackPoints (   $answer_feedback_points = 0)

Sets the answer specific feedback of reached points for the test.

Parameters
integer$answer_feedback_pointsIf 1, answer specific feedback will show the reached points after answering a question @access public
See also
$answer_feedback_points

Definition at line 2462 of file class.ilObjTest.php.

2463 {
2465 {
2466 case 1:
2467 $this->answer_feedback_points = 1;
2468 break;
2469 default:
2470 $this->answer_feedback_points = 0;
2471 break;
2472 }
2473 }

References $answer_feedback_points.

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setScoringFeedbackOptionsByArray().

+ Here is the caller graph for this function:

◆ setAuthor()

ilObjTest::setAuthor (   $author = "")

Sets the authors name of the ilObjTest object.

Parameters
string$authorA string containing the name of the test author @access public
See also
$author

Definition at line 7083 of file class.ilObjTest.php.

7084 {
7085 $this->author = $author;
7086 }

References $author.

Referenced by fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setAutosave()

ilObjTest::setAutosave (   $autosave)

Definition at line 11630 of file class.ilObjTest.php.

11631 {
11632 $this->autosave = $autosave;
11633 }

References $autosave.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setAutosaveIval()

ilObjTest::setAutosaveIval (   $autosave_ival)

Definition at line 11640 of file class.ilObjTest.php.

11641 {
11642 $this->autosave_ival = $autosave_ival;
11643 }

References $autosave_ival.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setCertificateVisibility()

ilObjTest::setCertificateVisibility (   $a_value)

Sets the visibility settings of the certificate.

Parameters
integer$a_valueThe value for the visibility settings (0 = always, 1 = only passed, 2 = never) @access public

Definition at line 9531 of file class.ilObjTest.php.

9532 {
9533 $this->certificate_visibility = $a_value;
9534 }

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setCharSelectorAvailability()

ilObjTest::setCharSelectorAvailability (   $availability)
Parameters
intavailability of the special character selector

Definition at line 11970 of file class.ilObjTest.php.

11971 {
11972 $this->char_selector_availability = (int) $availability;
11973 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setCharSelectorDefinition()

ilObjTest::setCharSelectorDefinition (   $definition = '')
Parameters
stringdefinition of the special character selector

Definition at line 11986 of file class.ilObjTest.php.

11987 {
11988 $this->char_selector_definition = $definition;
11989 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setClientIP()

ilObjTest::setClientIP (   $user_id,
  $client_ip 
)

Definition at line 7926 of file class.ilObjTest.php.

7927 {
7928 global $ilDB;
7929
7930 $affectedRows = $ilDB->manipulateF("UPDATE tst_invited_user SET clientip = %s, tstamp = %s WHERE test_fi=%s and user_fi=%s",
7931 array('text', 'integer', 'integer', 'integer'),
7932 array((strlen($client_ip)) ? $client_ip : NULL, time(), $this->getTestId(), $user_id)
7933 );
7934 }

References $ilDB, and getTestId().

+ Here is the call graph for this function:

◆ setCountSystem()

ilObjTest::setCountSystem (   $a_count_system = COUNT_PARTIAL_SOLUTIONS)

Sets the count system for the calculation of points.

Parameters
integer$a_count_systemThe count system for the calculation of points. @access public
See also
$count_system

Definition at line 3293 of file class.ilObjTest.php.

3294 {
3295 $this->count_system = $a_count_system;
3296 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setCustomStyle()

ilObjTest::setCustomStyle (   $a_customStyle = NULL)

Set the custom style.

Parameters
string$a_customStyleThe custom style @access public
See also
$_customStyle

Definition at line 2152 of file class.ilObjTest.php.

2153 {
2154 $this->_customStyle = $a_customStyle;
2155 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setECTSFX()

ilObjTest::setECTSFX (   $a_ects_fx)

{

Parameters
float | null$ects_fx
}

Implements ilEctsGradesEnabled.

Definition at line 2328 of file class.ilObjTest.php.

2329 {
2330 $this->ects_fx = $a_ects_fx;
2331 }

Referenced by applyDefaults(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setECTSGrades()

ilObjTest::setECTSGrades ( array  $a_ects_grades)

{

Parameters
array$grades
}

Implements ilEctsGradesEnabled.

Definition at line 2344 of file class.ilObjTest.php.

2345 {
2346 $this->ects_grades = $a_ects_grades;
2347 }

Referenced by applyDefaults(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setECTSOutput()

ilObjTest::setECTSOutput (   $a_ects_output)

{

Parameters
int | bool$status
}

Implements ilEctsGradesEnabled.

Definition at line 2312 of file class.ilObjTest.php.

2313 {
2314 $this->ects_output = $a_ects_output ? 1 : 0;
2315 }

Referenced by applyDefaults(), loadFromDb(), and setReportingDate().

+ Here is the caller graph for this function:

◆ setEnableArchiving()

ilObjTest::setEnableArchiving (   $enable_archiving)
Parameters
boolean$enable_archiving
Returns
$this

Definition at line 11843 of file class.ilObjTest.php.

11844 {
11845 $this->enable_archiving = $enable_archiving;
11846 return $this;
11847 }

References $enable_archiving.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setEnabledViewMode()

ilObjTest::setEnabledViewMode (   $mode)

Definition at line 10893 of file class.ilObjTest.php.

10893 {
10894 $this->enabled_view_mode = $mode;
10895 }

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setEnableExamview()

ilObjTest::setEnableExamview (   $enable_examview)
Parameters
boolean$enable_examview

Definition at line 11706 of file class.ilObjTest.php.

11707 {
11708 $this->enable_examview = $enable_examview;
11709 }

References $enable_examview.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setEnableProcessingTime()

ilObjTest::setEnableProcessingTime (   $enable = 0)

Sets the processing time enabled or disabled.

Parameters
integer$enable0 to disable the processing time, 1 to enable the processing time @access public
See also
$processing_time

Definition at line 3258 of file class.ilObjTest.php.

3259 {
3260 if ($enable) {
3261 $this->enable_processing_time = "1";
3262 } else {
3263 $this->enable_processing_time = "0";
3264 }
3265 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setEndingTime()

ilObjTest::setEndingTime (   $ending_time = NULL)

Sets the ending time in database timestamp format for the test.

Parameters
string$ending_timeThe ending time for the test. Empty string for no ending time. @access public
See also
$ending_time

Definition at line 3158 of file class.ilObjTest.php.

3159 {
3160 $this->ending_time = $ending_time;
3161 }

References $ending_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setEndingTimeEnabled()

ilObjTest::setEndingTimeEnabled (   $ending_time_enabled)
Parameters
boolean$ending_time_enabled

Definition at line 3134 of file class.ilObjTest.php.

3135 {
3136 $this->ending_time_enabled = $ending_time_enabled;
3137 }

References $ending_time_enabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setExportSettings()

ilObjTest::setExportSettings (   $a_settings)

Definition at line 10850 of file class.ilObjTest.php.

10851 {
10852 if ($a_settings)
10853 {
10854 $this->exportsettings = $a_settings;
10855 }
10856 else
10857 {
10858 $this->exportsettings = 0;
10859 }
10860 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setExportSettingsSingleChoiceShort()

ilObjTest::setExportSettingsSingleChoiceShort (   $a_settings)

Definition at line 10874 of file class.ilObjTest.php.

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()

References getExportSettingsSingleChoiceShort().

+ Here is the call graph for this function:

◆ setFinalStatement()

ilObjTest::setFinalStatement (   $a_statement = "")

Sets the final statement text of the ilObjTest object.

Parameters
string$a_statementA final statement @access public
See also
$_finalstatement

Definition at line 2116 of file class.ilObjTest.php.

2117 {
2118 $this->_finalstatement = $a_statement;
2119 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setFixedParticipants()

ilObjTest::setFixedParticipants (   $a_value = 1)

Sets the fixed participants status.

Parameters
integer$a_valueThe value for the fixed participants status (0 = don't allow, 1 = allow) @access public

Definition at line 9643 of file class.ilObjTest.php.

9644 {
9645 switch ($a_value)
9646 {
9647 case 1:
9648 $this->fixed_participants = 1;
9649 break;
9650 default:
9651 $this->fixed_participants = 0;
9652 break;
9653 }
9654 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setForceInstantFeedbackEnabled()

ilObjTest::setForceInstantFeedbackEnabled (   $forceInstantFeedbackEnabled)
Parameters
boolean$forceInstantFeedbackEnabled

Definition at line 12264 of file class.ilObjTest.php.

12265 {
12266 $this->forceInstantFeedbackEnabled = $forceInstantFeedbackEnabled;
12267 }

References $forceInstantFeedbackEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setForceJS()

ilObjTest::setForceJS (   $a_js = 1)

Set whether JavaScript should be forced for tests.

Parameters
integer$a_js1 to force JavaScript, 0 otherwise @access public
See also
$_forcejs

Definition at line 2140 of file class.ilObjTest.php.

2141 {
2142 $this->_forcejs = ($a_js) ? 1 : 0;
2143 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setGenericAnswerFeedback()

ilObjTest::setGenericAnswerFeedback (   $generic_answer_feedback = 0)

Sets if the generic feedback is to be shown in the test.

Parameters
int$generic_answer_feedback

Definition at line 2442 of file class.ilObjTest.php.

2443{
2444 switch ($generic_answer_feedback)
2445 {
2446 case 1:
2447 $this->answer_feedback = 1;
2448 break;
2449 default:
2450 $this->answer_feedback = 0;
2451 break;
2452 }
2453}

Referenced by setScoringFeedbackOptionsByArray().

+ 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 11280 of file class.ilObjTest.php.

11281 {
11282 $this->_highscore_achieved_ts = (bool)$a_achieved_ts;
11283 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setHighscoreAnon()

ilObjTest::setHighscoreAnon (   $a_anon)

Sets if the highscores should be anonymized.

Note: This setting will be overriden, if the test is globally anonymized.

Parameters
bool$a_anon

Definition at line 11236 of file class.ilObjTest.php.

11237 {
11238 $this->_highscore_anon = (bool)$a_anon;
11239 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setHighscoreEnabled()

ilObjTest::setHighscoreEnabled (   $a_enabled)

Sets if the highscore feature should be enabled.

Parameters
bool$a_enabled

Definition at line 11214 of file class.ilObjTest.php.

11215 {
11216 $this->_highscore_enabled = (bool)$a_enabled;
11217 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setHighscoreHints()

ilObjTest::setHighscoreHints (   $a_hints)

Sets if the number of requested hints should be shown.

Parameters
bool$a_hints

Definition at line 11340 of file class.ilObjTest.php.

11341 {
11342 $this->_highscore_hints = (bool)$a_hints;
11343 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setHighscoreMode()

ilObjTest::setHighscoreMode (   $mode)
Parameters
$modeint

Definition at line 11470 of file class.ilObjTest.php.

11471 {
11472 switch($mode)
11473 {
11475 $this->setHighscoreTopTable(1);
11476 $this->setHighscoreOwnTable(1);
11477 break;
11478
11480 $this->setHighscoreTopTable(1);
11481 $this->setHighscoreOwnTable(0);
11482 break;
11483
11485 default:
11486 $this->setHighscoreTopTable(0);
11487 $this->setHighscoreOwnTable(1);
11488 break;
11489 }
11490 }

References HIGHSCORE_SHOW_ALL_TABLES, HIGHSCORE_SHOW_OWN_TABLE, HIGHSCORE_SHOW_TOP_TABLE, setHighscoreOwnTable(), and setHighscoreTopTable().

+ Here is the call graph for this function:

◆ setHighscoreOwnTable()

ilObjTest::setHighscoreOwnTable (   $a_own_table)

Sets if the table with the own ranking should be shown.

Parameters
bool$a_own_tableTrue, if table with own ranking should be shown.

Definition at line 11380 of file class.ilObjTest.php.

11381 {
11382 $this->_highscore_own_table = (bool)$a_own_table;
11383 }

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setHighscoreMode().

+ Here is the caller graph for this function:

◆ setHighscorePercentage()

ilObjTest::setHighscorePercentage (   $a_percentage)

Sets if the percentages of the scores pass should be shown.

Parameters
bool$a_percentage

Definition at line 11320 of file class.ilObjTest.php.

11321 {
11322 $this->_highscore_percentage = (bool)$a_percentage;
11323 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setHighscoreScore()

ilObjTest::setHighscoreScore (   $a_score)

Sets if the actual score should be displayed.

Parameters
bool$a_score

Definition at line 11300 of file class.ilObjTest.php.

11301 {
11302 $this->_highscore_score = (bool)$a_score;
11303 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setHighscoreTopNum()

ilObjTest::setHighscoreTopNum (   $a_top_num)

Sets the number of entries which are to be shown in the top-rankings table.

Parameters
integer$a_top_numNumber of entries in the top-rankings table.

Definition at line 11421 of file class.ilObjTest.php.

11422 {
11423 $this->_highscore_top_num = (int)$a_top_num;
11424 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setHighscoreTopTable()

ilObjTest::setHighscoreTopTable (   $a_top_table)

Sets if the top-rankings table should be shown.

Parameters
bool$a_top_table

Definition at line 11400 of file class.ilObjTest.php.

11401 {
11402 $this->_highscore_top_table = (bool)$a_top_table;
11403 }

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setHighscoreMode().

+ Here is the caller graph for this function:

◆ setHighscoreWTime()

ilObjTest::setHighscoreWTime (   $a_wtime)

Sets if the workingtime of the scores should be shown.

Parameters
bool$a_wtime

Definition at line 11360 of file class.ilObjTest.php.

11361 {
11362 $this->_highscore_wtime = (bool)$a_wtime;
11363 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setInstantFeedbackAnswerFixationEnabled()

ilObjTest::setInstantFeedbackAnswerFixationEnabled (   $instantFeedbackAnswerFixationEnabled)

Definition at line 12243 of file class.ilObjTest.php.

12244 {
12245 $this->instantFeedbackAnswerFixationEnabled = $instantFeedbackAnswerFixationEnabled;
12246 }

References $instantFeedbackAnswerFixationEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ 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 @access public
See also
$instant_verification

Definition at line 2404 of file class.ilObjTest.php.

2405 {
2406 switch ($instant_feedback)
2407 {
2408 case 1:
2409 $this->instant_verification = 1;
2410 break;
2411 default:
2412 $this->instant_verification = 0;
2413 break;
2414 }
2415 }

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setScoringFeedbackOptionsByArray().

+ Here is the caller graph for this function:

◆ setIntroduction()

ilObjTest::setIntroduction (   $introduction = "")

Sets the introduction text of the ilObjTest object.

Parameters
string$introductionAn introduction string for the test @access public
See also
$introduction

Definition at line 2103 of file class.ilObjTest.php.

2104 {
2105 $this->introduction = $introduction;
2106 }

References $introduction.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setIntroductionEnabled()

ilObjTest::setIntroductionEnabled (   $introductionEnabled)
Parameters
boolean$introductionEnabled

Definition at line 2080 of file class.ilObjTest.php.

2081 {
2082 $this->introductionEnabled = $introductionEnabled;
2083 }

References $introductionEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setKiosk()

ilObjTest::setKiosk (   $kiosk = 0)

Sets the kiosk mode for the test.

Parameters
integer$kioskThe value for the kiosk mode. @access public
See also
$_kiosk

Definition at line 2742 of file class.ilObjTest.php.

2743 {
2744 $this->_kiosk = $kiosk;
2745 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setKioskMode()

ilObjTest::setKioskMode (   $a_kiosk = FALSE)

Sets the kiosk mode for the test.

Parameters
boolean$kioskThe value for the kiosk mode @access public
See also
$_kiosk

Definition at line 2773 of file class.ilObjTest.php.

2774 {
2775 if ($a_kiosk)
2776 {
2777 $this->_kiosk = $this->_kiosk | 1;
2778 }
2779 else
2780 {
2781 if ($this->getKioskMode())
2782 {
2783 $this->_kiosk = $this->_kiosk ^ 1;
2784 }
2785 }
2786 }
getKioskMode()
Returns the kiosk mode.

References getKioskMode().

+ Here is the call graph for this function:

◆ setLimitUsersEnabled()

ilObjTest::setLimitUsersEnabled (   $limitUsersEnabled)
Parameters
boolean$limitUsersEnabled

Definition at line 9310 of file class.ilObjTest.php.

9311 {
9312 $this->limitUsersEnabled = $limitUsersEnabled;
9313 }

References $limitUsersEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setListOfQuestions()

ilObjTest::setListOfQuestions (   $a_value = TRUE)

Sets if the the list of questions should be presented to the user or not.

Parameters
boolean$a_valueTRUE if the list of questions should be presented, FALSE otherwise @access public

Definition at line 8807 of file class.ilObjTest.php.

8808 {
8809 if ($a_value)
8810 {
8811 $this->show_summary = 1;
8812 }
8813 else
8814 {
8815 $this->show_summary = 0;
8816 }
8817 }

◆ setListOfQuestionsDescription()

ilObjTest::setListOfQuestionsDescription (   $a_value = TRUE)

Sets the show_summary attribute to TRUE if the list of questions should be presented with the question descriptions.

Parameters
boolean$a_valueTRUE if the list of questions should be shown with question descriptions, FALSE otherwise @access public

Definition at line 8921 of file class.ilObjTest.php.

8922 {
8923 if ($a_value && $this->getListOfQuestions())
8924 {
8925 $this->show_summary = $this->show_summary | 8;
8926 }
8927 if (!$a_value && $this->getListOfQuestions())
8928 {
8929 if ($this->getListOfQuestionsDescription())
8930 {
8931 $this->show_summary = $this->show_summary ^ 8;
8932 }
8933 }
8934 }
getListOfQuestions()
Returns if the list of questions should be presented to the user or not.
getListOfQuestionsDescription()
Returns TRUE if the list of questions should be presented with the question descriptions.

References getListOfQuestions(), and getListOfQuestionsDescription().

+ Here is the call graph for this function:

◆ setListOfQuestionsEnd()

ilObjTest::setListOfQuestionsEnd (   $a_value = TRUE)

Sets if the the list of questions as the end page of the test.

Parameters
boolean$a_valueTRUE if the list of questions should be the end page, FALSE otherwise @access public

Definition at line 8882 of file class.ilObjTest.php.

8883 {
8884 if ($a_value && $this->getListOfQuestions())
8885 {
8886 $this->show_summary = $this->show_summary | 4;
8887 }
8888 if (!$a_value && $this->getListOfQuestions())
8889 {
8890 if ($this->getListOfQuestionsEnd())
8891 {
8892 $this->show_summary = $this->show_summary ^ 4;
8893 }
8894 }
8895 }
getListOfQuestionsEnd()
Returns if the list of questions should be presented as the last page of the test.

References getListOfQuestions(), and getListOfQuestionsEnd().

+ Here is the call graph for this function:

◆ setListOfQuestionsSettings()

ilObjTest::setListOfQuestionsSettings (   $a_value = 0)

Sets the settings for the list of questions options in the test properties This could contain one of the following values: 0 = No list of questions offered 1 = A list of questions is offered 3 = A list of questions is offered and the list of questions is shown as first page of the test 5 = A list of questions is offered and the list of questions is shown as last page of the test 7 = A list of questions is offered and the list of questions is shown as first and last page of the test.

Parameters
integer$a_value0, 1, 3, 5 or 7 @access public

Definition at line 8778 of file class.ilObjTest.php.

8779 {
8780 $this->show_summary = $a_value;
8781 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setListOfQuestionsStart()

ilObjTest::setListOfQuestionsStart (   $a_value = TRUE)

Sets if the the list of questions as the start page of the test.

Parameters
boolean$a_valueTRUE if the list of questions should be the start page, FALSE otherwise @access public

Definition at line 8843 of file class.ilObjTest.php.

8844 {
8845 if ($a_value && $this->getListOfQuestions())
8846 {
8847 $this->show_summary = $this->show_summary | 2;
8848 }
8849 if (!$a_value && $this->getListOfQuestions())
8850 {
8851 if ($this->getListOfQuestionsStart())
8852 {
8853 $this->show_summary = $this->show_summary ^ 2;
8854 }
8855 }
8856 }
getListOfQuestionsStart()
Returns if the list of questions should be presented as the first page of the test.

References getListOfQuestions(), and getListOfQuestionsStart().

+ Here is the call graph for this function:

◆ setMailNotification()

ilObjTest::setMailNotification (   $a_notification)

Set mail notification settings.

Parameters
$a_notificationMail notification setting

Definition at line 10655 of file class.ilObjTest.php.

10656 {
10657 $this->mailnotification = $a_notification;
10658 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setMailNotificationType()

ilObjTest::setMailNotificationType (   $a_type)

Definition at line 10826 of file class.ilObjTest.php.

10827 {
10828 if ($a_type == 1)
10829 {
10830 $this->mailnottype = 1;
10831 }
10832 else
10833 {
10834 $this->mailnottype = 0;
10835 }
10836 }
$a_type
Definition: workflow.php:93

References $a_type.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setMCScoring()

ilObjTest::setMCScoring (   $a_mc_scoring = SCORE_ZERO_POINTS_WHEN_UNANSWERED)

Sets the multiple choice scoring.

Parameters
integer$a_mc_scoringThe scoring for multiple choice questions @access public
See also
$mc_scoring

Definition at line 3357 of file class.ilObjTest.php.

3358 {
3359 $this->mc_scoring = $a_mc_scoring;
3360 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setNrOfTries()

ilObjTest::setNrOfTries (   $nr_of_tries = 0)

Sets the nr of tries for the test.

Parameters
integer$nr_of_triesThe maximum number of tries for the test. 0 for infinite tries. @access public
See also
$nr_of_tries

Definition at line 3170 of file class.ilObjTest.php.

3171 {
3172 $this->nr_of_tries = $nr_of_tries;
3173 }

References $nr_of_tries.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setObligationsEnabled()

ilObjTest::setObligationsEnabled (   $obligationsEnabled = true)

sets obligations enabled/disabled

Parameters
boolean$obligationsEnabled

Definition at line 11522 of file class.ilObjTest.php.

11523 {
11524 $this->obligationsEnabled = (bool)$obligationsEnabled;
11525 }

References $obligationsEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setOfferingQuestionHintsEnabled()

ilObjTest::setOfferingQuestionHintsEnabled (   $offeringQuestionHintsEnabled)

sets offering question hints enabled/disabled

Parameters
boolean$offeringQuestionHintsEnabled

Definition at line 11182 of file class.ilObjTest.php.

11183 {
11184 $this->offeringQuestionHintsEnabled = (bool)$offeringQuestionHintsEnabled;
11185 }

References $offeringQuestionHintsEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setOldOnlineStatus()

ilObjTest::setOldOnlineStatus (   $oldOnlineStatus)
Parameters
null$oldOnlineStatus

Definition at line 11152 of file class.ilObjTest.php.

11153 {
11154 $this->oldOnlineStatus = $oldOnlineStatus;
11155 }

References $oldOnlineStatus.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setOnline()

ilObjTest::setOnline (   $a_online = true)

Definition at line 11136 of file class.ilObjTest.php.

11137 {
11138 $this->online = (bool)$a_online;
11139 }

Referenced by ilTestImporter\importQuestionSkillAssignments(), ilTestImporter\importSkillLevelThresholds(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setPassDeletionAllowed()

ilObjTest::setPassDeletionAllowed (   $passDeletionAllowed)

setter for the test setting passDeletionAllowed

Returns
integer

Definition at line 11665 of file class.ilObjTest.php.

11666 {
11667 $this->passDeletionAllowed = (bool)$passDeletionAllowed;
11668 }

References $passDeletionAllowed.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setPassScoring()

ilObjTest::setPassScoring (   $a_pass_scoring = SCORE_LAST_PASS)

Sets the pass scoring.

Parameters
integer$a_pass_scoringThe pass scoring type @access public
See also
$pass_scoring

Definition at line 3369 of file class.ilObjTest.php.

3370 {
3371 switch ($a_pass_scoring)
3372 {
3373 case SCORE_BEST_PASS:
3374 $this->pass_scoring = SCORE_BEST_PASS;
3375 break;
3376 default:
3377 $this->pass_scoring = SCORE_LAST_PASS;
3378 break;
3379 }
3380 }

References SCORE_BEST_PASS, and SCORE_LAST_PASS.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setPassWaiting()

ilObjTest::setPassWaiting (   $pass_waiting)
Parameters
string$pass_waitingmm:ddd:hh:ii:ss

Definition at line 3393 of file class.ilObjTest.php.

3394 {
3395 $this->pass_waiting = $pass_waiting;
3396 }

References $pass_waiting.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setPassword()

ilObjTest::setPassword (   $a_password = NULL)

Sets the password for test access.

Parameters
string$a_passwordThe password for test access @access public
See also
$password

Definition at line 3333 of file class.ilObjTest.php.

3334 {
3335 $this->password = $a_password;
3336 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setPasswordEnabled()

ilObjTest::setPasswordEnabled (   $passwordEnabled)
Parameters
boolean$passwordEnabled

Definition at line 3309 of file class.ilObjTest.php.

3310 {
3311 $this->passwordEnabled = $passwordEnabled;
3312 }

References $passwordEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setPoolUsage()

ilObjTest::setPoolUsage (   $usage)

Definition at line 10993 of file class.ilObjTest.php.

10993 {
10994 $this->poolUsage = (boolean)$usage;
10995 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setPostponingEnabled()

ilObjTest::setPostponingEnabled (   $postponingEnabled)
Parameters
bool$postponingEnabled

Definition at line 2380 of file class.ilObjTest.php.

2381 {
2382 $this->setSequenceSettings((int)$postponingEnabled);
2383 }

References setSequenceSettings().

+ Here is the call graph for this function:

◆ setPrintBestSolutionWithResult()

ilObjTest::setPrintBestSolutionWithResult (   $status)

Definition at line 11157 of file class.ilObjTest.php.

11158 {
11159 $this->print_best_solution_with_result = (bool) $status;
11160 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setProcessingTime()

ilObjTest::setProcessingTime (   $processing_time = "00:00:00")

Sets the processing time for the test.

Parameters
string$processing_timeThe maximum processing time for the test given in hh:mm:ss @access public
See also
$processing_time

Definition at line 3241 of file class.ilObjTest.php.

3241 :00:00")
3242 {
3243 $this->processing_time = $processing_time;
3244 }

References $processing_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setProcessingTimeByMinutes()

ilObjTest::setProcessingTimeByMinutes (   $minutes)

Definition at line 3246 of file class.ilObjTest.php.

3247 {
3248 $this->processing_time = sprintf("%02d:%02d:00", floor($minutes/60), $minutes%60);
3249 }

References sprintf.

◆ setQuestionOrderAndObligations()

ilObjTest::setQuestionOrderAndObligations (   $orders,
  $obligations 
)

Definition at line 11013 of file class.ilObjTest.php.

11014 {
11015 global $ilDB;
11016
11017 asort($orders);
11018
11019 $i = 0;
11020
11021 foreach($orders as $id => $position)
11022 {
11023 $i++;
11024
11025 $obligatory = (
11026 isset($obligations[$id]) && $obligations[$id] ? 1 : 0
11027 );
11028
11029 $query = "
11030 UPDATE tst_test_question
11031 SET sequence = %s,
11032 obligatory = %s
11033 WHERE question_fi = %s
11034 ";
11035
11036 $ilDB->manipulateF(
11037 $query, array('integer', 'integer', 'integer'), array($i, $obligatory, $id)
11038 );
11039 }
11040
11041 $this->loadQuestions();
11042 }

References ilObject\$id, $ilDB, $query, and loadQuestions().

+ Here is the call graph for this function:

◆ setQuestionSetSolved()

ilObjTest::setQuestionSetSolved (   $value,
  $question_id,
  $user_id 
)

sets question solved state to value for given user_id

Definition at line 7970 of file class.ilObjTest.php.

7971 {
7972 global $ilDB;
7973
7974 $active_id = $this->getActiveIdOfUser($user_id);
7975 $affectedRows = $ilDB->manipulateF("DELETE FROM tst_qst_solved WHERE active_fi = %s AND question_fi = %s",
7976 array('integer', 'integer'),
7977 array($active_id, $question_id)
7978 );
7979 $affectedRows = $ilDB->manipulateF("INSERT INTO tst_qst_solved (solved, question_fi, active_fi) VALUES (%s, %s, %s)",
7980 array('integer', 'integer', 'integer'),
7981 array($value, $question_id, $active_id)
7982 );
7983 }

References $ilDB, and getActiveIdOfUser().

+ Here is the call graph for this function:

◆ setQuestionSetType()

ilObjTest::setQuestionSetType (   $questionSetType)

setter for question set type

Parameters
string$questionSetType

Definition at line 12005 of file class.ilObjTest.php.

12006 {
12007 $this->questionSetType = $questionSetType;
12008 }

References $questionSetType.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setRedirectionMode()

ilObjTest::setRedirectionMode (   $redirection_mode = 0)

Definition at line 3194 of file class.ilObjTest.php.

3195 {
3196 $this->redirection_mode = $redirection_mode;
3197 }

References $redirection_mode.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setRedirectionUrl()

ilObjTest::setRedirectionUrl (   $redirection_url = NULL)

Definition at line 3202 of file class.ilObjTest.php.

3203 {
3204 $this->redirection_url = $redirection_url;
3205 }

References $redirection_url.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setReportingDate()

ilObjTest::setReportingDate (   $reporting_date)

Sets the reporting date of the ilObjTest object.

Parameters
timestamp$reporting_dateThe date and time the score reporting is available

Definition at line 2479 of file class.ilObjTest.php.

2480 {
2481 if(!$reporting_date)
2482 {
2483 $this->reporting_date = '';
2484 $this->setECTSOutput(false);
2485 }
2486 else
2487 {
2488 $this->reporting_date = $reporting_date;
2489 }
2490 }

References $reporting_date, and setECTSOutput().

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setResetProcessingTime()

ilObjTest::setResetProcessingTime (   $reset = 0)

Sets wheather the processing time should be reset or not.

Parameters
integer$reset1 to reset the processing time, 0 otherwise @access public
See also
$processing_time

Definition at line 3274 of file class.ilObjTest.php.

3275 {
3276 if ($reset)
3277 {
3278 $this->reset_processing_time = 1;
3279 }
3280 else
3281 {
3282 $this->reset_processing_time = 0;
3283 }
3284 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setResultFilterTaxIds()

ilObjTest::setResultFilterTaxIds (   $resultFilterTaxIds)

Definition at line 12182 of file class.ilObjTest.php.

12183 {
12184 $this->resultFilterTaxIds = $resultFilterTaxIds;
12185 }

References $resultFilterTaxIds.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setResultsPresentation()

ilObjTest::setResultsPresentation (   $a_results_presentation = 3)

Sets the combined results presentation value.

Parameters
integer$a_results_presentationThe combined results presentation value @access public

Definition at line 9093 of file class.ilObjTest.php.

9094 {
9095 $this->results_presentation = $a_results_presentation;
9096 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setResultsPresentationOptionsByArray()

ilObjTest::setResultsPresentationOptionsByArray (   $options)

Definition at line 10969 of file class.ilObjTest.php.

10969 {
10970 $setter = array(
10971 'pass_details' => 'setShowPassDetails',
10972 'solution_details' => 'setShowSolutionDetails',
10973 'solution_printview' => 'setShowSolutionPrintview',
10974 'solution_feedback' => 'setShowSolutionFeedback',
10975 'solution_answers_only' => 'setShowSolutionAnswersOnly',
10976 'solution_signature' => 'setShowSolutionSignature',
10977 'solution_suggested' => 'setShowSolutionSuggested',
10978 );
10979 foreach($setter as $key => $setter) {
10980 if (in_array($key, $options)) {
10981 $this->$setter(1);
10982 }
10983 else {
10984 $this->$setter(0);
10985 }
10986 }
10987 }
if(!is_array($argv)) $options

References $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 @access public
See also
$score_cutting

Definition at line 3345 of file class.ilObjTest.php.

3346 {
3347 $this->score_cutting = $a_score_cutting;
3348 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setScoreReporting()

ilObjTest::setScoreReporting (   $score_reporting = 0)

Sets the score reporting of the ilObjTest object.

Parameters
integer$score_reportingThe score reporting @access public
See also
$score_reporting

Definition at line 2392 of file class.ilObjTest.php.

2393 {
2394 $this->score_reporting = $score_reporting;
2395 }

References $score_reporting.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setScoringFeedbackOptionsByArray()

ilObjTest::setScoringFeedbackOptionsByArray (   $options)

Definition at line 10951 of file class.ilObjTest.php.

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 }
10960 else
10961 {
10962 $this->setGenericAnswerFeedback(0);
10963 $this->setSpecificAnswerFeedback(0);
10964 $this->setAnswerFeedbackPoints(0);
10966 }
10967 }
setGenericAnswerFeedback($generic_answer_feedback=0)
Sets if the generic feedback is to be shown in the test.

References $options, setAnswerFeedbackPoints(), setGenericAnswerFeedback(), setInstantFeedbackSolution(), and setSpecificAnswerFeedback().

+ 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 2364 of file class.ilObjTest.php.

2365 {
2366 $this->sequence_settings = $sequence_settings;
2367 }

References $sequence_settings.

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setPostponingEnabled().

+ Here is the caller graph for this function:

◆ setShowCancel()

ilObjTest::setShowCancel (   $a_value = 1)

Sets the cancel test button status.

Parameters
integer$a_valueThe value for the cancel test status (0 = don't show, 1 = show) @access public

Definition at line 9583 of file class.ilObjTest.php.

9584 {
9585 switch ($a_value)
9586 {
9587 case 1:
9588 $this->show_cancel = 1;
9589 break;
9590 default:
9591 $this->show_cancel = 0;
9592 break;
9593 }
9594 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowExamIdInTestPassEnabled()

ilObjTest::setShowExamIdInTestPassEnabled (   $show_exam_id_in_test_pass_enabled)

Definition at line 11925 of file class.ilObjTest.php.

11926 {
11927 $this->show_exam_id_in_test_pass_enabled = $show_exam_id_in_test_pass_enabled;
11928 }

References $show_exam_id_in_test_pass_enabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowExamIdInTestResultsEnabled()

ilObjTest::setShowExamIdInTestResultsEnabled (   $show_exam_id_in_test_results_enabled)
Parameters
boolean$show_exam_id

Definition at line 11938 of file class.ilObjTest.php.

11939 {
11940 $this->show_exam_id_in_test_results_enabled = $show_exam_id_in_test_results_enabled;
11941 }

References $show_exam_id_in_test_results_enabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowExamviewHtml()

ilObjTest::setShowExamviewHtml (   $show_examview_html)
Parameters
boolean$show_examview_html

Definition at line 11674 of file class.ilObjTest.php.

11675 {
11676 $this->show_examview_html = $show_examview_html;
11677 }

References $show_examview_html.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowExamviewPdf()

ilObjTest::setShowExamviewPdf (   $show_examview_pdf)
Parameters
boolean$show_examview_pdf

Definition at line 11690 of file class.ilObjTest.php.

11691 {
11692 $this->show_examview_pdf = $show_examview_pdf;
11693 }

References $show_examview_pdf.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowFinalStatement()

ilObjTest::setShowFinalStatement (   $show = 0)

Sets whether the final statement should be shown or not.

Parameters
integer$show1 if TRUE or 0 if FALSE @access public
See also
$_finalstatement

Definition at line 2237 of file class.ilObjTest.php.

2238 {
2239 $this->_showfinalstatement = ($show) ? 1 : 0;
2240 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowGradingMarkEnabled()

ilObjTest::setShowGradingMarkEnabled (   $showGradingMarkEnabled)

Definition at line 12232 of file class.ilObjTest.php.

12233 {
12234 $this->showGradingMarkEnabled = $showGradingMarkEnabled;
12235 }

References $showGradingMarkEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowGradingStatusEnabled()

ilObjTest::setShowGradingStatusEnabled (   $showGradingStatusEnabled)

Definition at line 12222 of file class.ilObjTest.php.

12223 {
12224 $this->showGradingStatusEnabled = $showGradingStatusEnabled;
12225 }

References $showGradingStatusEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowInfo()

ilObjTest::setShowInfo (   $a_info = 1)

Set whether the complete information page is shown or the required data only.

Parameters
integer$a_info1 for the complete information, 0 otherwise @access public
See also
$_showinfo

Definition at line 2128 of file class.ilObjTest.php.

2129 {
2130 $this->_showinfo = ($a_info) ? 1 : 0;
2131 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowKioskModeParticipant()

ilObjTest::setShowKioskModeParticipant (   $a_participant = FALSE)

Set to true, if the participant's name should be shown in kiosk mode.

Parameters
boolean$a_titleTRUE if the participant's name should be shown in kiosk mode, FALSE otherwise @access public

Definition at line 2853 of file class.ilObjTest.php.

2854 {
2855 if ($a_participant)
2856 {
2857 $this->_kiosk = $this->_kiosk | 4;
2858 }
2859 else
2860 {
2861 if ($this->getShowKioskModeParticipant())
2862 {
2863 $this->_kiosk = $this->_kiosk ^ 4;
2864 }
2865 }
2866 }
getShowKioskModeParticipant()
Returns the status of the kiosk mode participant.

References getShowKioskModeParticipant().

+ Here is the call graph for this function:

◆ setShowKioskModeTitle()

ilObjTest::setShowKioskModeTitle (   $a_title = FALSE)

Set to true, if the full test title should be shown in kiosk mode.

Parameters
boolean$a_titleTRUE if the test title should be shown in kiosk mode, FALSE otherwise @access public

Definition at line 2813 of file class.ilObjTest.php.

2814 {
2815 if ($a_title)
2816 {
2817 $this->_kiosk = $this->_kiosk | 2;
2818 }
2819 else
2820 {
2821 if ($this->getShowKioskModeTitle())
2822 {
2823 $this->_kiosk = $this->_kiosk ^ 2;
2824 }
2825 }
2826 }
getShowKioskModeTitle()
Returns the status of the kiosk mode title.

References getShowKioskModeTitle().

+ Here is the call graph for this function:

◆ setShowMarker()

ilObjTest::setShowMarker (   $a_value = 1)

Sets the marker button status.

Parameters
integer$a_valueThe value for the marker status (0 = don't show, 1 = show) @access public

Definition at line 9613 of file class.ilObjTest.php.

9614 {
9615 switch ($a_value)
9616 {
9617 case 1:
9618 $this->show_marker = 1;
9619 break;
9620 default:
9621 $this->show_marker = 0;
9622 break;
9623 }
9624 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setShowPassDetails()

ilObjTest::setShowPassDetails (   $a_details = 1)

Sets if the pass details should be shown when a test is not finished.

Sets if the pass details should be shown when a test is not finished

Parameters
boolean$a_detailsTRUE if the pass details should be shown, FALSE otherwise @access public

Definition at line 9106 of file class.ilObjTest.php.

9107 {
9108 if ($a_details)
9109 {
9110 $this->results_presentation = $this->results_presentation | 1;
9111 }
9112 else
9113 {
9114 if ($this->getShowPassDetails())
9115 {
9116 $this->results_presentation = $this->results_presentation ^ 1;
9117 }
9118 }
9119 }
getShowPassDetails()
Returns if the pass details should be shown when a test is not finished.

References getShowPassDetails().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setShowSolutionAnswersOnly()

ilObjTest::setShowSolutionAnswersOnly (   $a_full = TRUE)

Set to true, if the full solution (including the ILIAS content pages) should be shown in the solution output.

Parameters
boolean$a_fullTRUE if the full solution should be shown in the solution output, FALSE otherwise @access public

Definition at line 9201 of file class.ilObjTest.php.

9202 {
9203 if ($a_full)
9204 {
9205 $this->results_presentation = $this->results_presentation | 16;
9206 }
9207 else
9208 {
9209 if ($this->getShowSolutionAnswersOnly())
9210 {
9211 $this->results_presentation = $this->results_presentation ^ 16;
9212 }
9213 }
9214 }
getShowSolutionAnswersOnly()
Returns if the full solution (including ILIAS content) should be presented to the solution or not.

References getShowSolutionAnswersOnly().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setShowSolutionDetails()

ilObjTest::setShowSolutionDetails (   $a_details = 1)

Sets if the the solution details should be presented to the user or not.

Parameters
integer$a_details1 if the solution details should be presented, 0 otherwise @access public

Definition at line 9127 of file class.ilObjTest.php.

9128 {
9129 if ($a_details)
9130 {
9131 $this->results_presentation = $this->results_presentation | 2;
9132 }
9133 else
9134 {
9135 if ($this->getShowSolutionDetails())
9136 {
9137 $this->results_presentation = $this->results_presentation ^ 2;
9138 }
9139 }
9140 }
getShowSolutionDetails()
Returns if the solution details should be presented to the user or not.

References getShowSolutionDetails().

Referenced by __construct(), and fromXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setShowSolutionFeedback()

ilObjTest::setShowSolutionFeedback (   $a_feedback = TRUE)

Sets if the the feedback should be presented to the user in the solution or not.

Parameters
boolean$a_feedbackTRUE if the feedback should be presented in the solution, FALSE otherwise @access public

Definition at line 9180 of file class.ilObjTest.php.

9181 {
9182 if ($a_feedback)
9183 {
9184 $this->results_presentation = $this->results_presentation | 8;
9185 }
9186 else
9187 {
9188 if ($this->getShowSolutionFeedback())
9189 {
9190 $this->results_presentation = $this->results_presentation ^ 8;
9191 }
9192 }
9193 }
getShowSolutionFeedback()
Returns if the feedback should be presented to the solution or not.

References getShowSolutionFeedback().

+ Here is the call graph for this function:

◆ setShowSolutionListComparison()

ilObjTest::setShowSolutionListComparison (   $a_comparison = FALSE)

Set to TRUE, if the list of answers should be shown prior to finish the test.

Parameters
boolean$a_comparisonTRUE if the list of answers should be shown prior to finish the test, FALSE otherwise

Definition at line 9263 of file class.ilObjTest.php.

9264 {
9265 if($a_comparison)
9266 {
9267 $this->results_presentation = $this->results_presentation | 128;
9268 }
9269 else
9270 {
9272 {
9273 $this->results_presentation = $this->results_presentation ^ 128;
9274 }
9275 }
9276 }
getShowSolutionListComparison()

References getShowSolutionListComparison().

+ Here is the call graph for this function:

◆ setShowSolutionPrintview()

ilObjTest::setShowSolutionPrintview (   $a_printview = 1)

Sets if the the solution printview should be presented to the user or not.

Parameters
boolean$a_detailsTRUE if the solution printview should be presented, FALSE otherwise @access public

Definition at line 9159 of file class.ilObjTest.php.

9160 {
9161 if ($a_printview)
9162 {
9163 $this->results_presentation = $this->results_presentation | 4;
9164 }
9165 else
9166 {
9167 if ($this->getShowSolutionPrintview())
9168 {
9169 $this->results_presentation = $this->results_presentation ^ 4;
9170 }
9171 }
9172 }

References getShowSolutionPrintview().

Referenced by fromXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setShowSolutionSignature()

ilObjTest::setShowSolutionSignature (   $a_signature = FALSE)

Set to TRUE, if the signature field should be shown in the solution.

Parameters
boolean$a_signatureTRUE if the signature field should be shown, FALSE otherwise @access public

Definition at line 9222 of file class.ilObjTest.php.

9223 {
9224 if ($a_signature)
9225 {
9226 $this->results_presentation = $this->results_presentation | 32;
9227 }
9228 else
9229 {
9230 if ($this->getShowSolutionSignature())
9231 {
9232 $this->results_presentation = $this->results_presentation ^ 32;
9233 }
9234 }
9235 }
getShowSolutionSignature()
Returns if the signature field should be shown in the test results.

References getShowSolutionSignature().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setShowSolutionSuggested()

ilObjTest::setShowSolutionSuggested (   $a_solution = FALSE)

Set to TRUE, if the suggested solution should be shown in the solution.

Parameters
boolean$a_solutionTRUE if the suggested solution should be shown, FALSE otherwise @access public

Definition at line 9243 of file class.ilObjTest.php.

9244 {
9245 if ($a_solution)
9246 {
9247 $this->results_presentation = $this->results_presentation | 64;
9248 }
9249 else
9250 {
9251 if ($this->getShowSolutionSuggested())
9252 {
9253 $this->results_presentation = $this->results_presentation ^ 64;
9254 }
9255 }
9256 }

References getShowSolutionSuggested().

+ Here is the call graph for this function:

◆ setShuffleQuestions()

ilObjTest::setShuffleQuestions (   $a_shuffle)

Sets the status of the shuffle_questions variable.

Parameters
boolean$a_shuffle0 if the test questions are not shuffled, 1 if the test questions are shuffled @access public

Definition at line 8744 of file class.ilObjTest.php.

8745 {
8746 $this->shuffle_questions = ($a_shuffle) ? 1 : 0;
8747 }

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setSignSubmission()

ilObjTest::setSignSubmission (   $sign_submission)
Parameters
boolean$sign_submission

Definition at line 11954 of file class.ilObjTest.php.

11955 {
11956 $this->sign_submission = $sign_submission;
11957 }

References $sign_submission.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setSkillServiceEnabled()

ilObjTest::setSkillServiceEnabled (   $skillServiceEnabled)

Definition at line 12172 of file class.ilObjTest.php.

12173 {
12174 $this->skillServiceEnabled = $skillServiceEnabled;
12175 }

References $skillServiceEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setSpecificAnswerFeedback()

ilObjTest::setSpecificAnswerFeedback (   $specific_answer_feedback)

Definition at line 11493 of file class.ilObjTest.php.

11494 {
11495 switch ($specific_answer_feedback)
11496 {
11497 case 1:
11498 $this->specific_answer_feedback = 1;
11499 break;
11500 default:
11501 $this->specific_answer_feedback = 0;
11502 break;
11503 }
11504 }

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setScoringFeedbackOptionsByArray().

+ Here is the caller graph for this function:

◆ setStartingTime()

ilObjTest::setStartingTime (   $starting_time = NULL)

Sets the starting time in database timestamp format for the test.

Parameters
string$starting_timeThe starting time for the test. Empty string for no starting time. @access public
See also
$starting_time

Definition at line 3118 of file class.ilObjTest.php.

3119 {
3120 $this->starting_time = $starting_time;
3121 }

References $starting_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setStartingTimeEnabled()

ilObjTest::setStartingTimeEnabled (   $starting_time_enabled)
Parameters
boolean$starting_time_enabled

Definition at line 3094 of file class.ilObjTest.php.

3095 {
3096 $this->starting_time_enabled = $starting_time_enabled;
3097 }

References $starting_time_enabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setTemplate()

ilObjTest::setTemplate (   $template_id)

Definition at line 10897 of file class.ilObjTest.php.

10897 {
10898 $this->template_id = (int)$template_id;
10899 }

References $template_id.

Referenced by ilLOEditorGUI\applySettingsTemplate(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setTestFinalBroken()

ilObjTest::setTestFinalBroken (   $testFinalBroken)
Parameters
boolean$testFinalBroken

Definition at line 12339 of file class.ilObjTest.php.

12340 {
12341 $this->testFinalBroken = $testFinalBroken;
12342 }

References $testFinalBroken.

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setTestId()

ilObjTest::setTestId (   $a_id)

Sets the test ID.

Parameters
integer$a_idTest ID

Definition at line 10341 of file class.ilObjTest.php.

10342 {
10343 $this->test_id = $a_id;
10344 }

Referenced by loadFromDb().

+ Here is the caller graph for this function:

◆ setTitleOutput()

ilObjTest::setTitleOutput (   $title_output = 0)

Sets the status of the title output.

Parameters
integer$title_output0 for full title, 1 for title without points, 2 for no title @access public
See also
$title_output

Definition at line 3218 of file class.ilObjTest.php.

3219 {
3220 switch ($title_output)
3221 {
3222 case 1:
3223 $this->title_output = 1;
3224 break;
3225 case 2:
3226 $this->title_output = 2;
3227 break;
3228 default:
3229 $this->title_output = 0;
3230 break;
3231 }
3232 }

References $title_output.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ setTmpCopyWizardCopyId()

ilObjTest::setTmpCopyWizardCopyId (   $tmpCopyWizardCopyId)
Parameters
int$tmpCopyWizardCopyId

Definition at line 730 of file class.ilObjTest.php.

731 {
732 $this->tmpCopyWizardCopyId = $tmpCopyWizardCopyId;
733 }

References $tmpCopyWizardCopyId.

◆ setUsePreviousAnswers()

ilObjTest::setUsePreviousAnswers (   $use_previous_answers = 1)

Sets the status of the visibility of previous learner answers.

Parameters
integer$use_previous_answers1 if the previous answers should be shown @access public
See also
$use_previous_answers

Definition at line 3182 of file class.ilObjTest.php.

3183 {
3185 {
3186 $this->use_previous_answers = 1;
3187 }
3188 else
3189 {
3190 $this->use_previous_answers = 0;
3191 }
3192 }

References $use_previous_answers.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

+ Here is the caller graph for this function:

◆ startingTimeReached()

ilObjTest::startingTimeReached ( )

Returns true if the starting time of a test is reached A starting time is not available for self assessment tests.

Returns
boolean true if the starting time is reached, otherwise false @access public

Definition at line 5632 of file class.ilObjTest.php.

5633 {
5634 if( $this->isStartingTimeEnabled() && $this->getStartingTime() != 0 )
5635 {
5636 $now = time();
5637 if ($now < $this->getStartingTime())
5638 {
5639 return false;
5640 }
5641 }
5642 return true;
5643 }

References getStartingTime(), and isStartingTimeEnabled().

Referenced by isExecutable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ startWorkingTime()

ilObjTest::startWorkingTime (   $active_id,
  $pass 
)

Write the initial entry for the tests working time to the database.

Parameters
integer$user_idThe database id of the user working with the test @access public

Definition at line 3899 of file class.ilObjTest.php.

3900 {
3901 global $ilDB;
3902
3903 $next_id = $ilDB->nextId('tst_times');
3904 $affectedRows = $ilDB->manipulateF("INSERT INTO tst_times (times_id, active_fi, started, finished, pass, tstamp) VALUES (%s, %s, %s, %s, %s, %s)",
3905 array('integer', 'integer', 'timestamp', 'timestamp', 'integer', 'integer'),
3906 array($next_id, $active_id, strftime("%Y-%m-%d %H:%M:%S"), strftime("%Y-%m-%d %H:%M:%S"), $pass, time())
3907 );
3908 return $next_id;
3909 }

References $ilDB, and $pass.

◆ toXML()

ilObjTest::toXML ( )

Returns a QTI xml representation of the test.

Returns
string The QTI xml representation of the test

Definition at line 6179 of file class.ilObjTest.php.

6180 {
6181 include_once("./Services/Xml/classes/class.ilXmlWriter.php");
6182 $a_xml_writer = new ilXmlWriter;
6183 // set xml header
6184 $a_xml_writer->xmlHeader();
6185 $a_xml_writer->xmlSetDtdDef("<!DOCTYPE questestinterop SYSTEM \"ims_qtiasiv1p2p1.dtd\">");
6186 $a_xml_writer->xmlStartTag("questestinterop");
6187
6188 $attrs = array(
6189 "ident" => "il_".IL_INST_ID."_tst_".$this->getTestId(),
6190 "title" => $this->getTitle()
6191 );
6192 $a_xml_writer->xmlStartTag("assessment", $attrs);
6193 // add qti comment
6194 $a_xml_writer->xmlElement("qticomment", NULL, $this->getDescription());
6195
6196 // add qti duration
6197 if ($this->enable_processing_time)
6198 {
6199 preg_match("/(\d+):(\d+):(\d+)/", $this->processing_time, $matches);
6200 $a_xml_writer->xmlElement("duration", NULL, sprintf("P0Y0M0DT%dH%dM%dS", $matches[1], $matches[2], $matches[3]));
6201 }
6202
6203 // add the rest of the preferences in qtimetadata tags, because there is no correspondent definition in QTI
6204 $a_xml_writer->xmlStartTag("qtimetadata");
6205 $a_xml_writer->xmlStartTag("qtimetadatafield");
6206 $a_xml_writer->xmlElement("fieldlabel", NULL, "ILIAS_VERSION");
6207 $a_xml_writer->xmlElement("fieldentry", NULL, $this->ilias->getSetting("ilias_version"));
6208 $a_xml_writer->xmlEndTag("qtimetadatafield");
6209
6210 // anonymity
6211 $a_xml_writer->xmlStartTag("qtimetadatafield");
6212 $a_xml_writer->xmlElement("fieldlabel", NULL, "anonymity");
6213 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getAnonymity()));
6214 $a_xml_writer->xmlEndTag("qtimetadatafield");
6215
6216 $a_xml_writer->xmlStartTag("qtimetadatafield");
6217 $a_xml_writer->xmlElement("fieldlabel", NULL, "use_pool");
6218 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getPoolUsage() ? 1 : 0);
6219 $a_xml_writer->xmlEndTag("qtimetadatafield");
6220
6221 // question set type (fixed, random, dynamic, ...)
6222 $a_xml_writer->xmlStartTag("qtimetadatafield");
6223 $a_xml_writer->xmlElement("fieldlabel", NULL, "question_set_type");
6224 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getQuestionSetType());
6225 $a_xml_writer->xmlEndTag("qtimetadatafield");
6226
6227 // sequence settings
6228 $a_xml_writer->xmlStartTag("qtimetadatafield");
6229 $a_xml_writer->xmlElement("fieldlabel", NULL, "sequence_settings");
6230 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getSequenceSettings());
6231 $a_xml_writer->xmlEndTag("qtimetadatafield");
6232
6233 // author
6234 $a_xml_writer->xmlStartTag("qtimetadatafield");
6235 $a_xml_writer->xmlElement("fieldlabel", NULL, "author");
6236 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getAuthor());
6237 $a_xml_writer->xmlEndTag("qtimetadatafield");
6238
6239 // reset processing time
6240 $a_xml_writer->xmlStartTag("qtimetadatafield");
6241 $a_xml_writer->xmlElement("fieldlabel", NULL, "reset_processing_time");
6242 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getResetProcessingTime());
6243 $a_xml_writer->xmlEndTag("qtimetadatafield");
6244
6245 // count system
6246 $a_xml_writer->xmlStartTag("qtimetadatafield");
6247 $a_xml_writer->xmlElement("fieldlabel", NULL, "count_system");
6248 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getCountSystem());
6249 $a_xml_writer->xmlEndTag("qtimetadatafield");
6250
6251 // multiple choice scoring
6252 $a_xml_writer->xmlStartTag("qtimetadatafield");
6253 $a_xml_writer->xmlElement("fieldlabel", NULL, "mc_scoring");
6254 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getMCScoring());
6255 $a_xml_writer->xmlEndTag("qtimetadatafield");
6256
6257 // multiple choice scoring
6258 $a_xml_writer->xmlStartTag("qtimetadatafield");
6259 $a_xml_writer->xmlElement("fieldlabel", NULL, "score_cutting");
6260 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getScoreCutting());
6261 $a_xml_writer->xmlEndTag("qtimetadatafield");
6262
6263 // multiple choice scoring
6264 $a_xml_writer->xmlStartTag("qtimetadatafield");
6265 $a_xml_writer->xmlElement("fieldlabel", NULL, "password");
6266 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getPassword());
6267 $a_xml_writer->xmlEndTag("qtimetadatafield");
6268
6269 // allowed users
6270 $a_xml_writer->xmlStartTag("qtimetadatafield");
6271 $a_xml_writer->xmlElement("fieldlabel", NULL, "allowedUsers");
6272 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getAllowedUsers());
6273 $a_xml_writer->xmlEndTag("qtimetadatafield");
6274
6275 // allowed users time gap
6276 $a_xml_writer->xmlStartTag("qtimetadatafield");
6277 $a_xml_writer->xmlElement("fieldlabel", NULL, "allowedUsersTimeGap");
6278 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getAllowedUsersTimeGap());
6279 $a_xml_writer->xmlEndTag("qtimetadatafield");
6280
6281 // pass scoring
6282 $a_xml_writer->xmlStartTag("qtimetadatafield");
6283 $a_xml_writer->xmlElement("fieldlabel", NULL, "pass_scoring");
6284 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getPassScoring());
6285 $a_xml_writer->xmlEndTag("qtimetadatafield");
6286
6287 $a_xml_writer->xmlStartTag('qtimetadatafield');
6288 $a_xml_writer->xmlElement('fieldlabel', NULL, 'pass_deletion_allowed');
6289 $a_xml_writer->xmlElement('fieldentry', NULL, (int)$this->isPassDeletionAllowed());
6290 $a_xml_writer->xmlEndTag('qtimetadatafield');
6291
6292 // score reporting date
6293 if ($this->getReportingDate())
6294 {
6295 $a_xml_writer->xmlStartTag("qtimetadatafield");
6296 $a_xml_writer->xmlElement("fieldlabel", NULL, "reporting_date");
6297 preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->reporting_date, $matches);
6298 $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]));
6299 $a_xml_writer->xmlEndTag("qtimetadatafield");
6300 }
6301 // number of tries
6302 $a_xml_writer->xmlStartTag("qtimetadatafield");
6303 $a_xml_writer->xmlElement("fieldlabel", NULL, "nr_of_tries");
6304 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getNrOfTries()));
6305 $a_xml_writer->xmlEndTag("qtimetadatafield");
6306
6307 // pass_waiting
6308 $a_xml_writer->xmlStartTag("qtimetadatafield");
6309 $a_xml_writer->xmlElement("fieldlabel", NULL, "pass_waiting");
6310 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getPassWaiting());
6311 $a_xml_writer->xmlEndTag("qtimetadatafield");
6312
6313 // kiosk
6314 $a_xml_writer->xmlStartTag("qtimetadatafield");
6315 $a_xml_writer->xmlElement("fieldlabel", NULL, "kiosk");
6316 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getKiosk()));
6317 $a_xml_writer->xmlEndTag("qtimetadatafield");
6318
6319
6320 //redirection_mode
6321 $a_xml_writer->xmlStartTag('qtimetadatafield');
6322 $a_xml_writer->xmlElement("fieldlabel", NULL, "redirection_mode");
6323 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getRedirectionMode());
6324 $a_xml_writer->xmlEndTag("qtimetadatafield");
6325
6326 //redirection_url
6327 $a_xml_writer->xmlStartTag('qtimetadatafield');
6328 $a_xml_writer->xmlElement("fieldlabel", NULL, "redirection_url");
6329 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getRedirectionUrl());
6330 $a_xml_writer->xmlEndTag("qtimetadatafield");
6331
6332 // use previous answers
6333 $a_xml_writer->xmlStartTag("qtimetadatafield");
6334 $a_xml_writer->xmlElement("fieldlabel", NULL, "use_previous_answers");
6335 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getUsePreviousAnswers());
6336 $a_xml_writer->xmlEndTag("qtimetadatafield");
6337
6338 // hide title points
6339 $a_xml_writer->xmlStartTag("qtimetadatafield");
6340 $a_xml_writer->xmlElement("fieldlabel", NULL, "title_output");
6341 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getTitleOutput()));
6342 $a_xml_writer->xmlEndTag("qtimetadatafield");
6343
6344 // results presentation
6345 $a_xml_writer->xmlStartTag("qtimetadatafield");
6346 $a_xml_writer->xmlElement("fieldlabel", NULL, "results_presentation");
6347 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getResultsPresentation()));
6348 $a_xml_writer->xmlEndTag("qtimetadatafield");
6349
6350 // examid in test pass
6351 $a_xml_writer->xmlStartTag("qtimetadatafield");
6352 $a_xml_writer->xmlElement("fieldlabel", NULL, "examid_in_test_pass");
6353 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->isShowExamIdInTestPassEnabled()));
6354 $a_xml_writer->xmlEndTag("qtimetadatafield");
6355
6356 // examid in kiosk
6357 $a_xml_writer->xmlStartTag("qtimetadatafield");
6358 $a_xml_writer->xmlElement("fieldlabel", NULL, "examid_in_test_res");
6359 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->isShowExamIdInTestResultsEnabled()));
6360 $a_xml_writer->xmlEndTag("qtimetadatafield");
6361
6362 // solution details
6363 $a_xml_writer->xmlStartTag("qtimetadatafield");
6364 $a_xml_writer->xmlElement("fieldlabel", NULL, "show_summary");
6365 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getListOfQuestionsSettings()));
6366 $a_xml_writer->xmlEndTag("qtimetadatafield");
6367
6368 // solution details
6369 $a_xml_writer->xmlStartTag("qtimetadatafield");
6370 $a_xml_writer->xmlElement("fieldlabel", NULL, "score_reporting");
6371 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getScoreReporting()));
6372 $a_xml_writer->xmlEndTag("qtimetadatafield");
6373
6374 $a_xml_writer->xmlStartTag("qtimetadatafield");
6375 $a_xml_writer->xmlElement("fieldlabel", NULL, "solution_details");
6376 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getShowSolutionDetails());
6377 $a_xml_writer->xmlEndTag("qtimetadatafield");
6378 $a_xml_writer->xmlStartTag("qtimetadatafield");
6379 $a_xml_writer->xmlElement("fieldlabel", NULL, "print_bs_with_res");
6380 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getShowSolutionDetails() ? (int)$this->isBestSolutionPrintedWithResult() : 0);
6381 $a_xml_writer->xmlEndTag("qtimetadatafield");
6382
6383 // solution details
6384 $a_xml_writer->xmlStartTag("qtimetadatafield");
6385 $a_xml_writer->xmlElement("fieldlabel", NULL, "instant_verification");
6386 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getInstantFeedbackSolution()));
6387 $a_xml_writer->xmlEndTag("qtimetadatafield");
6388
6389 // answer specific feedback
6390 $a_xml_writer->xmlStartTag("qtimetadatafield");
6391 $a_xml_writer->xmlElement("fieldlabel", NULL, "answer_feedback");
6392 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getAnswerFeedback()));
6393 $a_xml_writer->xmlEndTag("qtimetadatafield");
6394
6395 // answer specific feedback of reached points
6396 $a_xml_writer->xmlStartTag("qtimetadatafield");
6397 $a_xml_writer->xmlElement("fieldlabel", NULL, "answer_feedback_points");
6398 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getAnswerFeedbackPoints()));
6399 $a_xml_writer->xmlEndTag("qtimetadatafield");
6400
6401 // instant response answer freezing
6402 $a_xml_writer->xmlStartTag("qtimetadatafield");
6403 $a_xml_writer->xmlElement("fieldlabel", NULL, "instant_feedback_answer_fixation");
6404 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->isInstantFeedbackAnswerFixationEnabled());
6405 $a_xml_writer->xmlEndTag("qtimetadatafield");
6406
6407 // instant response forced
6408 $a_xml_writer->xmlStartTag("qtimetadatafield");
6409 $a_xml_writer->xmlElement("fieldlabel", NULL, "force_instant_feedback");
6410 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->isForceInstantFeedbackEnabled());
6411 $a_xml_writer->xmlEndTag("qtimetadatafield");
6412
6413
6414 // highscore
6415 $highscore_metadata = array(
6416 'highscore_enabled' => array('value' => $this->getHighscoreEnabled()),
6417 'highscore_anon' => array('value' => $this->getHighscoreAnon()),
6418 'highscore_achieved_ts' => array('value' => $this->getHighscoreAchievedTS()),
6419 'highscore_score' => array('value' => $this->getHighscoreScore()),
6420 'highscore_percentage' => array('value' => $this->getHighscorePercentage()),
6421 'highscore_hints' => array('value' => $this->getHighscoreHints()),
6422 'highscore_wtime' => array('value' => $this->getHighscoreWTime()),
6423 'highscore_own_table' => array('value' => $this->getHighscoreOwnTable()),
6424 'highscore_top_table' => array('value' => $this->getHighscoreTopTable()),
6425 'highscore_top_num' => array('value' => $this->getHighscoreTopNum()),
6426 );
6427 foreach($highscore_metadata as $label => $data)
6428 {
6429 $a_xml_writer->xmlStartTag("qtimetadatafield");
6430 $a_xml_writer->xmlElement("fieldlabel", NULL, $label);
6431 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $data['value']));
6432 $a_xml_writer->xmlEndTag("qtimetadatafield");
6433 }
6434
6435 // show cancel
6436 $a_xml_writer->xmlStartTag("qtimetadatafield");
6437 $a_xml_writer->xmlElement("fieldlabel", NULL, "show_cancel");
6438 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getShowCancel()));
6439 $a_xml_writer->xmlEndTag("qtimetadatafield");
6440
6441 // show marker
6442 $a_xml_writer->xmlStartTag("qtimetadatafield");
6443 $a_xml_writer->xmlElement("fieldlabel", NULL, "show_marker");
6444 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getShowMarker()));
6445 $a_xml_writer->xmlEndTag("qtimetadatafield");
6446
6447 // fixed participants
6448 $a_xml_writer->xmlStartTag("qtimetadatafield");
6449 $a_xml_writer->xmlElement("fieldlabel", NULL, "fixed_participants");
6450 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getFixedParticipants()));
6451 $a_xml_writer->xmlEndTag("qtimetadatafield");
6452
6453 // show final statement
6454 $a_xml_writer->xmlStartTag("qtimetadatafield");
6455 $a_xml_writer->xmlElement("fieldlabel", NULL, "showfinalstatement");
6456 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", (($this->getShowFinalStatement()) ? "1" : "0")));
6457 $a_xml_writer->xmlEndTag("qtimetadatafield");
6458
6459 // show introduction only
6460 $a_xml_writer->xmlStartTag("qtimetadatafield");
6461 $a_xml_writer->xmlElement("fieldlabel", NULL, "showinfo");
6462 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", (($this->getShowInfo()) ? "1" : "0")));
6463 $a_xml_writer->xmlEndTag("qtimetadatafield");
6464
6465 // mail notification
6466 $a_xml_writer->xmlStartTag("qtimetadatafield");
6467 $a_xml_writer->xmlElement("fieldlabel", NULL, "mailnotification");
6468 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getMailNotification());
6469 $a_xml_writer->xmlEndTag("qtimetadatafield");
6470
6471 // mail notification type
6472 $a_xml_writer->xmlStartTag("qtimetadatafield");
6473 $a_xml_writer->xmlElement("fieldlabel", NULL, "mailnottype");
6474 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getMailNotificationType());
6475 $a_xml_writer->xmlEndTag("qtimetadatafield");
6476
6477 // export settings
6478 $a_xml_writer->xmlStartTag("qtimetadatafield");
6479 $a_xml_writer->xmlElement("fieldlabel", NULL, "exportsettings");
6480 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getExportSettings());
6481 $a_xml_writer->xmlEndTag("qtimetadatafield");
6482
6483 // force JavaScript
6484 $a_xml_writer->xmlStartTag("qtimetadatafield");
6485 $a_xml_writer->xmlElement("fieldlabel", NULL, "forcejs");
6486 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", (($this->getForceJS()) ? "1" : "0")));
6487 $a_xml_writer->xmlEndTag("qtimetadatafield");
6488
6489 // custom style
6490 $a_xml_writer->xmlStartTag("qtimetadatafield");
6491 $a_xml_writer->xmlElement("fieldlabel", NULL, "customstyle");
6492 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getCustomStyle());
6493 $a_xml_writer->xmlEndTag("qtimetadatafield");
6494
6495 // shuffle questions
6496 $a_xml_writer->xmlStartTag("qtimetadatafield");
6497 $a_xml_writer->xmlElement("fieldlabel", NULL, "shuffle_questions");
6498 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getShuffleQuestions()));
6499 $a_xml_writer->xmlEndTag("qtimetadatafield");
6500
6501 // processing time
6502 $a_xml_writer->xmlStartTag("qtimetadatafield");
6503 $a_xml_writer->xmlElement("fieldlabel", NULL, "processing_time");
6504 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getProcessingTime());
6505 $a_xml_writer->xmlEndTag("qtimetadatafield");
6506
6507 // enable_examview
6508 $a_xml_writer->xmlStartTag("qtimetadatafield");
6509 $a_xml_writer->xmlElement("fieldlabel", NULL, "enable_examview");
6510 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getEnableExamview());
6511 $a_xml_writer->xmlEndTag("qtimetadatafield");
6512
6513 // show_examview_html
6514 $a_xml_writer->xmlStartTag("qtimetadatafield");
6515 $a_xml_writer->xmlElement("fieldlabel", NULL, "show_examview_html");
6516 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getShowExamviewHtml());
6517 $a_xml_writer->xmlEndTag("qtimetadatafield");
6518
6519 // show_examview_pdf
6520 $a_xml_writer->xmlStartTag("qtimetadatafield");
6521 $a_xml_writer->xmlElement("fieldlabel", NULL, "show_examview_pdf");
6522 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getShowExamviewPdf());
6523 $a_xml_writer->xmlEndTag("qtimetadatafield");
6524
6525 // enable_archiving
6526 $a_xml_writer->xmlStartTag("qtimetadatafield");
6527 $a_xml_writer->xmlElement("fieldlabel", NULL, "enable_archiving");
6528 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getEnableArchiving());
6529 $a_xml_writer->xmlEndTag("qtimetadatafield");
6530
6531 // sign_submission
6532 $a_xml_writer->xmlStartTag("qtimetadatafield");
6533 $a_xml_writer->xmlElement("fieldlabel", NULL, "sign_submission");
6534 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getSignSubmission());
6535 $a_xml_writer->xmlEndTag("qtimetadatafield");
6536
6537 // char_selector_availability
6538 $a_xml_writer->xmlStartTag("qtimetadatafield");
6539 $a_xml_writer->xmlElement("fieldlabel", NULL, "char_selector_availability");
6540 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getCharSelectorAvailability()));
6541 $a_xml_writer->xmlEndTag("qtimetadatafield");
6542
6543 // char_selector_definition
6544 $a_xml_writer->xmlStartTag("qtimetadatafield");
6545 $a_xml_writer->xmlElement("fieldlabel", NULL, "char_selector_definition");
6546 $a_xml_writer->xmlElement("fieldentry", NULL, $this->getCharSelectorDefinition());
6547 $a_xml_writer->xmlEndTag("qtimetadatafield");
6548
6549 // skill_service
6550 $a_xml_writer->xmlStartTag("qtimetadatafield");
6551 $a_xml_writer->xmlElement("fieldlabel", NULL, "skill_service");
6552 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->isSkillServiceEnabled());
6553 $a_xml_writer->xmlEndTag("qtimetadatafield");
6554
6555 // result_tax_filters
6556 $a_xml_writer->xmlStartTag("qtimetadatafield");
6557 $a_xml_writer->xmlElement("fieldlabel", NULL, "result_tax_filters");
6558 $a_xml_writer->xmlElement("fieldentry", NULL, serialize((array)$this->getResultFilterTaxIds()));
6559 $a_xml_writer->xmlEndTag("qtimetadatafield");
6560
6561 // show_grading_status
6562 $a_xml_writer->xmlStartTag("qtimetadatafield");
6563 $a_xml_writer->xmlElement("fieldlabel", NULL, "show_grading_status");
6564 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->isShowGradingStatusEnabled());
6565 $a_xml_writer->xmlEndTag("qtimetadatafield");
6566
6567 // show_grading_mark
6568 $a_xml_writer->xmlStartTag("qtimetadatafield");
6569 $a_xml_writer->xmlElement("fieldlabel", NULL, "show_grading_mark");
6570 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->isShowGradingMarkEnabled());
6571 $a_xml_writer->xmlEndTag("qtimetadatafield");
6572
6573
6574 // starting time
6575 if ($this->getStartingTime())
6576 {
6577 $a_xml_writer->xmlStartTag("qtimetadatafield");
6578 $a_xml_writer->xmlElement("fieldlabel", NULL, "starting_time");
6579 $backward_compatibility_format = $this->buildIso8601PeriodFromUnixtimeForExportCompatibility($this->starting_time);
6580 $a_xml_writer->xmlElement("fieldentry", NULL, $backward_compatibility_format);
6581 $a_xml_writer->xmlEndTag("qtimetadatafield");
6582 }
6583 // ending time
6584 if ($this->getEndingTime())
6585 {
6586 $a_xml_writer->xmlStartTag("qtimetadatafield");
6587 $a_xml_writer->xmlElement("fieldlabel", NULL, "ending_time");
6588 $backward_compatibility_format = $this->buildIso8601PeriodFromUnixtimeForExportCompatibility($this->ending_time);
6589 $a_xml_writer->xmlElement("fieldentry", NULL, $backward_compatibility_format);
6590 $a_xml_writer->xmlEndTag("qtimetadatafield");
6591 }
6592
6593
6594 //activation_limited
6595 $a_xml_writer->xmlStartTag("qtimetadatafield");
6596 $a_xml_writer->xmlElement("fieldlabel", NULL, "activation_limited");
6597 $a_xml_writer->xmlElement("fieldentry", NULL,(int)$this->isActivationLimited());
6598 $a_xml_writer->xmlEndTag("qtimetadatafield");
6599
6600 //activation_start_time
6601 $a_xml_writer->xmlStartTag("qtimetadatafield");
6602 $a_xml_writer->xmlElement("fieldlabel", NULL, "activation_start_time");
6603 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getActivationStartingTime());
6604 $a_xml_writer->xmlEndTag("qtimetadatafield");
6605
6606 //activation_end_time
6607 $a_xml_writer->xmlStartTag("qtimetadatafield");
6608 $a_xml_writer->xmlElement("fieldlabel", NULL, "activation_end_time");
6609 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getActivationEndingTime());
6610 $a_xml_writer->xmlEndTag("qtimetadatafield");
6611
6612 //activation_visibility
6613 $a_xml_writer->xmlStartTag("qtimetadatafield");
6614 $a_xml_writer->xmlElement("fieldlabel", NULL, "activation_visibility");
6615 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getActivationVisibility());
6616 $a_xml_writer->xmlEndTag("qtimetadatafield");
6617
6618 // autosave
6619 $a_xml_writer->xmlStartTag("qtimetadatafield");
6620 $a_xml_writer->xmlElement("fieldlabel", NULL, "autosave");
6621 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getAutosave());
6622 $a_xml_writer->xmlEndTag("qtimetadatafield");
6623
6624 // autosave_ival
6625 $a_xml_writer->xmlStartTag("qtimetadatafield");
6626 $a_xml_writer->xmlElement("fieldlabel", NULL, "autosave_ival");
6627 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getAutosaveIval());
6628 $a_xml_writer->xmlEndTag("qtimetadatafield");
6629
6630 //offer_question_hints
6631 $a_xml_writer->xmlStartTag("qtimetadatafield");
6632 $a_xml_writer->xmlElement("fieldlabel", NULL, "offer_question_hints");
6633 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->isOfferingQuestionHintsEnabled());
6634 $a_xml_writer->xmlEndTag("qtimetadatafield");
6635
6636 //instant_feedback_specific
6637 $a_xml_writer->xmlStartTag("qtimetadatafield");
6638 $a_xml_writer->xmlElement("fieldlabel", NULL, "instant_feedback_specific");
6639 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getSpecificAnswerFeedback());
6640 $a_xml_writer->xmlEndTag("qtimetadatafield");
6641
6642 //instant_feedback_answer_fixation
6643 $a_xml_writer->xmlStartTag("qtimetadatafield");
6644 $a_xml_writer->xmlElement("fieldlabel", NULL, "instant_feedback_answer_fixation");
6645 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->isInstantFeedbackAnswerFixationEnabled());
6646 $a_xml_writer->xmlEndTag("qtimetadatafield");
6647
6648 //obligations_enabled
6649 $a_xml_writer->xmlStartTag("qtimetadatafield");
6650 $a_xml_writer->xmlElement("fieldlabel", NULL, "obligations_enabled");
6651 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->areObligationsEnabled());
6652 $a_xml_writer->xmlEndTag("qtimetadatafield");
6653
6654 //enable_processing_time
6655 $a_xml_writer->xmlStartTag("qtimetadatafield");
6656 $a_xml_writer->xmlElement("fieldlabel", NULL, "enable_processing_time");
6657 $a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getEnableProcessingTime());
6658 $a_xml_writer->xmlEndTag("qtimetadatafield");
6659
6660 foreach ($this->mark_schema->mark_steps as $index => $mark)
6661 {
6662 // mark steps
6663 $a_xml_writer->xmlStartTag("qtimetadatafield");
6664 $a_xml_writer->xmlElement("fieldlabel", NULL, "mark_step_$index");
6665 $a_xml_writer->xmlElement("fieldentry", NULL, sprintf(
6666 "<short>%s</short><official>%s</official><percentage>%.2f</percentage><passed>%d</passed>",
6667 $mark->getShortName(), $mark->getOfficialName(), $mark->getMinimumLevel(), $mark->getPassed()
6668 ));
6669 $a_xml_writer->xmlEndTag("qtimetadatafield");
6670 }
6671 $a_xml_writer->xmlEndTag("qtimetadata");
6672
6673 // add qti objectives
6674 $a_xml_writer->xmlStartTag("objectives");
6675 $this->addQTIMaterial($a_xml_writer, $this->getIntroduction());
6676 $a_xml_writer->xmlEndTag("objectives");
6677
6678 // add qti assessmentcontrol
6679 if ($this->getInstantFeedbackSolution() == 1)
6680 {
6681 $attrs = array(
6682 "solutionswitch" => "Yes"
6683 );
6684 }
6685 else
6686 {
6687 $attrs = NULL;
6688 }
6689 $a_xml_writer->xmlElement("assessmentcontrol", $attrs, NULL);
6690
6691 if (strlen($this->getFinalStatement()))
6692 {
6693 // add qti presentation_material
6694 $a_xml_writer->xmlStartTag("presentation_material");
6695 $a_xml_writer->xmlStartTag("flow_mat");
6696 $this->addQTIMaterial($a_xml_writer, $this->getFinalStatement());
6697 $a_xml_writer->xmlEndTag("flow_mat");
6698 $a_xml_writer->xmlEndTag("presentation_material");
6699 }
6700
6701 $attrs = array(
6702 "ident" => "1"
6703 );
6704 $a_xml_writer->xmlElement("section", $attrs, NULL);
6705 $a_xml_writer->xmlEndTag("assessment");
6706 $a_xml_writer->xmlEndTag("questestinterop");
6707
6708 $xml = $a_xml_writer->xmlDumpMem(FALSE);
6709 return $xml;
6710 }
buildIso8601PeriodFromUnixtimeForExportCompatibility($unix_timestamp)
addQTIMaterial(&$a_xml_writer, $a_material)
Creates a QTI material tag from a plain text or xhtml text.
getDescription()
get object description
XML writer class.
xmlHeader()
Writes xml header @access public.

References $data, addQTIMaterial(), areObligationsEnabled(), buildIso8601PeriodFromUnixtimeForExportCompatibility(), getActivationEndingTime(), getActivationStartingTime(), getActivationVisibility(), getAllowedUsers(), getAllowedUsersTimeGap(), getAnonymity(), getAnswerFeedback(), getAnswerFeedbackPoints(), getAuthor(), getAutosave(), getAutosaveIval(), getCharSelectorAvailability(), getCharSelectorDefinition(), getCountSystem(), getCustomStyle(), ilObject\getDescription(), getEnableArchiving(), getEnableExamview(), getEnableProcessingTime(), getEndingTime(), getExportSettings(), getFinalStatement(), getFixedParticipants(), getForceJS(), getHighscoreAchievedTS(), getHighscoreAnon(), getHighscoreEnabled(), getHighscoreHints(), getHighscoreOwnTable(), getHighscorePercentage(), getHighscoreScore(), getHighscoreTopNum(), getHighscoreTopTable(), getHighscoreWTime(), getInstantFeedbackSolution(), getIntroduction(), getKiosk(), getListOfQuestionsSettings(), getMailNotification(), getMailNotificationType(), getMCScoring(), getNrOfTries(), getPassScoring(), getPassWaiting(), getPassword(), getPoolUsage(), getProcessingTime(), getQuestionSetType(), getRedirectionMode(), getRedirectionUrl(), getReportingDate(), getResetProcessingTime(), getResultFilterTaxIds(), getResultsPresentation(), getScoreCutting(), getScoreReporting(), getSequenceSettings(), getShowCancel(), getShowExamviewHtml(), getShowExamviewPdf(), getShowFinalStatement(), getShowInfo(), getShowMarker(), getShowSolutionDetails(), getShuffleQuestions(), getSignSubmission(), getSpecificAnswerFeedback(), getStartingTime(), getTitleOutput(), getUsePreviousAnswers(), isActivationLimited(), isBestSolutionPrintedWithResult(), isForceInstantFeedbackEnabled(), isInstantFeedbackAnswerFixationEnabled(), isOfferingQuestionHintsEnabled(), isPassDeletionAllowed(), isShowExamIdInTestPassEnabled(), isShowExamIdInTestResultsEnabled(), isShowGradingMarkEnabled(), isShowGradingStatusEnabled(), isSkillServiceEnabled(), sprintf, and ilXmlWriter\xmlHeader().

+ Here is the call graph for this function:

◆ update()

ilObjTest::update ( )

update object data

@access public

Returns
boolean

Reimplemented from ilObject.

Definition at line 756 of file class.ilObjTest.php.

757 {
758 if (!parent::update())
759 {
760 return false;
761 }
762
763 // put here object specific stuff
764 $this->updateMetaData();
765 return true;
766 }
updateMetaData()
update meta data entry

References ilObject\updateMetaData().

+ Here is the call graph for this function:

◆ updateWorkingTime()

ilObjTest::updateWorkingTime (   $times_id)

Update the working time of a test when a question is answered.

Parameters
integer$times_idThe database id of a working time entry @access public

Definition at line 3917 of file class.ilObjTest.php.

3918 {
3919 global $ilDB;
3920
3921 $affectedRows = $ilDB->manipulateF("UPDATE tst_times SET finished = %s, tstamp = %s WHERE times_id = %s",
3922 array('timestamp', 'integer', 'integer'),
3923 array(strftime("%Y-%m-%d %H:%M:%S"), time(), $times_id)
3924 );
3925 }

References $ilDB.

◆ userLookupFullName()

ilObjTest::userLookupFullName (   $user_id,
  $overwrite_anonymity = FALSE,
  $sorted_order = FALSE,
  $suffix = "" 
)

Returns the full name of a test user according to the anonymity status.

Parameters
int$user_idThe database ID of the user
boolean$overwrite_anonymityIndicates if the anonymity status should be ignored
Returns
string The full name of the user or UNKNOWN if the anonymity status is affected @access public
Deprecated:
: use ilTestParticipantData instead

Definition at line 9741 of file class.ilObjTest.php.

9742 {
9743 if ($this->getAnonymity() && !$overwrite_anonymity)
9744 {
9745 return $this->lng->txt("anonymous") . $suffix;
9746 }
9747 else
9748 {
9749 include_once './Services/User/classes/class.ilObjUser.php';
9750 $uname = ilObjUser::_lookupName($user_id);
9751 if (strlen($uname["firstname"].$uname["lastname"]) == 0) $uname["firstname"] = $this->lng->txt("deleted_user");
9752 if ($sorted_order)
9753 {
9754 return trim($uname["lastname"] . ", " . $uname["firstname"]) . $suffix;
9755 }
9756 else
9757 {
9758 return trim($uname["firstname"] . " " . $uname["lastname"]) . $suffix;
9759 }
9760 }
9761 }
static _lookupName($a_user_id)
lookup user name

References ilObjUser\_lookupName(), and getAnonymity().

Referenced by sendAdvancedNotification(), and sendSimpleNotification().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $_customStyle

ilObjTest::$_customStyle
private

Definition at line 452 of file class.ilObjTest.php.

◆ $_finalstatement

ilObjTest::$_finalstatement
private

Definition at line 431 of file class.ilObjTest.php.

◆ $_forcejs

ilObjTest::$_forcejs = TRUE
private

Definition at line 445 of file class.ilObjTest.php.

◆ $_kiosk

ilObjTest::$_kiosk
protected

Definition at line 80 of file class.ilObjTest.php.

◆ $_showfinalstatement

ilObjTest::$_showfinalstatement
private

Definition at line 424 of file class.ilObjTest.php.

◆ $_showinfo

ilObjTest::$_showinfo
private

Definition at line 438 of file class.ilObjTest.php.

◆ $activation_ending_time

ilObjTest::$activation_ending_time
protected

Definition at line 496 of file class.ilObjTest.php.

◆ $activation_starting_time

ilObjTest::$activation_starting_time
protected

Definition at line 494 of file class.ilObjTest.php.

◆ $activation_visibility

ilObjTest::$activation_visibility
protected

Definition at line 492 of file class.ilObjTest.php.

Referenced by getActivationVisibility().

◆ $allowedUsers

ilObjTest::$allowedUsers
protected

Definition at line 354 of file class.ilObjTest.php.

◆ $allowedUsersTimeGap

ilObjTest::$allowedUsersTimeGap
protected

Definition at line 361 of file class.ilObjTest.php.

◆ $anonymity

ilObjTest::$anonymity

Definition at line 375 of file class.ilObjTest.php.

◆ $answer_feedback

ilObjTest::$answer_feedback

Definition at line 403 of file class.ilObjTest.php.

Referenced by setAnswerFeedback().

◆ $answer_feedback_points

ilObjTest::$answer_feedback_points

Definition at line 172 of file class.ilObjTest.php.

Referenced by setAnswerFeedbackPoints().

◆ $author

ilObjTest::$author

Definition at line 102 of file class.ilObjTest.php.

Referenced by _lookupAuthor(), getAuthor(), and setAuthor().

◆ $autosave

ilObjTest::$autosave
protected

Definition at line 498 of file class.ilObjTest.php.

Referenced by getAutosave(), and setAutosave().

◆ $autosave_ival

ilObjTest::$autosave_ival
protected

Definition at line 500 of file class.ilObjTest.php.

Referenced by getAutosaveIval(), and setAutosaveIval().

◆ $certificate_visibility

ilObjTest::$certificate_visibility

Definition at line 368 of file class.ilObjTest.php.

◆ $char_selector_availability

ilObjTest::$char_selector_availability
protected

Definition at line 549 of file class.ilObjTest.php.

Referenced by getCharSelectorAvailability().

◆ $char_selector_definition

ilObjTest::$char_selector_definition
protected

Definition at line 552 of file class.ilObjTest.php.

Referenced by getCharSelectorDefinition().

◆ $count_system

ilObjTest::$count_system

Definition at line 287 of file class.ilObjTest.php.

◆ $ects_fx

ilObjTest::$ects_fx = NULL
protected

Definition at line 272 of file class.ilObjTest.php.

◆ $ects_grades

ilObjTest::$ects_grades = array()
protected

Definition at line 278 of file class.ilObjTest.php.

Referenced by getECTSGrades().

◆ $ects_output

ilObjTest::$ects_output = FALSE
protected

Definition at line 266 of file class.ilObjTest.php.

◆ $enable_archiving

ilObjTest::$enable_archiving
protected

Definition at line 527 of file class.ilObjTest.php.

Referenced by getEnableArchiving(), and setEnableArchiving().

◆ $enable_examview

ilObjTest::$enable_examview
protected

Definition at line 518 of file class.ilObjTest.php.

Referenced by getEnableExamview(), and setEnableExamview().

◆ $enable_processing_time

ilObjTest::$enable_processing_time

Definition at line 229 of file class.ilObjTest.php.

◆ $ending_time

ilObjTest::$ending_time
protected

Definition at line 260 of file class.ilObjTest.php.

Referenced by setActivationEndingTime(), and setEndingTime().

◆ $ending_time_enabled

ilObjTest::$ending_time_enabled
protected

Definition at line 253 of file class.ilObjTest.php.

Referenced by isEndingTimeEnabled(), and setEndingTimeEnabled().

◆ $evaluation_data

ilObjTest::$evaluation_data

Definition at line 189 of file class.ilObjTest.php.

◆ $exportsettings

ilObjTest::$exportsettings
protected

Definition at line 458 of file class.ilObjTest.php.

Referenced by getExportSettings().

◆ $fixed_participants

ilObjTest::$fixed_participants

Definition at line 396 of file class.ilObjTest.php.

◆ $forceInstantFeedbackEnabled

ilObjTest::$forceInstantFeedbackEnabled
protected

◆ $instant_verification

ilObjTest::$instant_verification

Definition at line 165 of file class.ilObjTest.php.

◆ $instantFeedbackAnswerFixationEnabled

ilObjTest::$instantFeedbackAnswerFixationEnabled
protected

◆ $introduction

ilObjTest::$introduction
protected

Definition at line 129 of file class.ilObjTest.php.

Referenced by setIntroduction().

◆ $introductionEnabled

ilObjTest::$introductionEnabled
protected

Definition at line 121 of file class.ilObjTest.php.

Referenced by isIntroductionEnabled(), and setIntroductionEnabled().

◆ $invitation

ilObjTest::$invitation = INVITATION_OFF

Definition at line 94 of file class.ilObjTest.php.

◆ $isSkillManagementGloballyActivated

ilObjTest::$isSkillManagementGloballyActivated = null
staticprivate

Definition at line 12207 of file class.ilObjTest.php.

Referenced by isSkillManagementGloballyActivated().

◆ $limitUsersEnabled

ilObjTest::$limitUsersEnabled
protected

Definition at line 347 of file class.ilObjTest.php.

Referenced by isLimitUsersEnabled(), and setLimitUsersEnabled().

◆ $mailnotification

ilObjTest::$mailnotification
protected

Definition at line 454 of file class.ilObjTest.php.

Referenced by getMailNotification().

◆ $mailnottype

ilObjTest::$mailnottype
protected

Definition at line 456 of file class.ilObjTest.php.

Referenced by getMailNotificationType().

◆ $mark_schema

ilObjTest::$mark_schema

Definition at line 136 of file class.ilObjTest.php.

Referenced by getMarkSchema().

◆ $mc_scoring

ilObjTest::$mc_scoring

Definition at line 294 of file class.ilObjTest.php.

◆ $metadata

ilObjTest::$metadata

Definition at line 109 of file class.ilObjTest.php.

Referenced by fromXML().

◆ $nr_of_tries

ilObjTest::$nr_of_tries

Definition at line 197 of file class.ilObjTest.php.

Referenced by setNrOfTries().

◆ $obligationsEnabled

ilObjTest::$obligationsEnabled = null
private

Definition at line 490 of file class.ilObjTest.php.

Referenced by areObligationsEnabled(), and setObligationsEnabled().

◆ $offeringQuestionHintsEnabled

ilObjTest::$offeringQuestionHintsEnabled = null
private

◆ $oldOnlineStatus

ilObjTest::$oldOnlineStatus = null
protected

Definition at line 471 of file class.ilObjTest.php.

Referenced by getOldOnlineStatus(), and setOldOnlineStatus().

◆ $online

ilObjTest::$online = null
private

the object's online status

@var bool $online

Definition at line 469 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 515 of file class.ilObjTest.php.

Referenced by participantDataExist().

◆ $pass_scoring

ilObjTest::$pass_scoring

Definition at line 301 of file class.ilObjTest.php.

◆ $pass_waiting

ilObjTest::$pass_waiting = "00:000:00:00:00"
protected

Definition at line 587 of file class.ilObjTest.php.

Referenced by getPassWaiting(), and setPassWaiting().

◆ $passDeletionAllowed

ilObjTest::$passDeletionAllowed = null
private

Definition at line 508 of file class.ilObjTest.php.

Referenced by isPassDeletionAllowed(), and setPassDeletionAllowed().

◆ $password

ilObjTest::$password
protected

Definition at line 342 of file class.ilObjTest.php.

◆ $passwordEnabled

ilObjTest::$passwordEnabled
protected

Definition at line 335 of file class.ilObjTest.php.

Referenced by isPasswordEnabled(), and setPasswordEnabled().

◆ $poolUsage

ilObjTest::$poolUsage
protected

Definition at line 460 of file class.ilObjTest.php.

Referenced by getPoolUsage().

◆ $print_best_solution_with_result

ilObjTest::$print_best_solution_with_result = true
protected

Definition at line 476 of file class.ilObjTest.php.

Referenced by isBestSolutionPrintedWithResult().

◆ $processing_time

ilObjTest::$processing_time

Definition at line 222 of file class.ilObjTest.php.

Referenced by isMaxProcessingTimeReached(), and setProcessingTime().

◆ $questions

ilObjTest::$questions

◆ $questionSetType

ilObjTest::$questionSetType = self::QUESTION_SET_TYPE_FIXED
private

◆ $redirection_mode

ilObjTest::$redirection_mode = 0
private

Definition at line 532 of file class.ilObjTest.php.

Referenced by getRedirectionMode(), and setRedirectionMode().

◆ $redirection_url

ilObjTest::$redirection_url = NULL
private

Definition at line 537 of file class.ilObjTest.php.

Referenced by getRedirectionUrl(), and setRedirectionUrl().

◆ $reporting_date

ilObjTest::$reporting_date

Definition at line 182 of file class.ilObjTest.php.

Referenced by setReportingDate().

◆ $reset_processing_time

ilObjTest::$reset_processing_time

Definition at line 236 of file class.ilObjTest.php.

◆ $resultFilterTaxIds

ilObjTest::$resultFilterTaxIds = array()
private

Definition at line 71 of file class.ilObjTest.php.

Referenced by getResultFilterTaxIds(), and setResultFilterTaxIds().

◆ $results_presentation

ilObjTest::$results_presentation

Definition at line 316 of file class.ilObjTest.php.

◆ $score_cutting

ilObjTest::$score_cutting

Definition at line 330 of file class.ilObjTest.php.

◆ $score_reporting

ilObjTest::$score_reporting

Definition at line 156 of file class.ilObjTest.php.

Referenced by setScoreReporting().

◆ $sequence_settings

ilObjTest::$sequence_settings

Definition at line 145 of file class.ilObjTest.php.

Referenced by setSequenceSettings().

◆ $show_cancel

ilObjTest::$show_cancel

Definition at line 382 of file class.ilObjTest.php.

◆ $show_exam_id_in_test_pass_enabled

bool ilObjTest::$show_exam_id_in_test_pass_enabled
protected

◆ $show_exam_id_in_test_results_enabled

bool ilObjTest::$show_exam_id_in_test_results_enabled
protected

◆ $show_examview_html

ilObjTest::$show_examview_html
protected

Definition at line 521 of file class.ilObjTest.php.

Referenced by getShowExamviewHtml(), and setShowExamviewHtml().

◆ $show_examview_pdf

ilObjTest::$show_examview_pdf
protected

Definition at line 524 of file class.ilObjTest.php.

Referenced by getShowExamviewPdf(), and setShowExamviewPdf().

◆ $show_marker

ilObjTest::$show_marker

Definition at line 389 of file class.ilObjTest.php.

◆ $show_summary

ilObjTest::$show_summary

Definition at line 323 of file class.ilObjTest.php.

◆ $showGradingMarkEnabled

ilObjTest::$showGradingMarkEnabled
protected

Definition at line 562 of file class.ilObjTest.php.

Referenced by isShowGradingMarkEnabled(), and setShowGradingMarkEnabled().

◆ $showGradingStatusEnabled

ilObjTest::$showGradingStatusEnabled
protected

Definition at line 557 of file class.ilObjTest.php.

Referenced by isShowGradingStatusEnabled(), and setShowGradingStatusEnabled().

◆ $shuffle_questions

ilObjTest::$shuffle_questions

Definition at line 309 of file class.ilObjTest.php.

◆ $sign_submission

bool ilObjTest::$sign_submission
protected

Definition at line 546 of file class.ilObjTest.php.

Referenced by getSignSubmission(), and setSignSubmission().

◆ $skillServiceEnabled

ilObjTest::$skillServiceEnabled = false
private

Definition at line 66 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 241 of file class.ilObjTest.php.

Referenced by isStartingTimeEnabled(), and setStartingTimeEnabled().

◆ $template_id

ilObjTest::$template_id
private

Definition at line 462 of file class.ilObjTest.php.

Referenced by getTemplate(), and setTemplate().

◆ $test_id

◆ $testFinalBroken

ilObjTest::$testFinalBroken
protected

Definition at line 577 of file class.ilObjTest.php.

Referenced by isTestFinalBroken(), and setTestFinalBroken().

◆ $testSequence

◆ $testSession

◆ $title_output

ilObjTest::$title_output

Definition at line 215 of file class.ilObjTest.php.

Referenced by setTitleOutput().

◆ $tmpCopyWizardCopyId

ilObjTest::$tmpCopyWizardCopyId
private

Definition at line 582 of file class.ilObjTest.php.

Referenced by getTmpCopyWizardCopyId(), and setTmpCopyWizardCopyId().

◆ $use_previous_answers

ilObjTest::$use_previous_answers

Definition at line 205 of file class.ilObjTest.php.

Referenced by _getUsePreviousAnswers(), and setUsePreviousAnswers().

◆ DEFAULT_PROCESSING_TIME_MINUTES

const ilObjTest::DEFAULT_PROCESSING_TIME_MINUTES = 90

Definition at line 22 of file class.ilObjTest.php.

Referenced by getProcessingTimeAsMinutes().

◆ 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 2495 of file class.ilObjTest.php.

Referenced by canViewResults(), and ilTestPassesSelector\isReportablePass().

◆ SCORE_REPORTING_DISABLED

const ilObjTest::SCORE_REPORTING_DISABLED = 0

Definition at line 2492 of file class.ilObjTest.php.

◆ SCORE_REPORTING_FINISHED

const ilObjTest::SCORE_REPORTING_FINISHED = 1

Definition at line 2493 of file class.ilObjTest.php.

Referenced by canViewResults(), and ilTestPassesSelector\isReportablePass().

◆ SCORE_REPORTING_IMMIDIATLY

const ilObjTest::SCORE_REPORTING_IMMIDIATLY = 2

Definition at line 2494 of file class.ilObjTest.php.

Referenced by canViewResults(), and ilTestPassesSelector\isReportablePass().


The documentation for this class was generated from the following file: