4include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
5include_once
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
30 $this->user_id = $a_user_id;
31 $this->container_id = $a_course_id;
59 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
62 include_once
'./Modules/Course/classes/class.ilCourseObjective.php';
65 $relevant_objective_ids = array();
66 if(!$this->
getSettings()->hasSeparateInitialTests())
68 if($a_tst_ref_id == $this->
getSettings()->getInitialTest())
70 $relevant_objective_ids = $objective_ids;
73 elseif(!$this->
getSettings()->hasSeparateQualifiedTests())
75 if($a_tst_ref_id == $this->
getSettings()->getQualifiedTest())
77 $relevant_objective_ids = $objective_ids;
81 foreach((array) $objective_ids as $objective_id)
84 if($assigned_itest == $a_tst_ref_id)
86 $relevant_objective_ids[] = $objective_id;
89 if($assigned_qtest == $a_tst_ref_id)
91 $relevant_objective_ids[] = $objective_id;
95 $relevant_objective_ids = array_unique($relevant_objective_ids);
97 if(count($relevant_objective_ids) <= 1)
99 return $relevant_objective_ids;
103 $test_type =
$assignments->getTypeByTest($a_tst_ref_id);
105 $passed_objectives = array();
106 include_once
'./Modules/Course/classes/Objectives/class.ilLOUserResults.php';
109 $passed =
$results->getCompletedObjectiveIds();
110 $GLOBALS[
'ilLog']->write(__METHOD__.
': Passed objectives are '.print_r($passed,TRUE).
' test_type = '.$test_type);
114 if(count($passed) >= count($relevant_objective_ids))
116 return $relevant_objective_ids;
120 foreach($relevant_objective_ids as $objective_id)
122 if(!in_array($objective_id, $passed))
124 $unpassed[] = $objective_id;
143 $GLOBALS[
'ilLog']->write(__METHOD__.
': Notify test start ' . print_r($relevant_objectives,TRUE));
146 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestRun.php';
153 foreach((array) $relevant_objectives as $oid)
155 $GLOBALS[
'ilLog']->write(__METHOD__.
': Adding new run for objective with id '.$oid);
202 $testType = $this->assignments->getTypeByTest($this->
getTestRefId());
234 $definitionId = $a_test_sequence->getResponsibleSourcePoolDefinitionId($questionId);
242 if( count($objectiveIds) )
251 include_once
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
257 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
267 return $assignment->getObjectiveId();
309 $is_qualified_run =
false;
312 $is_qualified_run =
true;
315 foreach($this->run as $run)
317 include_once
'./Modules/Course/classes/Objectives/class.ilLOUserResults.php';
318 include_once
'./Modules/Course/classes/Objectives/class.ilLOUtils.php';
323 $run->getObjectiveId(),
324 $this->getAssignments()->getTypeByTest($session->
getRefId())
327 include_once
'./Modules/Course/classes/Objectives/class.ilLOUtils.php';
331 $run->getObjectiveId(),
341 $GLOBALS[
'ilLog']->write(__METHOD__.
': check for qualified...');
342 if(!$is_qualified_run)
344 $GLOBALS[
'ilLog']->write(__METHOD__.
': and increase attempts');
345 ++$old_result[
'tries'];
347 $old_result[
'is_final'] = ($old_result[
'tries'] >= $max_attempts);
351 $ur->saveObjectiveResult(
352 $run->getObjectiveId(),
353 $this->getAssignments()->getTypeByTest($session->
getRefId()),
354 $old_result[
'status'],
355 $old_result[
'result_perc'],
357 $old_result[
'tries'],
358 $old_result[
'is_final']
372 $GLOBALS[
'ilLog']->write(__METHOD__.
': is initial');
376 if($session->
getRefId() != $this->getSettings()->getQualifiedTest())
378 $GLOBALS[
'ilLog']->write(__METHOD__.
': is not qualified');
381 include_once
'./Services/Container/classes/class.ilContainerStartObjects.php';
384 $GLOBALS[
'ilLog']->write(__METHOD__.
': no start object');
390 $container_ref_id = end($container_ref_ids);
396 if($start->isFullfilled($this->getUserId(),$session->
getRefId()))
398 $GLOBALS[
'ilLog']->write(__METHOD__.
': is fullfilled');
402 $GLOBALS[
'ilLog']->write(__METHOD__.
': is not fullfilled');
413 foreach($this->run as $run)
415 if($run->questionExists($qst->
getId()))
418 $run->setQuestionResult(
424 $res = $run->getResult();
426 include_once
'./Modules/Course/classes/Objectives/class.ilLOUserResults.php';
427 include_once
'./Modules/Course/classes/Objectives/class.ilLOUtils.php';
432 $run->getObjectiveId(),
433 $this->getAssignments()->getTypeByTest($session->
getRefId())
437 $ur->saveObjectiveResult(
438 $run->getObjectiveId(),
439 $this->getAssignments()->getTypeByTest($session->
getRefId()),
443 $run->getObjectiveId(),
444 $res[
'max'],
$res[
'reached'],$old_result[
'limit_perc']) ?
447 (
int)
$res[
'percentage'],
448 $old_result[
'limit_perc'],
449 $old_result[
'tries'],
450 $old_result[
'is_final']
452 $GLOBALS[
'ilLog']->write(__METHOD__.
': '.print_r($run->getResult(),
true));
453 $GLOBALS[
'ilLog']->write(__METHOD__.
'!!!!!!!!!!!!!!!!!!!!: '.print_r($comp,TRUE));
455 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
498 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestRun.php';
511 foreach ($this->run as $tst_run)
522 $GLOBALS[
'ilLog']->write(__METHOD__.
': separate run');
527 $GLOBALS[
'ilLog']->write(__METHOD__.
': fixed run');
532 $GLOBALS[
'ilLog']->write(__METHOD__.
': random run');
545 foreach($this->run as $tst_run)
547 $tst_run->clearQuestions();
551 $tst_run->addQuestion($qst_id);
552 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
555 $tst_run->setMaxPoints($points);
562 foreach ($this->run as $tst_run)
564 $tst_run->clearQuestions();
565 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
568 $tst_run->getObjectiveId()
573 $tst_run->addQuestion($id);
576 $tst_run->setMaxPoints($points);
582 include_once
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
583 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
585 foreach($this->run as $tst_run)
588 $tst_run->clearQuestions();
591 $tst_run->getObjectiveId(),
592 ($this->getSettings()->getQualifiedTest() == $session->
getRefId() ?
596 $stored_sequence_id = $rnd->getQplSequence();
602 $tst_run->addQuestion($qst);
606 $tst_run->setMaxPoints($points);
612 foreach($this->run as $run)
614 if($run->questionExists($a_qid))
627 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
629 $questionList->setParentObjId($testObjId);
632 $questionList->setQuestionIdsFilter($questionIds);
634 $questionList->load();
636 return $questionList->getQuestionDataArray();
646 $adapter->setTestRefId($a_test_session->
getRefId());
647 $adapter->initTestRun($a_test_session);
Abstract basic class which is to be extended by the concrete assessment question type classes.
getId()
Gets the id of the assQuestion object.
getReachedPoints($active_id, $pass=NULL)
Returns the points, a learner has reached answering the question This is the fast way to get the poin...
const QUESTION_INSTANCE_TYPE_DUPLICATES
static isStartObject($a_container_id, $a_item_ref_id)
Check if object is start object @global type $ilDB.
static lookupObjectivesOfQuestion($a_qid)
Lookup objective for test question @global type $ilDB.
static lookupQuestionsByObjective($a_test_id, $a_objective)
static _lookupMaximumPointsOfQuestion($a_question_id)
lookup maximimum point
static _getObjectiveIds($course_id, $a_activated_only=false)
static lookupObjectiveIdsBySequence($a_container_id, $a_seq_id)
Lookup objective id by sequence.
const TYPE_TEST_QUALIFIED
const HIDE_PASSED_OBJECTIVE_QST
const MARK_PASSED_OBJECTIVE_QST
static getInstanceByObjId($a_obj_id)
get singleton instance
static getInstance($a_container_id)
Get instance by container id.
setQuestionsOptional(ilTestSequence $seq)
set questions optional
isQualifiedStartRun(ilTestSession $session)
Check if current run is a start object run.
buildQuestionRelatedObjectiveListByQuestions(ilTestQuestionSequence $a_test_sequence, ilTestQuestionRelatedObjectivesList $a_objectives_list)
buildQuestionRelatedObjectiveListByTest(ilTestQuestionSequence $a_test_sequence, ilTestQuestionRelatedObjectivesList $a_objectives_list)
getRelatedObjectivesForSeparatedTest($testRefId)
prepareTestPass(ilTestSession $a_test_session, ilTestSequence $a_test_sequence)
Called from learning objective test.
lookupObjectiveIdByFixedQuestionId($a_question_id)
buildQuestionRelatedObjectiveList(ilTestQuestionSequence $a_test_sequence, ilTestQuestionRelatedObjectivesList $a_objectives_list)
notifyTestStart(ilTestSession $a_test_session, $a_test_obj_id)
Called from learning objective test on actual test start.
hideQuestions(ilTestSequence $seq)
Hide questions.
initTestRun(ilTestSession $session)
updateQuestions(ilTestSession $session, ilTestSequence $seq)
updateQuestionResult(ilTestSession $session, assQuestion $qst)
update question result of run
storeTestRun()
Store test run in DB.
updateSeparateTestQuestions(ilTestSession $session, ilTestSequence $seq)
Update questions for separate tests.
updateRandomQuestions(ilTestSession $session, ilTestSequenceRandomQuestionSet $seq)
lookupRelevantObjectiveIdsForTest($a_container_id, $a_tst_ref_id, $a_user_id)
Lookup all relevant objective ids for a specific test.
lookupObjectiveIdByRandomQuestionSelectionDefinitionId($a_id)
initUserResult(ilTestSession $session)
init user result
static getInstance(ilTestSession $a_test_session)
__construct($a_user_id, $a_course_id)
static getQuestionData($testObjId, $questionIds)
updateFixedQuestions(ilTestSession $session, ilTestSequence $seq)
getSettings()
Get loc settings.
Stores current objective, questions and max points.
static deleteRun($a_container_id, $a_user_id, $a_test_id)
static getRun($a_container_id, $a_user_id, $a_test_id)
static lookupResult($a_course_obj_id, $a_user_id, $a_objective_id, $a_tst_type)
Lookup user result.
static lookupObjectiveRequiredPercentage($a_container_id, $a_objective_id, $a_test_ref_id, $a_max_points)
static isCompleted($a_cont_oid, $a_test_rid, $a_objective_id, $max_points, $reached, $limit_perc)
Check if objective is completed.
static lookupMaxAttempts($a_container_id, $a_objective_id)
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
static _lookupObjId($a_id)
static _getAllReferences($a_id)
get all reference ids of object
getResponsibleSourcePoolDefinitionId($questionId)
hideQuestion($question_id)
saveToDb()
Saves the sequence data for a given pass to the database.
setQuestionOptional($questionId)
getObjectiveOrientedContainerId()
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.