ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjTest Class Reference
+ Inheritance diagram for ilObjTest:
+ Collaboration diagram for ilObjTest:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor.
 create ($a_upload=false)
 create test object
 update ()
 update object data
 read ($a_force_db=false)
 read object data from db into object
 delete ()
 delete object and all related data
 deleteTest ()
 Deletes the test and all related objects, files and database entries.
 initDefaultRoles ()
 init default roles settings
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event happend, each object may decide how it reacts.
 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)
 getExportDirectory ()
 Get the location of the export directory for the test.
 _setImportDirectory ($a_import_dir=null)
 set import directory
 _getImportDirectory ()
 Get the import directory location of the test.
 getImportDirectory ()
 _createImportDirectory ()
 creates data directory for import files (data_dir/tst_data/tst_<id>/import, depending on data directory that is set in ILIAS setup/ini)
 hasSingleChoiceQuestions ()
 Returns TRUE if the test contains single choice results.
 isSingleChoiceTest ()
 Returns TRUE if the test contains single choice results only.
 isSingleChoiceTestWithoutShuffle ()
 Returns TRUE if the test contains single choice results and no shuffle only.
 isComplete (ilTestQuestionSetConfig $testQuestionSetConfig)
 Returns true, if a test is complete for use and can be set online.
 _isComplete ($obj_id)
 Returns true, if a test is complete for use.
 saveECTSStatus ($ects_output=0, $fx_support="", $ects_a=90, $ects_b=65, $ects_c=35, $ects_d=10, $ects_e=0)
 Saves the ECTS status (output of ECTS grades in a test) to the database.
 saveCompleteStatus (ilTestQuestionSetConfig $testQuestionSetConfig)
 Checks if the test is complete and saves the status in the database.
 getAllRTEContent ()
 Returns the content of all RTE enabled text areas in the test.
 cleanupMediaobjectUsage ()
 Cleans up the media objects for all text fields in a test which are using an RTE field.
 saveToDb ($properties_only=FALSE)
 Saves a ilObjTest object to a database.
 saveQuestionsToDb ()
 Saves the test questions to the database.
 randomSelectQuestions ($nr_of_questions, $questionpool, $use_obj_id=0, $qpls="", $pass=NULL)
 Returns a random selection of questions.
 getNrOfResultsForPass ($active_id, $pass)
 Calculates the number of user results for a specific test pass.
 hasRandomQuestionsForPass ($active_id, $pass)
 Checkes wheather a random test has already created questions for a given pass or not.
 loadFromDb ()
 Loads a ilObjTest object from a database.
 loadQuestions ($active_id="", $pass=NULL)
 Load the test question id's from the database.
 setIntroduction ($introduction="")
 Sets the introduction text of the ilObjTest object.
 setFinalStatement ($a_statement="")
 Sets the final statement text of the ilObjTest object.
 setShowInfo ($a_info=1)
 Set whether the complete information page is shown or the required data only.
 setForceJS ($a_js=1)
 Set whether JavaScript should be forced for tests.
 setCustomStyle ($a_customStyle=NULL)
 Set the custom style.
 getCustomStyle ()
 Get the custom style.
 getCustomStyles ()
 Return the available custom styles.
 getTestStyleLocation ($mode="output")
 get full style sheet file name (path inclusive) of current user
 setShowFinalStatement ($show=0)
 Sets whether the final statement should be shown or not.
 getIntroduction ()
 Gets the introduction text of the ilObjTest object.
 getFinalStatement ()
 Gets the final statement.
 getShowInfo ()
 Gets whether the complete information page is shown or the required data only.
 getForceJS ()
 Gets whether JavaScript should be forced for tests.
 getShowFinalStatement ()
 Returns whether the final statement should be shown or not.
 getTestId ()
 Gets the database id of the additional test data.
 getECTSOutput ()
 Indicates if ECTS grades output is presented in this test.
 setECTSOutput ($a_ects_output)
 Enables/Disables ECTS grades output for this test.
 getECTSFX ()
 Returns the ECTS FX grade.
 setECTSFX ($a_ects_fx)
 Sets the ECTS FX grade.
getECTSGrades ()
 Returns the ECTS grades.
 setECTSGrades ($a_ects_grades)
 Sets the ECTS grades.
 setSequenceSettings ($sequence_settings=0)
 Sets the sequence settings of the ilObjTest object.
 setScoreReporting ($score_reporting=0)
 Sets the score reporting of the ilObjTest object.
 setInstantFeedbackSolution ($instant_feedback=0)
 Sets the instant feedback for the solution.
 setAnswerFeedback ($answer_feedback=0)
 Sets the generic feedback for the test Use setGenericAnswerFeedback instead.
 setGenericAnswerFeedback ($generic_answer_feedback=0)
 Sets if the generic feedback is to be shown in the test.
 setAnswerFeedbackPoints ($answer_feedback_points=0)
 Sets the answer specific feedback of reached points for the test.
 setReportingDate ($reporting_date)
 Sets the reporting date of the ilObjTest object.
 getSequenceSettings ()
 Gets the sequence settings of the ilObjTest object SEQUENCE SETTING = POSTPONING ENABLED !!
 getScoreReporting ()
 Gets the score reporting of the ilObjTest object.
 getInstantFeedbackSolution ()
 Returns 1 if the correct solution will be shown after answering a question.
 getAnswerFeedback ()
 Returns 1 if generic answer feedback is activated.
 getGenericAnswerFeedback ()
 Returns 1 if generic answer feedback is to be shown.
 getAnswerFeedbackPoints ()
 Returns 1 if answer specific feedback as reached points is activated.
 getCountSystem ()
 Gets the count system for the calculation of points.
 _getCountSystem ($active_id)
 Gets the count system for the calculation of points.
 getMCScoring ()
 Gets the scoring type for multiple choice questions.
 getScoreCutting ()
 Determines if the score of a question should be cut at 0 points or the score of the whole test.
 getPassword ()
 Returns the password for test access.
 getPassScoring ()
 Gets the pass scoring type.
 _getPassScoring ($active_id)
 Gets the pass scoring type.
 _getMCScoring ($active_id)
 Gets the scoring type for multiple choice questions.
 _getScoreCutting ($active_id)
 Determines if the score of a question should be cut at 0 points or the score of the whole test.
 getReportingDate ()
 Gets the reporting date of the ilObjTest object.
 getNrOfTries ()
 Returns the nr of tries for the test.
 getKiosk ()
 Returns the kiosk mode.
 setKiosk ($kiosk=0)
 Sets the kiosk mode for the test.
 getKioskMode ()
 Returns the kiosk mode.
 setKioskMode ($a_kiosk=FALSE)
 Sets the kiosk mode for the test.
 getShowKioskModeTitle ()
 Returns the status of the kiosk mode title.
 setShowKioskModeTitle ($a_title=FALSE)
 Set to true, if the full test title should be shown in kiosk mode.
 getShowKioskModeParticipant ()
 Returns the status of the kiosk mode participant.
 setShowKioskModeParticipant ($a_participant=FALSE)
 Set to true, if the participant's name should be shown in kiosk mode.
 getUsePreviousAnswers ()
 Returns if the previous answers should be shown for a learner.
 getTitleOutput ()
 Returns the value of the title_output status.
 _getTitleOutput ($active_id)
 Returns the value of the title_output status.
 _getUsePreviousAnswers ($active_id, $user_active_user_setting=false)
 Returns if the previous results should be hidden for a learner.
 getProcessingTime ()
 Returns the processing time for the test.
 getProcessingTimeAsArray ()
 Returns the processing time for the test.
 getProcessingTimeInSeconds ($active_id="")
 Returns the processing time for the test in seconds.
 getSecondsUntilEndingTime ()
 Returns the seconds left from the actual time until the ending time.
 getEnableProcessingTime ()
 Returns the state of the processing time (enabled/disabled)
 getResetProcessingTime ()
 Returns wheather the processing time should be reset or not.
 getStartingTime ()
 Returns the starting time of the test.
 getEndingTime ()
 Returns the ending time of the test.
 setNrOfTries ($nr_of_tries=0)
 Sets the nr of tries for the test.
 setUsePreviousAnswers ($use_previous_answers=1)
 Sets the status of the visibility of previous learner answers.
 setRedirectionMode ($redirection_mode=0)
 getRedirectionMode ()
 setRedirectionUrl ($redirection_url=NULL)
 getRedirectionUrl ()
 setTitleOutput ($title_output=0)
 Sets the status of the title output.
 setProcessingTime ($processing_time="00:00:00")
 Sets the processing time for the test.
 setEnableProcessingTime ($enable=0)
 Sets the processing time enabled or disabled.
 setResetProcessingTime ($reset=0)
 Sets wheather the processing time should be reset or not.
 setStartingTime ($starting_time=NULL)
 Sets the starting time in database timestamp format for the test.
 setEndingTime ($ending_time=NULL)
 Sets the ending time in database timestamp format for the test.
 setCountSystem ($a_count_system=COUNT_PARTIAL_SOLUTIONS)
 Sets the count system for the calculation of points.
 setPassword ($a_password=NULL)
 Sets the password for test access.
 setScoreCutting ($a_score_cutting=SCORE_CUT_QUESTION)
 Sets the type of score cutting.
 setMCScoring ($a_mc_scoring=SCORE_ZERO_POINTS_WHEN_UNANSWERED)
 Sets the multiple choice scoring.
 setPassScoring ($a_pass_scoring=SCORE_LAST_PASS)
 Sets the pass scoring.
 removeQuestion ($question_id)
 Removes a question from the test object.
 removeAllTestEditings ($question_id="")
 Removes all references to the question in executed tests in case the question has been changed.
 removeTestResults (ilTestParticipantData $participantData)
 removeTestResultsByUserIds ($userIds)
 removeTestResultsByActiveIds ($activeIds)
 removeTestActives ($activeIds)
 removeTestResultsForUser ($user_id)
 questionMoveUp ($question_id)
 Moves a question up in order.
 questionMoveDown ($question_id)
 Moves a question down in order.
 duplicateQuestionForTest ($question_id)
 Takes a question and creates a copy of the question for use in the test.
 insertQuestion (ilTestQuestionSetConfig $testQuestionSetConfig, $question_id, $linkOnly=false)
 Insert a question in the list of questions.
getQuestionTitles ()
 Returns the titles of the test questions in question sequence.
getQuestionTitlesAndIndexes ()
 Returns the titles of the test questions in question sequence.
 getQuestionTitle ($title)
 Returns the title of a test question and checks if the title output is allowed.
 getQuestionDataset ($question_id)
 Returns the dataset for a given question id.
getExistingQuestions ($pass=NULL)
 Get the id's of the questions which are already part of the test.
 getQuestionType ($question_id)
 Returns the question type of a question with a given id.
 startWorkingTime ($active_id, $pass)
 Write the initial entry for the tests working time to the database.
 updateWorkingTime ($times_id)
 Update the working time of a test when a question is answered.
getWorkedQuestions ($active_id, $pass=NULL)
 Gets the id's of all questions a user already worked through.
 isTestFinishedToViewResults ($active_id, $currentpass)
 Returns true if an active user completed a test pass and did not start a new pass.
getAllQuestions ($pass=NULL)
 Returns all questions of a test in test order.
 getActiveIdOfUser ($user_id="", $anonymous_id="")
 Gets the active id of a given user.
 _getActiveIdOfUser ($user_id="", $test_id="")
 Gets the active id of the tst_active table for the active user.
 pcArrayShuffle ($array)
 Shuffles the values of a given array.
getTestResult ($active_id, $pass=NULL, $ordered_sequence=FALSE)
 Calculates the results of a test for a given user and returns an array with all test results.
 evalTotalPersons ()
 Returns the number of persons who started the test.
 getCompleteWorkingTime ($user_id)
 Returns the complete working time in seconds a user worked on the test.
getCompleteWorkingTimeOfParticipants ()
 Returns the complete working time in seconds for all test participants.
_getCompleteWorkingTimeOfParticipants ($test_id)
 Returns the complete working time in seconds for all test participants.
 getCompleteWorkingTimeOfParticipant ($active_id)
 Returns the complete working time in seconds for a test participant.
 _getWorkingTimeOfParticipantForPass ($active_id, $pass)
 Returns the complete working time in seconds for a test participant.
 getVisitTimeOfParticipant ($active_id)
 Returns the first and last visit of a participant.
 _getVisitTimeOfParticipant ($test_id, $active_id)
 Returns the first and last visit of a participant.
evalStatistical ($active_id)
 Returns the statistical evaluation of the test for a specified user.
getTotalPointsPassedArray ()
 Returns an array with the total points of all users who passed the test This array could be used for statistics.
getParticipants ()
 Returns all persons who started the test.
evalTotalPersonsArray ($name_sort_order="asc")
 Returns all persons who started the test.
evalTotalParticipantsArray ($name_sort_order="asc")
 Returns all participants who started the test.
 evalTotalFinished ()
 Returns the number of total finished tests.
getQuestionsOfTest ($active_id)
 Retrieves all the assigned questions for all test passes of a test participant.
getQuestionsOfPass ($active_id, $pass)
 Retrieves all the assigned questions for a test participant in a given test pass.
 getUnfilteredEvaluationData ()
 _getQuestionCountAndPointsForPassOfParticipant ($active_id, $pass)
getCompleteEvaluationData ($withStatistics=TRUE, $filterby="", $filtertext="")
evalResultsOverview ()
 Creates an associated array with the results of all participants of a test.
_evalResultsOverview ($test_id)
 Creates an associated array with the results of all participants of a test.
evalResultsOverviewOfParticipant ($active_id)
 Creates an associated array with the results for a given participant of a test.
 buildName ($user_id, $firstname, $lastname, $title)
 Builds a user name for the output depending on test type and existence of the user.
 _buildName ($is_anonymous, $user_id, $firstname, $lastname, $title)
 Builds a user name for the output depending on test type and existence of the user.
 evalTotalStartedAverageTime ()
 Returns the average processing time for all started tests.
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.
 getEstimatedWorkingTime ()
 Returns the estimated working time for the test calculated from the working time of the contained questions.
 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.
 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.
createQuestionGUI ($question_type, $question_id=-1)
 Creates a question GUI instance of a given question type.
_instanciateQuestion ($question_id)
 Creates an instance of a question with a given question id.
 moveQuestions ($move_questions, $target_index, $insert_mode)
 Move questions to another position.
 startingTimeReached ()
 Returns true if the starting time of a test is reached A starting time is not available for self assessment tests.
 endingTimeReached ()
 Returns true if the ending time of a test is reached An ending time is not available for self assessment tests.
 getAvailableQuestions ($arrFilter, $completeonly=0)
 Calculates the available questions for a test.
getQuestionTypeTranslations ()
 fromXML (ilQTIAssessment $assessment)
 Receives parameters from a QTI parser and creates a valid ILIAS test object.
 toXML ()
 Returns a QTI xml representation of the test.
 exportPagesXML (&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 export pages of test to xml (see ilias_co.dtd)
 exportXMLMetaData (&$a_xml_writer)
 export content objects meta data to xml (see ilias_co.dtd)
 modifyExportIdentifier ($a_tag, $a_param, $a_value)
 Returns the installation id for a given identifier.
 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)
 exportFileItems ($a_target_dir, &$expLog)
 export files of file itmes
 getImportMapping ()
 get array of (two) new created questions for import id
 getECTSGrade ($passed_array, $reached_points, $max_points)
 Returns the ECTS grade for a number of reached points.
 _getECTSGrade ($points_passed, $reached_points, $max_points, $a, $b, $c, $d, $e, $fx)
 Returns the ECTS grade for a number of reached points.
 checkMarks ()
 getMarkSchema ()
 setAuthor ($author="")
 Sets the authors name of the ilObjTest object.
 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.
 createMetaData ()
 Create meta data entry.
 getAuthor ()
 Gets the authors name of the ilObjTest object.
 _lookupAuthor ($obj_id)
 Gets the authors name of the ilObjTest object.
_getAvailableTests ($use_object_id=FALSE)
 Returns the available tests for the active user.
 getQuestionCount ()
 Returns the number of questions in the test.
 logAction ($logtext="", $question_id="")
 Logs an action into the Test&Assessment log.
 _getObjectIDFromTestID ($test_id)
 Returns the ILIAS test object id for a given test id.
 _getObjectIDFromActiveID ($active_id)
 Returns the ILIAS test object id for a given active id.
 _getTestIDFromObjectID ($object_id)
 Returns the ILIAS test id for a given object id.
 getTextAnswer ($active_id, $question_id, $pass=NULL)
 Returns the text answer of a given user for a given question.
 getQuestiontext ($question_id)
 Returns the question text for a given question.
getInvitedUsers ($user_id="", $order="login, lastname, firstname")
 Returns a list of all invited users in a test.
getTestParticipants ()
 Returns a list of all participants in a test.
 getTestParticipantsForManualScoring ($filter=NULL)
getUserData ($ids)
 Returns a data of all users specified by id list.
getGroupData ($ids)
getRoleData ($ids)
 inviteGroup ($group_id)
 Invites all users of a group to a test.
 inviteRole ($role_id)
 Invites all users of a role to a test.
 disinviteUser ($user_id)
 Disinvites a user from a test.
 inviteUser ($user_id, $client_ip="")
 Invites a user to a test.
 setClientIP ($user_id, $client_ip)
 _getSolvedQuestions ($active_id, $question_fi=null)
 get solved questions
 setQuestionSetSolved ($value, $question_id, $user_id)
 sets question solved state to value for given user_id
 isTestFinished ($active_id)
 returns if the active for user_id has been submitted
 isActiveTestSubmitted ($user_id=null)
 returns if the active for user_id has been submitted
 hasNrOfTriesRestriction ()
 returns if the numbers of tries have to be checked
 isNrOfTriesReached ($tries)
 returns if number of tries are reached
 getAllTestResults ($participants, $prepareForCSV=true)
 returns all test results for all participants
processCSVRow ($row, $quoteAll=FALSE, $separator=";")
 Processes an array as a CSV row and converts the array values to correct CSV values.
 _getPass ($active_id)
 Retrieves the actual pass of a given user for a given test.
 _getMaxPass ($active_id)
 Retrieves the maximum pass of a given user for a given test in which the user answered at least one question.
 _getBestPass ($active_id)
 Retrieves the best pass of a given user for a given test.
 _getResultPass ($active_id)
 Retrieves the pass number that should be counted for a given user.
 getAnsweredQuestionCount ($active_id, $pass=NULL)
 Retrieves the number of answered questions for a given user in a given test.
 getPassFinishDate ($active_id, $pass)
 Retrieves the number of answered questions for a given user in a given test.
 isExecutable ($testSession, $user_id, $allowPassIncrease=FALSE)
 Checks if the test is executable by the given user.
 canViewResults ()
 Returns true, if the test results can be viewed.
 canShowTestResults ($testSession, $user_id)
 canEditMarks ()
 getStartingTimeOfUser ($active_id, $pass=null)
 Returns the unix timestamp of the time a user started a test.
 isMaxProcessingTimeReached ($starting_time, $active_id)
 Returns whether the maximum processing time for a test is reached or not.
getTestQuestions ()
 getShuffleQuestions ()
 Returns the status of the shuffle_questions variable.
 setShuffleQuestions ($a_shuffle)
 Sets the status of the shuffle_questions variable.
 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.
 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.
 getListOfQuestions ()
 Returns if the list of questions should be presented to the user or not.
 setListOfQuestions ($a_value=TRUE)
 Sets if the the list of questions should be presented to the user or not.
 getListOfQuestionsStart ()
 Returns if the list of questions should be presented as the first page of the test.
 setListOfQuestionsStart ($a_value=TRUE)
 Sets if the the list of questions as the start page of the test.
 getListOfQuestionsEnd ()
 Returns if the list of questions should be presented as the last page of the test.
 setListOfQuestionsEnd ($a_value=TRUE)
 Sets if the the list of questions as the end page of the test.
 getListOfQuestionsDescription ()
 Returns TRUE if the list of questions should be presented with the question descriptions.
 setListOfQuestionsDescription ($a_value=TRUE)
 Sets the show_summary attribute to TRUE if the list of questions should be presented with the question descriptions.
 getResultsPresentation ()
 Returns the combined results presentation value.
 getShowPassDetails ()
 Returns if the pass details should be shown when a test is not finished.
 getShowSolutionDetails ()
 Returns if the solution details should be presented to the user or not.
 getShowSolutionPrintview ()
 Returns if the solution printview should be presented to the user or not.
 getShowSolutionFeedback ()
 Returns if the feedback should be presented to the solution or not.
 getShowSolutionAnswersOnly ()
 Returns if the full solution (including ILIAS content) should be presented to the solution or not.
 getShowSolutionSignature ()
 Returns if the signature field should be shown in the test results.
 getShowSolutionSuggested ()
 getShowSolutionListComparison ()
 setResultsPresentation ($a_results_presentation=3)
 Sets the combined results presentation value.
 setShowPassDetails ($a_details=1)
 Sets if the pass details should be shown when a test is not finished.
 setShowSolutionDetails ($a_details=1)
 Sets if the the solution details should be presented to the user or not.
 canShowSolutionPrintview ($user_id=NULL)
 Calculates if a user may see the solution printview of his/her test results.
 setShowSolutionPrintview ($a_printview=1)
 Sets if the the solution printview should be presented to the user or not.
 setShowSolutionFeedback ($a_feedback=TRUE)
 Sets if the the feedback should be presented to the user in the solution or not.
 setShowSolutionAnswersOnly ($a_full=TRUE)
 Set to true, if the full solution (including the ILIAS content pages) should be shown in the solution output.
 setShowSolutionSignature ($a_signature=FALSE)
 Set to TRUE, if the signature field should be shown in the solution.
 setShowSolutionSuggested ($a_solution=FALSE)
 Set to TRUE, if the suggested solution should be shown in the solution.
 setShowSolutionListComparison ($a_comparison=FALSE)
 Set to TRUE, if the list of answers should be shown prior to finish the test.
 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.
 QTIMaterialToString ($a_material)
 Reads an QTI material tag an creates a text string.
 addQTIMaterial (&$a_xml_writer, $a_material)
 Creates a QTI material tag from a plain text or xhtml text.
 prepareTextareaOutput ($txt_output, $prepare_for_latex_output=FALSE)
 Prepares a string for a text area output in tests.
 saveCertificateVisibility ($a_value)
 Saves the visibility settings of the certificate.
 getCertificateVisibility ()
 Returns the visibility settings of the certificate.
 setCertificateVisibility ($a_value)
 Sets the visibility settings of the certificate.
 getAnonymity ()
 Returns the anonymity status of the test.
 setAnonymity ($a_value=0)
 Sets the anonymity status of the test.
 getShowCancel ()
 Returns wheather the cancel test button is shown or not.
 setShowCancel ($a_value=1)
 Sets the cancel test button status.
 getShowMarker ()
 Returns wheather the marker button is shown or not.
 setShowMarker ($a_value=1)
 Sets the marker button status.
 getFixedParticipants ()
 Returns the fixed participants status.
 setFixedParticipants ($a_value=1)
 Sets the fixed participants status.
 _lookupAnonymity ($a_obj_id)
 Returns the anonymity status of a test with a given object id.
 _lookupRandomTestFromActiveId ($active_id)
 Returns the random status of a test with a given object id.
 userLookupFullName ($user_id, $overwrite_anonymity=FALSE, $sorted_order=FALSE, $suffix="")
 Returns the full name of a test user according to the anonymity status.
 getStartTestLabel ($active_id)
 Returns the "Start the Test" label for the Info page.
getTestDefaults ($test_defaults_id)
 Returns the test defaults for a given id.
 deleteDefaults ($test_default_id)
 Deletes the defaults for a test.
 addDefaults ($a_name)
 Adds the defaults of this test to the test defaults.
 applyDefaults ($test_defaults)
 Applies given test defaults to this test.
 processPrintoutput2FO ($print_output)
 Convert a print output to XSL-FO.
 deliverPDFfromHTML ($content, $title=NULL)
 Delivers a PDF file from XHTML.
 deliverPDFfromFO ($fo, $title=null)
 Delivers a PDF file from a XSL-FO string.
 getJavaScriptOutput ()
 Returns if Javascript should be chosen for drag & drop actions for the active user.
createTestSequence ($active_id, $pass, $shuffle)
 setTestId ($a_id)
 Sets the test ID.
 getDetailedTestResults ($participants)
 returns all test results for all participants
 _lookupTestObjIdForQuestionId ($a_q_id)
 Get test Object ID for question ID.
 isPluginActive ($a_pname)
 Checks wheather or not a question plugin with a given name is active.
 getPassed ($active_id)
 canShowCertificate ($testSession, $user_id, $active_id)
 Checks whether the certificate button could be shown on the info page or not.
 getAggregatedResultsData ()
 Returns the aggregated test results.
 getXMLZip ()
 Get zipped xml file for test.
 getMailNotification ()
 Get mail notification settings.
 setMailNotification ($a_notification)
 Set mail notification settings.
 sendSimpleNotification ($active_id)
 getEvaluationAdditionalFields ()
 Gets additional user fields that should be shown in the user evaluation.
 sendAdvancedNotification ($active_id)
 createRandomSolutions ($number)
 getResultsForActiveId ($active_id)
 getMailNotificationType ()
 setMailNotificationType ($a_type)
 getExportSettings ()
 setExportSettings ($a_settings)
 getExportSettingsSingleChoiceShort ()
 setExportSettingsSingleChoiceShort ($a_settings)
 getEnabledViewMode ()
 setEnabledViewMode ($mode)
 setTemplate ($template_id)
 getTemplate ()
 moveQuestionAfterOLD ($previous_question_id, $new_question_id)
 setScoringFeedbackOptionsByArray ($options)
 setResultsPresentationOptionsByArray ($options)
 getPoolUsage ()
 setPoolUsage ($usage)
 setQuestionOrderAndObligations ($orders, $obligations)
 moveQuestionAfter ($question_to_move, $question_before)
 hasQuestionsWithoutQuestionpool ()
 getQuestions ()
 isOnline ()
 setOnline ($a_online=true)
 setPrintBestSolutionWithResult ($status)
 isBestSolutionPrintedWithResult ()
 isOfferingQuestionHintsEnabled ()
 returns the fact wether offering hints is enabled or not
 setOfferingQuestionHintsEnabled ($offeringQuestionHintsEnabled)
 sets offering question hints enabled/disabled
 setActivationVisibility ($a_value)
 getActivationVisibility ()
 isActivationLimited ()
 setActivationLimited ($a_value)
 setHighscoreEnabled ($a_enabled)
 Sets if the highscore feature should be enabled.
 getHighscoreEnabled ()
 Gets the setting which determines if the highscore feature is enabled.
 setHighscoreAnon ($a_anon)
 Sets if the highscores should be anonymized.
 getHighscoreAnon ()
 Gets if the highscores should be anonymized per setting.
 isHighscoreAnon ()
 Gets if the highscores should be displayed anonymized.
 setHighscoreAchievedTS ($a_achieved_ts)
 Sets if the date and time of the scores achievement should be displayed.
 getHighscoreAchievedTS ()
 Returns if date and time of the scores achievement should be displayed.
 setHighscoreScore ($a_score)
 Sets if the actual score should be displayed.
 getHighscoreScore ()
 Gets if the score column should be shown.
 setHighscorePercentage ($a_percentage)
 Sets if the percentages of the scores pass should be shown.
 getHighscorePercentage ()
 Gets if the percentage column should be shown.
 setHighscoreHints ($a_hints)
 Sets if the number of requested hints should be shown.
 getHighscoreHints ()
 Gets, if the column with the number of requested hints should be shown.
 setHighscoreWTime ($a_wtime)
 Sets if the workingtime of the scores should be shown.
 getHighscoreWTime ()
 Gets if the column with the workingtime should be shown.
 setHighscoreOwnTable ($a_own_table)
 Sets if the table with the own ranking should be shown.
 getHighscoreOwnTable ()
 Gets if the own rankings table should be shown.
 setHighscoreTopTable ($a_top_table)
 Sets if the top-rankings table should be shown.
 getHighscoreTopTable ()
 Gets, if the top-rankings table should be shown.
 setHighscoreTopNum ($a_top_num)
 Sets the number of entries which are to be shown in the top-rankings table.
 getHighscoreTopNum ($a_retval=10)
 Gets the number of entries which are to be shown in the top-rankings table.
 setSpecificAnswerFeedback ($specific_answer_feedback)
 getSpecificAnswerFeedback ()
 setObligationsEnabled ($obligationsEnabled=true)
 sets obligations enabled/disabled
 areObligationsEnabled ()
 returns the fact wether obligations are enabled or not
 setAutosave ($autosave)
 getAutosave ()
 setAutosaveIval ($autosave_ival)
 getAutosaveIval ()
 isPassDeletionAllowed ()
 getter for the test setting passDeletionAllowed
 setPassDeletionAllowed ($passDeletionAllowed)
 setter for the test setting passDeletionAllowed
 setShowExamviewHtml ($show_examview_html)
 getShowExamviewHtml ()
 setShowExamviewPdf ($show_examview_pdf)
 getShowExamviewPdf ()
 setEnableExamview ($enable_examview)
 getEnableExamview ()
 setActivationStartingTime ($starting_time=NULL)
 setActivationEndingTime ($ending_time=NULL)
 getActivationStartingTime ()
 getActivationEndingTime ()
 getStartingTimeOfParticipants ()
 getTimeExtensionsOfParticipants ()
 getExtraTime ($active_id)
 addExtraTime ($active_id, $minutes)
 setEnableArchiving ($enable_archiving)
 getEnableArchiving ()
 lookupExamId ($active_id, $pass)
 setShowExamIdInTestPassEnabled ($show_exam_id_in_test_pass_enabled)
 isShowExamIdInTestPassEnabled ()
 setShowExamIdInTestResultsEnabled ($show_exam_id_in_test_results_enabled)
 isShowExamIdInTestResultsEnabled ()
 setSignSubmission ($sign_submission)
 getSignSubmission ()
 setCharSelectorAvailability ($availability)
 getCharSelectorAvailability ()
 setCharSelectorDefinition ($definition= '')
 getCharSelectorDefinition ()
 setQuestionSetType ($questionSetType)
 setter for question set type
 getQuestionSetType ()
 getter for question set type
 isRandomTest ()
 Returns the fact wether this test is a random questions test or not.
 isDynamicTest ()
 Returns the fact wether this test is a dynamic question set test or not.
 getQuestionSetTypeTranslation (ilLanguage $lng, $questionSetType)
 participantDataExist ()
 recalculateScores ($preserve_manscoring=false)
 isTestFinalBroken ()
 setTestFinalBroken ($testFinalBroken)
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public.
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not)
 getId ()
 get object id public
 setId ($a_id)
 set object id public
 setRefId ($a_id)
 set reference id public
 getRefId ()
 get reference id public
 getType ()
 get object type public
 setType ($a_type)
 set object type public
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions
 getTitle ()
 get object title public
 getUntranslatedTitle ()
 get untranslated object title public
 setTitle ($a_title)
 set object title
 getDescription ()
 get object description
 setDescription ($a_desc)
 set object description
 getLongDescription ()
 get object long description (stored in object_description)
 getImportId ()
 get import id
 setImportId ($a_import_id)
 set import id
 getOwner ()
 get object owner
 getOwnerName ()
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id
 setOwner ($a_owner)
 set object owner
 getCreateDate ()
 get create date public
 getLastUpdateDate ()
 get last update date public
 getDiskUsage ()
 Gets the disk usage of the object in bytes.
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class)
 create ()
 create
 MDUpdateListener ($a_element)
 Meta data update listener.
 updateMetaData ()
 update meta data entry
 deleteMetaData ()
 delete meta data entry
 updateOwner ()
 update owner of object in db
 _getIdForImportId ($a_import_id)
 get current object id for import id (static)
 _lookupOwner ($a_id)
 lookup object owner
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects.
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static)
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static)
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static)
 _isInTrash ($a_ref_id)
 checks wether object is in trash
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!?
 setPermissions ($a_parent_ref)
 set permissions of object
 createReference ()
 creates reference for object
 countReferences ()
 count references of object
 createRoleFolder ()
 creates a local role folder
 applyDidacticTemplate ($a_tpl_id)
 Apply template.
 setRegisterMode ($a_bool)
 isUserRegistered ($a_user_id=0)
 requireRegistration ()
 getHTMLDirectory ()
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ...
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container.
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies.
 cloneMetaData ($target_obj)
 Copy meta data.
 _lookupCreationDate ($a_id)
 Lookup creation date.

Static Public Member Functions

static _getUserIdFromActiveId ($active_id)
static lookupQuestionSetTypeByActiveId ($active_id)
 returns the question set type of test relating to passed active id
static _getTestDefaults ($test_defaults_id)
static getManualFeedback ($active_id, $question_id, $pass)
 Retrieves the manual feedback for a question in a test.
static _lookupFinishedUserTests ($a_user_id)
 Gather all finished tests for user.
static isQuestionObligationPossible ($questionId)
 checks wether the obligation for question with given id is possible or not
static isQuestionObligatory ($question_id)
 checks wether the question with given id is marked as obligatory or not
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
static hasObligations ($test_id)
 returns the fact wether the test with given test id contains questions markes as obligatory or not
static buildExamId ($active_id, $pass)
static lookupQuestionSetType ($objId)
 lookup-er for question set type
static _lookupRandomTest ($a_obj_id)
 Returns the fact wether the test with passed obj id is a random questions test or not.
static getPoolQuestionChangeListeners (ilDB $db, $poolObjId)
static getTestObjIdsWithActiveForUserId ($userId)
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
static _getAllReferences ($a_id)
 get all reference ids of object
static _lookupTitle ($a_id)
 lookup object title
static _getIdsForTitle ($title, $type= '', $partialmatch=false)
static _lookupDescription ($a_id)
 lookup object description
static _lookupObjId ($a_id)
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB.
static _lookupType ($a_id, $a_reference=false)
 lookup object type
static _lookupObjectId ($a_ref_id)
 lookup object id
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type.
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection.
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item.
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies.
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies.
static getLongDescriptions (array $a_obj_ids)
 Get long description data.
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns.
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course.

Data Fields

const QUESTION_SET_TYPE_FIXED = 'FIXED_QUEST_SET'
 type setting value for fixed question set
const QUESTION_SET_TYPE_RANDOM = 'RANDOM_QUEST_SET'
 type setting value for random question set
const QUESTION_SET_TYPE_DYNAMIC = 'DYNAMIC_QUEST_SET'
 type setting value for dynamic question set (continues testing mode)
 $test_id
 $invitation = INVITATION_OFF
 $author
 $metadata
 $questions
 $introduction
 $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
 $starting_time
 $ending_time
 $ects_output
 $ects_fx
 $ects_grades
 $count_system
 $mc_scoring
 $pass_scoring
 $shuffle_questions
 $results_presentation
 $show_summary
 $score_cutting
 $password
 $allowedUsers
 $allowedUsersTimeGap
 $certificate_visibility
 $anonymity
 $show_cancel
 $show_marker
 $fixed_participants
 $answer_feedback
 $testSession
 $testSequence
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title
const DESC_LENGTH = 128
 $ilias
 $lng
 $id
 $ref_id
 $type
 $title
 $untranslatedTitle
 $desc
 $long_desc
 $owner
 $create_date
 $last_update
 $import_id
 $register = false
 $referenced
 $objectList
 $max_title
 $max_desc
 $add_dots
 $obj_data_record
 object_data record

Protected Member Functions

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

Protected Attributes

 $_kiosk
 $mailnotification
 $mailnottype
 $exportsettings
 $poolUsage
 $print_best_solution_with_result = true
 $activation_visibility
 $activation_starting_time
 $activation_ending_time
 $autosave
 $autosave_ival
 $enable_examview
 $show_examview_html
 $show_examview_pdf
 $enable_archiving
 $show_exam_id_in_test_pass_enabled
 $show_exam_id_in_test_results_enabled
 $sign_submission
 $char_selector_availability
 $char_selector_definition
 $testFinalBroken

Private Attributes

 $questionSetType = self::QUESTION_SET_TYPE_FIXED
 $_showfinalstatement
 $_finalstatement
 $_showinfo
 $_forcejs
 $_customStyle
 $template_id
 $online = null
 the object's online status
 $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
 $redirection_mode = 0
 $redirection_url = NULL

Detailed Description

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

Constructor & Destructor Documentation

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

Constructor.

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

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

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

{
global $ilUser, $lng;
$this->type = "tst";
$lng->loadLanguageModule("assessment");
// Defaults:
include_once "./Modules/Test/classes/class.assMarkSchema.php";
$this->mark_schema = new ASS_MarkSchema();
$this->mark_schema->createSimpleSchema(
$lng->txt("failed_short"),
$lng->txt("failed_official"),
0,
0,
$lng->txt("passed_short"),
$lng->txt("passed_official"),
50,
1
);
$this->test_id = -1;
$this->author = $ilUser->fullname;
$this->introduction = "";
$this->questions = array();
$this->sequence_settings = TEST_FIXED_SEQUENCE;
$this->score_reporting = REPORT_AFTER_TEST;
$this->instant_verification = 0;
$this->answer_feedback_points = 0;
$this->reporting_date = "";
$this->nr_of_tries = 0;
$this->_kiosk = 0;
$this->use_previous_answers = 1;
$this->title_output = 0;
$this->starting_time = "";
$this->ending_time = "";
$this->processing_time = "00:00:00";
$this->enable_processing_time = "0";
$this->reset_processing_time = 0;
$this->ects_output = 0;
$this->ects_fx = NULL;
$this->shuffle_questions = FALSE;
$this->mailnottype = 0;
$this->exportsettings = 0;
$this->show_summary = 8;
$this->count_system = COUNT_PARTIAL_SOLUTIONS;
$this->mc_scoring = SCORE_ZERO_POINTS_WHEN_UNANSWERED;
$this->score_cutting = SCORE_CUT_QUESTION;
$this->pass_scoring = SCORE_LAST_PASS;
$this->answer_feedback = 0;
$this->password = "";
$this->certificate_visibility = 0;
$this->allowedUsers = "";
$this->_showfinalstatement = FALSE;
$this->_finalstatement = "";
$this->_showinfo = TRUE;
$this->_forcejs = FALSE;
$this->_customStyle = "";
$this->allowedUsersTimeGap = "";
$this->anonymity = 0;
$this->show_cancel = 0;
$this->show_marker = 0;
$this->fixed_participants = 0;
$this->setShowPassDetails(TRUE);
$this->setShowSolutionDetails(TRUE);
$this->setShowSolutionSignature(FALSE);
$this->testSession = FALSE;
$this->testSequence = FALSE;
$this->mailnotification = 0;
$this->poolUsage = 1;
$this->ects_grades = array(
"A" => 90,
"B" => 65,
"C" => 35,
"D" => 10,
"E" => 0
);
$this->autosave = FALSE;
$this->autosave_ival = 30000;
$this->enable_examview = false;
$this->show_examview_html = false;
$this->show_examview_pdf = false;
$this->enable_archiving = false;
$this->express_mode = false;
$this->template_id = '';
$this->redirection_mode = 0;
$this->redirection_url = NULL;
$this->show_exam_id_in_test_pass_enabled = false;
$this->show_exam_id_in_test_results_enabled = false;
$this->sign_submission = false;
$this->char_selector_availability = 0;
$this->char_selector_definition = null;
$this->testFinalBroken = false;
$this->ilObject($a_id, $a_call_by_reference);
}

+ Here is the call graph for this function:

Member Function Documentation

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

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

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

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

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

{
global $lng;
$name = "";
if (strlen($firstname.$lastname.$title) == 0)
{
$name = $lng->txt("deleted_user");
}
else
{
if ($user_id == ANONYMOUS_USER_ID)
{
$name = $lastname;
}
else
{
$name = trim($lastname . ", " . $firstname . " " . $title);
}
if ($is_anonymous)
{
$name = $lng->txt("anonymous");
}
}
return $name;
}
ilObjTest::_createImportDirectory ( )

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

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

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

Referenced by ilObjTestGUI\uploadTstObject().

{
global $ilias;
include_once "./Services/Utilities/classes/class.ilUtil.php";
$tst_data_dir = ilUtil::getDataDir()."/tst_data";
ilUtil::makeDir($tst_data_dir);
if (!is_writable($tst_data_dir))
{
$this->ilias->raiseError("Test Data Directory (".$tst_data_dir
.") not writeable.",$this->ilias->error_obj->FATAL);
}
// create test directory (data_dir/tst_data/tst_import)
$tst_dir = $tst_data_dir."/tst_import";
ilUtil::makeDir($tst_dir);
if (!@is_dir($tst_dir))
{
$ilias->raiseError("Creation of test import directory failed.",$ilias->error_obj->FATAL);
}
return $tst_dir;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilObjTest::_evalResultsOverview (   $test_id)

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

Returns
array An associated array containing the results public

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

References $result, $row, and $test_id.

Referenced by evalResultsOverview().

{
global $ilDB;
$result = $ilDB->queryF("SELECT usr_data.usr_id, usr_data.firstname, usr_data.lastname, usr_data.title, usr_data.login, " .
"tst_test_result.*, qpl_questions.original_id, qpl_questions.title questiontitle, " .
"qpl_questions.points maxpoints " .
"FROM tst_test_result, qpl_questions, tst_active " .
"LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id " .
"WHERE tst_active.active_id = tst_test_result.active_fi " .
"AND qpl_questions.question_id = tst_test_result.question_fi " .
"AND tst_active.test_fi = %s " .
"ORDER BY tst_active.active_id, tst_test_result.pass, tst_test_result.tstamp",
array('integer'),
array($test_id)
);
$overview = array();
while ($row = $ilDB->fetchAssoc($result))
{
if (!array_key_exists($row["active_fi"], $overview))
{
$overview[$row["active_fi"]] = array();
$overview[$row["active_fi"]]["firstname"] = $row["firstname"];
$overview[$row["active_fi"]]["lastname"] = $row["lastname"];
$overview[$row["active_fi"]]["title"] = $row["title"];
$overview[$row["active_fi"]]["login"] = $row["login"];
$overview[$row["active_fi"]]["usr_id"] = $row["usr_id"];
$overview[$row["active_fi"]]["started"] = $row["started"];
$overview[$row["active_fi"]]["finished"] = $row["finished"];
}
if (!array_key_exists($row["pass"], $overview[$row["active_fi"]]))
{
$overview[$row["active_fi"]][$row["pass"]] = array();
$overview[$row["active_fi"]][$row["pass"]]["reached"] = 0;
$overview[$row["active_fi"]][$row["pass"]]["maxpoints"] = $row["maxpoints"];
}
array_push($overview[$row["active_fi"]][$row["pass"]], $row);
$overview[$row["active_fi"]][$row["pass"]]["reached"] += $row["points"];
}
return $overview;
}

+ Here is the caller graph for this function:

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

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

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

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

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

{
global $ilDB;
global $ilUser;
if (!$user_id) {
$user_id = $ilUser->id;
}
if (!$test_id)
{
return "";
}
$result = $ilDB->queryF("SELECT tst_active.active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s",
array('integer', 'integer'),
array($user_id, $test_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
return $row["active_id"];
}
else
{
return "";
}
}
& ilObjTest::_getAvailableTests (   $use_object_id = FALSE)

Returns the available tests for the active user.

Returns
array The available tests public

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

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

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

{
global $ilUser;
global $ilDB;
$result_array = array();
$tests = ilUtil::_getObjectsByOperations("tst","write", $ilUser->getId(), -1);
if (count($tests))
{
foreach ($tests as $ref_id)
{
if ($use_object_id)
{
$obj_id = ilObject::_lookupObjId($ref_id);
$result_array[$obj_id] = $titles[$ref_id];
}
else
{
$result_array[$ref_id] = $titles[$ref_id];
}
}
}
return $result_array;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::_getBestPass (   $active_id)

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

ilLog $ilLog ILIAS $ilias

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

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

References $result, and $row.

Referenced by _getResultPass().

{
global $ilDB;
$result = $ilDB->queryF("SELECT * FROM tst_pass_result WHERE active_fi = %s",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$bestrow = null;
$bestfactor = 0;
while ($row = $ilDB->fetchAssoc($result))
{
if($row["maxpoints"] > 0)
{
$factor = $row["points"] / $row["maxpoints"];
}
else
{
$factor = 0;
}
if($factor > $bestfactor)
{
$bestrow = $row;
$bestfactor = $factor;
}
}
if (is_array($bestrow))
{
return $bestrow["pass"];
}
else
{
return 0;
}
}
else
{
return 0;
}
}

+ Here is the caller graph for this function:

& ilObjTest::_getCompleteWorkingTimeOfParticipants (   $test_id)

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

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

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

References $result, $row, and $test_id.

Referenced by getCompleteWorkingTimeOfParticipants().

{
global $ilDB;
$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",
array('integer'),
array($test_id)
);
$time = 0;
$times = array();
while ($row = $ilDB->fetchAssoc($result))
{
if (!array_key_exists($row["active_fi"], $times))
{
$times[$row["active_fi"]] = 0;
}
preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
$epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
$epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
$times[$row["active_fi"]] += ($epoch_2 - $epoch_1);
}
return $times;
}

+ Here is the caller graph for this function:

ilObjTest::_getCountSystem (   $active_id)

Gets the count system for the calculation of points.

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

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

References $result, and $row.

Referenced by assQuestion\adjustReachedPointsByScoringOptions().

{
global $ilDB;
$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",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
return $row["count_system"];
}
return FALSE;
}

+ Here is the caller graph for this function:

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

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

References $d.

Referenced by getECTSGrade().

{
include_once "./Modules/Test/classes/class.ilStatistics.php";
// calculate the median
$passed_statistics = new ilStatistics();
$passed_statistics->setData($points_passed);
$ects_percentiles = array
(
"A" => $passed_statistics->quantile($a),
"B" => $passed_statistics->quantile($b),
"C" => $passed_statistics->quantile($c),
"D" => $passed_statistics->quantile($d),
"E" => $passed_statistics->quantile($e)
);
if (count($points_passed) && ($reached_points >= $ects_percentiles["A"]))
{
return "A";
}
else if (count($points_passed) && ($reached_points >= $ects_percentiles["B"]))
{
return "B";
}
else if (count($points_passed) && ($reached_points >= $ects_percentiles["C"]))
{
return "C";
}
else if (count($points_passed) && ($reached_points >= $ects_percentiles["D"]))
{
return "D";
}
else if (count($points_passed) && ($reached_points >= $ects_percentiles["E"]))
{
return "E";
}
else if (strcmp($fx, "") != 0)
{
if ($max_points > 0)
{
$percentage = ($reached_points / $max_points) * 100.0;
if ($percentage < 0) $percentage = 0.0;
}
else
{
$percentage = 0.0;
}
if ($percentage >= $fx)
{
return "FX";
}
else
{
return "F";
}
}
else
{
return "F";
}
}

+ Here is the caller graph for this function:

ilObjTest::_getImportDirectory ( )

Get the import directory location of the test.

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

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

References $_SESSION.

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

{
if (strlen($_SESSION["tst_import_dir"]))
{
return $_SESSION["tst_import_dir"];
}
return null;
}

+ Here is the caller graph for this function:

ilObjTest::_getLastAccess (   $active_id)

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

References $result, and $row.

{
global $ilDB;
$result = $ilDB->queryF("SELECT finished FROM tst_times WHERE active_fi = %s ORDER BY finished DESC",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
return $row["finished"];
}
return "";
}
ilObjTest::_getMaxPass (   $active_id)

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

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

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

References $result, and $row.

Referenced by _getResultPass().

{
global $ilDB;
$result = $ilDB->queryF("SELECT MAX(pass) maxpass FROM tst_test_result WHERE active_fi = %s",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
$max = $row["maxpass"];
}
else
{
$max = NULL;
}
return $max;
}

+ Here is the caller graph for this function:

ilObjTest::_getMCScoring (   $active_id)

Gets the scoring type for multiple choice questions.

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

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

References $result, and $row.

Referenced by assMultipleChoice\calculateReachedPoints().

{
global $ilDB;
$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",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
return $row["mc_scoring"];
}
return FALSE;
}

+ Here is the caller graph for this function:

ilObjTest::_getObjectIDFromActiveID (   $active_id)

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

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

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

References $result, and $row.

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

{
global $ilDB;
$object_id = FALSE;
$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",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
$object_id = $row["obj_fi"];
}
return $object_id;
}

+ Here is the caller graph for this function:

ilObjTest::_getObjectIDFromTestID (   $test_id)

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

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

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

References $result, $row, and $test_id.

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

{
global $ilDB;
$object_id = FALSE;
$result = $ilDB->queryF("SELECT obj_fi FROM tst_tests WHERE test_id = %s",
array('integer'),
array($test_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
$object_id = $row["obj_fi"];
}
return $object_id;
}

+ Here is the caller graph for this function:

ilObjTest::_getPass (   $active_id)

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

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

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

References $result, and $row.

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

{
global $ilDB;
$result = $ilDB->queryF("SELECT tries FROM tst_active WHERE active_id = %s",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
return $row["tries"];
}
else
{
return 0;
}
}

+ Here is the caller graph for this function:

ilObjTest::_getPassScoring (   $active_id)

Gets the pass scoring type.

Returns
integer The pass scoring type public
See Also
$pass_scoring

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

References $result, and $row.

Referenced by _getResultPass().

{
global $ilDB;
$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",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
return $row["pass_scoring"];
}
return 0;
}

+ Here is the caller graph for this function:

ilObjTest::_getQuestionCountAndPointsForPassOfParticipant (   $active_id,
  $pass 
)

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

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

Referenced by ilTestEvaluationData\generateOverview().

{
global $ilDB;
switch( $questionSetType )
{
$res = $ilDB->queryF("
SELECT COUNT(qpl_questions.question_id) qcount,
SUM(qpl_questions.points) qsum
FROM tst_active
INNER JOIN tst_tests
ON tst_tests.test_id = tst_active.test_fi
INNER JOIN tst_dyn_quest_set_cfg
ON tst_dyn_quest_set_cfg.test_fi = tst_tests.test_id
INNER JOIN qpl_questions
ON qpl_questions.obj_fi = tst_dyn_quest_set_cfg.source_qpl_fi
AND qpl_questions.original_id IS NULL
AND qpl_questions.complete = %s
WHERE tst_active.active_id = %s
",
array('integer', 'integer'),
array(1, $active_id)
);
break;
$res = $ilDB->queryF("
SELECT tst_test_rnd_qst.pass,
COUNT(tst_test_rnd_qst.question_fi) qcount,
SUM(qpl_questions.points) qsum
FROM tst_test_rnd_qst,
qpl_questions
WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id
AND tst_test_rnd_qst.active_fi = %s
AND pass = %s
GROUP BY tst_test_rnd_qst.active_fi,
tst_test_rnd_qst.pass
",
array('integer', 'integer'),
array($active_id, $pass)
);
break;
$res = $ilDB->queryF("
SELECT COUNT(tst_test_question.question_fi) qcount,
SUM(qpl_questions.points) qsum
FROM tst_test_question,
qpl_questions,
tst_active
WHERE tst_test_question.question_fi = qpl_questions.question_id
AND tst_test_question.test_fi = tst_active.test_fi
AND tst_active.active_id = %s
GROUP BY tst_test_question.test_fi
",
array('integer'),
array($active_id)
);
break;
default:
throw new ilTestException("not supported question set type: $questionSetType");
}
$row = $ilDB->fetchAssoc($res);
if( is_array($row) )
{
return array("count" => $row["qcount"], "points" => $row["qsum"]);
}
return array("count" => 0, "points" => 0);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::_getResultPass (   $active_id)

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

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

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

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

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

{
$counted_pass = NULL;
{
$counted_pass = ilObjTest::_getBestPass($active_id);
}
else
{
$counted_pass = ilObjTest::_getMaxPass($active_id);
}
return $counted_pass;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::_getScoreCutting (   $active_id)

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

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

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

References $result, and $row.

Referenced by assQuestion\adjustReachedPointsByScoringOptions().

{
global $ilDB;
$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",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
return $row["score_cutting"];
}
return FALSE;
}

+ Here is the caller graph for this function:

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

get solved questions

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

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

References $result, and $row.

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

{
global $ilDB;
if (is_numeric($question_fi))
{
$result = $ilDB->queryF("SELECT question_fi, solved FROM tst_qst_solved WHERE active_fi = %s AND question_fi=%s",
array('integer', 'integer'),
array($active_id, $question_fi)
);
}
else
{
$result = $ilDB->queryF("SELECT question_fi, solved FROM tst_qst_solved WHERE active_fi = %s",
array('integer'),
array($active_id)
);
}
$result_array = array();
while ($row = $ilDB->fetchAssoc($result))
{
$result_array[$row["question_fi"]]= $row;
}
return $result_array;
}

+ Here is the caller graph for this function:

static ilObjTest::_getTestDefaults (   $test_defaults_id)
static

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

References $result, and $row.

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

{
global $ilDB;
$result = $ilDB->queryF("SELECT * FROM tst_test_defaults WHERE test_defaults_id = %s",
array('integer'),
array($test_defaults_id)
);
if ($result->numRows() == 1)
{
$row = $ilDB->fetchAssoc($result);
return $row;
}
else
{
return NULL;
}
}

+ Here is the caller graph for this function:

ilObjTest::_getTestIDFromObjectID (   $object_id)

Returns the ILIAS test id for a given object id.

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

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

References $result, $row, and $test_id.

{
global $ilDB;
$test_id = FALSE;
$result = $ilDB->queryF("SELECT test_id FROM tst_tests WHERE obj_fi = %s",
array('integer'),
array($object_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
$test_id = $row["test_id"];
}
return $test_id;
}
ilObjTest::_getTitleOutput (   $active_id)

Returns the value of the title_output status.

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

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

References $result, and $row.

Referenced by assQuestionGUI\outQuestionPage().

{
global $ilDB;
$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",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
return $row["title_output"];
}
return 0;
}

+ Here is the caller graph for this function:

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

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

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

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

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

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

{
global $ilDB;
global $ilUser;
$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",
array("integer"),
array($active_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
$use_previous_answers = $row["use_previous_answers"];
}
{
if ($user_active_user_setting)
{
$res = $ilUser->getPref("tst_use_previous_answers");
if ($res !== FALSE)
{
}
}
}
}

+ Here is the caller graph for this function:

static ilObjTest::_getUserIdFromActiveId (   $active_id)
static

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

References $result, and $row.

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

{
global $ilDB;
$result = $ilDB->queryF("SELECT user_fi FROM tst_active WHERE active_id = %s",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
return $row["user_fi"];
}
else
{
return -1;
}
}

+ Here is the caller graph for this function:

ilObjTest::_getVisitTimeOfParticipant (   $test_id,
  $active_id 
)

Returns the first and last visit of a participant.

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

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

References $result, $row, and $test_id.

Referenced by getVisitTimeOfParticipant().

{
global $ilDB;
$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",
array('integer','integer'),
array($test_id, $active_id)
);
$firstvisit = 0;
$lastvisit = 0;
while ($row = $ilDB->fetchAssoc($result))
{
preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
$epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
if ($firstvisit == 0 || $epoch_1 < $firstvisit) $firstvisit = $epoch_1;
preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
$epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
if ($epoch_2 > $lastvisit) $lastvisit = $epoch_2;
}
return array("firstvisit" => $firstvisit, "lastvisit" => $lastvisit);
}

+ Here is the caller graph for this function:

ilObjTest::_getWorkingTimeOfParticipantForPass (   $active_id,
  $pass 
)

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

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

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

References $pass, $result, and $row.

{
global $ilDB;
$result = $ilDB->queryF("SELECT * FROM tst_times WHERE active_fi = %s AND pass = %s ORDER BY started",
array('integer','integer'),
array($active_id, $pass)
);
$time = 0;
while ($row = $ilDB->fetchAssoc($result))
{
preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
$epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
$epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
$time += ($epoch_2 - $epoch_1);
}
return $time;
}
& ilObjTest::_instanciateQuestion (   $question_id)

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

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

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

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

{
if (strcmp($question_id, "") != 0)
{
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
return assQuestion::_instanciateQuestion($question_id);
}
}

+ Here is the caller graph for this function:

ilObjTest::_isComplete (   $obj_id)

Returns true, if a test is complete for use.

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

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

References $test.

{
global $tree, $ilDB, $ilPluginAdmin;
$test = new ilObjTest($obj_id, false);
$test->loadFromDb();
require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
$testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
return $test->isComplete( $testQuestionSetConfigFactory->getQuestionSetConfig() );
}
ilObjTest::_lookupAnonymity (   $a_obj_id)

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

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

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

References $result, and $row.

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

{
global $ilDB;
$result = $ilDB->queryF("SELECT anonymity FROM tst_tests WHERE obj_fi = %s",
array('integer'),
array($a_obj_id)
);
while($row = $ilDB->fetchAssoc($result))
{
return $row['anonymity'];
}
return 0;
}

+ Here is the caller graph for this function:

ilObjTest::_lookupAuthor (   $obj_id)

Gets the authors name of the ilObjTest object.

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

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

References $author, and ilObject\$id.

Referenced by assQuestion\getInstances().

{
$author = array();
include_once "./Services/MetaData/classes/class.ilMD.php";
$md =& new ilMD($obj_id, 0, "tst");
$md_life =& $md->getLifecycle();
if ($md_life)
{
$ids =& $md_life->getContributeIds();
foreach ($ids as $id)
{
$md_cont =& $md_life->getContribute($id);
if (strcmp($md_cont->getRole(), "Author") == 0)
{
$entids =& $md_cont->getEntityIds();
foreach ($entids as $entid)
{
$md_ent =& $md_cont->getEntity($entid);
array_push($author, $md_ent->getEntity());
}
}
}
}
return join($author, ",");
}

+ Here is the caller graph for this function:

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

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

{
global $ilDB;
$result = $ilDB->queryF("SELECT test_fi,MAX(pass) AS pass FROM tst_active".
" JOIN tst_pass_result ON (tst_pass_result.active_fi = tst_active.active_id)".
" WHERE user_fi=%s".
" GROUP BY test_fi",
array('integer', 'integer'),
array($a_user_id, 1)
);
$all = array();
while($row = $ilDB->fetchAssoc($result))
{
$obj_id = self::_getObjectIDFromTestID($row["test_fi"]);
$all[$obj_id] = (bool)$row["pass"];
}
return $all;
}

+ Here is the call graph for this function:

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

References lookupQuestionSetType(), and QUESTION_SET_TYPE_RANDOM.

Referenced by ilCourseObjectiveQuestionAssignmentTableGUI\parse().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::_lookupRandomTestFromActiveId (   $active_id)

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

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

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

References $result, and $row.

{
throw new Exception(__METHOD__.' is deprecated ... use ilObjTest::lookupQuestionSetTypeByActiveId() instead!');
global $ilDB;
$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",
array('integer'),
array($active_id)
);
while($row = $ilDB->fetchAssoc($result))
{
return $row['random_test'];
}
return 0;
}
ilObjTest::_lookupTestObjIdForQuestionId (   $a_q_id)

Get test Object ID for question ID.

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

References $result.

Referenced by ilObjMediaObject\getParentObjectIdForUsage().

{
global $ilDB;
$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",
array('integer'),
array($a_q_id)
);
$rec = $ilDB->fetchAssoc($result);
return $rec["obj_id"];
}

+ Here is the caller graph for this function:

ilObjTest::_setImportDirectory (   $a_import_dir = null)

set import directory

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

References $_SESSION.

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

{
if (strlen($a_import_dir))
{
$_SESSION["tst_import_dir"] = $a_import_dir;
}
else
{
unset($_SESSION["tst_import_dir"]);
}
}

+ Here is the caller graph for this function:

ilObjTest::addDefaults (   $a_name)

Adds the defaults of this test to the test defaults.

Parameters
string$a_nameThe name of the test defaults public

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

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

{
global $ilDB;
global $ilUser;
$testsettings = array(
"TitleOutput" => $this->getTitleOutput(),
"PassScoring" => $this->getPassScoring(),
"Introduction" => $this->getIntroduction(),
"FinalStatement" => $this->getFinalStatement(),
"ShowInfo" => $this->getShowInfo(),
"ForceJS" => $this->getForceJS(),
"CustomStyle" => $this->getCustomStyle(),
"ShowFinalStatement" => $this->getShowFinalStatement(),
"SequenceSettings" => $this->getSequenceSettings(),
"ScoreReporting" => $this->getScoreReporting(),
"ScoreCutting" => $this->getScoreCutting(),
'SpecificAnswerFeedback' => $this->getSpecificAnswerFeedback(),
'PrintBsWithRes' => (int)$this->isBestSolutionPrintedWithResult(),
"InstantFeedbackSolution" => $this->getInstantFeedbackSolution(),
"AnswerFeedback" => $this->getAnswerFeedback(),
"AnswerFeedbackPoints" => $this->getAnswerFeedbackPoints(),
"ResultsPresentation" => $this->getResultsPresentation(),
"Anonymity" => $this->getAnonymity(),
"ShowCancel" => $this->getShowCancel(),
"ShowMarker" => $this->getShowMarker(),
"ReportingDate" => $this->getReportingDate(),
"NrOfTries" => $this->getNrOfTries(),
"Shuffle" => $this->getShuffleQuestions(),
"Kiosk" => $this->getKiosk(),
"UsePreviousAnswers" => $this->getUsePreviousAnswers(),
"ProcessingTime" => $this->getProcessingTime(),
"EnableProcessingTime" => $this->getEnableProcessingTime(),
"ResetProcessingTime" => $this->getResetProcessingTime(),
"StartingTime" => $this->getStartingTime(),
"EndingTime" => $this->getEndingTime(),
"ECTSOutput" => $this->getECTSOutput(),
"ECTSFX" => $this->getECTSFX(),
"ECTSGrades" => $this->getECTSGrades(),
"questionSetType" => $this->getQuestionSetType(),
"CountSystem" => $this->getCountSystem(),
"MCScoring" => $this->getMCScoring(),
"mailnotification" => $this->getMailNotification(),
"mailnottype" => $this->getMailNotificationType(),
"exportsettings" => $this->getExportSettings(),
"ListOfQuestionsSettings" => $this->getListOfQuestionsSettings(),
'obligations_enabled' => (int)$this->areObligationsEnabled(),
'offer_question_hints' => (int)$this->isOfferingQuestionHintsEnabled(),
'pass_deletion_allowed' => (int)$this->isPassDeletionAllowed(),
'enable_examview' => $this->getEnableExamview(),
'show_examview_html' => $this->getShowExamviewHtml(),
'show_examview_pdf' => $this->getShowExamviewPdf(),
'char_selector_availability' => $this->getCharSelectorAvailability(),
'char_selector_definition' => $this->getCharSelectorDefinition(),
'redirection_mode' => $this->getRedirectionMode(),
'redirection_url' => $this->getRedirectionUrl(),
'sign_submission' => $this->getSignSubmission(),
'autosave' => (int)$this->getAutosave(),
'autosave_ival' => (int)$this->getAutosaveIval(),
'examid_in_test_pass' => (int)$this->isShowExamIdInTestPassEnabled(),
'examid_in_test_res' => (int)$this->isShowExamIdInTestResultsEnabled(),
'enable_archiving' => (int)$this->getEnableArchiving(),
'password' => (string)$this->getPassword(),
'fixed_participants' => $this->getFixedParticipants(),
'allowedusers' => $this->getAllowedUsers(),
'alloweduserstimegap' => $this->getAllowedUsersTimeGap(),
'pool_usage' => $this->getPoolUsage(),
'activation_limited' => $this->isActivationLimited(),
'activation_start_time' => $this->getActivationStartingTime(),
'activation_end_time' => $this->getActivationEndingTime(),
'activation_visibility' => $this->getActivationVisibility(),
'highscore_enabled' => $this->getHighscoreEnabled(),
'highscore_anon' => $this->getHighscoreAnon(),
'highscore_achieved_ts' => $this->getHighscoreAchievedTS(),
'highscore_score' => $this->getHighscoreScore(),
'highscore_percentage' => $this->getHighscorePercentage(),
'highscore_hints' => $this->getHighscoreHints(),
'highscore_wtime' => $this->getHighscoreWTime(),
'highscore_own_table' => $this->getHighscoreOwnTable(),
'highscore_top_table' => $this->getHighscoreTopTable(),
'highscore_top_num' => $this->getHighscoreTopNum(),
'use_previous_answers' => (string)$this->getUsePreviousAnswers()
);
$next_id = $ilDB->nextId('tst_test_defaults');
$ilDB->insert(
'tst_test_defaults',
array(
'test_defaults_id' => array('integer', $next_id),
'name' => array('text', $a_name),
'user_fi' => array('integer', $ilUser->getId()),
'defaults' => array('clob', serialize($testsettings)),
'marks' => array('clob', serialize($this->mark_schema)),
'tstamp' => array('integer', time())
)
);
}

+ Here is the call graph for this function:

ilObjTest::addExtraTime (   $active_id,
  $minutes 
)

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

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

{
global $ilDB;
$participants = array();
if ($active_id == 0)
{
$result = $ilDB->queryF("SELECT active_id FROM tst_active WHERE test_fi = %s",
array('integer'),
array($this->getTestId())
);
while ($row = $ilDB->fetchAssoc($result))
{
array_push($participants, $row['active_id']);
}
}
else
{
array_push($participants, $active_id);
}
foreach ($participants as $active_id)
{
$result = $ilDB->queryF("SELECT active_fi FROM tst_addtime WHERE active_fi = %s",
array('integer'),
array($active_id)
);
if ($result->numRows() > 0)
{
$ilDB->manipulateF("DELETE FROM tst_addtime WHERE active_fi = %s",
array('integer'),
array($active_id)
);
}
$ilDB->manipulateF("UPDATE tst_active SET tries = %s, submitted = %s, submittimestamp = %s WHERE active_id = %s",
array('integer','integer','timestamp','integer'),
array(0, 0, NULL, $active_id)
);
$ilDB->manipulateF("INSERT INTO tst_addtime (active_fi, additionaltime, tstamp) VALUES (%s, %s, %s)",
array('integer','integer','integer'),
array($active_id, $minutes, time())
);
require_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
{
$this->logAction(sprintf($this->lng->txtlng("assessment", "log_added_extratime", ilObjAssessmentFolder::_getLogLanguage()), $minutes, $active_id));
}
}
}

+ Here is the call graph for this function:

ilObjTest::addQTIMaterial ( $a_xml_writer,
  $a_material 
)

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

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

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

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

Referenced by toXML().

{
include_once "./Services/RTE/classes/class.ilRTE.php";
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
$a_xml_writer->xmlStartTag("material");
$attrs = array(
"texttype" => "text/plain"
);
if ($this->isHTML($a_material))
{
$attrs["texttype"] = "text/xhtml";
}
$a_xml_writer->xmlElement("mattext", $attrs, ilRTE::_replaceMediaObjectImageSrc($a_material, 0));
foreach ($mobs as $mob)
{
$moblabel = "il_" . IL_INST_ID . "_mob_" . $mob;
if (strpos($a_material, "mm_$mob") !== FALSE)
{
{
$mob_obj =& new ilObjMediaObject($mob);
$imgattrs = array(
"label" => $moblabel,
"uri" => "objects/" . "il_" . IL_INST_ID . "_mob_" . $mob . "/" . $mob_obj->getTitle()
);
}
$a_xml_writer->xmlElement("matimage", $imgattrs, NULL);
}
}
$a_xml_writer->xmlEndTag("material");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

public ilDB $ilDB

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

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

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

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

{
global $ilDB;
$rset = $ilDB->queryF(
'SELECT obligations_answered FROM tst_pass_result WHERE active_fi = %s AND pass = %s',
array('integer', 'integer'),
array($active_id, $pass)
);
if( $row = $ilDB->fetchAssoc($rset) )
{
return (bool)$row['obligations_answered'];
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

{
$testsettings = unserialize($test_defaults["defaults"]);
include_once "./Modules/Test/classes/class.assMarkSchema.php";
$this->mark_schema = unserialize($test_defaults["marks"]);
$this->setTitleOutput($testsettings["TitleOutput"]);
$this->setPassScoring($testsettings["PassScoring"]);
$this->setIntroduction($testsettings["Introduction"]);
$this->setFinalStatement($testsettings["FinalStatement"]);
$this->setShowInfo($testsettings["ShowInfo"]);
$this->setForceJS($testsettings["ForceJS"]);
$this->setCustomStyle($testsettings["CustomStyle"]);
$this->setShowFinalStatement($testsettings["ShowFinalStatement"]);
$this->setSequenceSettings($testsettings["SequenceSettings"]);
$this->setScoreReporting($testsettings["ScoreReporting"]);
$this->setScoreCutting($testsettings['ScoreCutting']);
$this->setSpecificAnswerFeedback($testsettings['SpecificAnswerFeedback']);
$this->setPrintBestSolutionWithResult((bool)$testsettings['PrintBsWithRes']);
$this->setInstantFeedbackSolution($testsettings["InstantFeedbackSolution"]);
$this->setAnswerFeedback($testsettings["AnswerFeedback"]);
$this->setAnswerFeedbackPoints($testsettings["AnswerFeedbackPoints"]);
$this->setResultsPresentation($testsettings["ResultsPresentation"]);
$this->setAnonymity($testsettings["Anonymity"]);
$this->setShowCancel($testsettings["ShowCancel"]);
$this->setShuffleQuestions($testsettings["Shuffle"]);
$this->setShowMarker($testsettings["ShowMarker"]);
$this->setReportingDate($testsettings["ReportingDate"]);
$this->setNrOfTries($testsettings["NrOfTries"]);
$this->setUsePreviousAnswers($testsettings["UsePreviousAnswers"]);
$this->setRedirectionMode($testsettings['redirection_mode']);
$this->setRedirectionUrl($testsettings['redirection_url']);
$this->setProcessingTime($testsettings["ProcessingTime"]);
$this->setResetProcessingTime($testsettings["ResetProcessingTime"]);
$this->setEnableProcessingTime($testsettings["EnableProcessingTime"]);
$this->setStartingTime($testsettings["StartingTime"]);
$this->setKiosk($testsettings["Kiosk"]);
$this->setEndingTime($testsettings["EndingTime"]);
$this->setECTSOutput($testsettings["ECTSOutput"]);
$this->setECTSFX($testsettings["ECTSFX"]);
$this->setECTSGrades($testsettings["ECTSGrades"]);
if( isset($testsettings["isRandomTest"]) )
{
if( $testsettings["isRandomTest"] )
{
$this->setQuestionSetType(self::QUESTION_SET_TYPE_RANDOM);
}
else
{
$this->setQuestionSetType(self::QUESTION_SET_TYPE_FIXED);
}
}
elseif( isset($testsettings["questionSetType"]) )
{
$this->setQuestionSetType($testsettings["questionSetType"]);
}
$this->setCountSystem($testsettings["CountSystem"]);
$this->setMCScoring($testsettings["MCScoring"]);
$this->setMailNotification($testsettings["mailnotification"]);
$this->setMailNotificationType($testsettings["mailnottype"]);
$this->setExportSettings($testsettings['exportsettings']);
$this->setListOfQuestionsSettings($testsettings["ListOfQuestionsSettings"]);
$this->setObligationsEnabled($testsettings["obligations_enabled"]);
$this->setOfferingQuestionHintsEnabled($testsettings["offer_question_hints"]);
$this->setHighscoreEnabled($testsettings['highscore_enabled']);
$this->setHighscoreAnon($testsettings['highscore_anon']);
$this->setHighscoreAchievedTS($testsettings['highscore_achieved_ts']);
$this->setHighscoreScore($testsettings['highscore_score']);
$this->setHighscorePercentage($testsettings['highscore_percentage']);
$this->setHighscoreHints($testsettings['highscore_hints']);
$this->setHighscoreWTime($testsettings['highscore_wtime']);
$this->setHighscoreOwnTable($testsettings['highscore_own_table']);
$this->setHighscoreTopTable($testsettings['highscore_top_table']);
$this->setHighscoreTopNum($testsettings['highscore_top_num']);
$this->setPassDeletionAllowed($testsettings['pass_deletion_allowed']);
if( isset($testsettings['examid_in_kiosk']) )
{
$this->setShowExamIdInTestPassEnabled($testsettings['examid_in_kiosk']);
}
else
{
$this->setShowExamIdInTestPassEnabled($testsettings['examid_in_test_pass']);
}
if( isset($testsettings['show_exam_id']) )
{
$this->setShowExamIdInTestResultsEnabled($testsettings['show_exam_id']);
}
else
{
$this->setShowExamIdInTestResultsEnabled($testsettings['examid_in_test_res']);
}
$this->setEnableExamview($testsettings['enable_examview']);
$this->setShowExamviewHtml($testsettings['show_examview_html']);
$this->setShowExamviewPdf($testsettings['show_examview_pdf']);
$this->setEnableArchiving($testsettings['enable_archiving']);
$this->setSignSubmission($testsettings['sign_submission']);
$this->setCharSelectorAvailability($testsettings['char_selector_availability']);
$this->setCharSelectorDefinition($testsettings['char_selector_definition']);
$this->setRedirectionMode($testsettings['redirection_mode']);
$this->setRedirectionUrl($testsettings['redirection_url']);
$this->setAutosave($testsettings['autosave']);
$this->setAutosaveIval($testsettings['autosave_ival']);
$this->setShowExamIdInTestResultsEnabled((int)$testsettings['examid_in_test_res']);
$this->setPassword($testsettings['password']);
$this->setFixedParticipants($testsettings['fixed_participants'] );
$this->setAllowedUsers($testsettings['allowedusers']);
$this->setAllowedUsersTimeGap($testsettings['alloweduserstimegap']);
$this->setUsePreviousAnswers($testsettings['use_previous_answers']);
$this->setPoolUsage($testsettings['pool_usage']);
$this->setActivationLimited($testsettings['activation_limited']);
$this->setActivationStartingTime($testsettings['activation_start_time']);
$this->setActivationEndingTime($testsettings['activation_end_time']);
$this->setActivationVisibility($testsettings['activation_visibility']);
$this->saveToDb();
return true;
}

+ Here is the call graph for this function:

ilObjTest::areObligationsEnabled ( )

returns the fact wether obligations are enabled or not

Returns
boolean

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

References $obligationsEnabled.

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

{
}

+ Here is the caller graph for this function:

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

Move this to a proper place.

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

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

Referenced by ilTestPlayerAbstractGUI\getKioskHead().

{
global $ilSetting;
$inst_id = $ilSetting->get( 'inst_id', null );
$obj_id = self::_getObjectIDFromActiveID($active_id);
$examId = 'I' . $inst_id . '_T' . $obj_id . '_A' . $active_id . '_P' . $pass;
return $examId;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

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

References ilObject\$title, and getAnonymity().

{
$name = "";
if (strlen($firstname.$lastname.$title) == 0)
{
$name = $this->lng->txt("deleted_user");
}
else
{
if ($user_id == ANONYMOUS_USER_ID)
{
$name = $lastname;
}
else
{
$name = trim($lastname . ", " . $firstname . " " . $title);
}
if ($this->getAnonymity())
{
$name = $this->lng->txt("anonymous");
}
}
return $name;
}

+ Here is the call graph for this function:

ilObjTest::canEditMarks ( )

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

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

{
if ($total > 0)
{
if ($this->getReportingDate())
{
if (preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getReportingDate(), $matches))
{
$epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
$now = mktime();
if ($now < $epoch_time)
{
return true;
}
}
}
return false;
}
else
{
return true;
}
}

+ Here is the call graph for this function:

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

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

public

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

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

{
if ($this->canShowTestResults($testSession, $user_id))
{
include_once "./Services/Certificate/classes/class.ilCertificate.php";
include_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
$cert = new ilCertificate(new ilTestCertificateAdapter($this));
if ($cert->isComplete())
{
$vis = $this->getCertificateVisibility();
$showcert = FALSE;
switch ($vis)
{
case 0:
$showcert = TRUE;
break;
case 1:
if ($this->getPassed($active_id))
{
$showcert = TRUE;
}
break;
case 2:
$showcert = FALSE;
break;
}
if ($showcert)
{
return TRUE;
}
else
{
return FALSE;
}
}
else
{
return FALSE;
}
}
else
{
return FALSE;
}
}

+ Here is the call graph for this function:

ilObjTest::canShowSolutionPrintview (   $user_id = NULL)

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

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

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

References getShowSolutionPrintview().

{
return $this->getShowSolutionPrintview();
}

+ Here is the call graph for this function:

ilObjTest::canShowTestResults (   $testSession,
  $user_id 
)

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

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

Referenced by canShowCertificate().

{
$active_id = $this->getActiveIdOfUser($user_id);
if ($active_id > 0)
{
$starting_time = $this->getStartingTimeOfUser($active_id);
}
$notimeleft = FALSE;
if ($starting_time !== FALSE)
{
if ($this->isMaxProcessingTimeReached($starting_time, $active_id))
{
$notimeleft = TRUE;
}
}
$result = TRUE;
if (!$this->isTestFinishedToViewResults($active_id, $testSession->getPass()) && ($this->getScoreReporting() == REPORT_AFTER_TEST))
{
$result = FALSE;
}
if (($this->endingTimeReached()) || $notimeleft) $result = TRUE;
return $result;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::canViewResults ( )

Returns true, if the test results can be viewed.

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

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

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

Referenced by canShowTestResults().

{
$result = true;
if ($this->getScoreReporting() == 4) return false;
if ($this->getReportingDate())
{
if (preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getReportingDate(), $matches))
{
$epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
$now = mktime();
if ($now < $epoch_time)
{
$result = false;
}
}
}
return $result;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::checkMarks ( )

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

{
return $this->mark_schema->checkMarks();
}
ilObjTest::checkMaximumAllowedUsers ( )

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

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

{
global $ilDB;
$nr_of_users = $this->getAllowedUsers();
$time_gap = ($this->getAllowedUsersTimeGap()) ? $this->getAllowedUsersTimeGap() : 60;
if (($nr_of_users > 0) && ($time_gap > 0))
{
$now = mktime();
$time_border = $now - $time_gap;
$str_time_border = strftime("%Y%m%d%H%M%S", $time_border);
$result = $ilDB->queryF("SELECT DISTINCT tst_times.active_fi FROM tst_times, tst_active WHERE tst_times.tstamp > %s AND tst_times.active_fi = tst_active.active_id AND tst_active.test_fi = %s",
array('integer', 'integer'),
array($time_border, $this->getTestId())
);
if ($result->numRows() >= $nr_of_users)
{
include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
{
$this->logAction($this->lng->txtlng("assessment", "log_could_not_enter_test_due_to_simultaneous_users", ilObjAssessmentFolder::_getLogLanguage()));
}
return FALSE;
}
else
{
return TRUE;
}
}
return TRUE;
}

+ Here is the call graph for this function:

ilObjTest::cleanupMediaobjectUsage ( )

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

private

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

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

Referenced by saveToDb().

{
include_once("./Services/RTE/classes/class.ilRTE.php");
$completecontent = "";
foreach ($this->getAllRTEContent() as $content)
{
$completecontent .= $content;
}
ilRTE::_cleanupMediaObjectUsage($completecontent, $this->getType() . ":html",
$this->getId());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::create (   $a_upload = false)

create test object

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

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

{
// meta data will be created by
// import parser
if (!$a_upload)
{
$this->createMetaData();
}
}

+ Here is the call graph for this function:

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

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

{
include_once "./Services/Utilities/classes/class.ilUtil.php";
$tst_data_dir = ilUtil::getDataDir()."/tst_data";
ilUtil::makeDir($tst_data_dir);
if (!is_writable($tst_data_dir))
{
$this->ilias->raiseError("Test Data Directory (".$tst_data_dir
.") not writeable.",$this->ilias->error_obj->MESSAGE);
}
// create learning module directory (data_dir/lm_data/lm_<id>)
$tst_dir = $tst_data_dir."/tst_".$this->getId();
ilUtil::makeDir($tst_dir);
if (!@is_dir($tst_dir))
{
$this->ilias->raiseError("Creation of Test Directory failed.",$this->ilias->error_obj->MESSAGE);
}
// create Export subdirectory (data_dir/lm_data/lm_<id>/Export)
$export_dir = $tst_dir."/export";
ilUtil::makeDir($export_dir);
if (!@is_dir($export_dir))
{
$this->ilias->raiseError("Creation of Export Directory failed.",$this->ilias->error_obj->MESSAGE);
}
}

+ Here is the call graph for this function:

ilObjTest::createMetaData ( )

Create meta data entry.

public

Reimplemented from ilObject.

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

References saveAuthorToMetadata().

Referenced by create().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Creates a question GUI instance of a given question type.

Parameters
integer$question_typeThe question type of the question
integer$question_idThe question id of the question, if available
Returns
object The question GUI instance public

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

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

{
if ((!$question_type) and ($question_id > 0))
{
$question_type = $this->getQuestionType($question_id);
}
if (!strlen($question_type)) return null;
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
assQuestion::_includeClass($question_type, 1);
$question_type_gui = assQuestion::getGuiClassNameByQuestionType($question_type);
$question = new $question_type_gui();
$question->object->setObligationsToBeConsidered( $this->areObligationsEnabled() );
if ($question_id > 0)
{
$question->object->loadFromDb($question_id);
global $ilCtrl, $ilDB, $ilUser, $lng;
$feedbackObjectClassname = assQuestion::getFeedbackClassNameByQuestionType($question_type);
$question->object->feedbackOBJ = new $feedbackObjectClassname($question->object, $ilCtrl, $ilDB, $lng);
$assSettings = new ilSetting('assessment');
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockerFactory.php';
$processLockerFactory = new ilAssQuestionProcessLockerFactory($assSettings, $ilDB);
$processLockerFactory->setQuestionId($question->object->getId());
$processLockerFactory->setUserId($ilUser->getId());
include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
$processLockerFactory->setAssessmentLogEnabled(ilObjAssessmentFolder::_enabledAssessmentLogging());
$question->object->setProcessLocker($processLockerFactory->getLocker());
}
return $question;
}

+ Here is the call graph for this function:

ilObjTest::createRandomSolutions (   $number)

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

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

{
global $ilDB;
// 1. get a user
$query = "SELECT usr_id FROM usr_data";
$result = $ilDB->query($query);
while ($data = $ilDB->fetchAssoc($result))
{
$activequery = sprintf("SELECT user_fi FROM tst_active WHERE test_fi = %s AND user_fi = %s",
$ilDB->quote($this->getTestId()),
$ilDB->quote($data['usr_id'])
);
$activeresult = $ilDB->query($activequery);
if ($activeresult->numRows() == 0)
{
$user_id = $data['usr_id'];
if ($user_id != 13)
{
include_once "./Modules/Test/classes/class.ilTestSession.php";
$testSession = FALSE;
$testSession->setRefId($this->getRefId());
$testSession->setTestId($this->getTestId());
$testSession->setUserId($user_id);
$testSession->saveToDb();
$passes = ($this->getNrOfTries()) ? $this->getNrOfTries() : 10;
$nr_of_passes = rand(1, $passes);
$active_id = $testSession->getActiveId();
for ($pass = 0; $pass < $nr_of_passes; $pass++)
{
include_once "./Modules/Test/classes/class.ilTestSequence.php";
$testSequence = new ilTestSequence($active_id, $pass, $this->isRandomTest());
if (!$testSequence->hasSequence())
{
$testSequence->createNewSequence($this->getQuestionCount(), $shuffle);
$testSequence->saveToDb();
}
for ($seq = 1; $seq <= count($this->questions); $seq++)
{
$question_id = $testSequence->getQuestionForSequence($seq);
$objQuestion = ilObjTest::_instanciateQuestion($question_id);
$objQuestion->createRandomSolution($testSession->getActiveId(), $pass);
}
if ($pass < $nr_of_passes - 1)
{
$testSession->increasePass();
$testSession->setLastSequence(0);
$testSession->saveToDb();
}
else
{
$testSession->setSubmitted(1);
$testSession->setSubmittedTimestamp(date('Y-m-d H:i:s'));
$testSession->saveToDb();
}
}
$number--;
if ($number == 0) return;
}
}
}
}

+ Here is the call graph for this function:

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

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

References $pass, and isRandomTest().

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

+ Here is the call graph for this function:

ilObjTest::delete ( )

delete object and all related data

public

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

Reimplemented from ilObject.

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

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

{
// always call parent delete function first!!
if (!parent::delete())
{
return false;
}
// delet meta data
$this->deleteMetaData();
//put here your module specific stuff
$this->deleteTest();
return true;
}

+ Here is the call graph for this function:

ilObjTest::deleteDefaults (   $test_default_id)

Deletes the defaults for a test.

Parameters
integer$test_default_idThe database ID of the test defaults public

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

{
global $ilDB;
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_defaults WHERE test_defaults_id = %s",
array('integer'),
array($test_default_id)
);
}
ilObjTest::deleteTest ( )

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

public

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

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

Referenced by delete().

{
global $tree, $ilDB, $ilPluginAdmin;
// first of all remove all test editings, because the delete statements used for this
// contain a subquery for active ids, that are deleted in the next steps
$result = $ilDB->queryF("SELECT active_id FROM tst_active WHERE test_fi = %s",
array('integer'),
array($this->getTestId())
);
$active_array = array();
while ($row = $ilDB->fetchAssoc($result))
{
array_push($active_array, $row["active_id"]);
}
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_active WHERE test_fi = %s",
array('integer'),
array($this->getTestId())
);
if (count($active_array))
{
foreach ($active_array as $active_id)
{
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_times WHERE active_fi = %s",
array('integer'),
array($active_id)
);
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_sequence WHERE active_fi = %s",
array('integer'),
array($active_id)
);
}
}
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_mark WHERE test_fi = %s",
array('integer'),
array($this->getTestId())
);
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_tests WHERE test_id = %s",
array('integer'),
array($this->getTestId())
);
require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
$testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this);
$testQuestionSetConfigFactory->getQuestionSetConfig()->removeQuestionSetRelatedData();
// delete export files
include_once "./Services/Utilities/classes/class.ilUtil.php";
$tst_data_dir = ilUtil::getDataDir()."/tst_data";
$directory = $tst_data_dir."/tst_".$this->getId();
if (is_dir($directory))
{
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::delDir($directory);
}
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
// remaining usages are not in text anymore -> delete them
// and media objects (note: delete method of ilObjMediaObject
// checks whether object is used in another context; if yes,
// the object is not deleted!)
foreach($mobs as $mob)
{
ilObjMediaObject::_removeUsage($mob, "tst:html", $this->getId());
{
$mob_obj =& new ilObjMediaObject($mob);
$mob_obj->delete();
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Delivers a PDF file from a XSL-FO string.

Parameters
string$foThe XSL-FO string public

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

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

Referenced by deliverPDFfromHTML().

{
global $ilLog;
include_once "./Services/Utilities/classes/class.ilUtil.php";
$fo_file = ilUtil::ilTempnam() . ".fo";
$fp = fopen($fo_file, "w"); fwrite($fp, $fo); fclose($fp);
include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
try
{
$pdf_base64 = ilRpcClientFactory::factory('RPCTransformationHandler')->ilFO2PDF($fo);
$filename = (strlen($title)) ? $title : $this->getTitle();
ilUtil::deliverData($pdf_base64->scalar, ilUtil::getASCIIFilename($filename) . ".pdf", "application/pdf", false, true);
return true;
}
{
$ilLog->write(__METHOD__.': '.$e->getMessage());
return false;
}
catch(Exception $e)
{
$ilLog->write(__METHOD__.': '.$e->getMessage());
return false;
}
/*
include_once "./Services/Transformation/classes/class.ilFO2PDF.php";
$fo2pdf = new ilFO2PDF();
$fo2pdf->setFOString($fo);
$result = $fo2pdf->send();
$filename = (strlen($title)) ? $title : $this->getTitle();
ilUtil::deliverData($result, ilUtil::getASCIIFilename($filename) . ".pdf", "application/pdf", false, true);
*/
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Delivers a PDF file from XHTML.

Parameters
string$htmlThe XHTML string public

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

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

{
$content = preg_replace("/href=\".*?\"/", "", $content);
$printbody = new ilTemplate("tpl.il_as_tst_print_body.html", TRUE, TRUE, "Modules/Test");
$printbody->setVariable("TITLE", ilUtil::prepareFormOutput($this->getTitle()));
$printbody->setVariable("ADM_CONTENT", $content);
$printbody->setCurrentBlock("css_file");
$printbody->setVariable("CSS_FILE", $this->getTestStyleLocation("filesystem"));
$printbody->parseCurrentBlock();
$printbody->setCurrentBlock("css_file");
$printbody->setVariable("CSS_FILE", ilUtil::getStyleSheetLocation("filesystem", "delos.css"));
$printbody->parseCurrentBlock();
$printoutput = $printbody->get();
$html = str_replace("href=\"./", "href=\"" . ILIAS_HTTP_PATH . "/", $printoutput);
$html = preg_replace("/<div id=\"dontprint\">.*?<\\/div>/ims", "", $html);
if (extension_loaded("tidy"))
{
$config = array(
"indent" => false,
"output-xml" => true,
"numeric-entities" => true
);
$tidy = new tidy();
$tidy->parseString($html, $config, 'utf8');
$tidy->cleanRepair();
$html = tidy_get_output($tidy);
$html = preg_replace("/^.*?(<html)/", "\\1", $html);
}
else
{
$html = str_replace("&nbsp;", "&#160;", $html);
$html = str_replace("&otimes;", "X", $html);
}
$html = preg_replace("/src=\".\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $html);
}

+ Here is the call graph for this function:

ilObjTest::disinviteUser (   $user_id)

Disinvites a user from a test.

Parameters
integer$user_idThe database id of the disinvited user public

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

References getTestId().

{
global $ilDB;
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_invited_user WHERE test_fi = %s AND user_fi = %s",
array('integer', 'integer'),
array($this->getTestId(), $user_id)
);
}

+ Here is the call graph for this function:

ilObjTest::duplicateQuestionForTest (   $question_id)

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

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

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

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

Referenced by insertQuestion().

{
global $ilUser;
$question =& ilObjTest::_instanciateQuestion($question_id);
$duplicate_id = $question->duplicate(true, null, null, null, $this->getId());
return $duplicate_id;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::endingTimeReached ( )

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

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

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

References getEndingTime().

Referenced by canShowTestResults(), and isExecutable().

{
if ($this->getEndingTime())
{
if (preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getEndingTime(), $matches))
{
$epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
$now = mktime();
if ($now > $epoch_time)
{
// ending time reached
return true;
}
}
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilObjTest::evalResultsOverview ( )

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

Returns
array An associated array containing the results public

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

References _evalResultsOverview(), and getTestId().

{
return $this->_evalResultsOverview($this->getTestId());
}

+ Here is the call graph for this function:

& ilObjTest::evalResultsOverviewOfParticipant (   $active_id)

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

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

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

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

{
global $ilDB;
$result = $ilDB->queryF("SELECT usr_data.usr_id, usr_data.firstname, usr_data.lastname, usr_data.title, usr_data.login, " .
"tst_test_result.*, qpl_questions.original_id, qpl_questions.title questiontitle, " .
"qpl_questions.points maxpoints " .
"FROM tst_test_result, qpl_questions, tst_active " .
"LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id " .
"WHERE tst_active.active_id = tst_test_result.active_fi " .
"AND qpl_questions.question_id = tst_test_result.question_fi " .
"AND tst_active.test_fi = %s AND tst_active.active_id = %s" .
"ORDER BY tst_active.active_id, tst_test_result.pass, tst_test_result.tstamp",
array('integer', 'integer'),
array($this->getTestId(), $active_id)
);
$overview = array();
while ($row = $ilDB->fetchAssoc($result))
{
if (!array_key_exists($row["active_fi"], $overview))
{
$overview[$row["active_fi"]] = array();
$overview[$row["active_fi"]]["firstname"] = $row["firstname"];
$overview[$row["active_fi"]]["lastname"] = $row["lastname"];
$overview[$row["active_fi"]]["title"] = $row["title"];
$overview[$row["active_fi"]]["login"] = $row["login"];
$overview[$row["active_fi"]]["usr_id"] = $row["usr_id"];
$overview[$row["active_fi"]]["started"] = $row["started"];
$overview[$row["active_fi"]]["finished"] = $row["finished"];
}
if (!array_key_exists($row["pass"], $overview[$row["active_fi"]]))
{
$overview[$row["active_fi"]][$row["pass"]] = array();
$overview[$row["active_fi"]][$row["pass"]]["reached"] = 0;
$overview[$row["active_fi"]][$row["pass"]]["maxpoints"] = $row["maxpoints"];
}
array_push($overview[$row["active_fi"]][$row["pass"]], $row);
$overview[$row["active_fi"]][$row["pass"]]["reached"] += $row["points"];
}
return $overview;
}

+ Here is the call graph for this function:

& ilObjTest::evalStatistical (   $active_id)

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

Returns
arrary The statistical evaluation array of the test public

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

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

{
global $ilDB;
// global $ilBench;
$test_result =& $this->getTestResult($active_id, $pass);
$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",
array('integer'),
array($active_id)
);
$times = array();
$first_visit = 0;
$last_visit = 0;
while ($row = $ilDB->fetchObject($result))
{
preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->started, $matches);
$epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
if (!$first_visit) {
$first_visit = $epoch_1;
}
if ($epoch_1 < $first_visit) {
$first_visit = $epoch_1;
}
preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->finished, $matches);
$epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
if (!$last_visit) {
$last_visit = $epoch_2;
}
if ($epoch_2 > $last_visit) {
$last_visit = $epoch_2;
}
$times[$row->active_fi] += ($epoch_2 - $epoch_1);
}
$max_time = 0;
foreach ($times as $key => $value) {
$max_time += $value;
}
if ((!$test_result["test"]["total_reached_points"]) or (!$test_result["test"]["total_max_points"]))
{
$percentage = 0.0;
}
else
{
$percentage = ($test_result["test"]["total_reached_points"] / $test_result["test"]["total_max_points"]) * 100.0;
if ($percentage < 0) $percentage = 0.0;
}
$mark_obj = $this->mark_schema->getMatchingMark($percentage);
$first_date = getdate($first_visit);
$last_date = getdate($last_visit);
$qworkedthrough = 0;
foreach ($test_result as $key => $value)
{
if (preg_match("/\d+/", $key))
{
$qworkedthrough += $value["workedthrough"];
}
}
if (!$qworkedthrough)
{
$atimeofwork = 0;
}
else
{
$atimeofwork = $max_time / $qworkedthrough;
}
$obligationsAnswered = $test_result["test"]["obligations_answered"];
$result_mark = "";
$passed = "";
if ($mark_obj)
{
$result_mark = $mark_obj->getShortName();
if( $mark_obj->getPassed() && $obligationsAnswered )
{
$passed = 1;
}
else
{
$passed = 0;
}
}
$percent_worked_through = 0;
if (count($this->questions))
{
$percent_worked_through = $qworkedthrough / count($this->questions);
}
$result_array = array(
"qworkedthrough" => $qworkedthrough,
"qmax" => count($this->questions),
"pworkedthrough" => $percent_worked_through,
"timeofwork" => $max_time,
"atimeofwork" => $atimeofwork,
"firstvisit" => $first_date,
"lastvisit" => $last_date,
"resultspoints" => $test_result["test"]["total_reached_points"],
"maxpoints" => $test_result["test"]["total_max_points"],
"resultsmarks" => $result_mark,
"passed" => $passed,
"distancemedian" => "0"
);
foreach ($test_result as $key => $value)
{
if (preg_match("/\d+/", $key))
{
$result_array[$key] = $value;
}
}
return $result_array;
}

+ Here is the call graph for this function:

ilObjTest::evalTotalFinished ( )

Returns the number of total finished tests.

Returns
integer The number of total finished tests public

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

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

Referenced by getAggregatedResultsData().

{
global $ilDB;
$result = $ilDB->queryF("SELECT COUNT(active_id) total FROM tst_active WHERE test_fi = %s AND submitted = %s",
array('integer', 'integer'),
array($this->getTestId(), 1)
);
$row = $ilDB->fetchAssoc($result);
return $row["total"];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Returns all participants who started the test.

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

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

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

Referenced by getTotalPointsPassedArray().

{
global $ilDB;
$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),
array('integer'),
array($this->getTestId())
);
$persons_array = array();
while ($row = $ilDB->fetchAssoc($result))
{
if ($this->getAnonymity())
{
$persons_array[$row["active_id"]] = array("name" => $this->lng->txt("unknown"));
}
else
{
if (strlen($row["firstname"].$row["lastname"].$row["title"]) == 0)
{
$persons_array[$row["active_id"]] = array("name" => $this->lng->txt("deleted_user"));
}
else
{
if ($row["user_fi"] == ANONYMOUS_USER_ID)
{
$persons_array[$row["active_id"]] = array("name" => $row["lastname"]);
}
else
{
$persons_array[$row["active_id"]] = array("name" => trim($row["lastname"] . ", " . $row["firstname"] . " " . $row["title"]), "login" => $row["login"]);
}
}
}
}
return $persons_array;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::evalTotalPersons ( )

Returns the number of persons who started the test.

Returns
integer The number of persons who started the test public

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

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

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

{
global $ilDB;
$result = $ilDB->queryF("SELECT COUNT(active_id) total FROM tst_active WHERE test_fi = %s",
array('integer'),
array($this->getTestId())
);
$row = $ilDB->fetchAssoc($result);
return $row["total"];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Returns all persons who started the test.

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

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

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

{
global $ilDB;
$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),
array('integer'),
array($this->getTestId())
);
$persons_array = array();
while ($row = $ilDB->fetchAssoc($result))
{
if ($this->getAnonymity())
{
$persons_array[$row["active_id"]] = $this->lng->txt("unknown");
}
else
{
if (strlen($row["firstname"].$row["lastname"].$row["title"]) == 0)
{
$persons_array[$row["active_id"]] = $this->lng->txt("deleted_user");
}
else
{
if ($row["user_fi"] == ANONYMOUS_USER_ID)
{
$persons_array[$row["active_id"]] = $row["lastname"];
}
else
{
$persons_array[$row["active_id"]] = trim($row["lastname"] . ", " . $row["firstname"] . " " . $row["title"]);
}
}
}
}
return $persons_array;
}

+ Here is the call graph for this function:

ilObjTest::evalTotalStartedAverageTime ( )

Returns the average processing time for all started tests.

Returns
integer The average processing time for all started tests public

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

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

Referenced by getAggregatedResultsData().

{
global $ilDB;
$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",
array('integer'),
array($this->getTestId())
);
$times = array();
while ($row = $ilDB->fetchObject($result))
{
preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->started, $matches);
$epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row->finished, $matches);
$epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
$times[$row->active_fi] += ($epoch_2 - $epoch_1);
}
$max_time = 0;
$counter = 0;
foreach ($times as $key => $value)
{
$max_time += $value;
$counter++;
}
if ($counter)
{
$average_time = round($max_time / $counter);
}
else
{
$average_time = 0;
}
return $average_time;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::exportFileItems (   $a_target_dir,
$expLog 
)

export files of file itmes

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

Referenced by exportPagesXML().

{
include_once "./Modules/File/classes/class.ilObjFile.php";
foreach ($this->file_ids as $file_id)
{
$expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
$file_obj = new ilObjFile($file_id, false);
$file_obj->export($a_target_dir);
unset($file_obj);
}
}

+ Here is the caller graph for this function:

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

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

{
global $ilBench;
$this->mob_ids = array();
$this->file_ids = array();
$attrs = array();
$attrs["Type"] = "Test";
$a_xml_writer->xmlStartTag("ContentObject", $attrs);
// MetaData
$this->exportXMLMetaData($a_xml_writer);
// PageObjects
$expLog->write(date("[y-m-d H:i:s] ")."Start Export Page Objects");
$ilBench->start("ContentObjectExport", "exportPageObjects");
$this->exportXMLPageObjects($a_xml_writer, $a_inst, $expLog);
$ilBench->stop("ContentObjectExport", "exportPageObjects");
$expLog->write(date("[y-m-d H:i:s] ")."Finished Export Page Objects");
// MediaObjects
$expLog->write(date("[y-m-d H:i:s] ")."Start Export Media Objects");
$ilBench->start("ContentObjectExport", "exportMediaObjects");
$this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
$ilBench->stop("ContentObjectExport", "exportMediaObjects");
$expLog->write(date("[y-m-d H:i:s] ")."Finished Export Media Objects");
// FileItems
$expLog->write(date("[y-m-d H:i:s] ")."Start Export File Items");
$ilBench->start("ContentObjectExport", "exportFileItems");
$this->exportFileItems($a_target_dir, $expLog);
$ilBench->stop("ContentObjectExport", "exportFileItems");
$expLog->write(date("[y-m-d H:i:s] ")."Finished Export File Items");
$a_xml_writer->xmlEndTag("ContentObject");
}

+ Here is the call graph for this function:

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

References ilObjMediaObject\_exists().

Referenced by exportPagesXML().

{
include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
foreach ($this->mob_ids as $mob_id)
{
$expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
{
$media_obj = new ilObjMediaObject($mob_id);
$media_obj->exportXML($a_xml_writer, $a_inst);
$media_obj->exportFiles($a_target_dir);
unset($media_obj);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

Referenced by exportPagesXML().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

References $ilBench, and ilPCFileList\collectFileItems().

Referenced by exportPagesXML().

{
global $ilBench;
include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
foreach ($this->questions as $question_id)
{
$ilBench->start("ContentObjectExport", "exportPageObject");
$expLog->write(date("[y-m-d H:i:s] ")."Page Object ".$question_id);
$attrs = array();
$a_xml_writer->xmlStartTag("PageObject", $attrs);
// export xml to writer object
$ilBench->start("ContentObjectExport", "exportPageObject_XML");
include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
$page_object = new ilAssQuestionPage($question_id);
$page_object->buildDom();
$page_object->insertInstIntoIDs($a_inst);
$mob_ids = $page_object->collectMediaObjects(false);
require_once 'Services/COPage/classes/class.ilPCFileList.php';
$file_ids = ilPCFileList::collectFileItems($page_object, $page_object->getDomDoc());
$xml = $page_object->getXMLFromDom(false, false, false, "", true);
$xml = str_replace("&","&amp;", $xml);
$a_xml_writer->appendXML($xml);
$page_object->freeDom();
unset ($page_object);
$ilBench->stop("ContentObjectExport", "exportPageObject_XML");
// collect media objects
$ilBench->start("ContentObjectExport", "exportPageObject_CollectMedia");
//$mob_ids = $page_obj->getMediaObjectIDs();
foreach($mob_ids as $mob_id)
{
$this->mob_ids[$mob_id] = $mob_id;
}
$ilBench->stop("ContentObjectExport", "exportPageObject_CollectMedia");
// collect all file items
$ilBench->start("ContentObjectExport", "exportPageObject_CollectFileItems");
//$file_ids = $page_obj->getFileItemIds();
foreach($file_ids as $file_id)
{
$this->file_ids[$file_id] = $file_id;
}
$ilBench->stop("ContentObjectExport", "exportPageObject_CollectFileItems");
$a_xml_writer->xmlEndTag("PageObject");
//unset($page_obj);
$ilBench->stop("ContentObjectExport", "exportPageObject");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::fromXML ( ilQTIAssessment  $assessment)

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

Parameters
ilQTIAssessment$assessment

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

References $_SESSION, $ilLog, $metadata, ilObject\$type, _getImportDirectory(), ilRTE\_replaceMediaObjectImageSrc(), ilObjMediaObject\_saveTempFileAsMediaObject(), ilObjMediaObject\_saveUsage(), ilQTIAssessment\getComment(), getFinalStatement(), ilObject\getId(), getIntroduction(), ilQTIAssessment\getPresentationMaterial(), ilQTIAssessment\getTitle(), QTIMaterialToString(), saveToDb(), setActivationEndingTime(), setActivationLimited(), setActivationStartingTime(), setActivationVisibility(), setAllowedUsers(), setAllowedUsersTimeGap(), setAnonymity(), setAnswerFeedback(), setAnswerFeedbackPoints(), setAuthor(), setAutosave(), setAutosaveIval(), setCharSelectorAvailability(), setCharSelectorDefinition(), setCountSystem(), setCustomStyle(), ilObject\setDescription(), setEnableArchiving(), setEnableExamview(), setEnableProcessingTime(), setEndingTime(), setExportSettings(), setFinalStatement(), setFixedParticipants(), setForceJS(), setHighscoreAchievedTS(), setHighscoreAnon(), setHighscoreEnabled(), setHighscoreHints(), setHighscoreOwnTable(), setHighscorePercentage(), setHighscoreScore(), setHighscoreTopNum(), setHighscoreTopTable(), setHighscoreWTime(), setInstantFeedbackSolution(), setIntroduction(), setKiosk(), setListOfQuestionsSettings(), setMailNotification(), setMailNotificationType(), setMCScoring(), setNrOfTries(), setObligationsEnabled(), setOfferingQuestionHintsEnabled(), setPassScoring(), setPassword(), setProcessingTime(), setQuestionSetType(), setRedirectionMode(), setRedirectionUrl(), setReportingDate(), setResetProcessingTime(), setResultsPresentation(), setScoreCutting(), setScoreReporting(), setSequenceSettings(), setShowCancel(), setShowExamIdInTestPassEnabled(), setShowExamIdInTestResultsEnabled(), setShowExamviewHtml(), setShowExamviewPdf(), setShowFinalStatement(), setShowInfo(), setShowMarker(), setShowSolutionPrintview(), setShuffleQuestions(), setSignSubmission(), setSpecificAnswerFeedback(), setStartingTime(), ilObject\setTitle(), setTitleOutput(), and setUsePreviousAnswers().

{
unset($_SESSION["import_mob_xhtml"]);
$this->setDescription($assessment->getComment());
$this->setTitle($assessment->getTitle());
foreach ($assessment->objectives as $objectives)
{
foreach ($objectives->materials as $material)
{
$this->setIntroduction($this->QTIMaterialToString($material));
}
}
if(
$assessment->getPresentationMaterial() &&
$assessment->getPresentationMaterial()->getFlowMat(0) &&
$assessment->getPresentationMaterial()->getFlowMat(0)->getMaterial(0)
)
{
$this->setFinalStatement($this->QTIMaterialToString($assessment->getPresentationMaterial()->getFlowMat(0)->getMaterial(0)));
}
foreach ($assessment->assessmentcontrol as $assessmentcontrol)
{
switch ($assessmentcontrol->getSolutionswitch())
{
case "Yes":
break;
default:
break;
}
}
foreach ($assessment->qtimetadata as $metadata)
{
switch ($metadata["label"])
{
case "test_type":
// for old tests with a test type
$type = $metadata["entry"];
switch ($type)
{
case 1:
// assessment
$this->setAnonymity(1);
break;
case 2:
// self assessment
break;
case 4:
// online exam
break;
case 5:
// varying random test
break;
}
break;
case "sequence_settings":
$this->setSequenceSettings($metadata["entry"]);
break;
case "author":
$this->setAuthor($metadata["entry"]);
break;
case "nr_of_tries":
$this->setNrOfTries($metadata["entry"]);
break;
case "kiosk":
$this->setKiosk($metadata["entry"]);
break;
case "showfinalstatement":
$this->setShowFinalStatement($metadata["entry"]);
break;
case "showinfo":
$this->setShowInfo($metadata["entry"]);
break;
case "forcejs":
$this->setForceJS($metadata["entry"]);
break;
case "customstyle":
$this->setCustomStyle($metadata["entry"]);
break;
case "highscore_enabled":
$this->setHighscoreEnabled($metadata["entry"]);
break;
case "highscore_anon":
$this->setHighscoreAnon($metadata["entry"]);
break;
case "highscore_achieved_ts":
$this->setHighscoreAchievedTS($metadata["entry"]);
break;
case "highscore_score":
$this->setHighscoreScore($metadata["entry"]);
break;
case "highscore_percentage":
$this->setHighscorePercentage($metadata["entry"]);
break;
case "highscore_hints":
$this->setHighscoreHints($metadata["entry"]);
break;
case "highscore_wtime":
$this->setHighscoreWTime($metadata["entry"]);
break;
case "highscore_own_table":
$this->setHighscoreOwnTable($metadata["entry"]);
break;
case "highscore_top_table":
$this->setHighscoreTopTable($metadata["entry"]);
break;
case "highscore_top_num":
$this->setHighscoreTopNum($metadata["entry"]);
break;
case "hide_previous_results":
if ($metadata["entry"] == 0)
{
}
else
{
}
break;
case "use_previous_answers":
$this->setUsePreviousAnswers($metadata["entry"]);
break;
case "answer_feedback":
$this->setAnswerFeedback($metadata["entry"]);
break;
case "hide_title_points":
$this->setTitleOutput($metadata["entry"]);
break;
case "title_output":
$this->setTitleOutput($metadata["entry"]);
break;
case "question_set_type":
$this->setQuestionSetType($metadata["entry"]);
break;
case "random_test":
if( $metadata["entry"] )
{
$this->setQuestionSetType(self::QUESTION_SET_TYPE_RANDOM);
}
else
{
$this->setQuestionSetType(self::QUESTION_SET_TYPE_FIXED);
}
break;
case "results_presentation":
$this->setResultsPresentation($metadata["entry"]);
break;
case "reset_processing_time":
$this->setResetProcessingTime($metadata["entry"]);
break;
case "instant_verification":
$this->setInstantFeedbackSolution($metadata["entry"]);
break;
case "answer_feedback_points":
$this->setAnswerFeedbackPoints($metadata["entry"]);
break;
case "anonymity":
$this->setAnonymity($metadata["entry"]);
break;
case "show_cancel":
$this->setShowCancel($metadata["entry"]);
break;
case "show_marker":
$this->setShowMarker($metadata["entry"]);
break;
case "fixed_participants":
$this->setFixedParticipants($metadata["entry"]);
break;
case "score_reporting":
$this->setScoreReporting($metadata["entry"]);
break;
case "shuffle_questions":
$this->setShuffleQuestions($metadata["entry"]);
break;
case "count_system":
$this->setCountSystem($metadata["entry"]);
break;
case "mc_scoring":
$this->setMCScoring($metadata["entry"]);
break;
case "mailnotification":
$this->setMailNotification($metadata["entry"]);
break;
case "mailnottype":
$this->setMailNotificationType($metadata["entry"]);
break;
case "exportsettings":
$this->setExportSettings($metadata['entry']);
break;
case "score_cutting":
$this->setScoreCutting($metadata["entry"]);
break;
case "password":
$this->setPassword($metadata["entry"]);
break;
case "allowedUsers":
$this->setAllowedUsers($metadata["entry"]);
break;
case "allowedUsersTimeGap":
$this->setAllowedUsersTimeGap($metadata["entry"]);
break;
case "pass_scoring":
$this->setPassScoring($metadata["entry"]);
break;
case "show_summary":
$this->setListOfQuestionsSettings($metadata["entry"]);
break;
case "reporting_date":
$iso8601period = $metadata["entry"];
if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $iso8601period, $matches))
{
$this->setReportingDate(sprintf("%02d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
}
break;
case 'enable_processing_time':
$this->setEnableProcessingTime($metadata['entry']);
break;
case "processing_time":
$this->setProcessingTime($metadata['entry']);
break;
case "starting_time":
$iso8601period = $metadata["entry"];
if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $iso8601period, $matches))
{
$this->setStartingTime(sprintf("%02d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
}
break;
case "ending_time":
$iso8601period = $metadata["entry"];
if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $iso8601period, $matches))
{
$this->setEndingTime(sprintf("%02d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
}
break;
case "enable_examview":
$this->setEnableExamview($metadata["entry"]);
break;
case 'show_examview_html':
$this->setShowExamviewHtml($metadata['entry']);
break;
case 'show_examview_pdf':
$this->setShowExamviewPdf($metadata['entry']);
break;
case 'redirection_mode':
$this->setRedirectionMode($metadata['entry']);
break;
case 'redirection_url':
$this->setRedirectionUrl($metadata['entry']);
break;
case 'examid_in_kiosk':
case 'examid_in_test_pass':
$this->setShowExamIdInTestPassEnabled($metadata['entry']);
break;
case 'show_exam_id':
case 'examid_in_test_res':
$this->setShowExamIdInTestResultsEnabled($metadata['entry']);
break;
case 'enable_archiving':
$this->setEnableArchiving($metadata['entry']);
break;
case 'sign_submission':
$this->setSignSubmission($metadata['entry']);
break;
case 'char_selector_availability':
$this->setCharSelectorAvailability($metadata['entry']);
break;
case 'char_selector_definition':
$this->setCharSelectorDefinition($metadata['entry']);
break;
case 'activation_limited':
$this->setActivationLimited($metadata['entry']);
break;
case 'activation_start_time':
$this->setActivationStartingTime($metadata['entry']);
break;
case 'activation_end_time':
$this->setActivationEndingTime($metadata['entry']);
break;
case 'activation_visibility':
$this->setActivationVisibility($metadata['entry']);
break;
case 'autosave':
$this->setAutosave($metadata['entry']);
break;
case 'autosave_ival':
$this->setAutosaveIval($metadata['entry']);
break;
case 'offer_question_hints':
$this->setOfferingQuestionHintsEnabled($metadata['entry']);
break;
case 'instant_feedback_specific':
$this->setSpecificAnswerFeedback($metadata['entry']);
break;
case 'obligations_enabled':
$this->setObligationsEnabled($metadata['entry']);
break;
}
if (preg_match("/mark_step_\d+/", $metadata["label"]))
{
$xmlmark = $metadata["entry"];
preg_match("/<short>(.*?)<\/short>/", $xmlmark, $matches);
$mark_short = $matches[1];
preg_match("/<official>(.*?)<\/official>/", $xmlmark, $matches);
$mark_official = $matches[1];
preg_match("/<percentage>(.*?)<\/percentage>/", $xmlmark, $matches);
$mark_percentage = $matches[1];
preg_match("/<passed>(.*?)<\/passed>/", $xmlmark, $matches);
$mark_passed = $matches[1];
$this->mark_schema->addMarkStep($mark_short, $mark_official, $mark_percentage, $mark_passed);
}
}
// handle the import of media objects in XHTML code
if (is_array($_SESSION["import_mob_xhtml"]))
{
include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
include_once "./Services/RTE/classes/class.ilRTE.php";
include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
foreach ($_SESSION["import_mob_xhtml"] as $mob)
{
$importfile = ilObjTest::_getImportDirectory() . '/' . $_SESSION["tst_import_subdir"] . '/' . $mob["uri"];
if (file_exists($importfile))
{
$media_object =& ilObjMediaObject::_saveTempFileAsMediaObject(basename($importfile), $importfile, FALSE);
ilObjMediaObject::_saveUsage($media_object->getId(), "tst:html", $this->getId());
$this->setIntroduction(ilRTE::_replaceMediaObjectImageSrc(str_replace("src=\"" . $mob["mob"] . "\"", "src=\"" . "il_" . IL_INST_ID . "_mob_" . $media_object->getId() . "\"", $this->getIntroduction()), 1));
$this->setFinalStatement(ilRTE::_replaceMediaObjectImageSrc(str_replace("src=\"" . $mob["mob"] . "\"", "src=\"" . "il_" . IL_INST_ID . "_mob_" . $media_object->getId() . "\"", $this->getFinalStatement()), 1));
}
else
{
global $ilLog;
$ilLog->write("Error: Could not open XHTML mob file for test introduction during test import. File $importfile does not exist!");
}
}
$this->saveToDb();
}
}

+ Here is the call graph for this function:

ilObjTest::getActivationEndingTime ( )

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getActivationStartingTime ( )

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getActivationVisibility ( )

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

References $activation_visibility.

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

+ Here is the caller graph for this function:

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

Gets the active id of a given user.

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

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

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

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

{
global $ilDB;
global $ilUser;
if (!$user_id) $user_id = $ilUser->getId();
if (($_SESSION["AccountId"] == ANONYMOUS_USER_ID) && (strlen($_SESSION["tst_access_code"][$this->getTestId()])))
{
$result = $ilDB->queryF("SELECT active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
array('integer','integer','text'),
array($user_id, $this->test_id, $_SESSION["tst_access_code"][$this->getTestId()])
);
}
else if (strlen($anonymous_id))
{
$result = $ilDB->queryF("SELECT active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
array('integer','integer','text'),
array($user_id, $this->test_id, $anonymous_id)
);
}
else
{
if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID)
{
return NULL;
}
$result = $ilDB->queryF("SELECT active_id FROM tst_active WHERE user_fi = %s AND test_fi = %s",
array('integer','integer'),
array($user_id, $this->test_id)
);
}
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
return $row["active_id"];
}
else
{
return 0;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getAggregatedResultsData ( )

Returns the aggregated test results.

public

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

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

{
$data =& $this->getCompleteEvaluationData();
$foundParticipants =& $data->getParticipants();
$results = array("overview" => array(), "questions" => array());
if (count($foundParticipants))
{
$results["overview"][$this->lng->txt("tst_eval_total_persons")] = count($foundParticipants);
$total_finished = $this->evalTotalFinished();
$results["overview"][$this->lng->txt("tst_eval_total_finished")] = $total_finished;
$average_time = $this->evalTotalStartedAverageTime();
$diff_seconds = $average_time;
$diff_hours = floor($diff_seconds/3600);
$diff_seconds -= $diff_hours * 3600;
$diff_minutes = floor($diff_seconds/60);
$diff_seconds -= $diff_minutes * 60;
$results["overview"][$this->lng->txt("tst_eval_total_finished_average_time")] = sprintf("%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds);
$total_passed = 0;
$total_passed_reached = 0;
$total_passed_max = 0;
$total_passed_time = 0;
foreach ($foundParticipants as $userdata)
{
if ($userdata->getPassed())
{
$total_passed++;
$total_passed_reached += $userdata->getReached();
$total_passed_max += $userdata->getMaxpoints();
$total_passed_time += $userdata->getTimeOfWork();
}
}
$average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
$average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
$average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
$results["overview"][$this->lng->txt("tst_eval_total_passed")] = $total_passed;
$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);
$average_time = $average_passed_time;
$diff_seconds = $average_time;
$diff_hours = floor($diff_seconds/3600);
$diff_seconds -= $diff_hours * 3600;
$diff_minutes = floor($diff_seconds/60);
$diff_seconds -= $diff_minutes * 60;
$results["overview"][$this->lng->txt("tst_eval_total_passed_average_time")] = sprintf("%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds);
}
foreach ($data->getQuestionTitles() as $question_id => $question_title)
{
$answered = 0;
$reached = 0;
$max = 0;
foreach ($foundParticipants as $userdata)
{
for ($i = 0; $i <= $userdata->getLastPass(); $i++)
{
if (is_object($userdata->getPass($i)))
{
$question =& $userdata->getPass($i)->getAnsweredQuestionByQuestionId($question_id);
if (is_array($question))
{
$answered++;
$reached += $question["reached"];
$max += $question["points"];
}
}
}
}
$percent = $max ? $reached/$max * 100.0 : 0;
$counter++;
$results["questions"][$question_id] = array(
$question_title,
sprintf("%.2f", $answered ? $reached / $answered : 0) . " " . strtolower($this->lng->txt("of")) . " " . sprintf("%.2f", $answered ? $max / $answered : 0),
sprintf("%.2f", $percent) . "%",
$answered,
sprintf("%.2f", $answered ? $reached / $answered : 0),
sprintf("%.2f", $answered ? $max / $answered : 0),
$percent / 100.0
);
}
return $results;
}

+ Here is the call graph for this function:

ilObjTest::getAllowedUsers ( )

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getAllowedUsersTimeGap ( )

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

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

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

+ Here is the caller graph for this function:

& ilObjTest::getAllQuestions (   $pass = NULL)

Returns all questions of a test in test order.

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

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

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

{
global $ilUser;
global $ilDB;
$result_array = array();
if ($this->isRandomTest())
{
$active_id = $this->getActiveIdOfUser($ilUser->getId());
$this->loadQuestions($active_id, $pass);
if (count($this->questions) == 0) return $result_array;
if (is_null($pass))
{
$pass = $this->_getPass($active_id);
}
$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'),
array('integer','integer'),
array($active_id, $pass)
);
}
else
{
if (count($this->questions) == 0) return $result_array;
$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'));
}
while ($row = $ilDB->fetchAssoc($result))
{
$result_array[$row["question_id"]] = $row;
}
return $result_array;
}

+ Here is the call graph for this function:

ilObjTest::getAllRTEContent ( )

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

private

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

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

Referenced by cleanupMediaobjectUsage().

{
$result = array();
array_push($result, $this->getIntroduction());
array_push($result, $this->getFinalStatement());
return $result;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

{
$results = array();
$row = array(
"user_id" => $this->lng->txt("user_id"),
"matriculation" => $this->lng->txt("matriculation"),
"lastname" => $this->lng->txt("lastname"),
"firstname" => $this->lng->txt("firstname"),
"login" =>$this->lng->txt("login"),
"reached_points" => $this->lng->txt("tst_reached_points"),
"max_points" => $this->lng->txt("tst_maximum_points"),
"percent_value" => $this->lng->txt("tst_percent_solved"),
"mark" => $this->lng->txt("tst_mark"),
"ects" => $this->lng->txt("ects_grade")
);
if (count($participants))
{
if ($this->ects_output)
{
$passed_array =& $this->getTotalPointsPassedArray();
}
foreach ($participants as $active_id => $user_rec)
{
$row = array();
$reached_points = 0;
$max_points = 0;
foreach ($this->questions as $value)
{
$question =& ilObjTest::_instanciateQuestion($value);
if (is_object($question))
{
$max_points += $question->getMaximumPoints();
$reached_points += $question->getReachedPoints($active_id);
}
}
if ($max_points > 0)
{
$percentvalue = $reached_points / $max_points;
if ($percentvalue < 0) $percentvalue = 0.0;
}
else
{
$percentvalue = 0;
}
$mark_obj = $this->mark_schema->getMatchingMark($percentvalue * 100);
$passed = "";
if ($mark_obj)
{
$mark = $mark_obj->getOfficialName();
$ects_mark = $this->getECTSGrade($passed_array, $reached_points, $max_points);
}
if ($this->getAnonymity())
{
$user_rec['firstname'] = "";
$user_rec['lastname'] = $this->lng->txt("unknown");
}
$row = array(
"user_id"=>$user_rec['usr_id'],
"matriculation" => $user_rec['matriculation'],
"lastname" => $user_rec['lastname'],
"firstname" => $user_rec['firstname'],
"login"=>$user_rec['login'],
"reached_points" => $reached_points,
"max_points" => $max_points,
"percent_value" => $percentvalue,
"mark" => $mark,
"ects" => $ects_mark
);
$results[] = $prepareForCSV ? $this->processCSVRow ($row, true) : $row;
}
}
return $results;
}

+ Here is the call graph for this function:

ilObjTest::getAnonymity ( )

Returns the anonymity status of the test.

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

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

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

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

+ Here is the caller graph for this function:

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

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

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

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

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

{
if( $this->isDynamicTest() )
{
global $tree, $ilDB, $lng, $ilPluginAdmin;
require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
$testSessionFactory = new ilTestSessionFactory($this);
$testSession = $testSessionFactory->getSession($active_id);
require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
$testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this);
$testSequence = $testSequenceFactory->getSequence($testSession);
require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
$dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this);
$dynamicQuestionSetConfig->loadFromDb();
$testSequence->loadFromDb($dynamicQuestionSetConfig);
$testSequence->loadQuestions($dynamicQuestionSetConfig, new ilTestDynamicQuestionSetFilterSelection());
return $testSequence->getTrackedQuestionCount();
}
if ($this->isRandomTest())
{
$this->loadQuestions($active_id, $pass);
}
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$workedthrough = 0;
foreach ($this->questions as $value)
{
if (assQuestion::_isWorkedThrough($active_id, $value, $pass))
{
$workedthrough += 1;
}
}
return $workedthrough;
}

+ Here is the call graph for this function:

ilObjTest::getAnswerFeedback ( )

Returns 1 if generic answer feedback is activated.

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

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getAnswerFeedbackPoints ( )

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

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

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getAuthor ( )

Gets the authors name of the ilObjTest object.

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

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

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

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

{
$author = array();
include_once "./Services/MetaData/classes/class.ilMD.php";
$md =& new ilMD($this->getId(), 0, $this->getType());
$md_life =& $md->getLifecycle();
if ($md_life)
{
$ids =& $md_life->getContributeIds();
foreach ($ids as $id)
{
$md_cont =& $md_life->getContribute($id);
if (strcmp($md_cont->getRole(), "Author") == 0)
{
$entids =& $md_cont->getEntityIds();
foreach ($entids as $entid)
{
$md_ent =& $md_cont->getEntity($entid);
array_push($author, $md_ent->getEntity());
}
}
}
}
return join($author, ",");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getAutosave ( )

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

References $autosave.

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

{
}

+ Here is the caller graph for this function:

ilObjTest::getAutosaveIval ( )

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

References $autosave_ival.

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

{
}

+ Here is the caller graph for this function:

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

Returns the available question pools for the active user.

Returns
array The available question pools public

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

References ilObjQuestionPool\_getAvailableQuestionpools().

{
include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
return ilObjQuestionPool::_getAvailableQuestionpools($use_object_id, $equal_points, $could_be_offline, $show_path, $with_questioncount, $permission);
}

+ Here is the call graph for this function:

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

Calculates the available questions for a test.

public

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

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

{
global $ilUser;
global $ilDB;
include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
$available_pools = array_keys(ilObjQuestionPool::_getAvailableQuestionpools($use_object_id = TRUE, $equal_points = FALSE, $could_be_offline = FALSE, $showPath = FALSE, $with_questioncount = FALSE));
$available = "";
if (count($available_pools))
{
$available = " AND " . $ilDB->in('qpl_questions.obj_fi', $available_pools, false, 'integer');
}
else
{
return array();
}
if ($completeonly)
{
$available .= " AND qpl_questions.complete = " . $ilDB->quote("1", 'text');
}
$where = "";
if (is_array($arrFilter))
{
if (array_key_exists('title', $arrFilter) && strlen($arrFilter['title']))
{
$where .= " AND " . $ilDB->like('qpl_questions.title', 'text', "%%" . $arrFilter['title'] . "%%");
}
if (array_key_exists('description', $arrFilter) && strlen($arrFilter['description']))
{
$where .= " AND " . $ilDB->like('qpl_questions.description', 'text', "%%" . $arrFilter['description'] . "%%");
}
if (array_key_exists('author', $arrFilter) && strlen($arrFilter['author']))
{
$where .= " AND " . $ilDB->like('qpl_questions.author', 'text', "%%" . $arrFilter['author'] . "%%");
}
if (array_key_exists('type', $arrFilter) && strlen($arrFilter['type']))
{
$where .= " AND qpl_qst_type.type_tag = " . $ilDB->quote($arrFilter['type'], 'text');
}
if (array_key_exists('qpl', $arrFilter) && strlen($arrFilter['qpl']))
{
$where .= " AND " . $ilDB->like('object_data.title', 'text', "%%" . $arrFilter['qpl'] . "%%");
}
}
$original_ids =& $this->getExistingQuestions();
$original_clause = " qpl_questions.original_id IS NULL";
if (count($original_ids))
{
$original_clause = " qpl_questions.original_id IS NULL AND " . $ilDB->in('qpl_questions.question_id', $original_ids, true, 'integer');
}
$query_result = $ilDB->query(
"SELECT qpl_questions.*, qpl_questions.tstamp, qpl_qst_type.type_tag, qpl_qst_type.plugin, object_data.title qpl " .
"FROM qpl_questions, qpl_qst_type, object_data WHERE $original_clause $available AND " .
"object_data.obj_id = qpl_questions.obj_fi AND qpl_questions.tstamp > 0 AND " .
"qpl_questions.question_type_fi = qpl_qst_type.question_type_id$where");
$rows = array();
$types = $this->getQuestionTypeTranslations();
if ($query_result->numRows())
{
while ($row = $ilDB->fetchAssoc($query_result))
{
$row['ttype'] = $types[$row['type_tag']];
if ($row["plugin"])
{
if ($this->isPluginActive($row["type_tag"]))
{
array_push($rows, $row);
}
}
else
{
array_push($rows, $row);
}
}
}
return $rows;
}

+ Here is the call graph for this function:

ilObjTest::getCertificateVisibility ( )

Returns the visibility settings of the certificate.

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

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

Referenced by canShowCertificate(), and saveToDb().

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

+ Here is the caller graph for this function:

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

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

References $char_selector_availability.

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

+ Here is the caller graph for this function:

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

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

References $char_selector_definition.

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

+ Here is the caller graph for this function:

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

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

References getUnfilteredEvaluationData().

Referenced by getAggregatedResultsData().

{
include_once "./Modules/Test/classes/class.ilTestEvaluationData.php";
include_once "./Modules/Test/classes/class.ilTestEvaluationPassData.php";
include_once "./Modules/Test/classes/class.ilTestEvaluationUserData.php";
$data = $this->getUnfilteredEvaluationData();
if ($withStatistics)
{
$data->calculateStatistics();
}
$data->setFilter($filterby, $filtertext);
return $data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getCompleteWorkingTime (   $user_id)

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

Returns
integer The working time in seconds public

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

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

{
global $ilDB;
$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",
array('integer','integer'),
array($this->getTestId(), $user_id)
);
$time = 0;
while ($row = $ilDB->fetchAssoc($result))
{
preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
$epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
$epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
$time += ($epoch_2 - $epoch_1);
}
return $time;
}

+ Here is the call graph for this function:

ilObjTest::getCompleteWorkingTimeOfParticipant (   $active_id)

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

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

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

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

{
global $ilDB;
$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",
array('integer','integer'),
array($this->getTestId(), $active_id)
);
$time = 0;
while ($row = $ilDB->fetchAssoc($result))
{
preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches);
$epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["finished"], $matches);
$epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
$time += ($epoch_2 - $epoch_1);
}
return $time;
}

+ Here is the call graph for this function:

& ilObjTest::getCompleteWorkingTimeOfParticipants ( )

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

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

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

References _getCompleteWorkingTimeOfParticipants(), and getTestId().

{
}

+ Here is the call graph for this function:

ilObjTest::getCountSystem ( )

Gets the count system for the calculation of points.

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

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getCustomStyle ( )

Get the custom style.

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

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getCustomStyles ( )

Return the available custom styles.

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

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

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

{
$css_path = ilUtil::getStyleSheetLocation("filesystem", "ta.css", "Modules/Test");
$css_path = str_replace("ta.css", "customstyles", $css_path) . "/";
$customstyles = array();
if (is_dir($css_path))
{
$results = array();
include_once "./Services/Utilities/classes/class.ilFileUtils.php";
if (is_array($results["file"]))
{
foreach ($results["file"] as $filename)
{
if (strpos($filename, ".css"))
{
array_push($customstyles, $filename);
}
}
}
}
return $customstyles;
}

+ Here is the call graph for this function:

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

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

{
$results = array();
if (count($participants))
{
foreach ($participants as $active_id => $user_rec)
{
$row = array();
$reached_points = 0;
$max_points = 0;
foreach ($this->questions as $value)
{
$question =& ilObjTest::_instanciateQuestion($value);
if (is_object($question))
{
$max_points += $question->getMaximumPoints();
$reached_points += $question->getReachedPoints($active_id);
if ($max_points > 0)
{
$percentvalue = $reached_points / $max_points;
if ($percentvalue < 0) $percentvalue = 0.0;
}
else
{
$percentvalue = 0;
}
if ($this->getAnonymity())
{
$user_rec['firstname'] = "";
$user_rec['lastname'] = $this->lng->txt("unknown");
}
$row = array(
"user_id"=>$user_rec['usr_id'],
"matriculation" => $user_rec['matriculation'],
"lastname" => $user_rec['lastname'],
"firstname" => $user_rec['firstname'],
"login"=>$user_rec['login'],
"question_id" => $question->getId(),
"question_title" => $question->getTitle(),
"reached_points" => $reached_points,
"max_points" => $max_points
);
}
}
}
}
return $results;
}

+ Here is the call graph for this function:

ilObjTest::getECTSFX ( )

Returns the ECTS FX grade.

Returns
mixed The ECTS FX grade, NULL if empty public
See Also
$ects_fx

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

Referenced by addDefaults(), and saveToDb().

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

+ Here is the caller graph for this function:

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 public

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

References _getECTSGrade().

Referenced by getAllTestResults(), and getUnfilteredEvaluationData().

{
return ilObjTest::_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);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilObjTest::getECTSGrades ( )

Returns the ECTS grades.

Returns
array The ECTS grades public
See Also
$ects_grades

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

References $ects_grades.

Referenced by addDefaults().

{
}

+ Here is the caller graph for this function:

ilObjTest::getECTSOutput ( )

Indicates if ECTS grades output is presented in this test.

Returns
integer 0 if there is no ECTS grades output, 1 otherwise public
See Also
$ects_output

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

Referenced by addDefaults(), and saveToDb().

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

+ Here is the caller graph for this function:

ilObjTest::getEnableArchiving ( )
Returns
boolean

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

References $enable_archiving.

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

+ Here is the caller graph for this function:

ilObjTest::getEnabledViewMode ( )

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

Referenced by saveToDb().

{
return $this->enabled_view_mode;
}

+ Here is the caller graph for this function:

ilObjTest::getEnableExamview ( )
Returns
boolean

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

References $enable_examview.

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

+ Here is the caller graph for this function:

ilObjTest::getEnableProcessingTime ( )

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

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

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getEndingTime ( )

Returns the ending time of the test.

Returns
string The ending time of the test public
See Also
$ending_time

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

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

{
return (strlen($this->ending_time)) ? $this->ending_time : NULL;
}

+ Here is the caller graph for this function:

ilObjTest::getEstimatedWorkingTime ( )

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

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

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

References $result, and _instanciateQuestion().

Referenced by getProcessingTimeAsArray().

{
$time_in_seconds = 0;
foreach ($this->questions as $question_id)
{
$question =& ilObjTest::_instanciateQuestion($question_id);
$est_time = $question->getEstimatedWorkingTime();
$time_in_seconds += $est_time["h"] * 3600 + $est_time["m"] * 60 + $est_time["s"];
}
$hours = (int)($time_in_seconds / 3600) ;
$time_in_seconds = $time_in_seconds - ($hours * 3600);
$minutes = (int)($time_in_seconds / 60);
$time_in_seconds = $time_in_seconds - ($minutes * 60);
$result = array("hh" => $hours, "mm" => $minutes, "ss" => $time_in_seconds);
return $result;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

References getAnonymity().

{
include_once "./Modules/Test/classes/class.ilObjTestGUI.php";
include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
$table_gui = new ilEvaluationAllTableGUI(new ilObjTestGUI(), 'outEvaluation', $this->getAnonymity());
return $table_gui->getSelectedColumns();
}

+ Here is the call graph for this function:

& ilObjTest::getExistingQuestions (   $pass = NULL)

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

Returns
array An array containing the already existing questions public

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

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

Referenced by getAvailableQuestions().

{
global $ilUser;
global $ilDB;
$existing_questions = array();
$active_id = $this->getActiveIdOfUser($ilUser->getId());
if ($this->isRandomTest())
{
if (is_null($pass)) $pass = 0;
$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",
array('integer','integer'),
array($active_id, $pass)
);
}
else
{
$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",
array('integer'),
array($this->getTestId())
);
}
while ($data = $ilDB->fetchObject($result))
{
if( $data->original_id === null )
{
continue;
}
array_push($existing_questions, $data->original_id);
}
return $existing_questions;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getExportDirectory ( )

Get the location of the export directory for the test.

public

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

References ilUtil\getDataDir().

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

+ Here is the call graph for this function:

ilObjTest::getExportSettings ( )

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

References $exportsettings.

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

{
if ($this->exportsettings)
{
}
else
{
return 0;
}
}

+ Here is the caller graph for this function:

ilObjTest::getExportSettingsSingleChoiceShort ( )

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

Referenced by setExportSettingsSingleChoiceShort().

{
if (($this->exportsettings & 1) > 0)
{
return true;
}
else
{
return false;
}
}

+ Here is the caller graph for this function:

ilObjTest::getExtraTime (   $active_id)

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

References $result, and $row.

Referenced by getProcessingTimeInSeconds().

{
global $ilDB;
$result = $ilDB->queryF("SELECT additionaltime FROM tst_addtime WHERE active_fi = %s",
array('integer'),
array($active_id)
);
if ($result->numRows() > 0)
{
$row = $ilDB->fetchAssoc($result);
return $row['additionaltime'];
}
return 0;
}

+ Here is the caller graph for this function:

ilObjTest::getFinalStatement ( )

Gets the final statement.

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

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getFixedParticipants ( )

Returns the fixed participants status.

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

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getForceJS ( )

Gets whether JavaScript should be forced for tests.

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

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getGenericAnswerFeedback ( )

Returns 1 if generic answer feedback is to be shown.

Returns
integer 1, if answer specific feedback is to be shown. public
See Also
$answer_feedback
Todo:
Rename $this->answer_feedback to something more meaningful.

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

Referenced by saveToDb().

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

+ Here is the caller graph for this function:

& ilObjTest::getGroupData (   $ids)

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

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

{
if (!is_array($ids) || count($ids) ==0) return array();
$result = array();
foreach ($ids as $ref_id)
{
$obj_id = ilObject::_lookupObjId($ref_id);
$result[$ref_id] = array("ref_id" => $ref_id, "title" => ilObject::_lookupTitle($obj_id), "description" => ilObject::_lookupDescription($obj_id));
}
return $result;
}

+ Here is the call graph for this function:

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

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

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

+ Here is the caller graph for this function:

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getHighscoreEnabled ( )

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

Returns
bool True, if highscore is enabled.

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

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

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

+ Here is the caller graph for this function:

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

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

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

+ Here is the caller graph for this function:

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getHighscorePercentage ( )

Gets if the percentage column should be shown.

Returns
bool True, if percentage column should be shown.

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getHighscoreScore ( )

Gets if the score column should be shown.

Returns
bool True, if score column should be shown.

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

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

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

+ Here is the caller graph for this function:

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

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

{
$retval = $a_retval;
if ( (int) $this->_highscore_top_num != 0)
{
$retval = $this->_highscore_top_num;
}
return $retval;
}

+ Here is the caller graph for this function:

ilObjTest::getHighscoreTopTable ( )

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

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

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

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

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

+ Here is the caller graph for this function:

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getImagePath ( )

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

public

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

References ilObject\getId().

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

+ Here is the call graph for this function:

ilObjTest::getImagePathWeb ( )

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

public

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

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

{
include_once "./Services/Utilities/classes/class.ilUtil.php";
$webdir = ilUtil::removeTrailingPathSeparators(CLIENT_WEB_DIR) . "/assessment/" . $this->getId() . "/images/";
}

+ Here is the call graph for this function:

ilObjTest::getImportDirectory ( )

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

References _getImportDirectory().

+ Here is the call graph for this function:

ilObjTest::getImportMapping ( )

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

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

{
if (!is_array($this->import_mapping))
{
return array();
}
else
{
return $this->import_mapping;
}
}
ilObjTest::getInstantFeedbackSolution ( )

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

Returns
integer The status of the solution instant feedback public
See Also
$instant_verification

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

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

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

+ Here is the caller graph for this function:

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

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

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

+ Here is the caller graph for this function:

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

Returns a list of all invited users in a test.

Returns
array array of invited users public

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

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

{
global $ilDB;
$result_array = array();
if ($this->getAnonymity())
{
if (is_numeric($user_id))
{
$result = $ilDB->queryF("SELECT tst_active.active_id, tst_active.tries, usr_id, %s login, %s lastname, %s firstname, tst_invited_user.clientip, " .
"tst_active.submitted test_finished, matriculation FROM usr_data, tst_invited_user " .
"LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
"WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id AND usr_data.usr_id=%s " .
"ORDER BY $order",
array('text', 'text', 'text', 'integer', 'integer'),
array("", $this->lng->txt("unknown"), "", $this->getTestId(), $user_id)
);
}
else
{
$result = $ilDB->queryF("SELECT tst_active.active_id, usr_id, %s login, %s lastname, %s firstname, tst_invited_user.clientip, " .
"tst_active.submitted test_finished, matriculation FROM usr_data, tst_invited_user " .
"LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
"WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id " .
"ORDER BY $order",
array('text', 'text', 'text', 'integer'),
array("", $this->lng->txt("unknown"), "", $this->getTestId())
);
}
}
else
{
if (is_numeric($user_id))
{
$result = $ilDB->queryF("SELECT tst_active.active_id, tst_active.tries, usr_id, login, lastname, firstname, tst_invited_user.clientip, " .
"tst_active.submitted test_finished, matriculation FROM usr_data, tst_invited_user " .
"LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
"WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id AND usr_data.usr_id=%s " .
"ORDER BY $order",
array('integer', 'integer'),
array($this->getTestId(), $user_id)
);
}
else
{
$result = $ilDB->queryF("SELECT tst_active.active_id, tst_active.tries, usr_id, login, lastname, firstname, tst_invited_user.clientip, " .
"tst_active.submitted test_finished, matriculation FROM usr_data, tst_invited_user " .
"LEFT JOIN tst_active ON tst_active.user_fi = tst_invited_user.user_fi AND tst_active.test_fi = tst_invited_user.test_fi " .
"WHERE tst_invited_user.test_fi = %s and tst_invited_user.user_fi=usr_data.usr_id " .
"ORDER BY $order",
array('integer'),
array($this->getTestId())
);
}
}
$result_array = array();
while ($row = $ilDB->fetchAssoc($result))
{
$result_array[$row['usr_id']]= $row;
}
return $result_array;
}

+ Here is the call graph for this function:

ilObjTest::getJavaScriptOutput ( )

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

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

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

References $_GET, $ilUser, and getForceJS().

{
global $ilUser;
if (strcmp($_GET["tst_javascript"], "0") == 0) return FALSE;
if ($this->getForceJS()) return TRUE;
$assessmentSetting = new ilSetting("assessment");
return ($ilUser->getPref("tst_javascript") === FALSE) ? $assessmentSetting->get("use_javascript") : $ilUser->getPref("tst_javascript");
}

+ Here is the call graph for this function:

ilObjTest::getKiosk ( )

Returns the kiosk mode.

Returns
integer Kiosk mode public
See Also
$_kiosk

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getKioskMode ( )

Returns the kiosk mode.

Returns
boolean Kiosk mode public
See Also
$_kiosk

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

Referenced by setKioskMode().

{
if (($this->_kiosk & 1) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::getListOfQuestions ( )

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

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

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

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

{
if (($this->show_summary & 1) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::getListOfQuestionsDescription ( )

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

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

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

Referenced by setListOfQuestionsDescription().

{
if (($this->show_summary & 8) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::getListOfQuestionsEnd ( )

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

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

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

Referenced by setListOfQuestionsEnd().

{
if (($this->show_summary & 4) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::getListOfQuestionsSettings ( )

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

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

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getListOfQuestionsStart ( )

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

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

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

Referenced by setListOfQuestionsStart().

{
if (($this->show_summary & 2) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::getMailNotification ( )

Get mail notification settings.

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

References $mailnotification.

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

+ Here is the caller graph for this function:

ilObjTest::getMailNotificationType ( )

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

References $mailnottype.

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

{
if ($this->mailnottype == 1)
{
}
else
{
return 0;
}
}

+ Here is the caller graph for this function:

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

Retrieves the manual feedback for a question in a test.

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

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

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

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

{
global $ilDB;
$feedback = "";
$result = $ilDB->queryF("SELECT feedback FROM tst_manual_fb WHERE active_fi = %s AND question_fi = %s AND pass = %s",
array('integer', 'integer', 'integer'),
array($active_id, $question_id, $pass)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
include_once("./Services/RTE/classes/class.ilRTE.php");
$feedback = ilRTE::_replaceMediaObjectImageSrc($row["feedback"], 1);
}
return $feedback;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getMarkSchema ( )

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

References $mark_schema.

{
}
ilObjTest::getMCScoring ( )

Gets the scoring type for multiple choice questions.

Returns
integer The scoring type for multiple choice questions public
See Also
$mc_scoring

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getNrOfResultsForPass (   $active_id,
  $pass 
)

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

private

Deprecated:
: still in use?

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

References $pass, and $result.

Referenced by getStartTestLabel().

{
global $ilDB;
$result = $ilDB->queryF("SELECT test_result_id FROM tst_test_result WHERE active_fi = %s AND pass = %s",
array('integer','integer'),
array($active_id, $pass)
);
return $result->numRows();
}

+ Here is the caller graph for this function:

ilObjTest::getNrOfTries ( )

Returns the nr of tries for the test.

Returns
integer The maximum number of tries public
See Also
$nr_of_tries

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

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

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

+ Here is the caller graph for this function:

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

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

{
global $ilDB;
$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",
array('integer'),
array($this->getTestId())
);
$persons_array = array();
while ($row = $ilDB->fetchAssoc($result))
{
$name = $this->lng->txt("unknown");
$fullname = $this->lng->txt("unknown");
$login = "";
if (!$this->getAnonymity())
{
if (strlen($row["firstname"].$row["lastname"].$row["title"]) == 0)
{
$name = $this->lng->txt("deleted_user");
$fullname = $this->lng->txt("deleted_user");
$login = $this->lng->txt("unknown");
}
else
{
$login = $row["login"];
if ($row["user_fi"] == ANONYMOUS_USER_ID)
{
$name = $this->lng->txt("unknown");
$fullname = $this->lng->txt("unknown");
}
else
{
$name = trim($row["lastname"] . ", " . $row["firstname"] . " " . $row["title"]);
$fullname = trim($row["title"] . " " . $row["firstname"] . " " . $row["lastname"]);
}
}
}
$persons_array[$row["active_id"]] = array(
"name" => $name,
"fullname" => $fullname,
"login" => $login
);
}
return $persons_array;
}

+ Here is the call graph for this function:

ilObjTest::getPassed (   $active_id)

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

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

Referenced by canShowCertificate().

{
global $ilDB;
$result = $ilDB->queryF("SELECT passed FROM tst_result_cache WHERE active_fi = %s",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
return $row['passed'];
}
else
{
$counted_pass = ilObjTest::_getResultPass($active_id);
$result_array =& $this->getTestResult($active_id, $counted_pass);
return $result_array["test"]["passed"];
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getPassFinishDate (   $active_id,
  $pass 
)

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

Parameters
integer$user_idThe user id
integer$test_idThe test id
integer$passThe pass of the test
Returns
timestamp The SQL timestamp of the finished pass public

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

References $pass, $result, and $row.

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

{
global $ilDB;
if (is_null($pass)) $pass = 0;
$result = $ilDB->queryF("SELECT tst_test_result.tstamp FROM tst_test_result WHERE active_fi = %s AND pass = %s ORDER BY tst_test_result.tstamp DESC",
array('integer', 'integer'),
array($active_id, $pass)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
return $row["tstamp"];
}
else
{
return 0;
}
}

+ Here is the caller graph for this function:

ilObjTest::getPassScoring ( )

Gets the pass scoring type.

Returns
integer The pass scoring type public
See Also
$pass_scoring

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getPassword ( )

Returns the password for test access.

Returns
striong Password for test access public
See Also
$password

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

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

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

+ Here is the caller graph for this function:

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

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

References ilObjTestDynamicQuestionSetConfig\getPoolQuestionChangeListener().

Referenced by ilObjQuestionPool\addQuestionChangeListeners().

{
require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
$questionChangeListeners = array(
);
return $questionChangeListeners;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getPoolUsage ( )

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

References $poolUsage.

Referenced by addDefaults(), and saveToDb().

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

+ Here is the caller graph for this function:

ilObjTest::getProcessingTime ( )

Returns the processing time for the test.

Returns
string The processing time for the test public
See Also
$processing_time

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getProcessingTimeAsArray ( )

Returns the processing time for the test.

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

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

References getEstimatedWorkingTime().

{
if (strlen($this->processing_time))
{
if (preg_match("/(\d{2}):(\d{2}):(\d{2})/is", $this->processing_time, $matches))
{
if ((int)$matches[1]+(int)$matches[2]+(int)$matches[3] == 0)
{
return $this->getEstimatedWorkingTime();
}
else
{
return array(
'hh' => $matches[1],
'mm' => $matches[2],
'ss' => $matches[3],
);
}
}
}
return $this->getEstimatedWorkingTime();
}

+ Here is the call graph for this function:

ilObjTest::getProcessingTimeInSeconds (   $active_id = "")

Returns the processing time for the test in seconds.

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

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

References getExtraTime(), and getProcessingTime().

Referenced by isMaxProcessingTimeReached().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getQuestionCount ( )

Returns the number of questions in the test.

Returns
integer The number of questions public

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

References isRandomTest().

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

{
$num = 0;
if( $this->isRandomTest() )
{
global $tree, $ilDB, $ilPluginAdmin;
$questionSetConfig = new ilTestRandomQuestionSetConfig(
$tree, $ilDB, $ilPluginAdmin, $this
);
$questionSetConfig->loadFromDb();
if( $questionSetConfig->isQuestionAmountConfigurationModePerPool() )
{
require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetBuilderWithAmountPerPool.php';
require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
$srcPoolDefFactory = new ilTestRandomQuestionSetSourcePoolDefinitionFactory($ilDB, $this);
$srcPoolDefList = new ilTestRandomQuestionSetSourcePoolDefinitionList($ilDB, $this, $srcPoolDefFactory);
$srcPoolDefList->loadDefinitions();
$num = ilTestRandomQuestionSetBuilderWithAmountPerPool::getRequiredQuestionAmountForDefinitionList($srcPoolDefList);
}
else
{
$num = $questionSetConfig->getQuestionAmountPerTest();
}
}
else
{
$num = count($this->questions);
}
return $num;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getQuestionDataset (   $question_id)

Returns the dataset for a given question id.

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

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

References $result, and $row.

{
global $ilDB;
$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",
array('integer'),
array($question_id)
);
$row = $ilDB->fetchObject($result);
return $row;
}
ilObjTest::getQuestions ( )

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

References $questions.

{
}
ilObjTest::getQuestionSetType ( )

getter for question set type

Returns
string $questionSetType

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

References $questionSetType.

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

+ Here is the caller graph for this function:

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

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

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

{
switch( $questionSetType )
{
return $lng->txt('tst_question_set_type_fixed');
return $lng->txt('tst_question_set_type_random');
return $lng->txt('tst_question_set_type_dynamic');
}
throw new ilTestException('invalid question set type value given: '.$questionSetType);
}

+ Here is the call graph for this function:

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

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

Returns
array An associated array containing the questions public

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

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

{
global $ilDB;
if ($this->isRandomTest())
{
$ilDB->setLimit($this->getQuestionCount(), 0);
$result = $ilDB->queryF("SELECT tst_test_rnd_qst.sequence, tst_test_rnd_qst.question_fi, " .
"qpl_questions.points " .
"FROM tst_test_rnd_qst, qpl_questions " .
"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 " .
"ORDER BY tst_test_rnd_qst.sequence",
array('integer', 'integer'),
array($active_id, $pass)
);
}
else
{
$result = $ilDB->queryF("SELECT tst_test_question.sequence, tst_test_question.question_fi, " .
"qpl_questions.points " .
"FROM tst_test_question, tst_active, qpl_questions " .
"WHERE tst_test_question.question_fi = qpl_questions.question_id " .
"AND tst_active.active_id = %s AND tst_active.test_fi = tst_test_question.test_fi",
array('integer'),
array($active_id)
);
}
$qpass = array();
if ($result->numRows())
{
while ($row = $ilDB->fetchAssoc($result))
{
array_push($qpass, $row);
}
}
return $qpass;
}

+ Here is the call graph for this function:

& ilObjTest::getQuestionsOfTest (   $active_id)

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

Returns
array An associated array containing the questions public

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

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

{
global $ilDB;
if ($this->isRandomTest())
{
$ilDB->setLimit($this->getQuestionCount(), 0);
$result = $ilDB->queryF("SELECT tst_test_rnd_qst.sequence, tst_test_rnd_qst.question_fi, " .
"tst_test_rnd_qst.pass, qpl_questions.points " .
"FROM tst_test_rnd_qst, qpl_questions " .
"WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id " .
"AND tst_test_rnd_qst.active_fi = %s ORDER BY tst_test_rnd_qst.sequence",
array('integer'),
array($active_id)
);
}
else
{
$result = $ilDB->queryF("SELECT tst_test_question.sequence, tst_test_question.question_fi, " .
"qpl_questions.points " .
"FROM tst_test_question, tst_active, qpl_questions " .
"WHERE tst_test_question.question_fi = qpl_questions.question_id " .
"AND tst_active.active_id = %s AND tst_active.test_fi = tst_test_question.test_fi",
array('integer'),
array($active_id)
);
}
$qtest = array();
if ($result->numRows())
{
while ($row = $ilDB->fetchAssoc($result))
{
array_push($qtest, $row);
}
}
return $qtest;
}

+ Here is the call graph for this function:

ilObjTest::getQuestiontext (   $question_id)

Returns the question text for a given question.

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

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

References $res, $result, and $row.

{
global $ilDB;
$res = "";
if ($question_id)
{
$result = $ilDB->queryF("SELECT question_text FROM qpl_questions WHERE question_id = %s",
array('integer'),
array($question_id)
);
if ($result->numRows() == 1)
{
$row = $ilDB->fetchAssoc($result);
$res = $row["question_text"];
}
}
return $res;
}
ilObjTest::getQuestionTitle (   $title)

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

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

Parameters
string$titleThe original title of the question
Returns
string The title for the question title output public

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

References ilObject\$title, and getTitleOutput().

{
if ($this->getTitleOutput() == 2)
{
return $this->lng->txt("ass_question");
}
else
{
return $title;
}
}

+ Here is the call graph for this function:

& ilObjTest::getQuestionTitles ( )

Returns the titles of the test questions in question sequence.

Returns
array The question titles public
See Also
$questions

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

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

{
$titles = array();
if ($this->getQuestionSetType() == self::QUESTION_SET_TYPE_FIXED)
{
global $ilDB;
$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",
array('integer'),
array($this->getTestId())
);
while ($row = $ilDB->fetchAssoc($result))
{
array_push($titles, $row["title"]);
}
}
return $titles;
}

+ Here is the call graph for this function:

& ilObjTest::getQuestionTitlesAndIndexes ( )

Returns the titles of the test questions in question sequence.

Returns
array The question titles public
See Also
$questions

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

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

Referenced by hasQuestionsWithoutQuestionpool().

{
$titles = array();
if ($this->getQuestionSetType() == self::QUESTION_SET_TYPE_FIXED)
{
global $ilDB;
$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",
array('integer'),
array($this->getTestId())
);
while ($row = $ilDB->fetchAssoc($result))
{
$titles[$row['question_id']] = $row["title"];
}
}
return $titles;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getQuestionType (   $question_id)

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

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

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

References $result.

Referenced by createQuestionGUI().

{
global $ilDB;
if ($question_id < 1) return -1;
$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",
array('integer'),
array($question_id)
);
if ($result->numRows() == 1)
{
$data = $ilDB->fetchObject($result);
return $data->type_tag;
}
else
{
return "";
}
}

+ Here is the caller graph for this function:

& ilObjTest::getQuestionTypeTranslations ( )

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

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

Referenced by getAvailableQuestions().

{
global $ilDB;
global $lng;
global $ilLog;
global $ilPluginAdmin;
$lng->loadLanguageModule("assessment");
$result = $ilDB->query("SELECT * FROM qpl_qst_type");
$types = array();
while ($row = $ilDB->fetchAssoc($result))
{
if ($row["plugin"] == 0)
{
$types[$row['type_tag']] = $lng->txt($row["type_tag"]);
}
else
{
$pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, "TestQuestionPool", "qst");
foreach ($pl_names as $pl_name)
{
$pl = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", $pl_name);
if (strcmp($pl->getQuestionType(), $row["type_tag"]) == 0)
{
$types[$row['type_tag']] = $pl->getQuestionTypeTranslation();
}
}
}
}
ksort($types);
return $types;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getRedirectionMode ( )

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

References $redirection_mode.

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

+ Here is the caller graph for this function:

ilObjTest::getRedirectionUrl ( )

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

References $redirection_url.

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

+ Here is the caller graph for this function:

ilObjTest::getReportingDate ( )

Gets the reporting date of the ilObjTest object.

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

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getResetProcessingTime ( )

Returns wheather the processing time should be reset or not.

Returns
integer 0 for no reset, 1 for a reset public
See Also
$reset_processing_time

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

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

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

+ Here is the caller graph for this function:

ilObjTest::getResultsForActiveId (   $active_id)

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

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

Referenced by getTestResult().

{
global $ilDB;
$query = "
SELECT *
FROM tst_result_cache
WHERE active_fi = %s
";
$result = $ilDB->queryF(
$query, array('integer'), array($active_id)
);
if( !$result->numRows() )
{
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$query = "
SELECT *
FROM tst_result_cache
WHERE active_fi = %s
";
$result = $ilDB->queryF(
$query, array('integer'), array($active_id)
);
}
$row = $ilDB->fetchAssoc($result);
return $row;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getResultsPresentation ( )

Returns the combined results presentation value.

Returns
integer The combined results presentation value public

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

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

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

+ Here is the caller graph for this function:

& ilObjTest::getRoleData (   $ids)

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

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

{
if (!is_array($ids) || count($ids) ==0) return array();
$result = array();
foreach ($ids as $obj_id)
{
$result[$obj_id] = array("obj_id" => $obj_id, "title" => ilObject::_lookupTitle($obj_id), "description" => ilObject::_lookupDescription($obj_id));
}
return $result;
}

+ Here is the call graph for this function:

ilObjTest::getScoreCutting ( )

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

Returns
integer The score cutting type. 0 for question cutting, 1 for test cutting public
See Also
$score_cutting

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

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

{
return ($this->score_cutting) ? $this->score_cutting : 0;
}

+ Here is the caller graph for this function:

ilObjTest::getScoreReporting ( )

Gets the score reporting of the ilObjTest object.

Returns
integer The score reporting of the test public
See Also
$score_reporting

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

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

{
return ($this->score_reporting) ? $this->score_reporting : 0;
}

+ Here is the caller graph for this function:

ilObjTest::getSecondsUntilEndingTime ( )

Returns the seconds left from the actual time until the ending time.

Returns
integer The seconds left until the ending time is reached public
See Also
$ending_time

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

References getEndingTime().

{
if (preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getEndingTime(), $matches))
{
$ending = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
$now = time();
return $ending - $now;
}
else
{
return 0;
}
}

+ Here is the call graph for this function:

ilObjTest::getSequenceSettings ( )

Gets the sequence settings of the ilObjTest object SEQUENCE SETTING = POSTPONING ENABLED !!

Returns
integer The sequence settings of the test public
See Also
$sequence_settings

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

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

{
return ($this->sequence_settings) ? $this->sequence_settings : 0;
}

+ Here is the caller graph for this function:

ilObjTest::getShowCancel ( )

Returns wheather the cancel test button is shown or not.

Returns
integer The value for the show cancel status (0 = don't show, 1 = show) public

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

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

{
return ($this->show_cancel) ? 1 : 0;
}

+ Here is the caller graph for this function:

ilObjTest::getShowExamviewHtml ( )
Returns
boolean

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

References $show_examview_html.

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

+ Here is the caller graph for this function:

ilObjTest::getShowExamviewPdf ( )
Returns
boolean

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

References $show_examview_pdf.

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

+ Here is the caller graph for this function:

ilObjTest::getShowFinalStatement ( )

Returns whether the final statement should be shown or not.

Returns
integer 0 if false, 1 if true public
See Also
$_showfinalstatement

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

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

{
return ($this->_showfinalstatement) ? 1 : 0;
}

+ Here is the caller graph for this function:

ilObjTest::getShowInfo ( )

Gets whether the complete information page is shown or the required data only.

Returns
integer 1 for the complete information, 0 otherwise public
See Also
$_showinfo

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

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

{
return ($this->_showinfo) ? 1 : 0;
}

+ Here is the caller graph for this function:

ilObjTest::getShowKioskModeParticipant ( )

Returns the status of the kiosk mode participant.

Returns
boolean Kiosk mode participant public
See Also
$_kiosk

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

Referenced by setShowKioskModeParticipant().

{
if (($this->_kiosk & 4) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::getShowKioskModeTitle ( )

Returns the status of the kiosk mode title.

Returns
boolean Kiosk mode title public
See Also
$_kiosk

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

Referenced by setShowKioskModeTitle().

{
if (($this->_kiosk & 2) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::getShowMarker ( )

Returns wheather the marker button is shown or not.

Returns
integer The value for the marker status (0 = don't show, 1 = show) public

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

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

{
return ($this->show_marker) ? 1 : 0;
}

+ Here is the caller graph for this function:

ilObjTest::getShowPassDetails ( )

Returns if the pass details should be shown when a test is not finished.

Returns
boolean TRUE if the pass details should be shown, FALSE otherwise public

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

Referenced by setShowPassDetails().

{
if (($this->results_presentation & 1) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::getShowSolutionAnswersOnly ( )

Returns if the full solution (including ILIAS content) should be presented to the solution or not.

Returns
boolean TRUE if the full solution should be presented in the solution output, FALSE otherwise public

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

Referenced by setShowSolutionAnswersOnly().

{
if (($this->results_presentation & 16) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::getShowSolutionDetails ( )

Returns if the solution details should be presented to the user or not.

Returns
boolean TRUE if the solution details should be presented, FALSE otherwise public

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

Referenced by setShowSolutionDetails().

{
if (($this->results_presentation & 2) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::getShowSolutionFeedback ( )

Returns if the feedback should be presented to the solution or not.

Returns
boolean TRUE if the feedback should be presented in the solution, FALSE otherwise public

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

Referenced by setShowSolutionFeedback().

{
if (($this->results_presentation & 8) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::getShowSolutionListComparison ( )
Returns
boolean TRUE if the results should be compared with the correct results in the list of answers, FALSE otherwise public

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

Referenced by setShowSolutionListComparison().

{
if(($this->results_presentation & 128) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::getShowSolutionPrintview ( )

Returns if the solution printview should be presented to the user or not.

Returns
boolean TRUE if the solution printview should be presented, FALSE otherwise public

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

Referenced by canShowSolutionPrintview(), and setShowSolutionPrintview().

{
if (($this->results_presentation & 4) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::getShowSolutionSignature ( )

Returns if the signature field should be shown in the test results.

Returns
boolean TRUE if the signature field should be shown, FALSE otherwise public

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

Referenced by setShowSolutionSignature().

{
if (($this->results_presentation & 32) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

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

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

Referenced by setShowSolutionSuggested().

{
if (($this->results_presentation & 64) > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::getShuffleQuestions ( )

Returns the status of the shuffle_questions variable.

Returns
integer 0 if the test questions are not shuffled, 1 if the test questions are shuffled public

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

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

{
return ($this->shuffle_questions) ? 1 : 0;
}

+ Here is the caller graph for this function:

ilObjTest::getSignSubmission ( )
Returns
boolean

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

References $sign_submission.

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

+ Here is the caller graph for this function:

ilObjTest::getSpecificAnswerFeedback ( )

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

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

{
switch ($this->specific_answer_feedback)
{
case 1:
return 1;
default:
return 0;
}
}

+ Here is the caller graph for this function:

ilObjTest::getStartingTime ( )

Returns the starting time of the test.

Returns
string The starting time of the test public
See Also
$starting_time

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

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

{
return (strlen($this->starting_time)) ? $this->starting_time : NULL;
}

+ Here is the caller graph for this function:

ilObjTest::getStartingTimeOfParticipants ( )

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

References $result, and $row.

{
global $ilDB;
$times = array();
$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");
while ($row = $ilDB->fetchAssoc($result))
{
$times[$row['active_fi']] = $row['started'];
}
return $times;
}
ilObjTest::getStartingTimeOfUser (   $active_id,
  $pass = null 
)

Returns the unix timestamp of the time a user started a test.

Parameters
integer$active_idThe active id of the user
Returns
mixed The unix timestamp if the user started the test, FALSE otherwise public

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

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

Referenced by canShowTestResults(), and isExecutable().

{
global $ilDB;
if ($active_id < 1) return FALSE;
if($pass === null)
{
$pass = ($this->getResetProcessingTime()) ? $this->_getPass($active_id) : 0;
}
$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",
array('integer', 'integer'),
array($active_id, $pass)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
if (preg_match("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row["started"], $matches))
{
return mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
}
else
{
return mktime();
}
}
else
{
return mktime();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getStartTestLabel (   $active_id)

Returns the "Start the Test" label for the Info page.

Parameters
int$active_idThe active id of the current user
Returns
string The "Start the Test" label public

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

References $res, _getPass(), getNrOfResultsForPass(), and getNrOfTries().

{
if ($this->getNrOfTries() == 1)
{
return $this->lng->txt("tst_start_test");
}
$active_pass = $this->_getPass($active_id);
$res = $this->getNrOfResultsForPass($active_id, $active_pass);
if ($res == 0)
{
if ($active_pass == 0)
{
return $this->lng->txt("tst_start_test");
}
else
{
return $this->lng->txt("tst_start_new_test_pass");
}
}
else
{
return $this->lng->txt("tst_resume_test");
}
}

+ Here is the call graph for this function:

ilObjTest::getTemplate ( )

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

References $template_id.

Referenced by saveToDb().

{
}

+ Here is the caller graph for this function:

& ilObjTest::getTestDefaults (   $test_defaults_id)

Returns the test defaults for a given id.

Parameters
integer$test_defaults_idThe database id of a test defaults dataset
Returns
array An array containing the test defaults public

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

References _getTestDefaults().

{
return self::_getTestDefaults($test_defaults_id);
}

+ Here is the call graph for this function:

static ilObjTest::getTestObjIdsWithActiveForUserId (   $userId)
static

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

References $query, $res, and $row.

Referenced by ilTestVerificationTableGUI\getItems().

{
global $ilDB;
$query = "
SELECT obj_fi
FROM tst_active
INNER JOIN tst_tests
ON test_id = test_fi
WHERE user_fi = %s
";
$res = $ilDB->queryF($query, array('integer'), array($userId));
$objIds = array();
while( $row = $ilDB->fetchAssoc($res) )
{
$objIds[] = (int)$row['obj_fi'];
}
return $objIds;
}

+ Here is the caller graph for this function:

& ilObjTest::getTestParticipants ( )

Returns a list of all participants in a test.

Returns
array The user id's of the participants public

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

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

Referenced by getTestParticipantsForManualScoring().

{
global $ilDB;
if ($this->getAnonymity())
{
$result = $ilDB->queryF("SELECT tst_active.active_id, tst_active.tries, tst_active.user_fi usr_id, %s login, %s lastname, %s firstname, tst_active.submitted test_finished, usr_data.matriculation, usr_data.active ".
"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),
array('text', 'text', 'text', 'integer'),
array("", $this->lng->txt("unknown"), "", $this->getTestId())
);
}
else
{
$result = $ilDB->queryF("SELECT tst_active.active_id, tst_active.tries, tst_active.user_fi usr_id, usr_data.login, usr_data.lastname, usr_data.firstname, tst_active.submitted test_finished, usr_data.matriculation, usr_data.active ".
"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),
array('integer'),
array($this->getTestId())
);
}
$data = array();
while ($row = $ilDB->fetchAssoc($result))
{
$data[$row['active_id']] = $row;
}
foreach ($data as $index => $participant)
{
if (strlen(trim($participant["firstname"].$participant["lastname"])) == 0)
{
$data[$index]["lastname"] = $this->lng->txt("deleted_user");
}
}
return $data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getTestParticipantsForManualScoring (   $filter = NULL)

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

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

{
global $ilDB;
include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
if (count($scoring) == 0) return array();
$participants =& $this->getTestParticipants();
$filtered_participants = array();
foreach ($participants as $active_id => $participant)
{
$qstType_IN_manScoreableQstTypes = $ilDB->in('qpl_questions.question_type_fi', $scoring, false, 'integer');
$queryString = "
SELECT tst_test_result.manual
FROM tst_test_result
INNER JOIN qpl_questions
ON tst_test_result.question_fi = qpl_questions.question_id
WHERE tst_test_result.active_fi = %s
AND $qstType_IN_manScoreableQstTypes
";
$result = $ilDB->queryF(
$queryString, array("integer"), array($active_id)
);
$count = $result->numRows();
if ($count > 0)
{
switch ($filter)
{
case 1: // only active users
if ($participant->active) $filtered_participants[$active_id] = $participant;
break;
case 2: // only inactive users
if (!$participant->active) $filtered_participants[$active_id] = $participant;
break;
case 3: // all users
$filtered_participants[$active_id] = $participant;
break;
case 4:
// already scored participants
//$found = 0;
//while ($row = $ilDB->fetchAssoc($result))
//{
// if ($row["manual"]) $found++;
//}
//if ($found == $count)
//{
//$filtered_participants[$active_id] = $participant;
//}
//else
//{
$assessmentSetting = new ilSetting("assessment");
$manscoring_done = $assessmentSetting->get("manscoring_done_" . $active_id);
if ($manscoring_done) $filtered_participants[$active_id] = $participant;
//}
break;
case 5:
// unscored participants
//$found = 0;
//while ($row = $ilDB->fetchAssoc($result))
//{
// if ($row["manual"]) $found++;
//}
//if ($found == 0)
//{
$assessmentSetting = new ilSetting("assessment");
$manscoring_done = $assessmentSetting->get("manscoring_done_" . $active_id);
if (!$manscoring_done) $filtered_participants[$active_id] = $participant;
//}
break;
case 6:
// partially scored participants
$found = 0;
while ($row = $ilDB->fetchAssoc($result))
{
if ($row["manual"]) $found++;
}
if (($found > 0) && ($found < $count)) $filtered_participants[$active_id] = $participant;
break;
default:
$filtered_participants[$active_id] = $participant;
break;
}
}
}
return $filtered_participants;
}

+ Here is the call graph for this function:

& ilObjTest::getTestQuestions ( )

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

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

{
global $ilDB;
$query = "
SELECT questions.*,
questtypes.type_tag,
tstquest.sequence,
tstquest.obligatory,
origquest.obj_fi orig_obj_fi
FROM qpl_questions questions
INNER JOIN qpl_qst_type questtypes
ON questtypes.question_type_id = questions.question_type_fi
INNER JOIN tst_test_question tstquest
ON tstquest.question_fi = questions.question_id
LEFT JOIN qpl_questions origquest
ON origquest.question_id = questions.original_id
WHERE tstquest.test_fi = %s
ORDER BY tstquest.sequence
";
$query_result = $ilDB->queryF(
$query, array('integer'), array($this->getTestId())
);
$questions = array();
while ($row = $ilDB->fetchAssoc($query_result))
{
$question = $row;
$question['obligationPossible'] = self::isQuestionObligationPossible($row['question_id']);
$questions[] = $question;
}
return $questions;
}

+ Here is the call graph for this function:

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

Calculates the results of a test for a given user and returns an array with all test results.

Returns
array An array containing the test results for the given user public

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

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

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

{
global $tree, $ilDB, $lng, $ilPluginAdmin;
$results = $this->getResultsForActiveId($active_id);
if( is_null($pass) )
{
$pass = $results['pass'];
}
require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
$testSessionFactory = new ilTestSessionFactory($this);
$testSession = $testSessionFactory->getSession($active_id);
require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
$testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this);
$testSequence = $testSequenceFactory->getSequenceByPass($testSession, $pass);
if( $this->isDynamicTest() )
{
require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
$dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this);
$dynamicQuestionSetConfig->loadFromDb();
$testSequence->loadFromDb($dynamicQuestionSetConfig);
$testSequence->loadQuestions($dynamicQuestionSetConfig, new ilTestDynamicQuestionSetFilterSelection());
$sequence = $testSequence->getUserSequenceQuestions();
}
else
{
$testSequence->loadFromDb();
$testSequence->loadQuestions();
if( $ordered_sequence )
{
$sequence = $testSequence->getOrderedSequenceQuestions();
}
else
{
$sequence = $testSequence->getUserSequenceQuestions();
}
}
$arrResults = array();
$query = "
SELECT tst_test_result.question_fi,
tst_test_result.points reached,
tst_test_result.hint_count requested_hints,
tst_test_result.hint_points hint_points,
tst_test_result.answered answered
FROM tst_test_result
LEFT JOIN tst_solutions
ON tst_solutions.active_fi = tst_test_result.active_fi
AND tst_solutions.question_fi = tst_test_result.question_fi
WHERE tst_test_result.active_fi = %s
AND tst_test_result.pass = %s
";
$solutionresult = $ilDB->queryF(
$query, array('integer', 'integer'), array($active_id, $pass)
);
while( $row = $ilDB->fetchAssoc($solutionresult) )
{
$arrResults[ $row['question_fi'] ] = $row;
}
$numWorkedThrough = count($arrResults);
require_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$IN_question_ids = $ilDB->in('qpl_questions.question_id', $sequence, false, 'integer');
$query = "
SELECT qpl_questions.*,
qpl_qst_type.type_tag,
qpl_sol_sug.question_fi has_sug_sol
FROM qpl_qst_type,
qpl_questions
LEFT JOIN qpl_sol_sug
ON qpl_sol_sug.question_fi = qpl_questions.question_id
WHERE qpl_qst_type.question_type_id = qpl_questions.question_type_fi
AND $IN_question_ids
";
$result = $ilDB->query($query);
$unordered = array();
$key = 1;
$obligationsAnswered = true;
while( $row = $ilDB->fetchAssoc($result) )
{
$percentvalue = (
$row['points'] ? $arrResults[ $row['question_id'] ]['reached'] / $row['points'] : 0
);
if( $percentvalue < 0 ) $percentvalue = 0.0;
$data = array(
"nr" => "$key",
"title" => ilUtil::prepareFormOutput($row['title']),
"max" => round($row['points'], 2),
"reached" => round($arrResults[$row['question_id']]['reached'],2),
'requested_hints' => $arrResults[$row['question_id']]['requested_hints'],
'hint_points' => $arrResults[$row['question_id']]['hint_points'],
"percent" => sprintf("%2.2f ", ($percentvalue) * 100) . "%",
"solution" => ($row['has_sug_sol']) ? assQuestion::_getSuggestedSolutionOutput($row['question_id']) : '',
"type" => $row["type_tag"],
"qid" => $row['question_id'],
"original_id" => $row["original_id"],
"workedthrough" => isset($arrResults[$row['question_id']]) ? 1 : 0,
'answered' => $arrResults[$row['question_id']]['answered']
);
if( !$arrResults[ $row['question_id'] ]['answered'] )
{
$obligationsAnswered = false;
}
$unordered[ $row['question_id'] ] = $data;
$key++;
}
$pass_max = 0;
$pass_reached = 0;
$pass_requested_hints = 0;
$pass_hint_points = 0;
$key = 1;
$found = array();
foreach( $sequence as $qid )
{
// building pass point sums based on prepared data
// for question that exists in users qst sequence
$pass_max += round($unordered[$qid]['max'], 2);
$pass_reached += round($unordered[$qid]['reached'], 2);
$pass_requested_hints += $unordered[$qid]['requested_hints'];
$pass_hint_points += $unordered[$qid]['hint_points'];
// pickup prepared data for question
// that exists in users qst sequence
$unordered[$qid]['nr'] = $key;
array_push($found, $unordered[$qid]);
// increment key counter
$key++;
}
$unordered = null;
if( $this->getScoreCutting() == 1 )
{
if( $results['reached_points'] < 0 )
{
$results['reached_points'] = 0;
}
if( $pass_reached < 0 ) $pass_reached = 0;
}
$found['pass']['total_max_points'] = $pass_max;
$found['pass']['total_reached_points'] = $pass_reached;
$found['pass']['total_requested_hints'] = $pass_requested_hints;
$found['pass']['total_hint_points'] = $pass_hint_points;
$found['pass']['percent'] = ($pass_max > 0) ? $pass_reached / $pass_max : 0;
$found['pass']['obligationsAnswered'] = $obligationsAnswered;
$found['pass']['num_workedthrough'] = $numWorkedThrough;
$found["test"]["total_max_points"] = $results['max_points'];
$found["test"]["total_reached_points"] = $results['reached_points'];
$found["test"]["total_requested_hints"] = $results['hint_count'];
$found["test"]["total_hint_points"] = $results['hint_points'];
$found["test"]["result_pass"] = $results['pass'];
$found['test']['obligations_answered'] = $results['obligations_answered'];
if( (!$total_reached_points) or (!$total_max_points) )
{
$percentage = 0.0;
}
else
{
$percentage = ($total_reached_points / $total_max_points) * 100.0;
if( $percentage < 0 ) $percentage = 0.0;
}
$found["test"]["passed"] = $results['passed'];
return $found;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

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

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

Referenced by deliverPDFfromHTML().

{
if (strlen($this->getCustomStyle()))
{
$default = ilUtil::getStyleSheetLocation("filesystem", "ta.css", "Modules/Test");
$custom = str_replace("ta.css", "customstyles/" . $this->getCustomStyle(), $default);
if (file_exists($custom))
{
$custom = ilUtil::getStyleSheetLocation($mode, "ta.css", "Modules/Test");
$custom = str_replace("ta.css", "customstyles/" . $this->getCustomStyle(), $custom);
return $custom;
}
else
{
return ilUtil::getStyleSheetLocation($mode, "ta.css", "Modules/Test");
}
}
else
{
return ilUtil::getStyleSheetLocation($mode, "ta.css", "Modules/Test");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getTextAnswer (   $active_id,
  $question_id,
  $pass = NULL 
)

Returns the text answer of a given user for a given question.

Parameters
integer$user_idThe user id
integer$question_idThe question id
Returns
string The answer text public

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

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

{
global $ilDB;
$res = "";
if (($active_id) && ($question_id))
{
if (is_null($pass))
{
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$pass = assQuestion::_getSolutionMaxPass($question_id, $active_id);
}
$result = $ilDB->queryF("SELECT value1 FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
array('integer', 'integer', 'integer'),
array($active_id, $question_id, $pass)
);
if ($result->numRows() == 1)
{
$row = $ilDB->fetchAssoc($result);
$res = $row["value1"];
}
}
return $res;
}

+ Here is the call graph for this function:

ilObjTest::getTimeExtensionsOfParticipants ( )

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

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

{
global $ilDB;
$times = array();
$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",
array('integer'),
array($this->getTestId())
);
while ($row = $ilDB->fetchAssoc($result))
{
$times[$row['active_fi']] = $row['additionaltime'];
}
return $times;
}

+ Here is the call graph for this function:

ilObjTest::getTitleOutput ( )

Returns the value of the title_output status.

Returns
integer 0 for full title, 1 for title without points, 2 for no title public
See Also
$title_output

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

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

{
return ($this->title_output) ? $this->title_output : 0;
}

+ Here is the caller graph for this function:

& ilObjTest::getTotalPointsPassedArray ( )

Returns an array with the total points of all users who passed the test This array could be used for statistics.

Returns
array The total point values public

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

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

Referenced by getAllTestResults(), and getUnfilteredEvaluationData().

{
$totalpoints_array = array();
$all_users =& $this->evalTotalParticipantsArray();
foreach ($all_users as $active_id => $user_name)
{
$test_result =& $this->getTestResult($active_id);
$reached = $test_result["test"]["total_reached_points"];
$total = $test_result["test"]["total_max_points"];
$percentage = $total != 0 ? $reached/$total : 0;
$mark = $this->mark_schema->getMatchingMark($percentage*100.0);
$obligationsAnswered = $test_result["test"]["obligations_answered"];
if ($mark)
{
if( $mark->getPassed() && $obligationsAnswered )
{
array_push($totalpoints_array, $test_result["test"]["total_reached_points"]);
}
}
}
return $totalpoints_array;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getUnfilteredEvaluationData ( )

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

References $pass, $query, $result, $row, getECTSGrade(), getQuestionCount(), getTestId(), getTotalPointsPassedArray(), getVisitTimeOfParticipant(), and isRandomTest().

Referenced by getCompleteEvaluationData().

{
global $ilDB;
include_once "./Modules/Test/classes/class.ilTestEvaluationPassData.php";
include_once "./Modules/Test/classes/class.ilTestEvaluationUserData.php";
include_once "./Modules/Test/classes/class.ilTestEvaluationData.php";
$data = new ilTestEvaluationData($this);
$query = "
SELECT tst_test_result.*,
qpl_questions.original_id,
qpl_questions.title questiontitle,
qpl_questions.points maxpoints
FROM tst_test_result, qpl_questions, tst_active
WHERE tst_active.active_id = tst_test_result.active_fi
AND qpl_questions.question_id = tst_test_result.question_fi
AND tst_active.test_fi = %s
ORDER BY tst_active.active_id ASC, tst_test_result.pass ASC, tst_test_result.tstamp DESC
";
$result = $ilDB->queryF(
$query, array('integer'), array($this->getTestId())
);
$pass = NULL;
$checked = array();
$datasets = 0;
while( $row = $ilDB->fetchAssoc($result) )
{
$participantObject = $data->getParticipant($row["active_fi"]);
if( !($participantObject instanceof ilTestEvaluationUserData) )
{
continue;
}
$passObject = $participantObject->getPass($row["pass"]);
if( !($passObject instanceof ilTestEvaluationPassData) )
{
continue;
}
$passObject->addAnsweredQuestion(
$row["question_fi"], $row["maxpoints"], $row["points"], $row['answered'], null, $row['manual']
);
}
foreach( array_keys($data->getParticipants()) as $active_id )
{
if( $this->isRandomTest() )
{
for( $testpass = 0; $testpass <= $data->getParticipant($active_id)->getLastPass(); $testpass++ )
{
$ilDB->setLimit($this->getQuestionCount(), 0);
$result = $ilDB->queryF("SELECT tst_test_rnd_qst.sequence, tst_test_rnd_qst.question_fi, qpl_questions.original_id, " .
"tst_test_rnd_qst.pass, qpl_questions.points, qpl_questions.title " .
"FROM tst_test_rnd_qst, qpl_questions " .
"WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id " .
"AND tst_test_rnd_qst.pass = %s " .
"AND tst_test_rnd_qst.active_fi = %s ORDER BY tst_test_rnd_qst.sequence",
array('integer','integer'),
array($testpass, $active_id)
);
if ($result->numRows())
{
while ($row = $ilDB->fetchAssoc($result))
{
$tpass = array_key_exists("pass", $row) ? $row["pass"] : 0;
$data->getParticipant($active_id)->addQuestion($row["original_id"], $row["question_fi"], $row["points"], $row["sequence"], $tpass);
$data->addQuestionTitle($row["question_fi"], $row["title"]);
}
}
}
}
else
{
$result = $ilDB->queryF("SELECT tst_test_question.sequence, tst_test_question.question_fi, " .
"qpl_questions.points, qpl_questions.title, qpl_questions.original_id " .
"FROM tst_test_question, tst_active, qpl_questions " .
"WHERE tst_test_question.question_fi = qpl_questions.question_id " .
"AND tst_active.active_id = %s AND tst_active.test_fi = tst_test_question.test_fi ORDER BY tst_test_question.sequence",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$questionsbysequence = array();
while ($row = $ilDB->fetchAssoc($result))
{
$questionsbysequence[$row["sequence"]] = $row;
}
$seqresult = $ilDB->queryF("SELECT * FROM tst_sequence WHERE active_fi = %s",
array('integer'),
array($active_id)
);
while ($seqrow = $ilDB->fetchAssoc($seqresult))
{
$questionsequence = unserialize($seqrow["sequence"]);
foreach ($questionsequence as $sidx => $seq)
{
$data->getParticipant($active_id)->addQuestion($questionsbysequence[$seq]["original_id"], $questionsbysequence[$seq]["question_fi"], $questionsbysequence[$seq]["points"], $sidx + 1, $seqrow["pass"]);
$data->addQuestionTitle($questionsbysequence[$seq]["question_fi"], $questionsbysequence[$seq]["title"]);
}
}
}
}
}
if ($this->ects_output)
{
$passed_array =& $this->getTotalPointsPassedArray();
}
foreach( array_keys($data->getParticipants()) as $active_id )
{
$tstUserData = $data->getParticipant($active_id);
$percentage = $tstUserData->getReachedPointsInPercent();
$obligationsAnswered = $tstUserData->areObligationsAnswered();
$mark = $this->mark_schema->getMatchingMark($percentage);
if (is_object($mark))
{
$tstUserData->setMark($mark->getShortName());
$tstUserData->setMarkOfficial($mark->getOfficialName());
$tstUserData->setPassed(
$mark->getPassed() && $tstUserData->areObligationsAnswered()
);
}
if ($this->ects_output)
{
$ects_mark = $this->getECTSGrade(
$passed_array, $tstUserData->getReached(), $tstUserData->getMaxPoints()
);
$tstUserData->setECTSMark($ects_mark);
}
$visitingTime =& $this->getVisitTimeOfParticipant($active_id);
$tstUserData->setFirstVisit($visitingTime["firstvisit"]);
$tstUserData->setLastVisit($visitingTime["lastvisit"]);
}
return $data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::getUsePreviousAnswers ( )

Returns if the previous answers should be shown for a learner.

Returns
integer 1 if the previous answers should be shown, 0 otherwise public
See Also
$use_previous_answers

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

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

{
return ($this->use_previous_answers) ? $this->use_previous_answers : 0;
}

+ Here is the caller graph for this function:

& ilObjTest::getUserData (   $ids)

Returns a data of all users specified by id list.

Parameters
$usr_idskommaseparated list of ids
Returns
array The user data "usr_id, login, lastname, firstname, clientip" of the users with id as key public

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

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

{
global $ilDB;
if (!is_array($ids) || count($ids) ==0) return array();
if ($this->getAnonymity())
{
$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",
array('text', 'text', 'text'),
array("", $this->lng->txt("unknown"), "")
);
}
else
{
$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");
}
$result_array = array();
while ($row = $ilDB->fetchAssoc($result))
{
$result_array[$row["usr_id"]]= $row;
}
return $result_array;
}

+ Here is the call graph for this function:

ilObjTest::getVisitTimeOfParticipant (   $active_id)

Returns the first and last visit of a participant.

Parameters
integer$active_idThe active ID of the participant
Returns
array The first and last visit of a participant public

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

References _getVisitTimeOfParticipant(), and getTestId().

Referenced by getUnfilteredEvaluationData().

{
return ilObjTest::_getVisitTimeOfParticipant($this->getTestId(), $active_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilObjTest::getWorkedQuestions (   $active_id,
  $pass = NULL 
)

Gets the id's of all questions a user already worked through.

Returns
array The question id's of the questions already worked through public

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

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

{
global $ilUser;
global $ilDB;
if (is_null($pass))
{
$result = $ilDB->queryF("SELECT question_fi FROM tst_solutions WHERE active_fi = %s AND pass = %s GROUP BY question_fi",
array('integer','integer'),
array($active_id, 0)
);
}
else
{
$result = $ilDB->queryF("SELECT question_fi FROM tst_solutions WHERE active_fi = %s AND pass = %s GROUP BY question_fi",
array('integer','integer'),
array($active_id, $pass)
);
}
$result_array = array();
while ($row = $ilDB->fetchAssoc($result))
{
array_push($result_array, $row["question_fi"]);
}
return $result_array;
}
ilObjTest::getXMLZip ( )

Get zipped xml file for test.

Reimplemented from ilObject.

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

{
include_once("./Modules/Test/classes/class.ilTestExport.php");
$test_exp = new ilTestExport($this, "xml");
return $test_exp->buildExportFile();
}
ilObjTest::hasNrOfTriesRestriction ( )

returns if the numbers of tries have to be checked

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

References getNrOfTries().

Referenced by isExecutable().

{
return $this->getNrOfTries() != 0;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilObjTest::hasObligations (   $test_id)
static

returns the fact wether the test with given test id contains questions markes as obligatory or not

ilDB $ilDB

Parameters
integer$test_id
Returns
boolean $hasObligations

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

References $row, and $test_id.

Referenced by allObligationsAnswered().

{
global $ilDB;
$rset = $ilDB->queryF(
'SELECT count(*) cnt FROM tst_test_question WHERE test_fi = %s AND obligatory = 1',
array('integer'), array($test_id)
);
$row = $ilDB->fetchAssoc($rset);
return (bool)$row['cnt'] > 0;
}

+ Here is the caller graph for this function:

ilObjTest::hasQuestionsWithoutQuestionpool ( )

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

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

{
global $ilDB;
$IN_questions = $ilDB->in('q1.question_id', array_keys($questions), false, 'integer');
$query = "
SELECT count(q1.question_id) cnt
FROM qpl_questions q1
INNER JOIN qpl_questions q2
ON q2.question_id = q1.original_id
WHERE $IN_questions
AND q1.obj_fi = q2.obj_fi
";
$rset = $ilDB->query($query);
$row = $ilDB->fetchAssoc($rset);
return $row['cnt'] > 0;
}

+ Here is the call graph for this function:

ilObjTest::hasRandomQuestionsForPass (   $active_id,
  $pass 
)

Checkes wheather a random test has already created questions for a given pass or not.

private

Parameters
$active_idActive id of the test
$passPass of the test
Returns
boolean TRUE if the test already contains questions, FALSE otherwise
Deprecated:
: still in use?

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

References $pass, and $result.

{
global $ilDB;
$result = $ilDB->queryF("SELECT test_random_question_id FROM tst_test_rnd_qst WHERE active_fi = %s AND pass = %s",
array('integer','integer'),
array($active_id, $pass)
);
return ($result->numRows() > 0) ? true : false;
}
ilObjTest::hasSingleChoiceQuestions ( )

Returns TRUE if the test contains single choice results.

Returns
boolean public

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

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

Referenced by isSingleChoiceTestWithoutShuffle().

{
global $ilDB;
$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",
array('integer'),
array($this->getTestId())
);
$hasSC = false;
while ($row = $ilDB->fetchAssoc($result))
{
if (strcmp($row['foundtypes'], 'assSingleChoice') == 0)
{
$hasSC = true;
}
}
return $hasSC;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::initDefaultRoles ( )

init default roles settings

If your module does not require any default roles, delete this method (For an example how this method is used, look at ilObjForum)

public

Returns
array object IDs of created local roles.

Reimplemented from ilObject.

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

{
global $rbacadmin;
return array();
}
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 3620 of file class.ilObjTest.php.

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

{
global $ilDB;
#var_dump($question_id);
if ($linkOnly)
{
$duplicate_id = $question_id;
}
else
{
$duplicate_id = $this->duplicateQuestionForTest($question_id);
}
// get maximum sequence index in test
$result = $ilDB->queryF("SELECT MAX(sequence) seq FROM tst_test_question WHERE test_fi=%s",
array('integer'),
array($this->getTestId())
);
$sequence = 1;
if ($result->numRows() == 1)
{
$data = $ilDB->fetchObject($result);
$sequence = $data->seq + 1;
}
$next_id = $ilDB->nextId('tst_test_question');
$affectedRows = $ilDB->manipulateF("INSERT INTO tst_test_question (test_question_id, test_fi, question_fi, sequence, tstamp) VALUES (%s, %s, %s, %s, %s)",
array('integer', 'integer','integer','integer','integer'),
array($next_id, $this->getTestId(), $duplicate_id, $sequence, time())
);
if ($affectedRows == 1)
{
include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
{
$this->logAction($this->lng->txtlng("assessment", "log_question_added", ilObjAssessmentFolder::_getLogLanguage()) . ": " . $sequence, $duplicate_id);
}
}
// remove test_active entries, because test has changed
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_active WHERE test_fi = %s",
array('integer'),
array($this->getTestId())
);
$this->loadQuestions();
$this->saveCompleteStatus($testQuestionSetConfig);
return $duplicate_id;
}

+ Here is the call graph for this function:

ilObjTest::inviteGroup (   $group_id)

Invites all users of a group to a test.

Parameters
integer$group_idThe database id of the invited group public

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

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

{
include_once "./Modules/Group/classes/class.ilObjGroup.php";
$group = new ilObjGroup($group_id);
$members = $group->getGroupMemberIds();
include_once './Services/User/classes/class.ilObjUser.php';
foreach ($members as $user_id)
{
$this->inviteUser($user_id, ilObjUser::_lookupClientIP($user_id));
}
}

+ Here is the call graph for this function:

ilObjTest::inviteRole (   $role_id)

Invites all users of a role to a test.

Parameters
integer$group_idThe database id of the invited group public

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

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

{
global $rbacreview;
$members = $rbacreview->assignedUsers($role_id,"usr_id");
include_once './Services/User/classes/class.ilObjUser.php';
foreach ($members as $user_id)
{
$this->inviteUser($user_id, ilObjUser::_lookupClientIP($user_id));
}
}

+ Here is the call graph for this function:

ilObjTest::inviteUser (   $user_id,
  $client_ip = "" 
)

Invites a user to a test.

Parameters
integer$user_idThe database id of the invited user public

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

References getTestId().

Referenced by inviteGroup(), and inviteRole().

{
global $ilDB;
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_invited_user WHERE test_fi = %s AND user_fi = %s",
array('integer', 'integer'),
array($this->getTestId(), $user_id)
);
$affectedRows = $ilDB->manipulateF("INSERT INTO tst_invited_user (test_fi, user_fi, clientip, tstamp) VALUES (%s, %s, %s, %s)",
array('integer', 'integer', 'text', 'integer'),
array($this->getTestId(), $user_id, (strlen($client_ip)) ? $client_ip : NULL, time())
);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::isActivationLimited ( )

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

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

{
return (bool)$this->activation_limited;
}

+ Here is the caller graph for this function:

ilObjTest::isActiveTestSubmitted (   $user_id = null)

returns if the active for user_id has been submitted

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

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

{
global $ilUser;
global $ilDB;
if (!is_numeric($user_id))
$user_id = $ilUser->getId();
$result = $ilDB->queryF("SELECT submitted FROM tst_active WHERE test_fi=%s AND user_fi=%s AND submitted=%s",
array('integer', 'integer', 'integer'),
array($this->getTestId(), $user_id, 1)
);
return $result->numRows() == 1;
}

+ Here is the call graph for this function:

ilObjTest::isBestSolutionPrintedWithResult ( )

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

References $print_best_solution_with_result.

Referenced by addDefaults(), and saveToDb().

+ Here is the caller graph for this function:

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

References ilTestQuestionSetConfig\isQuestionSetConfigured().

Referenced by saveCompleteStatus(), and saveToDb().

{
if( !count($this->mark_schema->mark_steps) )
{
return false;
}
if( !$testQuestionSetConfig->isQuestionSetConfigured() )
{
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::isDynamicTest ( )

Returns the fact wether this test is a dynamic question set test or not.

Returns
boolean $isDynamicTest

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

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:

ilObjTest::isExecutable (   $testSession,
  $user_id,
  $allowPassIncrease = FALSE 
)

Checks if the test is executable by the given user.

Parameters
ilTestSession|ilTestSessionDynamicQuestionSet
integer$user_idThe user id
Returns
array Result array public

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

References $GLOBALS, $result, $starting_time, $testSession, _getPass(), endingTimeReached(), ilFormat\ftimestamp2datetimeDB(), getActiveIdOfUser(), getEnableProcessingTime(), getEndingTime(), getNrOfTries(), getResetProcessingTime(), getStartingTime(), getStartingTimeOfUser(), hasNrOfTriesRestriction(), isMaxProcessingTimeReached(), and startingTimeReached().

{
$result = array(
"executable" => true,
"errormessage" => ""
);
if (!$this->startingTimeReached())
{
$result["executable"] = false;
$result["errormessage"] = sprintf($this->lng->txt("detail_starting_time_not_reached"), ilFormat::ftimestamp2datetimeDB($this->getStartingTime()));
return $result;
}
if ($this->endingTimeReached())
{
$result["executable"] = false;
$result["errormessage"] = sprintf($this->lng->txt("detail_ending_time_reached"), ilFormat::ftimestamp2datetimeDB($this->getEndingTime()));
return $result;
}
$active_id = $this->getActiveIdOfUser($user_id);
{
if ($active_id > 0)
{
$starting_time = $this->getStartingTimeOfUser($active_id);
if ($starting_time !== FALSE)
{
if ($this->isMaxProcessingTimeReached($starting_time, $active_id))
{
if ($allowPassIncrease && $this->getResetProcessingTime() && (($this->getNrOfTries() == 0) || ($this->getNrOfTries() > ($this->_getPass($active_id)+1))))
{
// a test pass was quitted because the maximum processing time was reached, but the time
// will be resetted for future passes, so if there are more passes allowed, the participant may
// start the test again.
// This code block is only called when $allowPassIncrease is TRUE which only happens when
// the test info page is opened. Otherwise this will lead to unexpected results!
$testSession->increasePass();
$testSession->setLastSequence(0);
$testSession->saveToDb();
}
else
{
$result["executable"] = false;
$result["errormessage"] = $this->lng->txt("detail_max_processing_time_reached");
}
return $result;
}
}
}
}
if ($this->hasNrOfTriesRestriction() && ($active_id > 0))
{
require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
$testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this);
$testPassesSelector->setActiveId($active_id);
$testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
$closedPasses = $testPassesSelector->getClosedPasses();
if( count($closedPasses) >= $this->getNrOfTries() )
{
$result["executable"] = false;
$result["errormessage"] = $this->lng->txt("maximum_nr_of_tries_reached");
return $result;
}
}
return $result;
}

+ Here is the call graph for this function:

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

References getAnonymity(), and getHighscoreAnon().

{
if ($this->getAnonymity() == 1)
{
return true;
}
else
{
return (bool)$this->getHighscoreAnon();
}
}

+ Here is the call graph for this function:

ilObjTest::isHTML (   $a_text)

Checks if a given string contains HTML or not.

Parameters
string$a_textText which should be checked
Returns
boolean public

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

Referenced by addQTIMaterial().

{
if (preg_match("/<[^>]*?>/", $a_text))
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

ilObjTest::isMaxProcessingTimeReached (   $starting_time,
  $active_id 
)

Returns whether the maximum processing time for a test is reached or not.

Parameters
long$starting_timeThe unix timestamp of the starting time of the test
Returns
boolean TRUE if the maxium processing time is reached, FALSE if the maximum processing time is not reached or no maximum processing time is given public

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

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

Referenced by canShowTestResults(), and isExecutable().

{
{
$now = mktime();
{
return TRUE;
}
else
{
return FALSE;
}
}
else
{
return FALSE;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

References $result, and getTestId().

{
global $ilDB;
$result = $ilDB->queryF('SELECT copy_id FROM tst_rnd_cpy WHERE tst_fi = %s',
array('integer'),
array($this->getTestId())
);
return $result->numRows() > 0;
}

+ Here is the call graph for this function:

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

References getNrOfTries().

{
return $tries >= (int) $this->getNrOfTries();
}

+ Here is the call graph for this function:

ilObjTest::isOfferingQuestionHintsEnabled ( )

returns the fact wether offering hints is enabled or not

Returns
boolean

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

References $offeringQuestionHintsEnabled.

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

+ Here is the caller graph for this function:

ilObjTest::isOnline ( )

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

References $online.

Referenced by saveToDb().

{
return $this->online;
}

+ Here is the caller graph for this function:

ilObjTest::isPassDeletionAllowed ( )

getter for the test setting passDeletionAllowed

Returns
integer

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

References $passDeletionAllowed.

Referenced by addDefaults(), and saveToDb().

+ Here is the caller graph for this function:

ilObjTest::isPluginActive (   $a_pname)

Checks wheather or not a question plugin with a given name is active.

Parameters
string$a_pnameThe plugin name public

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

References IL_COMP_MODULE.

Referenced by getAvailableQuestions().

{
global $ilPluginAdmin;
if ($ilPluginAdmin->isActive(IL_COMP_MODULE, "TestQuestionPool", "qst", $a_pname))
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

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

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

Referenced by getTestQuestions(), and ilObjTestGUI\saveOrderAndObligationsObject().

{
require_once('Modules/TestQuestionPool/classes/class.assQuestion.php');
$classConcreteQuestion = assQuestion::_getQuestionType($questionId);
assQuestion::_includeClass($classConcreteQuestion, 0);
// static binder is not at work yet (in PHP < 5.3)
//$obligationPossible = $classConcreteQuestion::isObligationPossible();
$obligationPossible = call_user_func(array($classConcreteQuestion, 'isObligationPossible'), $questionId);
return $obligationPossible;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

References $row.

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

{
global $ilDB;
$rset = $ilDB->queryF('SELECT obligatory FROM tst_test_question WHERE question_fi = %s', array('integer'), array($question_id));
if( $row = $ilDB->fetchAssoc($rset) )
{
return (bool) $row['obligatory'];
}
return false;
}

+ Here is the caller graph for this function:

ilObjTest::isRandomTest ( )

Returns the fact wether this test is a random questions test or not.

Returns
boolean $isRandomTest

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

References getQuestionSetType(), and QUESTION_SET_TYPE_RANDOM.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::isShowExamIdInTestPassEnabled ( )

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

References $show_exam_id_in_test_pass_enabled.

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

+ Here is the caller graph for this function:

ilObjTest::isShowExamIdInTestResultsEnabled ( )
Returns
boolean

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

References $show_exam_id_in_test_results_enabled.

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

+ Here is the caller graph for this function:

ilObjTest::isSingleChoiceTest ( )

Returns TRUE if the test contains single choice results only.

Returns
boolean public

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

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

{
global $ilDB;
$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",
array('integer'),
array($this->getTestId())
);
if ($result->numRows() == 1)
{
$row = $ilDB->fetchAssoc($result);
if (strcmp($row['foundtypes'], 'assSingleChoice') == 0)
{
return TRUE;
}
else
{
return false;
}
}
return FALSE;
}

+ Here is the call graph for this function:

ilObjTest::isSingleChoiceTestWithoutShuffle ( )

Returns TRUE if the test contains single choice results and no shuffle only.

Returns
boolean public

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

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

{
global $ilDB;
if (!$this->hasSingleChoiceQuestions()) return false;
$result = $ilDB->queryF("
SELECT DISTINCT(qpl_qst_sc.shuffle) foundshuffles
FROM qpl_questions,
qpl_qst_sc,
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 qpl_questions.question_id = qpl_qst_sc.question_fi
AND tst_active.test_fi = %s
AND qpl_qst_type.type_tag = %s
",
array('integer', 'text'),
array($this->getTestId(), 'assSingleChoice')
);
if ($result->numRows() == 1)
{
$row = $ilDB->fetchAssoc($result);
return ($row['foundshuffles'] == 0);
}
return FALSE;
}

+ Here is the call graph for this function:

ilObjTest::isTestFinalBroken ( )
Returns
boolean

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

References $testFinalBroken.

Referenced by saveToDb().

+ Here is the caller graph for this function:

ilObjTest::isTestFinished (   $active_id)

returns if the active for user_id has been submitted

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

References $result.

Referenced by isTestFinishedToViewResults().

{
global $ilDB;
$result = $ilDB->queryF("SELECT submitted FROM tst_active WHERE active_id=%s AND submitted=%s",
array('integer', 'integer'),
array($active_id, 1)
);
return $result->numRows() == 1;
}

+ Here is the caller graph for this function:

ilObjTest::isTestFinishedToViewResults (   $active_id,
  $currentpass 
)

Returns true if an active user completed a test pass and did not start a new pass.

Parameters
integer$active_idThe active id of the user
integer$currentpassThe current test pass of the user
Returns
boolean true if an active user completed a test pass and did not start a new pass, false otherwise public

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

References getPassFinishDate(), and isTestFinished().

Referenced by canShowTestResults().

{
$num = $this->getPassFinishDate($active_id, $currentpass);
return ((($currentpass > 0) && ($num == 0)) || $this->isTestFinished($active_id)) ? true : false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::loadFromDb ( )

Loads a ilObjTest object from a database.

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

References $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(), setExportSettings(), setFinalStatement(), setFixedParticipants(), setForceJS(), setHighscoreAchievedTS(), setHighscoreAnon(), setHighscoreEnabled(), setHighscoreHints(), setHighscoreOwnTable(), setHighscorePercentage(), setHighscoreScore(), setHighscoreTopNum(), setHighscoreTopTable(), setHighscoreWTime(), setInstantFeedbackSolution(), setIntroduction(), setKiosk(), setListOfQuestionsSettings(), setMailNotification(), setMailNotificationType(), setMCScoring(), setNrOfTries(), setObligationsEnabled(), setOfferingQuestionHintsEnabled(), setOnline(), setPassDeletionAllowed(), setPassScoring(), setPassword(), setPoolUsage(), setPrintBestSolutionWithResult(), setProcessingTime(), setQuestionSetType(), setRedirectionMode(), setRedirectionUrl(), setReportingDate(), setResetProcessingTime(), setResultsPresentation(), setScoreCutting(), setScoreReporting(), setSequenceSettings(), setShowCancel(), setShowExamIdInTestPassEnabled(), setShowExamIdInTestResultsEnabled(), setShowExamviewHtml(), setShowExamviewPdf(), setShowFinalStatement(), setShowInfo(), setShowMarker(), setShuffleQuestions(), setSignSubmission(), setSpecificAnswerFeedback(), setStartingTime(), setTemplate(), setTestFinalBroken(), setTestId(), setTitleOutput(), setUsePreviousAnswers(), and ilObjectActivation\TIMINGS_ACTIVATION.

Referenced by read().

{
global $ilDB;
$result = $ilDB->queryF("SELECT * FROM tst_tests WHERE obj_fi = %s",
array('integer'),
array($this->getId())
);
if ($result->numRows() == 1)
{
$data = $ilDB->fetchObject($result);
$this->setTestId($data->test_id);
if (strlen($this->getAuthor()) == 0)
{
$this->saveAuthorToMetadata($data->author);
}
$this->setAuthor($data->author);
include_once("./Services/RTE/classes/class.ilRTE.php");
$this->setIntroduction(ilRTE::_replaceMediaObjectImageSrc($data->introduction, 1));
$this->setFinalStatement(ilRTE::_replaceMediaObjectImageSrc($data->finalstatement, 1));
$this->setShowInfo($data->showinfo);
$this->setForceJS($data->forcejs);
$this->setCustomStyle($data->customstyle);
$this->setShowFinalStatement($data->showfinalstatement);
$this->setSequenceSettings($data->sequence_settings);
$this->setScoreReporting($data->score_reporting);
$this->setInstantFeedbackSolution($data->instant_verification);
$this->setAnswerFeedbackPoints($data->answer_feedback_points);
$this->setAnswerFeedback($data->answer_feedback);
$this->setAnonymity($data->anonymity);
$this->setShowCancel($data->show_cancel);
$this->setShowMarker($data->show_marker);
$this->setFixedParticipants($data->fixed_participants);
$this->setNrOfTries($data->nr_of_tries);
$this->setKiosk($data->kiosk);
$this->setUsePreviousAnswers($data->use_previous_answers);
$this->setRedirectionMode($data->redirection_mode);
$this->setRedirectionUrl($data->redirection_url);
$this->setTitleOutput($data->title_output);
$this->setProcessingTime($data->processing_time);
$this->setEnableProcessingTime($data->enable_processing_time);
$this->setResetProcessingTime($data->reset_processing_time);
$this->setReportingDate($data->reporting_date);
$this->setShuffleQuestions($data->shuffle_questions);
$this->setResultsPresentation($data->results_presentation);
$this->setStartingTime($data->starting_time);
$this->setEndingTime($data->ending_time);
$this->setListOfQuestionsSettings($data->show_summary);
$this->setECTSOutput($data->ects_output);
$this->setECTSGrades(
array(
"A" => $data->ects_a,
"B" => $data->ects_b,
"C" => $data->ects_c,
"D" => $data->ects_d,
"E" => $data->ects_e
)
);
$this->setECTSFX($data->ects_fx);
$this->mark_schema->flush();
$this->mark_schema->loadFromDb($this->getTestId());
$this->setCountSystem($data->count_system);
$this->setMCScoring($data->mc_scoring);
$this->setMailNotification($data->mailnotification);
$this->setMailNotificationType($data->mailnottype);
$this->setExportSettings($data->exportsettings);
$this->setScoreCutting($data->score_cutting);
$this->setPassword($data->password);
$this->setAllowedUsers($data->allowedusers);
$this->setAllowedUsersTimeGap($data->alloweduserstimegap);
$this->setPassScoring($data->pass_scoring);
$this->setObligationsEnabled($data->obligations_enabled);
$this->setOfferingQuestionHintsEnabled($data->offer_question_hints);
$this->setCertificateVisibility($data->certificate_visibility);
$this->setEnabledViewMode($data->enabled_view_mode);
$this->setTemplate($data->template_id);
$this->setPoolUsage($data->pool_usage);
$this->setPrintBestSolutionWithResult((bool) $data->print_bs_with_res);
$this->setHighscoreEnabled((bool) $data->highscore_enabled);
$this->setHighscoreAnon((bool) $data->highscore_anon);
$this->setHighscoreAchievedTS((bool) $data->highscore_achieved_ts);
$this->setHighscoreScore((bool) $data->highscore_score);
$this->setHighscorePercentage((bool) $data->highscore_percentage);
$this->setHighscoreHints((bool) $data->highscore_hints);
$this->setHighscoreWTime((bool) $data->highscore_wtime);
$this->setHighscoreOwnTable((bool) $data->highscore_own_table);
$this->setHighscoreTopTable((bool) $data->highscore_top_table);
$this->setHighscoreTopNum((int) $data->highscore_top_num);
$this->setOnline((bool) $data->online_status);
$this->setSpecificAnswerFeedback((int) $data->specific_feedback);
$this->setAutosave((bool)$data->autosave);
$this->setAutosaveIval((int)$data->autosave_ival);
$this->setPassDeletionAllowed($data->pass_deletion_allowed);
$this->setEnableExamview((bool)$data->enable_examview);
$this->setShowExamviewHtml((bool)$data->show_examview_html);
$this->setShowExamviewPdf((bool)$data->show_examview_pdf);
$this->setEnableArchiving((bool)$data->enable_archiving);
$this->setShowExamIdInTestPassEnabled( (bool)$data->examid_in_test_pass);
$this->setShowExamIdInTestResultsEnabled( (bool)$data->examid_in_test_res);
$this->setSignSubmission( (bool)$data->sign_submission );
$this->setQuestionSetType($data->question_set_type);
$this->setCharSelectorAvailability((int)$data->char_selector_availability);
$this->setCharSelectorDefinition($data->char_selector_definition);
$this->setTestFinalBroken((bool)$data->broken);
$this->loadQuestions();
}
// moved activation to ilObjectActivation
if($this->ref_id)
{
include_once "./Services/Object/classes/class.ilObjectActivation.php";
$activation = ilObjectActivation::getItem($this->ref_id);
switch($activation["timing_type"])
{
$this->setActivationLimited(true);
$this->setActivationStartingTime($activation["timing_start"]);
$this->setActivationEndingTime($activation["timing_end"]);
$this->setActivationVisibility($activation["visible"]);
break;
default:
$this->setActivationLimited(false);
break;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::loadQuestions (   $active_id = "",
  $pass = NULL 
)

Load the test question id's from the database.

Parameters
integer$user_idThe user id of the test user (necessary for random tests) public

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

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

Referenced by getAllQuestions(), getAnsweredQuestionCount(), insertQuestion(), loadFromDb(), questionMoveDown(), questionMoveUp(), removeQuestion(), and setQuestionOrderAndObligations().

{
global $ilUser;
global $ilDB;
$this->questions = array();
if (strcmp($active_id, "") == 0)
{
$active_id = $this->getActiveIdOfUser($ilUser->getId());
}
if ($this->isRandomTest())
{
if (is_null($pass))
{
$pass = $this->_getPass($active_id);
}
$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",
array('integer', 'integer'),
array($active_id, $pass)
);
// The following is a fix for random tests prior to ILIAS 3.8. If someone started a random test in ILIAS < 3.8, there
// is only one test pass (pass = 0) in tst_test_rnd_qst while with ILIAS 3.8 there are questions for every test pass.
// To prevent problems with tests started in an older version and continued in ILIAS 3.8, the first pass should be taken if
// no questions are present for a newer pass.
if ($result->numRows() == 0)
{
$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",
array('integer'),
array($active_id)
);
}
}
else
{
$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",
array('integer'),
array($this->test_id)
);
}
$index = 1;
while ($data = $ilDB->fetchAssoc($result))
{
$this->questions[$index++] = $data["question_fi"];
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::logAction (   $logtext = "",
  $question_id = "" 
)

Logs an action into the Test&Assessment log.

Parameters
string$logtextThe log text
integer$question_idIf given, saves the question id to the database public

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

References $ilUser, ilObjAssessmentFolder\_addLog(), assQuestion\_getOriginalId(), ilObject\getId(), and ilObject\getRefId().

Referenced by addExtraTime(), checkMaximumAllowedUsers(), insertQuestion(), questionMoveDown(), questionMoveUp(), removeAllTestEditings(), removeQuestion(), removeTestResultsByActiveIds(), removeTestResultsForUser(), saveQuestionsToDb(), and saveToDb().

{
global $ilUser;
$original_id = "";
if (strcmp($question_id, "") != 0)
{
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$original_id = assQuestion::_getOriginalId($question_id);
}
include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
ilObjAssessmentFolder::_addLog($ilUser->getId(), $this->getId(), $logtext, $question_id, $original_id, TRUE, $this->getRefId());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::lookupExamId (   $active_id,
  $pass 
)
Parameters
$active_id
$pass
Returns
array

Move this to a proper place.

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

References $ilSetting, and $pass.

Referenced by ilTestPlayerDynamicQuestionSetGUI\outCurrentlyFinishedPage(), and ilTestPlayerAbstractGUI\outTestPage().

{
global $ilDB, $ilSetting;
$exam_id_query = 'SELECT exam_id FROM tst_pass_result WHERE active_fi = %s AND pass = %s';
$exam_id_result = $ilDB->queryF( $exam_id_query, array( 'integer', 'integer' ), array( $active_id, $pass ) );
if ($ilDB->numRows( $exam_id_result ) == 1)
{
$exam_id_row = $ilDB->fetchAssoc( $exam_id_result );
if ($exam_id_row['exam_id'] != null)
{
return $exam_id_row['exam_id'];
}
}
return null;
}

+ Here is the caller graph for this function:

static ilObjTest::lookupQuestionSetType (   $objId)
static

lookup-er for question set type

ilDB $ilDB

Parameters
integer$objId
Returns
string $questionSetType

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

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

Referenced by _lookupRandomTest().

{
global $ilDB;
$query = "SELECT question_set_type FROM tst_tests WHERE obj_fi = %s";
$res = $ilDB->queryF($query, array('integer'), array($objId));
while( $row = $ilDB->fetchAssoc($res) )
{
$questionSetType = $row['question_set_type'];
}
}

+ Here is the caller graph for this function:

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

References $query, $res, and $row.

Referenced by _getQuestionCountAndPointsForPassOfParticipant().

{
global $ilDB;
$query = "
SELECT tst_tests.question_set_type
FROM tst_active
INNER JOIN tst_tests
ON tst_active.test_fi = tst_tests.test_id
WHERE tst_active.active_id = %s
";
$res = $ilDB->queryF( $query, array('integer'), array($active_id) );
while($row = $ilDB->fetchAssoc($res))
{
return $row['question_set_type'];
}
return null;
}

+ Here is the caller graph for this function:

ilObjTest::modifyExportIdentifier (   $a_tag,
  $a_param,
  $a_value 
)

Returns the installation id for a given identifier.

private

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

References ilUtil\insertInstIntoID().

{
if ($a_tag == "Identifier" && $a_param == "Entry")
{
include_once "./Services/Utilities/classes/class.ilUtil.php";
$a_value = ilUtil::insertInstIntoID($a_value);
}
return $a_value;
}

+ Here is the call graph for this function:

ilObjTest::moveQuestionAfter (   $question_to_move,
  $question_before 
)

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

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

{
global $ilDB;
//var_dump(func_get_args());
if ($question_before) {
$query = 'SELECT sequence, test_fi FROM tst_test_question WHERE question_fi = %s';
$types = array('integer');
$values = array($question_before);
$rset = $ilDB->queryF($query, $types, $values);
}
if (!$question_before || ($rset && !($row = $ilDB->fetchAssoc($rset)))) {
$row = array(
'sequence' => 0,
'test_fi' => $this->getTestId(),
);
}
$update = 'UPDATE tst_test_question SET sequence = sequence + 1 WHERE sequence > %s AND test_fi = %s';
$types = array('integer', 'integer');
$values = array($row['sequence'], $row['test_fi']);
$ilDB->manipulateF($update, $types, $values);
$update = 'UPDATE tst_test_question SET sequence = %s WHERE question_fi = %s';
$types = array('integer', 'integer');
$values = array($row['sequence'] + 1, $question_to_move);
$ilDB->manipulateF($update, $types, $values);
}

+ Here is the call graph for this function:

ilObjTest::moveQuestionAfterOLD (   $previous_question_id,
  $new_question_id 
)

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

References $query, $res, $row, and getTestId().

{
$new_array = array();
$position = 1;
$query = 'SELECT question_fi FROM tst_test_question WHERE test_fi = %s';
$types = array('integer');
$values = array($this->getTestId());
$new_question_id += 1;
global $ilDB;
$inserted = false;
$res = $ilDB->queryF($query, $types, $values);
while($row = $ilDB->fetchAssoc($res)) {
$qid = $row['question_fi'];
if ($qid == $new_question_id) {
continue;
}
else if ($qid == $previous_question_id) {
$new_array[$position++] = $qid;
$new_array[$position++] = $new_question_id;
$inserted = true;
}
else {
$new_array[$position++] = $qid;
}
}
$update_query = 'UPDATE tst_test_question SET sequence = %s WHERE test_fi = %s AND question_fi = %s';
$update_types = array('integer', 'integer', 'integer');
foreach($new_array as $position => $qid) {
$ilDB->manipulateF(
$update_query,
$update_types,
$vals = array(
$position,
$this->getTestId(),
$qid
)
);
}
}

+ Here is the call graph for this function:

ilObjTest::moveQuestions (   $move_questions,
  $target_index,
  $insert_mode 
)

Move questions to another position.

Parameters
array$move_questionsAn array with the question id's of the questions to move
integer$target_indexThe question id of the target position
integer$insert_mode0, if insert before the target position, 1 if insert after the target position public

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

References saveQuestionsToDb().

{
$this->questions = array_values($this->questions);
$array_pos = array_search($target_index, $this->questions);
if ($insert_mode == 0)
{
$part1 = array_slice($this->questions, 0, $array_pos);
$part2 = array_slice($this->questions, $array_pos);
}
else if ($insert_mode == 1)
{
$part1 = array_slice($this->questions, 0, $array_pos + 1);
$part2 = array_slice($this->questions, $array_pos + 1);
}
foreach ($move_questions as $question_id)
{
if (!(array_search($question_id, $part1) === FALSE))
{
unset($part1[array_search($question_id, $part1)]);
}
if (!(array_search($question_id, $part2) === FALSE))
{
unset($part2[array_search($question_id, $part2)]);
}
}
$part1 = array_values($part1);
$part2 = array_values($part2);
$new_array = array_values(array_merge($part1, $move_questions, $part2));
$this->questions = array();
$counter = 1;
foreach ($new_array as $question_id)
{
$this->questions[$counter] = $question_id;
$counter++;
}
}

+ Here is the call graph for this function:

ilObjTest::notify (   $a_event,
  $a_ref_id,
  $a_parent_non_rbac_id,
  $a_node_id,
  $a_params = 0 
)

notifys an object about an event occured Based on the event happend, each object may decide how it reacts.

If you are not required to handle any events related to your module, just delete this method. (For an example how this method is used, look at ilObjGroup)

public

Parameters
stringevent
integerreference id of object where the event occured
arraypasses optional parameters if required
Returns
boolean

Reimplemented from ilObject.

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

References $_GET, and ilObject\getType().

{
global $tree;
switch ($a_event)
{
case "link":
//var_dump("<pre>",$a_params,"</pre>");
//echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
//exit;
break;
case "cut":
//echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
//exit;
break;
case "copy":
//var_dump("<pre>",$a_params,"</pre>");
//echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
//exit;
break;
case "paste":
//echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
//exit;
break;
case "new":
//echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
//exit;
break;
}
// At the beginning of the recursive process it avoids second call of the notify function with the same parameter
if ($a_node_id==$_GET["ref_id"])
{
$parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
$parent_type = $parent_obj->getType();
if ($parent_type == $this->getType())
{
$a_node_id = (int) $tree->getParentId($a_node_id);
}
}
parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
}

+ Here is the call graph for this function:

ilObjTest::participantDataExist ( )

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

References $participantDataExist, and evalTotalPersons().

{
if( $this->participantDataExist === null )
{
$this->participantDataExist = (bool)$this->evalTotalPersons();
}
}

+ Here is the call graph for this function:

ilObjTest::pcArrayShuffle (   $array)

Shuffles the values of a given array.

Parameters
array$arrayAn array which should be shuffled public

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

References $result.

{
$keys = array_keys($array);
shuffle($keys);
$result = array();
foreach ($keys as $key)
{
$result[$key] = $array[$key];
}
return $result;
}
ilObjTest::prepareTextareaOutput (   $txt_output,
  $prepare_for_latex_output = FALSE 
)

Prepares a string for a text area output in tests.

Parameters
string$txt_outputString which should be prepared for output public

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

{
include_once "./Services/Utilities/classes/class.ilUtil.php";
return ilUtil::prepareTextareaOutput($txt_output, $prepare_for_latex_output);
}
& ilObjTest::processCSVRow (   $row,
  $quoteAll = FALSE,
  $separator = ";" 
)

Processes an array as a CSV row and converts the array values to correct CSV values.

The "converted" array is returned

Parameters
array$rowThe array containing the values for a CSV row
string$quoteAllIndicates to quote every value (=TRUE) or only values containing quotes and separators (=FALSE, default)
string$separatorThe value separator in the CSV row (used for quoting) (; = default)
Returns
array The converted array ready for CSV use public

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

References $row, and $separator.

Referenced by getAllTestResults().

{
$resultarray = array();
foreach ($row as $rowindex => $entry)
{
$surround = FALSE;
if ($quoteAll)
{
$surround = TRUE;
}
if (strpos($entry, "\"") !== FALSE)
{
$entry = str_replace("\"", "\"\"", $entry);
$surround = TRUE;
}
if (strpos($entry, $separator) !== FALSE)
{
$surround = TRUE;
}
// replace all CR LF with LF (for Excel for Windows compatibility
$entry = str_replace(chr(13).chr(10), chr(10), $entry);
if ($surround)
{
$entry = "\"" . $entry . "\"";
}
$resultarray[$rowindex] = $entry;
}
return $resultarray;
}

+ Here is the caller graph for this function:

ilObjTest::processPrintoutput2FO (   $print_output)

Convert a print output to XSL-FO.

Parameters
string$print_outputThe print output
Returns
string XSL-FO code public

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

References $GLOBALS, xslt_create(), xslt_error(), xslt_free(), and xslt_process().

Referenced by deliverPDFfromHTML().

{
if (extension_loaded("tidy"))
{
$config = array(
"indent" => false,
"output-xml" => true,
"numeric-entities" => true
);
$tidy = new tidy();
$tidy->parseString($print_output, $config, 'utf8');
$tidy->cleanRepair();
$print_output = tidy_get_output($tidy);
$print_output = preg_replace("/^.*?(<html)/", "\\1", $print_output);
}
else
{
$print_output = str_replace("&nbsp;", "&#160;", $print_output);
$print_output = str_replace("&otimes;", "X", $print_output);
}
$xsl = file_get_contents("./Modules/Test/xml/question2fo.xsl");
// additional font support
$xsl = str_replace(
'font-family="Helvetica, unifont"',
'font-family="'.$GLOBALS['ilSetting']->get('rpc_pdf_font','Helvetica, unifont').'"',
$xsl
);
$args = array( '/_xml' => $print_output, '/_xsl' => $xsl );
$xh = xslt_create();
$params = array();
$output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params);
xslt_error($xh);
xslt_free($xh);
return $output;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::QTIMaterialToString (   $a_material)

Reads an QTI material tag an creates a text string.

Parameters
string$a_materialQTI material tag
Returns
string text or xhtml string public

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

References $_SESSION, $ilLog, and $result.

Referenced by fromXML().

{
$result = "";
for ($i = 0; $i < $a_material->getMaterialCount(); $i++)
{
$material = $a_material->getMaterial($i);
if (strcmp($material["type"], "mattext") == 0)
{
$result .= $material["material"]->getContent();
}
if (strcmp($material["type"], "matimage") == 0)
{
$matimage = $material["material"];
if (preg_match("/(il_([0-9]+)_mob_([0-9]+))/", $matimage->getLabel(), $matches))
{
// import an mediaobject which was inserted using tiny mce
if (!is_array($_SESSION["import_mob_xhtml"])) $_SESSION["import_mob_xhtml"] = array();
array_push($_SESSION["import_mob_xhtml"], array("mob" => $matimage->getLabel(), "uri" => $matimage->getUri()));
}
}
}
global $ilLog;
$ilLog->write(print_r($_SESSION["import_mob_xhtml"], true));
return $result;
}

+ Here is the caller graph for this function:

ilObjTest::questionMoveDown (   $question_id)

Moves a question down in order.

Parameters
integer$question_idThe database id of the question to be moved down public
See Also
$test_id

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

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

{
global $ilDB;
// Move a question down in sequence
$result = $ilDB->queryF("SELECT * FROM tst_test_question WHERE test_fi=%s AND question_fi=%s",
array('integer','integer'),
array($this->getTestId(), $question_id)
);
$data = $ilDB->fetchObject($result);
$result = $ilDB->queryF("SELECT * FROM tst_test_question WHERE test_fi=%s AND sequence=%s",
array('integer','integer'),
array($this->getTestId(), $data->sequence + 1)
);
if ($result->numRows() == 1)
{
// OK, it's not the last question, so move it down
$data_next = $ilDB->fetchObject($result);
// change next dataset
$affectedRows = $ilDB->manipulateF("UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
array('integer','integer'),
array($data->sequence, $data_next->test_question_id)
);
// move actual dataset down
$affectedRows = $ilDB->manipulateF("UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
array('integer','integer'),
array($data->sequence + 1, $data->test_question_id)
);
include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
{
$this->logAction($this->lng->txtlng("assessment", "log_question_position_changed", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($data->sequence) . " => " . ($data->sequence+1), $question_id);
}
}
$this->loadQuestions();
}

+ Here is the call graph for this function:

ilObjTest::questionMoveUp (   $question_id)

Moves a question up in order.

Parameters
integer$question_idThe database id of the question to be moved up public
See Also
$test_id

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

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

{
global $ilDB;
// Move a question up in sequence
$result = $ilDB->queryF("SELECT * FROM tst_test_question WHERE test_fi=%s AND question_fi=%s",
array('integer', 'integer'),
array($this->getTestId(), $question_id)
);
$data = $ilDB->fetchObject($result);
if ($data->sequence > 1)
{
// OK, it's not the top question, so move it up
$result = $ilDB->queryF("SELECT * FROM tst_test_question WHERE test_fi=%s AND sequence=%s",
array('integer','integer'),
array($this->getTestId(), $data->sequence - 1)
);
$data_previous = $ilDB->fetchObject($result);
// change previous dataset
$affectedRows = $ilDB->manipulateF("UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
array('integer','integer'),
array($data->sequence, $data_previous->test_question_id)
);
// move actual dataset up
$affectedRows = $ilDB->manipulateF("UPDATE tst_test_question SET sequence=%s WHERE test_question_id=%s",
array('integer','integer'),
array($data->sequence - 1, $data->test_question_id)
);
include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
{
$this->logAction($this->lng->txtlng("assessment", "log_question_position_changed", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($data->sequence) . " => " . ($data->sequence-1), $question_id);
}
}
$this->loadQuestions();
}

+ Here is the call graph for this function:

ilObjTest::randomSelectQuestions (   $nr_of_questions,
  $questionpool,
  $use_obj_id = 0,
  $qpls = "",
  $pass = NULL 
)

Returns a random selection of questions.

Parameters
integer$nr_of_questionsNumber of questions to return
integer$questionpoolID of questionpool to choose the questions from (0 = all available questionpools)
boolean$user_obj_idUse the object id instead of the reference id when set to true
array$qplsAn array of questionpool id's if the random questions should only be chose from the contained questionpools
Returns
array A random selection of questions public
Deprecated:
--> old school random test

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

References $result, $row, ilObjQuestionPool\_getAvailableQuestionpools(), ilObject\_lookupObjId(), ilObject\_lookupOwner(), ilObject\getId(), and getTestId().

{
global $rbacsystem;
global $ilDB;
// retrieve object id instead of ref id if necessary
if (($questionpool != 0) && (!$use_obj_id)) $questionpool = ilObject::_lookupObjId($questionpool);
// get original ids of all existing questions in the test
$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",
array("integer"),
array($this->getTestId())
);
$original_ids = array();
$paramtypes = array();
$paramvalues = array();
while ($row = $ilDB->fetchAssoc($result))
{
array_push($original_ids, $row['original_id']);
}
$available = "";
// get a list of all available questionpools
if (($questionpool == 0) && (!is_array($qpls)))
{
include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
$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())));
if (count($available_pools))
{
$available = " AND " . $ilDB->in('obj_fi', $available_pools, false, 'integer');
}
else
{
return array();
}
}
$constraint_qpls = "";
$result_array = array();
if ($questionpool == 0)
{
if (is_array($qpls))
{
if (count($qpls) > 0)
{
$constraint_qpls = " AND " . $ilDB->in('obj_fi', $qpls, false, 'integer');
}
}
}
$original_clause = "";
if (count($original_ids))
{
$original_clause = " AND " . $ilDB->in('question_id', $original_ids, true, 'integer');
}
if ($questionpool == 0)
{
$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",
array('integer', 'text'),
array(0, "1")
);
}
else
{
$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",
array('integer','integer', 'text'),
array($questionpool, 0, "1")
);
}
$found_ids = array();
while ($row = $ilDB->fetchAssoc($result))
{
array_push($found_ids, $row['question_id']);
}
$nr_of_questions = ($nr_of_questions > count($found_ids)) ? count($found_ids) : $nr_of_questions;
if ($nr_of_questions == 0) return array();
$rand_keys = array_rand($found_ids, $nr_of_questions);
$result = array();
if (is_array($rand_keys))
{
foreach ($rand_keys as $key)
{
$result[$found_ids[$key]] = $found_ids[$key];
}
}
else
{
$result[$found_ids[$rand_keys]] = $found_ids[$rand_keys];
}
return $result;
}

+ Here is the call graph for this function:

ilObjTest::read (   $a_force_db = false)

read object data from db into object

Parameters
booleanpublic

Reimplemented from ilObject.

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

References loadFromDb().

{
parent::read($a_force_db);
$this->loadFromDb();
}

+ Here is the call graph for this function:

ilObjTest::recalculateScores (   $preserve_manscoring = false)

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

{
require_once 'class.ilTestScoring.php';
$scoring = new ilTestScoring($this);
$scoring->setPreserveManualScores($preserve_manscoring);
$scoring->recalculateSolutions();
}
ilObjTest::removeAllTestEditings (   $question_id = "")

Removes all references to the question in executed tests in case the question has been changed.

If a question was changed it cannot be guaranteed that the content and the meaning of the question is the same as before. So we have to delete all already started or completed tests using that question. Therefore we have to delete all references to that question in tst_solutions and the tst_active entries which were created for the user and test in the tst_solutions entry.

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

References $query, $res, $row, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilUtil\delDir(), ilAssQuestionHintTracking\deleteRequestsByActiveIds(), ilAssQuestionHintTracking\deleteRequestsByQuestionIds(), getTestId(), isRandomTest(), and logAction().

Referenced by deleteTest(), and removeQuestion().

{
global $ilDB;
// remove the question from tst_solutions
if ($question_id)
{
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_solutions WHERE tst_solutions.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s) AND tst_solutions.question_fi = %s",
array('integer','integer'),
array($this->getTestId(), $question_id)
);
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_qst_solved WHERE tst_qst_solved.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s) AND tst_qst_solved.question_fi = %s",
array('integer','integer'),
array($this->getTestId(), $question_id)
);
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_result WHERE tst_test_result.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s) AND tst_test_result.question_fi = %s",
array('integer','integer'),
array($this->getTestId(), $question_id)
);
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_pass_result WHERE tst_pass_result.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s)",
array('integer'),
array($this->getTestId())
);
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
}
else
{
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_solutions WHERE tst_solutions.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s)",
array('integer'),
array($this->getTestId())
);
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_qst_solved WHERE tst_qst_solved.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s)",
array('integer'),
array($this->getTestId())
);
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_result WHERE tst_test_result.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s)",
array('integer'),
array($this->getTestId())
);
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_pass_result WHERE tst_pass_result.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s)",
array('integer'),
array($this->getTestId())
);
$query = "SELECT active_id FROM tst_active WHERE test_fi = %s";
$res = $ilDB->queryF($query, array('integer'), array($this->getTestId()));
$activeIds = array();
while( $row = $ilDB->fetchAssoc($res) )
{
$activeIds[] = $row['active_id'];
}
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
{
$this->logAction($this->lng->txtlng("assessment", "log_user_data_removed", ilObjAssessmentFolder::_getLogLanguage()));
}
}
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_sequence WHERE tst_sequence.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s)",
array('integer'),
array($this->getTestId())
);
if ($this->isRandomTest())
{
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_rnd_qst WHERE tst_test_rnd_qst.active_fi IN (SELECT active_id FROM tst_active WHERE test_fi = %s)",
array('integer'),
array($this->getTestId())
);
}
// remove test_active entries, because test has changed
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_active WHERE test_fi = %s",
array('integer'),
array($this->getTestId())
);
// remove saved user passwords
$affectedRows = $ilDB->manipulateF("DELETE FROM usr_pref WHERE keyword = %s",
array('text'),
array("tst_password_".$this->getTestId())
);
// TODO: this shouldn't be here since it is question stuff and should be modular but there's no other solution yet
// remove file uploads
if (@is_dir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId()))
{
ilUtil::delDir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::removeQuestion (   $question_id)

Removes a question from the test object.

Parameters
integer$question_idThe database id of the question to be removed public
See Also
$test_id

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

References ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), _instanciateQuestion(), loadQuestions(), logAction(), removeAllTestEditings(), and saveQuestionsToDb().

{
$question =& ilObjTest::_instanciateQuestion($question_id);
include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
{
$this->logAction($this->lng->txtlng("assessment", "log_question_removed", ilObjAssessmentFolder::_getLogLanguage()), $question_id);
}
$question->delete($question_id);
$this->removeAllTestEditings($question_id);
$this->loadQuestions();
}

+ Here is the call graph for this function:

ilObjTest::removeTestActives (   $activeIds)

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

Referenced by removeTestResults().

{
global $ilDB;
$IN_activeIds = $ilDB->in('active_id', $activeIds, false, 'integer');
$ilDB->manipulate("DELETE FROM tst_active WHERE $IN_activeIds");
}

+ Here is the caller graph for this function:

ilObjTest::removeTestResults ( ilTestParticipantData  $participantData)

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

References ilTestParticipantData\getActiveIds(), ilTestParticipantData\getAnonymousActiveIds(), ilObject\getId(), ilObjectLP\getInstance(), ilTestParticipantData\getUserIds(), removeTestActives(), and removeTestResultsByActiveIds().

{
if( count($participantData->getAnonymousActiveIds()) )
{
}
if( count($participantData->getUserIds()) )
{
/* @var ilTestLP $testLP */
require_once 'Services/Object/classes/class.ilObjectLP.php';
$testLP = ilObjectLP::getInstance($this->getId());
$testLP->resetLPDataForUserIds($participantData->getUserIds(), false);
}
if( count($participantData->getActiveIds()) )
{
$this->removeTestActives($participantData->getActiveIds());
}
}

+ Here is the call graph for this function:

ilObjTest::removeTestResultsByActiveIds (   $activeIds)

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

References ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), _getUserIdFromActiveId(), ilUtil\delDir(), ilAssQuestionHintTracking\deleteRequestsByActiveIds(), getTestId(), isDynamicTest(), isRandomTest(), logAction(), and userLookupFullName().

Referenced by removeTestResults(), and removeTestResultsByUserIds().

{
global $ilDB;
$IN_activeIds = $ilDB->in('active_fi', $activeIds, false, 'integer');
$ilDB->manipulate("DELETE FROM tst_solutions WHERE $IN_activeIds");
$ilDB->manipulate("DELETE FROM tst_qst_solved WHERE $IN_activeIds");
$ilDB->manipulate("DELETE FROM tst_test_result WHERE $IN_activeIds");
$ilDB->manipulate("DELETE FROM tst_pass_result WHERE $IN_activeIds");
$ilDB->manipulate("DELETE FROM tst_result_cache WHERE $IN_activeIds");
$ilDB->manipulate("DELETE FROM tst_sequence WHERE $IN_activeIds");
if( $this->isRandomTest() )
{
$ilDB->manipulate("DELETE FROM tst_test_rnd_qst WHERE $IN_activeIds");
}
elseif( $this->isDynamicTest() )
{
$ilDB->manipulate("DELETE FROM tst_seq_qst_tracking WHERE $IN_activeIds");
$ilDB->manipulate("DELETE FROM tst_seq_qst_answstatus WHERE $IN_activeIds");
$ilDB->manipulate("DELETE FROM tst_seq_qst_postponed WHERE $IN_activeIds");
$ilDB->manipulate("DELETE FROM tst_seq_qst_checked WHERE $IN_activeIds");
}
include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
foreach ($activeIds as $active_id)
{
// TODO: this shouldn't be here since it is question stuff and should be modular but there's no other solution yet
// remove file uploads
if (@is_dir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId() . "/$active_id"))
{
ilUtil::delDir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId() . "/$active_id");
}
{
$this->logAction(sprintf($this->lng->txtlng("assessment", "log_selected_user_data_removed", ilObjAssessmentFolder::_getLogLanguage()), $this->userLookupFullName($this->_getUserIdFromActiveId($active_id))));
}
}
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::removeTestResultsByUserIds (   $userIds)

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

References ilObject\$lng, getTestId(), and removeTestResultsByActiveIds().

{
global $ilDB, $lng;
require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
$participantData = new ilTestParticipantData($ilDB, $lng);
$participantData->setUserIds($userIds);
$participantData->load($this->getTestId());
$IN_userIds = $ilDB->in('usr_id', $participantData->getUserIds(), false, 'integer');
$ilDB->manipulateF("DELETE FROM usr_pref WHERE $IN_userIds AND keyword = %s",
array('text'), array("tst_password_".$this->getTestId())
);
if( count($participantData->getActiveIds()) )
{
$this->removeTestResultsByActiveIds($participantData->getActiveIds());
}
}

+ Here is the call graph for this function:

ilObjTest::removeTestResultsForUser (   $user_id)

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

References ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), _getUserIdFromActiveId(), ilUtil\delDir(), ilAssQuestionHintTracking\deleteRequestsByActiveIds(), getActiveIdOfUser(), getTestId(), isRandomTest(), logAction(), and userLookupFullName().

{
global $ilDB;
$active_id = $this->getActiveIdOfUser($user_id);
// remove the question from tst_solutions
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_solutions WHERE active_fi = %s",
array('integer'),
array($active_id)
);
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_qst_solved WHERE active_fi = %s",
array('integer'),
array($active_id)
);
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_result WHERE active_fi = %s",
array('integer'),
array($active_id)
);
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_pass_result WHERE active_fi = %s",
array('integer'),
array($active_id)
);
if ($this->isRandomTest())
{
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_rnd_qst WHERE active_fi = %s",
array('integer'),
array($active_id)
);
}
include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
{
$this->logAction(sprintf($this->lng->txtlng("assessment", "log_selected_user_data_removed", ilObjAssessmentFolder::_getLogLanguage()), $this->userLookupFullName($this->_getUserIdFromActiveId($active_id))));
}
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_sequence WHERE active_fi = %s",
array('integer'),
array($active_id)
);
// remove test_active entry
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_active WHERE active_id = %s",
array('integer'),
array($active_id)
);
// remove saved user password
if ($user_id > 0)
{
$affectedRows = $ilDB->manipulateF("DELETE FROM usr_pref WHERE usr_id = %s AND keyword = %s",
array('integer', 'text'),
array($user_id, "tst_password_".$this->getTestId())
);
}
// TODO: this shouldn't be here since it is question stuff and should be modular but there's no other solution yet
// remove file uploads
if (@is_dir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId() . "/$active_id"))
{
ilUtil::delDir(CLIENT_WEB_DIR . "/assessment/tst_" . $this->getTestId() . "/$active_id");
}
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
}

+ Here is the call graph for this function:

ilObjTest::saveAuthorToMetadata (   $a_author = "")

Saves an authors name into the lifecycle metadata if no lifecycle metadata exists This will only be called for conversion of "old" tests where the author hasn't been stored in the lifecycle metadata.

Parameters
string$a_authorA string containing the name of the test author private
See Also
$author

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

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

Referenced by createMetaData(), and loadFromDb().

{
$md =& new ilMD($this->getId(), 0, $this->getType());
$md_life =& $md->getLifecycle();
if (!$md_life)
{
if (strlen($a_author) == 0)
{
global $ilUser;
$a_author = $ilUser->getFullname();
}
$md_life =& $md->addLifecycle();
$md_life->save();
$con =& $md_life->addContribute();
$con->setRole("Author");
$con->save();
$ent =& $con->addEntity();
$ent->setEntity($a_author);
$ent->save();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::saveCertificateVisibility (   $a_value)

Saves the visibility settings of the certificate.

Parameters
integer$a_valueThe value for the visibility settings (0 = always, 1 = only passed, 2 = never) private

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

References getTestId().

{
global $ilDB;
$affectedRows = $ilDB->manipulateF("UPDATE tst_tests SET certificate_visibility = %s, tstamp = %s WHERE test_id = %s",
array('text', 'integer', 'integer'),
array($a_value, time(), $this->getTestId())
);
}

+ Here is the call graph for this function:

ilObjTest::saveCompleteStatus ( ilTestQuestionSetConfig  $testQuestionSetConfig)

Checks if the test is complete and saves the status in the database.

public

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

References isComplete().

Referenced by insertQuestion().

{
global $ilDB;
$complete = 0;
if ($this->isComplete($testQuestionSetConfig))
{
$complete = 1;
}
if ($this->test_id > 0)
{
$affectedRows = $ilDB->manipulateF("UPDATE tst_tests SET complete = %s WHERE test_id = %s",
array('text','integer'),
array($complete, $this->test_id)
);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::saveECTSStatus (   $ects_output = 0,
  $fx_support = "",
  $ects_a = 90,
  $ects_b = 65,
  $ects_c = 35,
  $ects_d = 10,
  $ects_e = 0 
)

Saves the ECTS status (output of ECTS grades in a test) to the database.

public

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

References $ects_output, and getTestId().

{
global $ilDB;
if ($this->test_id > 0)
{
$fx_support = preg_replace("/,/", ".", $fx_support);
if (preg_match("/\d+/", $fx_support))
{
$fx_support = $fx_support;
}
else
{
$fx_support = NULL;
}
$affectedRows = $ilDB->manipulateF("UPDATE tst_tests SET ects_output = %s, ects_a = %s, ects_b = %s, ects_c = %s, ects_d = %s, ects_e = %s, ects_fx = %s WHERE test_id = %s",
array('text','float','float','float','float','float','float','integer'),
array($ects_output, $ects_a, $ects_b, $ects_c, $ects_d, $ects_e, $fx_support, $this->getTestId())
);
$this->ects_output = $ects_output;
$this->ects_fx = $fx_support;
}
}

+ Here is the call graph for this function:

ilObjTest::saveQuestionsToDb ( )

Saves the test questions to the database.

public

See Also
$questions

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

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

Referenced by moveQuestions(), removeQuestion(), and saveToDb().

{
global $ilDB;
$oldquestions = array();
include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
{
$result = $ilDB->queryF("SELECT question_fi FROM tst_test_question WHERE test_fi = %s ORDER BY sequence",
array('integer'),
array($this->getTestId())
);
if ($result->numRows() > 0)
{
while ($row = $ilDB->fetchAssoc($result))
{
array_push($oldquestions, $row["question_fi"]);
}
}
}
// workaround for lost obligations
// this method is called if a question is removed
$currentQuestionsObligationsQuery = 'SELECT question_fi, obligatory FROM tst_test_question WHERE test_fi = %s';
$rset = $ilDB->queryF($currentQuestionsObligationsQuery, array('integer'), array($this->getTestId()));
while ($row = $ilDB->fetchAssoc($rset)) {
$obligatoryQuestionState[$row['question_fi']] = $row['obligatory'];
}
// delete existing category relations
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_question WHERE test_fi = %s",
array('integer'),
array($this->getTestId())
);
// create new category relations
foreach ($this->questions as $key => $value)
{
// workaround for import witout obligations information
if( !isset($obligatoryQuestionState[$value]) || is_null($obligatoryQuestionState[$value]) )
{
$obligatoryQuestionState[$value] = 0;
}
// insert question
$next_id = $ilDB->nextId('tst_test_question');
$ilDB->insert('tst_test_question', array(
'test_question_id' => array('integer', $next_id),
'test_fi' => array('integer', $this->getTestId()),
'question_fi' => array('integer', $value),
'sequence' => array('integer', $key),
'obligatory' => array('integer', $obligatoryQuestionState[$value]),
'tstamp' => array('integer', time())
));
}
include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
{
$result = $ilDB->queryF("SELECT question_fi FROM tst_test_question WHERE test_fi = %s ORDER BY sequence",
array('integer'),
array($this->getTestId())
);
$newquestions = array();
if ($result->numRows() > 0)
{
while ($row = $ilDB->fetchAssoc($result))
{
array_push($newquestions, $row["question_fi"]);
}
}
foreach ($oldquestions as $index => $question_id)
{
if (strcmp($newquestions[$index], $question_id) != 0)
{
$pos = array_search($question_id, $newquestions);
if ($pos === FALSE)
{
$this->logAction($this->lng->txtlng("assessment", "log_question_removed", ilObjAssessmentFolder::_getLogLanguage()), $question_id);
}
else
{
$this->logAction($this->lng->txtlng("assessment", "log_question_position_changed", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($index+1) . " => " . ($pos+1), $question_id);
}
}
}
foreach ($newquestions as $index => $question_id)
{
if (array_search($question_id, $oldquestions) === FALSE)
{
$this->logAction($this->lng->txtlng("assessment", "log_question_added", ilObjAssessmentFolder::_getLogLanguage()) . ": " . ($index+1), $question_id);
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::saveToDb (   $properties_only = FALSE)

Saves a ilObjTest object to a database.

Parameters
bool$properties_only

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

References ilObject\$ilias, $result, $row, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilRTE\_replaceMediaObjectImageSrc(), areObligationsEnabled(), cleanupMediaobjectUsage(), evalTotalPersons(), getActivationEndingTime(), getActivationStartingTime(), getActivationVisibility(), getAllowedUsers(), getAllowedUsersTimeGap(), getAnonymity(), getAnswerFeedback(), getAnswerFeedbackPoints(), getAuthor(), getAutosave(), getAutosaveIval(), getCertificateVisibility(), getCharSelectorAvailability(), getCharSelectorDefinition(), getCountSystem(), getCustomStyle(), getECTSFX(), getECTSOutput(), getEnableArchiving(), getEnabledViewMode(), getEnableExamview(), getEnableProcessingTime(), getEndingTime(), getExportSettings(), getFinalStatement(), getFixedParticipants(), getForceJS(), getGenericAnswerFeedback(), getHighscoreAchievedTS(), getHighscoreAnon(), getHighscoreEnabled(), getHighscoreHints(), getHighscoreOwnTable(), getHighscorePercentage(), getHighscoreScore(), getHighscoreTopNum(), getHighscoreTopTable(), getHighscoreWTime(), ilObject\getId(), getInstantFeedbackSolution(), getIntroduction(), ilObjectActivation\getItem(), getKiosk(), getListOfQuestionsSettings(), getMailNotification(), getMailNotificationType(), getMCScoring(), getNrOfTries(), getPassScoring(), getPassword(), getPoolUsage(), getProcessingTime(), getQuestionSetType(), getRedirectionMode(), getRedirectionUrl(), getReportingDate(), getResetProcessingTime(), getResultsPresentation(), getScoreCutting(), getScoreReporting(), getSequenceSettings(), getShowCancel(), getShowExamviewHtml(), getShowExamviewPdf(), getShowFinalStatement(), getShowInfo(), getShowMarker(), getShuffleQuestions(), getSignSubmission(), getSpecificAnswerFeedback(), getStartingTime(), getTemplate(), getTestId(), getTitleOutput(), getUsePreviousAnswers(), isActivationLimited(), isBestSolutionPrintedWithResult(), isComplete(), PEAR\isError(), isOfferingQuestionHintsEnabled(), isOnline(), isPassDeletionAllowed(), isShowExamIdInTestPassEnabled(), isShowExamIdInTestResultsEnabled(), isTestFinalBroken(), logAction(), QUESTION_SET_TYPE_FIXED, saveQuestionsToDb(), ilObjectActivation\setTimingType(), ilObjectActivation\TIMINGS_ACTIVATION, and ilObjectActivation\TIMINGS_DEACTIVATED.

Referenced by applyDefaults(), and fromXML().

{
global $tree, $ilDB, $ilPluginAdmin;
// moved online_status to ilObjectActivation (see below)
// cleanup RTE images
require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
$testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this);
$testQuestionSetConfig = $testQuestionSetConfigFactory->getQuestionSetConfig();
include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
if ($this->test_id == -1)
{
// Create new dataset
$next_id = $ilDB->nextId('tst_tests');
$ilDB->insert('tst_tests', array(
'test_id' => array('integer', $next_id),
'obj_fi' => array('integer', $this->getId()),
'author' => array('text', $this->getAuthor()),
'introduction' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getIntroduction(), 0)),
'finalstatement' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getFinalStatement(), 0)),
'showinfo' => array('integer', $this->getShowInfo()),
'forcejs' => array('integer', $this->getForceJS()),
'customstyle' => array('text', $this->getCustomStyle()),
'showfinalstatement' => array('integer', $this->getShowFinalStatement()),
'sequence_settings' => array('integer', $this->getSequenceSettings()),
'score_reporting' => array('integer', $this->getScoreReporting()),
'instant_verification' => array('text', $this->getInstantFeedbackSolution()),
'answer_feedback_points' => array('text', $this->getAnswerFeedbackPoints()),
'answer_feedback' => array('text', $this->getAnswerFeedback()),
'anonymity' => array('text', $this->getAnonymity()),
'show_cancel' => array('text', $this->getShowCancel()),
'show_marker' => array('integer', $this->getShowMarker()),
'fixed_participants' => array('text', $this->getFixedParticipants()),
'nr_of_tries' => array('integer', $this->getNrOfTries()),
'kiosk' => array('integer', $this->getKiosk()),
'use_previous_answers' => array('text', $this->getUsePreviousAnswers()),
'title_output' => array('text', $this->getTitleOutput()),
'processing_time' => array('text', $this->getProcessingTime()),
'enable_processing_time' => array('text', $this->getEnableProcessingTime()),
'reset_processing_time' => array('integer', $this->getResetProcessingTime()),
'reporting_date' => array('text', $this->getReportingDate()),
'starting_time' => array('text', $this->getStartingTime()),
'ending_time' => array('text', $this->getEndingTime()),
'complete' => array('text', $this->isComplete($testQuestionSetConfig)),
'ects_output' => array('text', $this->getECTSOutput()),
'ects_a' => array('float', strlen($this->ects_grades["A"]) ? $this->ects_grades["A"] : NULL),
'ects_b' => array('float', strlen($this->ects_grades["B"]) ? $this->ects_grades["B"] : NULL),
'ects_c' => array('float', strlen($this->ects_grades["C"]) ? $this->ects_grades["C"] : NULL),
'ects_d' => array('float', strlen($this->ects_grades["D"]) ? $this->ects_grades["D"] : NULL),
'ects_e' => array('float', strlen($this->ects_grades["E"]) ? $this->ects_grades["E"] : NULL),
'ects_fx' => array('float', $this->getECTSFX()),
'count_system' => array('text', $this->getCountSystem()),
'mc_scoring' => array('text', $this->getMCScoring()),
'score_cutting' => array('text', $this->getScoreCutting()),
'pass_scoring' => array('text', $this->getPassScoring()),
'shuffle_questions' => array('text', $this->getShuffleQuestions()),
'results_presentation' => array('integer', $this->getResultsPresentation()),
'show_summary' => array('integer', $this->getListOfQuestionsSettings()),
'password' => array('text', $this->getPassword()),
'allowedusers' => array('integer', $this->getAllowedUsers()),
'alloweduserstimegap' => array('integer', $this->getAllowedUsersTimeGap()),
'mailnottype' => array('integer', $this->getMailNotificationType()),
'exportsettings' => array('integer', $this->getExportSettings()),
'certificate_visibility' => array('text', $this->getCertificateVisibility()),
'mailnotification' => array('integer', $this->getMailNotification()),
'created' => array('integer', time()),
'tstamp' => array('integer', time()),
'enabled_view_mode' => array('text', $this->getEnabledViewMode()),
'template_id' => array('integer', $this->getTemplate()),
'pool_usage' => array('integer', $this->getPoolUsage()),
'print_bs_with_res' => array('integer', (int)$this->isBestSolutionPrintedWithResult()),
'obligations_enabled' => array('integer', (int)$this->areObligationsEnabled()),
'offer_question_hints' => array('integer', (int)$this->isOfferingQuestionHintsEnabled()),
'highscore_enabled' => array('integer', (int)$this->getHighscoreEnabled()),
'highscore_anon' => array('integer', (int)$this->getHighscoreAnon()),
'highscore_achieved_ts' => array('integer', (int)$this->getHighscoreAchievedTS()),
'highscore_score' => array('integer', (int)$this->getHighscoreScore()),
'highscore_percentage' => array('integer', (int)$this->getHighscorePercentage()),
'highscore_hints' => array('integer', (int)$this->getHighscoreHints()),
'highscore_wtime' => array('integer', (int)$this->getHighscoreWTime()),
'highscore_own_table' => array('integer', (int)$this->getHighscoreOwnTable()),
'highscore_top_table' => array('integer', (int)$this->getHighscoreTopTable()),
'highscore_top_num' => array('integer', (int)$this->getHighscoreTopNum()),
'online_status' => array('integer', (int)$this->isOnline()),
'specific_feedback' => array('integer', (int)$this->getSpecificAnswerFeedback()),
'autosave' => array('integer', (int)$this->getAutosave()),
'autosave_ival' => array('integer', (int)$this->getAutosaveIval()),
'pass_deletion_allowed' => array('integer', (int)$this->isPassDeletionAllowed()),
'enable_examview' => array('integer', (int)$this->getEnableExamview()),
'show_examview_html' => array('integer', (int)$this->getShowExamviewHtml()),
'show_examview_pdf' => array('integer', (int)$this->getShowExamviewPdf()),
'redirection_mode' => array('integer', (int)$this->getRedirectionMode()),
'redirection_url' => array('text', (string)$this->getRedirectionUrl()),
'enable_archiving' => array('integer', (int)$this->getEnableArchiving()),
'examid_in_test_pass' => array('integer', (int)$this->isShowExamIdInTestPassEnabled()),
'examid_in_test_res' => array('integer', (int)$this->isShowExamIdInTestResultsEnabled()),
'sign_submission' => array('integer', (int)$this->getSignSubmission()),
'question_set_type' => array('text', $this->getQuestionSetType()),
'char_selector_availability' => array('integer', (int)$this->getCharSelectorAvailability()),
'char_selector_definition' => array('text', (string)$this->getCharSelectorDefinition()),
'broken' => array('integer', (int)$this->isTestFinalBroken())
));
$this->test_id = $next_id;
{
$this->logAction($this->lng->txtlng("assessment", "log_create_new_test", ilObjAssessmentFolder::_getLogLanguage()));
}
}
else
{
// Modify existing dataset
$oldrow = array();
{
$result = $ilDB->queryF("SELECT * FROM tst_tests WHERE test_id = %s",
array('integer'),
array($this->test_id)
);
if ($result->numRows() == 1)
{
$oldrow = $ilDB->fetchAssoc($result);
}
}
$ilDB->update('tst_tests',
array(
'author' => array('text', $this->getAuthor()),
'introduction' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getIntroduction(), 0)),
'finalstatement' => array('text', ilRTE::_replaceMediaObjectImageSrc($this->getFinalStatement(), 0)),
'showinfo' => array('integer', $this->getShowInfo()),
'forcejs' => array('integer', $this->getForceJS()),
'customstyle' => array('text', $this->getCustomStyle()),
'showfinalstatement' => array('integer', $this->getShowFinalStatement()),
'sequence_settings' => array('integer', $this->getSequenceSettings()),
'score_reporting' => array('integer', $this->getScoreReporting()),
'instant_verification' => array('text', $this->getInstantFeedbackSolution()),
'answer_feedback_points' => array('text', $this->getAnswerFeedbackPoints()),
'answer_feedback' => array('text', $this->getGenericAnswerFeedback()),
'anonymity' => array('text', $this->getAnonymity()),
'show_cancel' => array('text', $this->getShowCancel()),
'show_marker' => array('integer', $this->getShowMarker()),
'fixed_participants' => array('text', $this->getFixedParticipants()),
'nr_of_tries' => array('integer', $this->getNrOfTries()),
'kiosk' => array('integer', $this->getKiosk()),
'use_previous_answers' => array('text', $this->getUsePreviousAnswers()),
'title_output' => array('text', $this->getTitleOutput()),
'processing_time' => array('text', $this->getProcessingTime()),
'enable_processing_time' => array('text', $this->getEnableProcessingTime()),
'reset_processing_time' => array('integer', $this->getResetProcessingTime()),
'reporting_date' => array('text', $this->getReportingDate()),
'starting_time' => array('text', $this->getStartingTime()),
'ending_time' => array('text', $this->getEndingTime()),
'complete' => array('text', $this->isComplete($testQuestionSetConfig)),
'ects_output' => array('text', $this->getECTSOutput()),
'ects_a' => array('float', strlen($this->ects_grades["A"]) ? $this->ects_grades["A"] : NULL),
'ects_b' => array('float', strlen($this->ects_grades["B"]) ? $this->ects_grades["B"] : NULL),
'ects_c' => array('float', strlen($this->ects_grades["C"]) ? $this->ects_grades["C"] : NULL),
'ects_d' => array('float', strlen($this->ects_grades["D"]) ? $this->ects_grades["D"] : NULL),
'ects_e' => array('float', strlen($this->ects_grades["E"]) ? $this->ects_grades["E"] : NULL),
'ects_fx' => array('float', $this->getECTSFX()),
'count_system' => array('text', $this->getCountSystem()),
'mc_scoring' => array('text', $this->getMCScoring()),
'score_cutting' => array('text', $this->getScoreCutting()),
'pass_scoring' => array('text', $this->getPassScoring()),
'shuffle_questions' => array('text', $this->getShuffleQuestions()),
'results_presentation' => array('integer', $this->getResultsPresentation()),
'show_summary' => array('integer', $this->getListOfQuestionsSettings()),
'password' => array('text', $this->getPassword()),
'allowedusers' => array('integer', $this->getAllowedUsers()),
'alloweduserstimegap' => array('integer', $this->getAllowedUsersTimeGap()),
'mailnottype' => array('integer', $this->getMailNotificationType()),
'exportsettings' => array('integer', $this->getExportSettings()),
'print_bs_with_res' => array('integer', (int)$this->isBestSolutionPrintedWithResult()),
'alloweduserstimegap' => array('integer', $this->getAllowedUsersTimeGap()),
'certificate_visibility' => array('text', $this->getCertificateVisibility()),
'mailnotification' => array('integer', $this->getMailNotification()),
'tstamp' => array('integer', time()),
'enabled_view_mode' => array('text', $this->getEnabledViewMode()),
'template_id' => array('integer', $this->getTemplate()),
'pool_usage' => array('integer', $this->getPoolUsage()),
'print_bs_with_res' => array('integer', (int)$this->isBestSolutionPrintedWithResult()),
'obligations_enabled' => array('integer', (int)$this->areObligationsEnabled()),
'offer_question_hints' => array('integer', (int)$this->isOfferingQuestionHintsEnabled()),
'highscore_enabled' => array('integer', (int)$this->getHighscoreEnabled()),
'highscore_anon' => array('integer', (int)$this->getHighscoreAnon()),
'highscore_achieved_ts' => array('integer', (int)$this->getHighscoreAchievedTS()),
'highscore_score' => array('integer', (int)$this->getHighscoreScore()),
'highscore_percentage' => array('integer', (int)$this->getHighscorePercentage()),
'highscore_hints' => array('integer', (int)$this->getHighscoreHints()),
'highscore_wtime' => array('integer', (int)$this->getHighscoreWTime()),
'highscore_own_table' => array('integer', (int)$this->getHighscoreOwnTable()),
'highscore_top_table' => array('integer', (int)$this->getHighscoreTopTable()),
'highscore_top_num' => array('integer', (int)$this->getHighscoreTopNum()),
'online_status' => array('integer', (int)$this->isOnline()),
'specific_feedback' => array('integer', (int)$this->getSpecificAnswerFeedback()),
'autosave' => array('integer', (int)$this->getAutosave()),
'autosave_ival' => array('integer', (int)$this->getAutosaveIval()),
'pass_deletion_allowed' => array('integer', (int)$this->isPassDeletionAllowed()),
'enable_examview' => array('integer', (int)$this->getEnableExamview()),
'show_examview_html' => array('integer', (int)$this->getShowExamviewHtml()),
'show_examview_pdf' => array('integer', (int)$this->getShowExamviewPdf()),
'redirection_mode' => array('integer', (int)$this->getRedirectionMode()),
'redirection_url' => array('text', (string)$this->getRedirectionUrl()),
'enable_archiving' => array('integer', (int)$this->getEnableArchiving()),
'examid_in_test_pass' => array('integer', (int)$this->isShowExamIdInTestPassEnabled()),
'examid_in_test_res' => array('integer', (int)$this->isShowExamIdInTestResultsEnabled()),
'sign_submission' => array('integer', (int)$this->getSignSubmission()),
'question_set_type' => array('text', $this->getQuestionSetType()),
'char_selector_availability' => array('integer', (int)$this->getCharSelectorAvailability()),
'char_selector_definition' => array('text', (string)$this->getCharSelectorDefinition()),
'broken' => array('integer', (int)$this->isTestFinalBroken())
),
array(
'test_id' => array('integer', (int)$this->getTestId())
)
);
include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
{
$logresult = $ilDB->queryF("SELECT * FROM tst_tests WHERE test_id = %s",
array('integer'),
array($this->getTestId())
);
$newrow = array();
if ($logresult->numRows() == 1)
{
$newrow = $ilDB->fetchAssoc($logresult);
}
$changed_fields = array();
foreach ($oldrow as $key => $value)
{
if (strcmp($oldrow[$key], $newrow[$key]) != 0)
{
array_push($changed_fields, "$key: " . $oldrow[$key] . " => " . $newrow[$key]);
}
}
$changes = join($changed_fields, ", ");
if (count($changed_fields) > 0)
{
$this->logAction($this->lng->txtlng("assessment", "log_modified_test", ilObjAssessmentFolder::_getLogLanguage()) . " [".$changes."]");
}
}
if ($this->evalTotalPersons() > 0)
{
// reset the finished status of participants if the nr of test passes did change
if ($this->getNrOfTries() > 0)
{
// set all unfinished tests with nr of passes >= allowed passes finished
$aresult = $ilDB->queryF("SELECT active_id FROM tst_active WHERE test_fi = %s AND tries >= %s AND submitted = %s",
array('integer', 'integer', 'integer'),
array($this->getTestId(), $this->getNrOfTries(), 0)
);
while ($row = $ilDB->fetchAssoc($aresult))
{
$ilDB->manipulateF("UPDATE tst_active SET submitted = %s, submittimestamp = %s WHERE active_id = %s",
array('integer', 'timestamp', 'integer'),
array(1, date('Y-m-d H:i:s'), $row["active_id"])
);
}
// set all finished tests with nr of passes < allowed passes not finished
$aresult = $ilDB->queryF("SELECT active_id FROM tst_active WHERE test_fi = %s AND tries < %s AND submitted = %s",
array('integer', 'integer', 'integer'),
array($this->getTestId(), $this->getNrOfTries()-1, 1)
);
while ($row = $ilDB->fetchAssoc($aresult))
{
$ilDB->manipulateF("UPDATE tst_active SET submitted = %s, submittimestamp = %s WHERE active_id = %s",
array('integer', 'timestamp', 'integer'),
array(0, NULL, $row["active_id"])
);
}
}
else
{
// set all finished tests with nr of passes >= allowed passes not finished
$aresult = $ilDB->queryF("SELECT active_id FROM tst_active WHERE test_fi = %s AND submitted = %s",
array('integer', 'integer'),
array($this->getTestId(), 1)
);
while ($row = $ilDB->fetchAssoc($aresult))
{
$ilDB->manipulateF("UPDATE tst_active SET submitted = %s, submittimestamp = %s WHERE active_id = %s",
array('integer', 'timestamp', 'integer'),
array(0, NULL, $row["active_id"])
);
}
}
}
}
// moved activation to ilObjectActivation
if($this->ref_id)
{
include_once "./Services/Object/classes/class.ilObjectActivation.php";
$item = new ilObjectActivation;
if(!$this->isActivationLimited())
{
}
else
{
$item->setTimingStart($this->getActivationStartingTime());
$item->setTimingEnd($this->getActivationEndingTime());
$item->toggleVisible($this->getActivationVisibility());
}
$item->update($this->ref_id);
}
if (!$properties_only)
{
{
global $ilias;
$ilias->raiseError($result->getMessage());
}
else
{
{
}
$this->mark_schema->saveToDb($this->test_id);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::sendAdvancedNotification (   $active_id)

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

References _getUserIdFromActiveId(), ilObject\getOwner(), ilObject\getTitle(), and userLookupFullName().

{
include_once "./Modules/Test/classes/class.ilTestMailNotification.php";
$mail = new ilTestMailNotification();
$owner_id = $this->getOwner();
$usr_data = $this->userLookupFullName(ilObjTest::_getUserIdFromActiveId($active_id));
include_once "./Modules/Test/classes/class.ilTestExport.php";
$exportObj = new ilTestExport($this, "results");
$file = $exportObj->exportToExcel($deliver = FALSE, 'active_id', $active_id, $passedonly = FALSE);
include_once "./Services/Mail/classes/class.ilFileDataMail.php";
$fd = new ilFileDataMail(ANONYMOUS_USER_ID);
$fd->copyAttachmentFile($file, "result_" . $active_id . ".xls");
$file_names[] = "result_" . $active_id . ".xls";
$mail->sendAdvancedNotification($owner_id, $this->getTitle(), $usr_data, $file_names);
if(count($file_names))
{
$fd->unlinkFiles($file_names);
unset($fd);
@unlink($file);
}
}

+ Here is the call graph for this function:

ilObjTest::sendSimpleNotification (   $active_id)

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

References _getUserIdFromActiveId(), ilObject\getOwner(), ilObject\getTitle(), and userLookupFullName().

{
include_once "./Modules/Test/classes/class.ilTestMailNotification.php";
$mail = new ilTestMailNotification();
$owner_id = $this->getOwner();
$usr_data = $this->userLookupFullName(ilObjTest::_getUserIdFromActiveId($active_id));
$mail->sendSimpleNotification($owner_id, $this->getTitle(), $usr_data);
}

+ Here is the call graph for this function:

ilObjTest::setActivationEndingTime (   $ending_time = NULL)

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

References $ending_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->activation_ending_time = $ending_time;
}

+ Here is the caller graph for this function:

ilObjTest::setActivationLimited (   $a_value)

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->activation_limited = (bool)$a_value;
}

+ Here is the caller graph for this function:

ilObjTest::setActivationStartingTime (   $starting_time = NULL)

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

References $starting_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->activation_starting_time = $starting_time;
}

+ Here is the caller graph for this function:

ilObjTest::setActivationVisibility (   $a_value)

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->activation_visibility = (bool) $a_value;
}

+ Here is the caller graph for this function:

ilObjTest::setAllowedUsers (   $a_allowed_users)

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->allowedUsers = $a_allowed_users;
}

+ Here is the caller graph for this function:

ilObjTest::setAllowedUsersTimeGap (   $a_allowed_users_time_gap)

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->allowedUsersTimeGap = $a_allowed_users_time_gap;
}

+ Here is the caller graph for this function:

ilObjTest::setAnonymity (   $a_value = 0)

Sets the anonymity status of the test.

Parameters
integer$a_valueThe value for the anonymity status (0 = personalized, 1 = anonymized) public

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
switch ($a_value)
{
case 1:
$this->anonymity = 1;
break;
default:
$this->anonymity = 0;
break;
}
}

+ Here is the caller graph for this function:

ilObjTest::setAnswerFeedback (   $answer_feedback = 0)

Sets the generic feedback for the test Use setGenericAnswerFeedback instead.

Parameters
integer$answer_feedbackIf 1, answer specific feedback will be shown after answering a question public
See Also
$answer_feedback

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

References $answer_feedback.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
{
case 1:
$this->answer_feedback = 1;
break;
default:
$this->answer_feedback = 0;
break;
}
}

+ Here is the caller graph for this function:

ilObjTest::setAnswerFeedbackPoints (   $answer_feedback_points = 0)

Sets the answer specific feedback of reached points for the test.

Parameters
integer$answer_feedback_pointsIf 1, answer specific feedback will show the reached points after answering a question public
See Also
$answer_feedback_points

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

References $answer_feedback_points.

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setScoringFeedbackOptionsByArray().

{
{
case 1:
$this->answer_feedback_points = 1;
break;
default:
$this->answer_feedback_points = 0;
break;
}
}

+ Here is the caller graph for this function:

ilObjTest::setAuthor (   $author = "")

Sets the authors name of the ilObjTest object.

Parameters
string$authorA string containing the name of the test author public
See Also
$author

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

References $author.

Referenced by fromXML(), and loadFromDb().

{
$this->author = $author;
}

+ Here is the caller graph for this function:

ilObjTest::setAutosave (   $autosave)

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

References $autosave.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->autosave = $autosave;
}

+ Here is the caller graph for this function:

ilObjTest::setAutosaveIval (   $autosave_ival)

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

References $autosave_ival.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->autosave_ival = $autosave_ival;
}

+ Here is the caller graph for this function:

ilObjTest::setCertificateVisibility (   $a_value)

Sets the visibility settings of the certificate.

Parameters
integer$a_valueThe value for the visibility settings (0 = always, 1 = only passed, 2 = never) public

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

Referenced by loadFromDb().

{
$this->certificate_visibility = $a_value;
}

+ Here is the caller graph for this function:

ilObjTest::setCharSelectorAvailability (   $availability)
Parameters
intavailability of the special character selector

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->char_selector_availability = (int) $availability;
}

+ Here is the caller graph for this function:

ilObjTest::setCharSelectorDefinition (   $definition = '')
Parameters
stringdefinition of the special character selector

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->char_selector_definition = $definition;
}

+ Here is the caller graph for this function:

ilObjTest::setClientIP (   $user_id,
  $client_ip 
)

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

References getTestId().

{
global $ilDB;
$affectedRows = $ilDB->manipulateF("UPDATE tst_invited_user SET clientip = %s, tstamp = %s WHERE test_fi=%s and user_fi=%s",
array('text', 'integer', 'integer', 'integer'),
array((strlen($client_ip)) ? $client_ip : NULL, time(), $this->getTestId(), $user_id)
);
}

+ Here is the call graph for this function:

ilObjTest::setCountSystem (   $a_count_system = COUNT_PARTIAL_SOLUTIONS)

Sets the count system for the calculation of points.

Parameters
integer$a_count_systemThe count system for the calculation of points. public
See Also
$count_system

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->count_system = $a_count_system;
}

+ Here is the caller graph for this function:

ilObjTest::setCustomStyle (   $a_customStyle = NULL)

Set the custom style.

Parameters
string$a_customStyleThe custom style public
See Also
$_customStyle

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_customStyle = $a_customStyle;
}

+ Here is the caller graph for this function:

ilObjTest::setECTSFX (   $a_ects_fx)

Sets the ECTS FX grade.

Parameters
string$a_ects_fxThe ECTS FX grade public
See Also
$ects_fx

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

Referenced by applyDefaults(), and loadFromDb().

{
$this->ects_fx = $a_ects_fx;
}

+ Here is the caller graph for this function:

ilObjTest::setECTSGrades (   $a_ects_grades)

Sets the ECTS grades.

Parameters
array$a_ects_gradesThe ECTS grades public
See Also
$ects_grades

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

Referenced by applyDefaults(), and loadFromDb().

{
if (is_array($a_ects_grades))
{
$this->ects_grades = $a_ects_grades;
}
}

+ Here is the caller graph for this function:

ilObjTest::setECTSOutput (   $a_ects_output)

Enables/Disables ECTS grades output for this test.

Parameters
integer$a_ects_output0 if ECTS grades output should be deactivated, 1 otherwise public
See Also
$ects_output

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

Referenced by applyDefaults(), and loadFromDb().

{
$this->ects_output = $a_ects_output ? 1 : 0;
}

+ Here is the caller graph for this function:

ilObjTest::setEnableArchiving (   $enable_archiving)
Parameters
boolean$enable_archiving
Returns
$this

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

References $enable_archiving.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->enable_archiving = $enable_archiving;
return $this;
}

+ Here is the caller graph for this function:

ilObjTest::setEnabledViewMode (   $mode)

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

Referenced by loadFromDb().

{
$this->enabled_view_mode = $mode;
}

+ Here is the caller graph for this function:

ilObjTest::setEnableExamview (   $enable_examview)
Parameters
boolean$enable_examview

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

References $enable_examview.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->enable_examview = $enable_examview;
}

+ Here is the caller graph for this function:

ilObjTest::setEnableProcessingTime (   $enable = 0)

Sets the processing time enabled or disabled.

Parameters
integer$enable0 to disable the processing time, 1 to enable the processing time public
See Also
$processing_time

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
if ($enable) {
$this->enable_processing_time = "1";
} else {
$this->enable_processing_time = "0";
}
}

+ Here is the caller graph for this function:

ilObjTest::setEndingTime (   $ending_time = NULL)

Sets the ending time in database timestamp format for the test.

Parameters
string$ending_timeThe ending time for the test. Empty string for no ending time. public
See Also
$ending_time

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

References $ending_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->ending_time = $ending_time;
}

+ Here is the caller graph for this function:

ilObjTest::setExportSettings (   $a_settings)

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
if ($a_settings)
{
$this->exportsettings = $a_settings;
}
else
{
$this->exportsettings = 0;
}
}

+ Here is the caller graph for this function:

ilObjTest::setExportSettingsSingleChoiceShort (   $a_settings)

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

References getExportSettingsSingleChoiceShort().

{
if ($a_settings)
{
$this->exportsettings = $this->exportsettings | 1;
}
else
{
{
$this->exportsettings = $this->exportsettings ^ 1;
}
}
}

+ Here is the call graph for this function:

ilObjTest::setFinalStatement (   $a_statement = "")

Sets the final statement text of the ilObjTest object.

Parameters
string$a_statementA final statement public
See Also
$_finalstatement

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_finalstatement = $a_statement;
}

+ Here is the caller graph for this function:

ilObjTest::setFixedParticipants (   $a_value = 1)

Sets the fixed participants status.

Parameters
integer$a_valueThe value for the fixed participants status (0 = don't allow, 1 = allow) public

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
switch ($a_value)
{
case 1:
$this->fixed_participants = 1;
break;
default:
$this->fixed_participants = 0;
break;
}
}

+ Here is the caller graph for this function:

ilObjTest::setForceJS (   $a_js = 1)

Set whether JavaScript should be forced for tests.

Parameters
integer$a_js1 to force JavaScript, 0 otherwise public
See Also
$_forcejs

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_forcejs = ($a_js) ? 1 : 0;
}

+ Here is the caller graph for this function:

ilObjTest::setGenericAnswerFeedback (   $generic_answer_feedback = 0)

Sets if the generic feedback is to be shown in the test.

Parameters
int$generic_answer_feedback
Todo:
Rename "$this->answer_feedback to something more meaningful.

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

Referenced by setScoringFeedbackOptionsByArray().

{
switch ($generic_answer_feedback)
{
case 1:
$this->answer_feedback = 1;
break;
default:
$this->answer_feedback = 0;
break;
}
}

+ Here is the caller graph for this function:

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_highscore_achieved_ts = (bool)$a_achieved_ts;
}

+ Here is the caller graph for this function:

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_highscore_anon = (bool)$a_anon;
}

+ Here is the caller graph for this function:

ilObjTest::setHighscoreEnabled (   $a_enabled)

Sets if the highscore feature should be enabled.

Parameters
bool$a_enabled

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_highscore_enabled = (bool)$a_enabled;
}

+ Here is the caller graph for this function:

ilObjTest::setHighscoreHints (   $a_hints)

Sets if the number of requested hints should be shown.

Parameters
bool$a_hints

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_highscore_hints = (bool)$a_hints;
}

+ Here is the caller graph for this function:

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_highscore_own_table = (bool)$a_own_table;
}

+ Here is the caller graph for this function:

ilObjTest::setHighscorePercentage (   $a_percentage)

Sets if the percentages of the scores pass should be shown.

Parameters
bool$a_percentage

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_highscore_percentage = (bool)$a_percentage;
}

+ Here is the caller graph for this function:

ilObjTest::setHighscoreScore (   $a_score)

Sets if the actual score should be displayed.

Parameters
bool$a_score

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_highscore_score = (bool)$a_score;
}

+ Here is the caller graph for this function:

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_highscore_top_num = (int)$a_top_num;
}

+ Here is the caller graph for this function:

ilObjTest::setHighscoreTopTable (   $a_top_table)

Sets if the top-rankings table should be shown.

Parameters
bool$a_top_table

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_highscore_top_table = (bool)$a_top_table;
}

+ Here is the caller graph for this function:

ilObjTest::setHighscoreWTime (   $a_wtime)

Sets if the workingtime of the scores should be shown.

Parameters
bool$a_wtime

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_highscore_wtime = (bool)$a_wtime;
}

+ Here is the caller graph for this function:

ilObjTest::setInstantFeedbackSolution (   $instant_feedback = 0)

Sets the instant feedback for the solution.

Parameters
integer$instant_feedbackIf 1, the solution will be shown after answering a question public
See Also
$instant_verification

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

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setScoringFeedbackOptionsByArray().

{
switch ($instant_feedback)
{
case 1:
$this->instant_verification = 1;
break;
default:
$this->instant_verification = 0;
break;
}
}

+ Here is the caller graph for this function:

ilObjTest::setIntroduction (   $introduction = "")

Sets the introduction text of the ilObjTest object.

Parameters
string$introductionAn introduction string for the test public
See Also
$introduction

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

References $introduction.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->introduction = $introduction;
}

+ Here is the caller graph for this function:

ilObjTest::setKiosk (   $kiosk = 0)

Sets the kiosk mode for the test.

Parameters
integer$kioskThe value for the kiosk mode. public
See Also
$_kiosk

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_kiosk = $kiosk;
}

+ Here is the caller graph for this function:

ilObjTest::setKioskMode (   $a_kiosk = FALSE)

Sets the kiosk mode for the test.

Parameters
boolean$kioskThe value for the kiosk mode public
See Also
$_kiosk

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

References getKioskMode().

{
if ($a_kiosk)
{
$this->_kiosk = $this->_kiosk | 1;
}
else
{
if ($this->getKioskMode())
{
$this->_kiosk = $this->_kiosk ^ 1;
}
}
}

+ Here is the call graph for this function:

ilObjTest::setListOfQuestions (   $a_value = TRUE)

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

Parameters
boolean$a_valueTRUE if the list of questions should be presented, FALSE otherwise public

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

{
if ($a_value)
{
$this->show_summary = 1;
}
else
{
$this->show_summary = 0;
}
}
ilObjTest::setListOfQuestionsDescription (   $a_value = TRUE)

Sets the show_summary attribute to TRUE if the list of questions should be presented with the question descriptions.

Parameters
boolean$a_valueTRUE if the list of questions should be shown with question descriptions, FALSE otherwise public

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

References getListOfQuestions(), and getListOfQuestionsDescription().

{
if ($a_value && $this->getListOfQuestions())
{
$this->show_summary = $this->show_summary | 8;
}
if (!$a_value && $this->getListOfQuestions())
{
{
$this->show_summary = $this->show_summary ^ 8;
}
}
}

+ Here is the call graph for this function:

ilObjTest::setListOfQuestionsEnd (   $a_value = TRUE)

Sets if the the list of questions as the end page of the test.

Parameters
boolean$a_valueTRUE if the list of questions should be the end page, FALSE otherwise public

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

References getListOfQuestions(), and getListOfQuestionsEnd().

{
if ($a_value && $this->getListOfQuestions())
{
$this->show_summary = $this->show_summary | 4;
}
if (!$a_value && $this->getListOfQuestions())
{
if ($this->getListOfQuestionsEnd())
{
$this->show_summary = $this->show_summary ^ 4;
}
}
}

+ Here is the call graph for this function:

ilObjTest::setListOfQuestionsSettings (   $a_value = 0)

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

Parameters
integer$a_value0, 1, 3, 5 or 7 public

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->show_summary = $a_value;
}

+ Here is the caller graph for this function:

ilObjTest::setListOfQuestionsStart (   $a_value = TRUE)

Sets if the the list of questions as the start page of the test.

Parameters
boolean$a_valueTRUE if the list of questions should be the start page, FALSE otherwise public

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

References getListOfQuestions(), and getListOfQuestionsStart().

{
if ($a_value && $this->getListOfQuestions())
{
$this->show_summary = $this->show_summary | 2;
}
if (!$a_value && $this->getListOfQuestions())
{
{
$this->show_summary = $this->show_summary ^ 2;
}
}
}

+ Here is the call graph for this function:

ilObjTest::setMailNotification (   $a_notification)

Set mail notification settings.

Parameters
$a_notificationMail notification setting

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->mailnotification = $a_notification;
}

+ Here is the caller graph for this function:

ilObjTest::setMailNotificationType (   $a_type)

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
if ($a_type == 1)
{
$this->mailnottype = 1;
}
else
{
$this->mailnottype = 0;
}
}

+ Here is the caller graph for this function:

ilObjTest::setMCScoring (   $a_mc_scoring = SCORE_ZERO_POINTS_WHEN_UNANSWERED)

Sets the multiple choice scoring.

Parameters
integer$a_mc_scoringThe scoring for multiple choice questions public
See Also
$mc_scoring

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->mc_scoring = $a_mc_scoring;
}

+ Here is the caller graph for this function:

ilObjTest::setNrOfTries (   $nr_of_tries = 0)

Sets the nr of tries for the test.

Parameters
integer$nr_of_triesThe maximum number of tries for the test. 0 for infinite tries. public
See Also
$nr_of_tries

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

References $nr_of_tries.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->nr_of_tries = $nr_of_tries;
}

+ Here is the caller graph for this function:

ilObjTest::setObligationsEnabled (   $obligationsEnabled = true)

sets obligations enabled/disabled

Parameters
boolean$obligationsEnabled

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

References $obligationsEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->obligationsEnabled = (bool)$obligationsEnabled;
}

+ Here is the caller graph for this function:

ilObjTest::setOfferingQuestionHintsEnabled (   $offeringQuestionHintsEnabled)

sets offering question hints enabled/disabled

Parameters
boolean$offeringQuestionHintsEnabled

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

References $offeringQuestionHintsEnabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->offeringQuestionHintsEnabled = (bool)$offeringQuestionHintsEnabled;
}

+ Here is the caller graph for this function:

ilObjTest::setOnline (   $a_online = true)

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

Referenced by loadFromDb().

{
$this->online = (bool)$a_online;
}

+ Here is the caller graph for this function:

ilObjTest::setPassDeletionAllowed (   $passDeletionAllowed)

setter for the test setting passDeletionAllowed

Returns
integer

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

References $passDeletionAllowed.

Referenced by applyDefaults(), and loadFromDb().

{
$this->passDeletionAllowed = (bool)$passDeletionAllowed;
}

+ Here is the caller graph for this function:

ilObjTest::setPassScoring (   $a_pass_scoring = SCORE_LAST_PASS)

Sets the pass scoring.

Parameters
integer$a_pass_scoringThe pass scoring type public
See Also
$pass_scoring

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

References SCORE_BEST_PASS, and SCORE_LAST_PASS.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
switch ($a_pass_scoring)
{
$this->pass_scoring = SCORE_BEST_PASS;
break;
default:
$this->pass_scoring = SCORE_LAST_PASS;
break;
}
}

+ Here is the caller graph for this function:

ilObjTest::setPassword (   $a_password = NULL)

Sets the password for test access.

Parameters
string$a_passwordThe password for test access public
See Also
$password

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->password = $a_password;
}

+ Here is the caller graph for this function:

ilObjTest::setPoolUsage (   $usage)

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

Referenced by applyDefaults(), and loadFromDb().

{
$this->poolUsage = (boolean)$usage;
}

+ Here is the caller graph for this function:

ilObjTest::setPrintBestSolutionWithResult (   $status)

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

Referenced by applyDefaults(), and loadFromDb().

{
$this->print_best_solution_with_result = (bool) $status;
}

+ Here is the caller graph for this function:

ilObjTest::setProcessingTime (   $processing_time = "00:00:00")

Sets the processing time for the test.

Parameters
string$processing_timeThe maximum processing time for the test given in hh:mm:ss public
See Also
$processing_time

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

References $processing_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

:00:00")
{
$this->processing_time = $processing_time;
}

+ Here is the caller graph for this function:

ilObjTest::setQuestionOrderAndObligations (   $orders,
  $obligations 
)

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

References ilObject\$id, $query, and loadQuestions().

{
global $ilDB;
asort($orders);
$i = 0;
foreach($orders as $id => $position)
{
$i++;
$obligatory = (
isset($obligations[$id]) && $obligations[$id] ? 1 : 0
);
$query = "
UPDATE tst_test_question
SET sequence = %s,
obligatory = %s
WHERE question_fi = %s
";
$ilDB->manipulateF(
$query, array('integer', 'integer', 'integer'), array($i, $obligatory, $id)
);
}
$this->loadQuestions();
}

+ Here is the call graph for this function:

ilObjTest::setQuestionSetSolved (   $value,
  $question_id,
  $user_id 
)

sets question solved state to value for given user_id

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

References getActiveIdOfUser().

{
global $ilDB;
$active_id = $this->getActiveIdOfUser($user_id);
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_qst_solved WHERE active_fi = %s AND question_fi = %s",
array('integer', 'integer'),
array($active_id, $question_id)
);
$affectedRows = $ilDB->manipulateF("INSERT INTO tst_qst_solved (solved, question_fi, active_fi) VALUES (%s, %s, %s)",
array('integer', 'integer', 'integer'),
array($value, $question_id, $active_id)
);
}

+ Here is the call graph for this function:

ilObjTest::setQuestionSetType (   $questionSetType)

setter for question set type

Parameters
string$questionSetType

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

References $questionSetType.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->questionSetType = $questionSetType;
}

+ Here is the caller graph for this function:

ilObjTest::setRedirectionMode (   $redirection_mode = 0)

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

References $redirection_mode.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->redirection_mode = $redirection_mode;
}

+ Here is the caller graph for this function:

ilObjTest::setRedirectionUrl (   $redirection_url = NULL)

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

References $redirection_url.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->redirection_url = $redirection_url;
}

+ Here is the caller graph for this function:

ilObjTest::setReportingDate (   $reporting_date)

Sets the reporting date of the ilObjTest object.

Parameters
timestamp$reporting_dateThe date and time the score reporting is available public
See Also
$reporting_date

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

References $reporting_date.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
{
$this->reporting_date = "";
$this->ects_output = 0;
}
else
{
$this->reporting_date = $reporting_date;
}
}

+ Here is the caller graph for this function:

ilObjTest::setResetProcessingTime (   $reset = 0)

Sets wheather the processing time should be reset or not.

Parameters
integer$reset1 to reset the processing time, 0 otherwise public
See Also
$processing_time

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
if ($reset)
{
$this->reset_processing_time = 1;
}
else
{
$this->reset_processing_time = 0;
}
}

+ Here is the caller graph for this function:

ilObjTest::setResultsPresentation (   $a_results_presentation = 3)

Sets the combined results presentation value.

Parameters
integer$a_results_presentationThe combined results presentation value public

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->results_presentation = $a_results_presentation;
}

+ Here is the caller graph for this function:

ilObjTest::setResultsPresentationOptionsByArray (   $options)

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

References $options.

{
$setter = array(
'pass_details' => 'setShowPassDetails',
'solution_details' => 'setShowSolutionDetails',
'solution_printview' => 'setShowSolutionPrintview',
'solution_feedback' => 'setShowSolutionFeedback',
'solution_answers_only' => 'setShowSolutionAnswersOnly',
'solution_signature' => 'setShowSolutionSignature',
'solution_suggested' => 'setShowSolutionSuggested',
);
foreach($setter as $key => $setter) {
if (in_array($key, $options)) {
$this->$setter(1);
}
else {
$this->$setter(0);
}
}
}
ilObjTest::setScoreCutting (   $a_score_cutting = SCORE_CUT_QUESTION)

Sets the type of score cutting.

Parameters
integer$a_score_cuttingThe type of score cutting. 0 for cut questions, 1 for cut tests public
See Also
$score_cutting

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->score_cutting = $a_score_cutting;
}

+ Here is the caller graph for this function:

ilObjTest::setScoreReporting (   $score_reporting = 0)

Sets the score reporting of the ilObjTest object.

Parameters
integer$score_reportingThe score reporting public
See Also
$score_reporting

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

References $score_reporting.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->score_reporting = $score_reporting;
}

+ Here is the caller graph for this function:

ilObjTest::setScoringFeedbackOptionsByArray (   $options)

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

References $options, setAnswerFeedbackPoints(), setGenericAnswerFeedback(), setInstantFeedbackSolution(), and setSpecificAnswerFeedback().

{
if (is_array($options))
{
$this->setGenericAnswerFeedback( in_array('instant_feedback_generic', $options) ? 1 : 0);
$this->setSpecificAnswerFeedback( in_array('instant_feedback_specific', $options) ? 1 : 0);
$this->setAnswerFeedbackPoints( in_array('instant_feedback_points', $options) ? 1 : 0);
$this->setInstantFeedbackSolution( in_array('instant_feedback_solution', $options) ? 1 : 0);
} else {
}
}

+ Here is the call graph for this function:

ilObjTest::setSequenceSettings (   $sequence_settings = 0)

Sets the sequence settings of the ilObjTest object.

Parameters
integer$sequence_settingsThe sequence settings public
See Also
$sequence_settings

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

References $sequence_settings.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->sequence_settings = $sequence_settings;
}

+ Here is the caller graph for this function:

ilObjTest::setShowCancel (   $a_value = 1)

Sets the cancel test button status.

Parameters
integer$a_valueThe value for the cancel test status (0 = don't show, 1 = show) public

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
switch ($a_value)
{
case 1:
$this->show_cancel = 1;
break;
default:
$this->show_cancel = 0;
break;
}
}

+ Here is the caller graph for this function:

ilObjTest::setShowExamIdInTestPassEnabled (   $show_exam_id_in_test_pass_enabled)

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

References $show_exam_id_in_test_pass_enabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->show_exam_id_in_test_pass_enabled = $show_exam_id_in_test_pass_enabled;
}

+ Here is the caller graph for this function:

ilObjTest::setShowExamIdInTestResultsEnabled (   $show_exam_id_in_test_results_enabled)
Parameters
boolean$show_exam_id

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

References $show_exam_id_in_test_results_enabled.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->show_exam_id_in_test_results_enabled = $show_exam_id_in_test_results_enabled;
}

+ Here is the caller graph for this function:

ilObjTest::setShowExamviewHtml (   $show_examview_html)
Parameters
boolean$show_examview_html

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

References $show_examview_html.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->show_examview_html = $show_examview_html;
}

+ Here is the caller graph for this function:

ilObjTest::setShowExamviewPdf (   $show_examview_pdf)
Parameters
boolean$show_examview_pdf

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

References $show_examview_pdf.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->show_examview_pdf = $show_examview_pdf;
}

+ Here is the caller graph for this function:

ilObjTest::setShowFinalStatement (   $show = 0)

Sets whether the final statement should be shown or not.

Parameters
integer$show1 if TRUE or 0 if FALSE public
See Also
$_finalstatement

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_showfinalstatement = ($show) ? 1 : 0;
}

+ Here is the caller graph for this function:

ilObjTest::setShowInfo (   $a_info = 1)

Set whether the complete information page is shown or the required data only.

Parameters
integer$a_info1 for the complete information, 0 otherwise public
See Also
$_showinfo

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->_showinfo = ($a_info) ? 1 : 0;
}

+ Here is the caller graph for this function:

ilObjTest::setShowKioskModeParticipant (   $a_participant = FALSE)

Set to true, if the participant's name should be shown in kiosk mode.

Parameters
boolean$a_titleTRUE if the participant's name should be shown in kiosk mode, FALSE otherwise public

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

References getShowKioskModeParticipant().

{
if ($a_participant)
{
$this->_kiosk = $this->_kiosk | 4;
}
else
{
{
$this->_kiosk = $this->_kiosk ^ 4;
}
}
}

+ Here is the call graph for this function:

ilObjTest::setShowKioskModeTitle (   $a_title = FALSE)

Set to true, if the full test title should be shown in kiosk mode.

Parameters
boolean$a_titleTRUE if the test title should be shown in kiosk mode, FALSE otherwise public

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

References getShowKioskModeTitle().

{
if ($a_title)
{
$this->_kiosk = $this->_kiosk | 2;
}
else
{
if ($this->getShowKioskModeTitle())
{
$this->_kiosk = $this->_kiosk ^ 2;
}
}
}

+ Here is the call graph for this function:

ilObjTest::setShowMarker (   $a_value = 1)

Sets the marker button status.

Parameters
integer$a_valueThe value for the marker status (0 = don't show, 1 = show) public

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

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
switch ($a_value)
{
case 1:
$this->show_marker = 1;
break;
default:
$this->show_marker = 0;
break;
}
}

+ Here is the caller graph for this function:

ilObjTest::setShowPassDetails (   $a_details = 1)

Sets if the pass details should be shown when a test is not finished.

Sets if the pass details should be shown when a test is not finished

Parameters
boolean$a_detailsTRUE if the pass details should be shown, FALSE otherwise public

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

References getShowPassDetails().

Referenced by __construct().

{
if ($a_details)
{
$this->results_presentation = $this->results_presentation | 1;
}
else
{
if ($this->getShowPassDetails())
{
$this->results_presentation = $this->results_presentation ^ 1;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::setShowSolutionAnswersOnly (   $a_full = TRUE)

Set to true, if the full solution (including the ILIAS content pages) should be shown in the solution output.

Parameters
boolean$a_fullTRUE if the full solution should be shown in the solution output, FALSE otherwise public

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

References getShowSolutionAnswersOnly().

Referenced by __construct().

{
if ($a_full)
{
$this->results_presentation = $this->results_presentation | 16;
}
else
{
{
$this->results_presentation = $this->results_presentation ^ 16;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::setShowSolutionDetails (   $a_details = 1)

Sets if the the solution details should be presented to the user or not.

Parameters
integer$a_details1 if the solution details should be presented, 0 otherwise public

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

References getShowSolutionDetails().

Referenced by __construct().

{
if ($a_details)
{
$this->results_presentation = $this->results_presentation | 2;
}
else
{
if ($this->getShowSolutionDetails())
{
$this->results_presentation = $this->results_presentation ^ 2;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::setShowSolutionFeedback (   $a_feedback = TRUE)

Sets if the the feedback should be presented to the user in the solution or not.

Parameters
boolean$a_feedbackTRUE if the feedback should be presented in the solution, FALSE otherwise public

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

References getShowSolutionFeedback().

{
if ($a_feedback)
{
$this->results_presentation = $this->results_presentation | 8;
}
else
{
{
$this->results_presentation = $this->results_presentation ^ 8;
}
}
}

+ Here is the call graph for this function:

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

References getShowSolutionListComparison().

{
if($a_comparison)
{
$this->results_presentation = $this->results_presentation | 128;
}
else
{
{
$this->results_presentation = $this->results_presentation ^ 128;
}
}
}

+ Here is the call graph for this function:

ilObjTest::setShowSolutionPrintview (   $a_printview = 1)

Sets if the the solution printview should be presented to the user or not.

Parameters
boolean$a_detailsTRUE if the solution printview should be presented, FALSE otherwise public

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

References getShowSolutionPrintview().

Referenced by fromXML().

{
if ($a_printview)
{
$this->results_presentation = $this->results_presentation | 4;
}
else
{
{
$this->results_presentation = $this->results_presentation ^ 4;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::setShowSolutionSignature (   $a_signature = FALSE)

Set to TRUE, if the signature field should be shown in the solution.

Parameters
boolean$a_signatureTRUE if the signature field should be shown, FALSE otherwise public

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

References getShowSolutionSignature().

Referenced by __construct().

{
if ($a_signature)
{
$this->results_presentation = $this->results_presentation | 32;
}
else
{
{
$this->results_presentation = $this->results_presentation ^ 32;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::setShowSolutionSuggested (   $a_solution = FALSE)

Set to TRUE, if the suggested solution should be shown in the solution.

Parameters
boolean$a_solutionTRUE if the suggested solution should be shown, FALSE otherwise public

Definition at line 8847 of file class.ilObjTest.php.

References getShowSolutionSuggested().

{
if ($a_solution)
{
$this->results_presentation = $this->results_presentation | 64;
}
else
{
{
$this->results_presentation = $this->results_presentation ^ 64;
}
}
}

+ Here is the call graph for this function:

ilObjTest::setShuffleQuestions (   $a_shuffle)

Sets the status of the shuffle_questions variable.

Parameters
boolean$a_shuffle0 if the test questions are not shuffled, 1 if the test questions are shuffled public

Definition at line 8348 of file class.ilObjTest.php.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->shuffle_questions = ($a_shuffle) ? 1 : 0;
}

+ Here is the caller graph for this function:

ilObjTest::setSignSubmission (   $sign_submission)
Parameters
boolean$sign_submission

Definition at line 11428 of file class.ilObjTest.php.

References $sign_submission.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->sign_submission = $sign_submission;
}

+ Here is the caller graph for this function:

ilObjTest::setSpecificAnswerFeedback (   $specific_answer_feedback)

Definition at line 10972 of file class.ilObjTest.php.

Referenced by applyDefaults(), fromXML(), loadFromDb(), and setScoringFeedbackOptionsByArray().

{
switch ($specific_answer_feedback)
{
case 1:
$this->specific_answer_feedback = 1;
break;
default:
$this->specific_answer_feedback = 0;
break;
}
}

+ Here is the caller graph for this function:

ilObjTest::setStartingTime (   $starting_time = NULL)

Sets the starting time in database timestamp format for the test.

Parameters
string$starting_timeThe starting time for the test. Empty string for no starting time. public
See Also
$starting_time

Definition at line 3134 of file class.ilObjTest.php.

References $starting_time.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
$this->starting_time = $starting_time;
}

+ Here is the caller graph for this function:

ilObjTest::setTemplate (   $template_id)

Definition at line 10459 of file class.ilObjTest.php.

References $template_id.

Referenced by loadFromDb().

{
$this->template_id = (int)$template_id;
}

+ Here is the caller graph for this function:

ilObjTest::setTestFinalBroken (   $testFinalBroken)
Parameters
boolean$testFinalBroken

Definition at line 11632 of file class.ilObjTest.php.

References $testFinalBroken.

Referenced by loadFromDb().

{
$this->testFinalBroken = $testFinalBroken;
}

+ Here is the caller graph for this function:

ilObjTest::setTestId (   $a_id)

Sets the test ID.

Parameters
integer$a_idTest ID

Definition at line 9910 of file class.ilObjTest.php.

Referenced by loadFromDb().

{
$this->test_id = $a_id;
}

+ Here is the caller graph for this function:

ilObjTest::setTitleOutput (   $title_output = 0)

Sets the status of the title output.

Parameters
integer$title_output0 for full title, 1 for title without points, 2 for no title public
See Also
$title_output

Definition at line 3064 of file class.ilObjTest.php.

References $title_output.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
switch ($title_output)
{
case 1:
$this->title_output = 1;
break;
case 2:
$this->title_output = 2;
break;
default:
$this->title_output = 0;
break;
}
}

+ Here is the caller graph for this function:

ilObjTest::setUsePreviousAnswers (   $use_previous_answers = 1)

Sets the status of the visibility of previous learner answers.

Parameters
integer$use_previous_answers1 if the previous answers should be shown public
See Also
$use_previous_answers

Definition at line 3028 of file class.ilObjTest.php.

References $use_previous_answers.

Referenced by applyDefaults(), fromXML(), and loadFromDb().

{
{
$this->use_previous_answers = 1;
}
else
{
$this->use_previous_answers = 0;
}
}

+ Here is the caller graph for this function:

ilObjTest::startingTimeReached ( )

Returns true if the starting time of a test is reached A starting time is not available for self assessment tests.

Returns
boolean true if the starting time is reached, otherwise false public

Definition at line 5497 of file class.ilObjTest.php.

References getStartingTime().

Referenced by isExecutable().

{
if ($this->getStartingTime())
{
if (preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getStartingTime(), $matches))
{
$epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
$now = mktime();
if ($now < $epoch_time)
{
// starting time not reached
return false;
}
}
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTest::startWorkingTime (   $active_id,
  $pass 
)

Write the initial entry for the tests working time to the database.

Parameters
integer$user_idThe database id of the user working with the test public

Definition at line 3832 of file class.ilObjTest.php.

References $pass.

{
global $ilDB;
$next_id = $ilDB->nextId('tst_times');
$affectedRows = $ilDB->manipulateF("INSERT INTO tst_times (times_id, active_fi, started, finished, pass, tstamp) VALUES (%s, %s, %s, %s, %s, %s)",
array('integer', 'integer', 'timestamp', 'timestamp', 'integer', 'integer'),
array($next_id, $active_id, strftime("%Y-%m-%d %H:%M:%S"), strftime("%Y-%m-%d %H:%M:%S"), $pass, time())
);
return $next_id;
}
ilObjTest::toXML ( )

Returns a QTI xml representation of the test.

Returns
string The QTI xml representation of the test

Definition at line 6025 of file class.ilObjTest.php.

References _instanciateQuestion(), addQTIMaterial(), areObligationsEnabled(), getActivationEndingTime(), getActivationStartingTime(), getActivationVisibility(), getAllowedUsers(), getAllowedUsersTimeGap(), getAnonymity(), getAnswerFeedback(), getAnswerFeedbackPoints(), getAuthor(), getAutosave(), getAutosaveIval(), getCharSelectorAvailability(), getCharSelectorDefinition(), getCountSystem(), getCustomStyle(), ilObject\getDescription(), getEnableArchiving(), getEnableExamview(), getEnableProcessingTime(), getEndingTime(), getExportSettings(), getFinalStatement(), getFixedParticipants(), getForceJS(), getHighscoreAchievedTS(), getHighscoreAnon(), getHighscoreEnabled(), getHighscoreHints(), getHighscoreOwnTable(), getHighscorePercentage(), getHighscoreScore(), getHighscoreTopNum(), getHighscoreTopTable(), getHighscoreWTime(), getInstantFeedbackSolution(), getIntroduction(), getKiosk(), getListOfQuestionsSettings(), getMailNotification(), getMailNotificationType(), getMCScoring(), getNrOfTries(), getPassScoring(), getPassword(), getProcessingTime(), getQuestionSetType(), getRedirectionMode(), getRedirectionUrl(), getReportingDate(), getResetProcessingTime(), getResultsPresentation(), getScoreCutting(), getScoreReporting(), getSequenceSettings(), getShowCancel(), getShowExamviewHtml(), getShowExamviewPdf(), getShowFinalStatement(), getShowInfo(), getShowMarker(), getShuffleQuestions(), getSignSubmission(), getSpecificAnswerFeedback(), getStartingTime(), ilObject\getTitle(), getTitleOutput(), getUsePreviousAnswers(), isActivationLimited(), isOfferingQuestionHintsEnabled(), isShowExamIdInTestPassEnabled(), isShowExamIdInTestResultsEnabled(), and ilXmlWriter\xmlHeader().

{
include_once("./Services/Xml/classes/class.ilXmlWriter.php");
$a_xml_writer = new ilXmlWriter;
// set xml header
$a_xml_writer->xmlHeader();
$a_xml_writer->xmlSetDtdDef("<!DOCTYPE questestinterop SYSTEM \"ims_qtiasiv1p2p1.dtd\">");
$a_xml_writer->xmlStartTag("questestinterop");
$attrs = array(
"ident" => "il_".IL_INST_ID."_tst_".$this->getTestId(),
"title" => $this->getTitle()
);
$a_xml_writer->xmlStartTag("assessment", $attrs);
// add qti comment
$a_xml_writer->xmlElement("qticomment", NULL, $this->getDescription());
// add qti duration
if ($this->enable_processing_time)
{
preg_match("/(\d+):(\d+):(\d+)/", $this->processing_time, $matches);
$a_xml_writer->xmlElement("duration", NULL, sprintf("P0Y0M0DT%dH%dM%dS", $matches[1], $matches[2], $matches[3]));
}
// add the rest of the preferences in qtimetadata tags, because there is no correspondent definition in QTI
$a_xml_writer->xmlStartTag("qtimetadata");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "ILIAS_VERSION");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->ilias->getSetting("ilias_version"));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// anonymity
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "anonymity");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getAnonymity()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// question set type (fixed, random, dynamic, ...)
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "question_set_type");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getQuestionSetType());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// sequence settings
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "sequence_settings");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getSequenceSettings());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// author
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "author");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getAuthor());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// reset processing time
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "reset_processing_time");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getResetProcessingTime());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// count system
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "count_system");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getCountSystem());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// multiple choice scoring
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "mc_scoring");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getMCScoring());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// multiple choice scoring
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "score_cutting");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getScoreCutting());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// multiple choice scoring
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "password");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getPassword());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// allowed users
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "allowedUsers");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getAllowedUsers());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// allowed users time gap
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "allowedUsersTimeGap");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getAllowedUsersTimeGap());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// pass scoring
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "pass_scoring");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getPassScoring());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// score reporting date
if ($this->getReportingDate())
{
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "reporting_date");
preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->reporting_date, $matches);
$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]));
$a_xml_writer->xmlEndTag("qtimetadatafield");
}
// number of tries
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "nr_of_tries");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getNrOfTries()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// kiosk
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "kiosk");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getKiosk()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
//redirection_mode
$a_xml_writer->xmlStartTag('qtimetadatafield');
$a_xml_writer->xmlElement("fieldlabel", NULL, "redirection_mode");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getRedirectionMode());
$a_xml_writer->xmlEndTag("qtimetadatafield");
//redirection_url
$a_xml_writer->xmlStartTag('qtimetadatafield');
$a_xml_writer->xmlElement("fieldlabel", NULL, "redirection_url");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getRedirectionUrl());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// use previous answers
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "use_previous_answers");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getUsePreviousAnswers());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// hide title points
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "title_output");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getTitleOutput()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// results presentation
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "results_presentation");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getResultsPresentation()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// examid in test pass
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "examid_in_test_pass");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->isShowExamIdInTestPassEnabled()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// examid in kiosk
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "examid_in_test_res");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->isShowExamIdInTestResultsEnabled()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// solution details
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "show_summary");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getListOfQuestionsSettings()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// solution details
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "score_reporting");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getScoreReporting()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// solution details
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "instant_verification");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getInstantFeedbackSolution()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// answer specific feedback
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "answer_feedback");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getAnswerFeedback()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// answer specific feedback of reached points
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "answer_feedback_points");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getAnswerFeedbackPoints()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// highscore
$highscore_metadata = array(
'highscore_enabled' => array('value' => $this->getHighscoreEnabled()),
'highscore_anon' => array('value' => $this->getHighscoreAnon()),
'highscore_achieved_ts' => array('value' => $this->getHighscoreAchievedTS()),
'highscore_score' => array('value' => $this->getHighscoreScore()),
'highscore_percentage' => array('value' => $this->getHighscorePercentage()),
'highscore_hints' => array('value' => $this->getHighscoreHints()),
'highscore_wtime' => array('value' => $this->getHighscoreWTime()),
'highscore_own_table' => array('value' => $this->getHighscoreOwnTable()),
'highscore_top_table' => array('value' => $this->getHighscoreTopTable()),
'highscore_top_num' => array('value' => $this->getHighscoreTopNum()),
);
foreach($highscore_metadata as $label => $data)
{
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, $label);
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $data['value']));
$a_xml_writer->xmlEndTag("qtimetadatafield");
}
// show cancel
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "show_cancel");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getShowCancel()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// show marker
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "show_marker");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getShowMarker()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// fixed participants
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "fixed_participants");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getFixedParticipants()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// show final statement
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "showfinalstatement");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", (($this->getShowFinalStatement()) ? "1" : "0")));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// show introduction only
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "showinfo");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", (($this->getShowInfo()) ? "1" : "0")));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// mail notification
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "mailnotification");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getMailNotification());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// mail notification type
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "mailnottype");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getMailNotificationType());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// export settings
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "exportsettings");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getExportSettings());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// force JavaScript
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "forcejs");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", (($this->getForceJS()) ? "1" : "0")));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// custom style
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "customstyle");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getCustomStyle());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// shuffle questions
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "shuffle_questions");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getShuffleQuestions()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// processing time
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "processing_time");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getProcessingTime());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// enable_examview
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "enable_examview");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getEnableExamview());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// show_examview_html
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "show_examview_html");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getShowExamviewHtml());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// show_examview_pdf
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "show_examview_pdf");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getShowExamviewPdf());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// enable_archiving
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "enable_archiving");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getEnableArchiving());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// sign_submission
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "sign_submission");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getSignSubmission());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// char_selector_availability
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "char_selector_availability");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf("%d", $this->getCharSelectorAvailability()));
$a_xml_writer->xmlEndTag("qtimetadatafield");
// char_selector_definition
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "char_selector_definition");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->getCharSelectorDefinition());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// starting time
if ($this->getStartingTime())
{
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "starting_time");
preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->starting_time, $matches);
$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]));
$a_xml_writer->xmlEndTag("qtimetadatafield");
}
// ending time
if ($this->getEndingTime())
{
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "ending_time");
preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->ending_time, $matches);
$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]));
$a_xml_writer->xmlEndTag("qtimetadatafield");
}
//activation_limited
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "activation_limited");
$a_xml_writer->xmlElement("fieldentry", NULL,(int)$this->isActivationLimited());
$a_xml_writer->xmlEndTag("qtimetadatafield");
//activation_start_time
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "activation_start_time");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getActivationStartingTime());
$a_xml_writer->xmlEndTag("qtimetadatafield");
//activation_end_time
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "activation_end_time");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getActivationEndingTime());
$a_xml_writer->xmlEndTag("qtimetadatafield");
//activation_visibility
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "activation_visibility");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getActivationVisibility());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// autosave
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "autosave");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getAutosave());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// autosave_ival
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "autosave_ival");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getAutosaveIval());
$a_xml_writer->xmlEndTag("qtimetadatafield");
//offer_question_hints
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "offer_question_hints");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->isOfferingQuestionHintsEnabled());
$a_xml_writer->xmlEndTag("qtimetadatafield");
//instant_feedback_specific
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "instant_feedback_specific");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getSpecificAnswerFeedback());
$a_xml_writer->xmlEndTag("qtimetadatafield");
//obligations_enabled
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "obligations_enabled");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->areObligationsEnabled());
$a_xml_writer->xmlEndTag("qtimetadatafield");
//enable_processing_time
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "enable_processing_time");
$a_xml_writer->xmlElement("fieldentry", NULL, (int)$this->getEnableProcessingTime());
$a_xml_writer->xmlEndTag("qtimetadatafield");
foreach ($this->mark_schema->mark_steps as $index => $mark)
{
// mark steps
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "mark_step_$index");
$a_xml_writer->xmlElement("fieldentry", NULL, sprintf(
"<short>%s</short><official>%s</official><percentage>%.2f</percentage><passed>%d</passed>",
$mark->getShortName(), $mark->getOfficialName(), $mark->getMinimumLevel(), $mark->getPassed()
));
$a_xml_writer->xmlEndTag("qtimetadatafield");
}
$a_xml_writer->xmlEndTag("qtimetadata");
// add qti objectives
$a_xml_writer->xmlStartTag("objectives");
$this->addQTIMaterial($a_xml_writer, $this->getIntroduction());
$a_xml_writer->xmlEndTag("objectives");
// add qti assessmentcontrol
if ($this->getInstantFeedbackSolution() == 1)
{
$attrs = array(
"solutionswitch" => "Yes"
);
}
else
{
$attrs = NULL;
}
$a_xml_writer->xmlElement("assessmentcontrol", $attrs, NULL);
if (strlen($this->getFinalStatement()))
{
// add qti presentation_material
$a_xml_writer->xmlStartTag("presentation_material");
$a_xml_writer->xmlStartTag("flow_mat");
$this->addQTIMaterial($a_xml_writer, $this->getFinalStatement());
$a_xml_writer->xmlEndTag("flow_mat");
$a_xml_writer->xmlEndTag("presentation_material");
}
$attrs = array(
"ident" => "1"
);
$a_xml_writer->xmlElement("section", $attrs, NULL);
$a_xml_writer->xmlEndTag("assessment");
$a_xml_writer->xmlEndTag("questestinterop");
$xml = $a_xml_writer->xmlDumpMem(FALSE);
foreach ($this->questions as $question_id)
{
$question =& ilObjTest::_instanciateQuestion($question_id);
$qti_question = $question->toXML(false);
$qti_question = preg_replace("/<questestinterop>/", "", $qti_question);
$qti_question = preg_replace("/<\/questestinterop>/", "", $qti_question);
if (strpos($xml, "</section>") !== false)
{
$xml = str_replace("</section>", "$qti_question</section>", $xml);
}
else
{
$xml = str_replace("<section ident=\"1\"/>", "<section ident=\"1\">\n$qti_question</section>", $xml);
}
}
return $xml;
}

+ Here is the call graph for this function:

ilObjTest::update ( )

update object data

public

Returns
boolean

Reimplemented from ilObject.

Definition at line 638 of file class.ilObjTest.php.

{
if (!parent::update())
{
return false;
}
// put here object specific stuff
return true;
}
ilObjTest::updateWorkingTime (   $times_id)

Update the working time of a test when a question is answered.

Parameters
integer$times_idThe database id of a working time entry public

Definition at line 3850 of file class.ilObjTest.php.

{
global $ilDB;
$affectedRows = $ilDB->manipulateF("UPDATE tst_times SET finished = %s, tstamp = %s WHERE times_id = %s",
array('timestamp', 'integer', 'integer'),
array(strftime("%Y-%m-%d %H:%M:%S"), time(), $times_id)
);
}
ilObjTest::userLookupFullName (   $user_id,
  $overwrite_anonymity = FALSE,
  $sorted_order = FALSE,
  $suffix = "" 
)

Returns the full name of a test user according to the anonymity status.

Parameters
int$user_idThe database ID of the user
boolean$overwrite_anonymityIndicates if the anonymity status should be ignored
Returns
string The full name of the user or UNKNOWN if the anonymity status is affected public

Definition at line 9316 of file class.ilObjTest.php.

References ilObjUser\_lookupName(), and getAnonymity().

Referenced by removeTestResultsByActiveIds(), removeTestResultsForUser(), sendAdvancedNotification(), and sendSimpleNotification().

{
if ($this->getAnonymity() && !$overwrite_anonymity)
{
return $this->lng->txt("unknown") . $suffix;
}
else
{
include_once './Services/User/classes/class.ilObjUser.php';
$uname = ilObjUser::_lookupName($user_id);
if (strlen($uname["firstname"].$uname["lastname"]) == 0) $uname["firstname"] = $this->lng->txt("deleted_user");
if ($sorted_order)
{
return trim($uname["lastname"] . ", " . $uname["firstname"]) . $suffix;
}
else
{
return trim($uname["firstname"] . " " . $uname["lastname"]) . $suffix;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilObjTest::$_customStyle
private

Definition at line 400 of file class.ilObjTest.php.

ilObjTest::$_finalstatement
private

Definition at line 379 of file class.ilObjTest.php.

ilObjTest::$_forcejs
private

Definition at line 393 of file class.ilObjTest.php.

ilObjTest::$_kiosk
protected

Definition at line 50 of file class.ilObjTest.php.

ilObjTest::$_showfinalstatement
private

Definition at line 372 of file class.ilObjTest.php.

ilObjTest::$_showinfo
private

Definition at line 386 of file class.ilObjTest.php.

ilObjTest::$activation_ending_time
protected

Definition at line 442 of file class.ilObjTest.php.

ilObjTest::$activation_starting_time
protected

Definition at line 440 of file class.ilObjTest.php.

ilObjTest::$activation_visibility
protected

Definition at line 438 of file class.ilObjTest.php.

Referenced by getActivationVisibility().

ilObjTest::$allowedUsers

Definition at line 302 of file class.ilObjTest.php.

ilObjTest::$allowedUsersTimeGap

Definition at line 309 of file class.ilObjTest.php.

ilObjTest::$anonymity

Definition at line 323 of file class.ilObjTest.php.

ilObjTest::$answer_feedback

Definition at line 351 of file class.ilObjTest.php.

Referenced by setAnswerFeedback().

ilObjTest::$answer_feedback_points

Definition at line 137 of file class.ilObjTest.php.

Referenced by setAnswerFeedbackPoints().

ilObjTest::$author

Definition at line 72 of file class.ilObjTest.php.

Referenced by _lookupAuthor(), getAuthor(), and setAuthor().

ilObjTest::$autosave
protected

Definition at line 444 of file class.ilObjTest.php.

Referenced by getAutosave(), and setAutosave().

ilObjTest::$autosave_ival
protected

Definition at line 446 of file class.ilObjTest.php.

Referenced by getAutosaveIval(), and setAutosaveIval().

ilObjTest::$certificate_visibility

Definition at line 316 of file class.ilObjTest.php.

ilObjTest::$char_selector_availability
protected

Definition at line 495 of file class.ilObjTest.php.

Referenced by getCharSelectorAvailability().

ilObjTest::$char_selector_definition
protected

Definition at line 498 of file class.ilObjTest.php.

Referenced by getCharSelectorDefinition().

ilObjTest::$count_system

Definition at line 245 of file class.ilObjTest.php.

ilObjTest::$ects_fx

Definition at line 229 of file class.ilObjTest.php.

ilObjTest::$ects_grades

Definition at line 236 of file class.ilObjTest.php.

Referenced by getECTSGrades().

ilObjTest::$ects_output

Definition at line 222 of file class.ilObjTest.php.

Referenced by saveECTSStatus().

ilObjTest::$enable_archiving
protected

Definition at line 473 of file class.ilObjTest.php.

Referenced by getEnableArchiving(), and setEnableArchiving().

ilObjTest::$enable_examview
protected

Definition at line 464 of file class.ilObjTest.php.

Referenced by getEnableExamview(), and setEnableExamview().

ilObjTest::$enable_processing_time

Definition at line 194 of file class.ilObjTest.php.

ilObjTest::$ending_time

Definition at line 215 of file class.ilObjTest.php.

Referenced by setActivationEndingTime(), and setEndingTime().

ilObjTest::$evaluation_data

Definition at line 154 of file class.ilObjTest.php.

ilObjTest::$exportsettings
protected

Definition at line 406 of file class.ilObjTest.php.

Referenced by getExportSettings().

ilObjTest::$fixed_participants

Definition at line 344 of file class.ilObjTest.php.

ilObjTest::$instant_verification

Definition at line 130 of file class.ilObjTest.php.

ilObjTest::$introduction

Definition at line 94 of file class.ilObjTest.php.

Referenced by setIntroduction().

ilObjTest::$invitation = INVITATION_OFF

Definition at line 64 of file class.ilObjTest.php.

ilObjTest::$mailnotification
protected

Definition at line 402 of file class.ilObjTest.php.

Referenced by getMailNotification().

ilObjTest::$mailnottype
protected

Definition at line 404 of file class.ilObjTest.php.

Referenced by getMailNotificationType().

ilObjTest::$mark_schema

Definition at line 101 of file class.ilObjTest.php.

Referenced by getMarkSchema().

ilObjTest::$mc_scoring

Definition at line 252 of file class.ilObjTest.php.

ilObjTest::$metadata

Definition at line 79 of file class.ilObjTest.php.

Referenced by fromXML().

ilObjTest::$nr_of_tries

Definition at line 162 of file class.ilObjTest.php.

Referenced by setNrOfTries().

ilObjTest::$obligationsEnabled = null
private

Definition at line 436 of file class.ilObjTest.php.

Referenced by areObligationsEnabled(), and setObligationsEnabled().

ilObjTest::$offeringQuestionHintsEnabled = null
private
bool ilObjTest::$online = null
private

the object's online status

Definition at line 417 of file class.ilObjTest.php.

Referenced by isOnline().

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 461 of file class.ilObjTest.php.

Referenced by participantDataExist().

ilObjTest::$pass_scoring

Definition at line 259 of file class.ilObjTest.php.

ilObjTest::$passDeletionAllowed = null
private

Definition at line 454 of file class.ilObjTest.php.

Referenced by isPassDeletionAllowed(), and setPassDeletionAllowed().

ilObjTest::$password

Definition at line 295 of file class.ilObjTest.php.

ilObjTest::$poolUsage
protected

Definition at line 408 of file class.ilObjTest.php.

Referenced by getPoolUsage().

ilObjTest::$print_best_solution_with_result = true
protected

Definition at line 422 of file class.ilObjTest.php.

Referenced by isBestSolutionPrintedWithResult().

ilObjTest::$processing_time

Definition at line 187 of file class.ilObjTest.php.

Referenced by isMaxProcessingTimeReached(), and setProcessingTime().

ilObjTest::$questions
ilObjTest::$questionSetType = self::QUESTION_SET_TYPE_FIXED
private
ilObjTest::$redirection_mode = 0
private

Definition at line 478 of file class.ilObjTest.php.

Referenced by getRedirectionMode(), and setRedirectionMode().

ilObjTest::$redirection_url = NULL
private

Definition at line 483 of file class.ilObjTest.php.

Referenced by getRedirectionUrl(), and setRedirectionUrl().

ilObjTest::$reporting_date

Definition at line 147 of file class.ilObjTest.php.

Referenced by setReportingDate().

ilObjTest::$reset_processing_time

Definition at line 201 of file class.ilObjTest.php.

ilObjTest::$results_presentation

Definition at line 274 of file class.ilObjTest.php.

ilObjTest::$score_cutting

Definition at line 288 of file class.ilObjTest.php.

ilObjTest::$score_reporting

Definition at line 121 of file class.ilObjTest.php.

Referenced by setScoreReporting().

ilObjTest::$sequence_settings

Definition at line 110 of file class.ilObjTest.php.

Referenced by setSequenceSettings().

ilObjTest::$show_cancel

Definition at line 330 of file class.ilObjTest.php.

ilObjTest::$show_exam_id_in_test_pass_enabled
protected
ilObjTest::$show_exam_id_in_test_results_enabled
protected
ilObjTest::$show_examview_html
protected

Definition at line 467 of file class.ilObjTest.php.

Referenced by getShowExamviewHtml(), and setShowExamviewHtml().

ilObjTest::$show_examview_pdf
protected

Definition at line 470 of file class.ilObjTest.php.

Referenced by getShowExamviewPdf(), and setShowExamviewPdf().

ilObjTest::$show_marker

Definition at line 337 of file class.ilObjTest.php.

ilObjTest::$show_summary

Definition at line 281 of file class.ilObjTest.php.

ilObjTest::$shuffle_questions

Definition at line 267 of file class.ilObjTest.php.

ilObjTest::$sign_submission
protected

Definition at line 492 of file class.ilObjTest.php.

Referenced by getSignSubmission(), and setSignSubmission().

ilObjTest::$template_id
private

Definition at line 410 of file class.ilObjTest.php.

Referenced by getTemplate(), and setTemplate().

ilObjTest::$testFinalBroken
protected

Definition at line 503 of file class.ilObjTest.php.

Referenced by isTestFinalBroken(), and setTestFinalBroken().

ilObjTest::$testSequence
ilObjTest::$title_output

Definition at line 180 of file class.ilObjTest.php.

Referenced by setTitleOutput().

ilObjTest::$use_previous_answers

Definition at line 170 of file class.ilObjTest.php.

Referenced by _getUsePreviousAnswers(), and setUsePreviousAnswers().


The documentation for this class was generated from the following file: