ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLPStatusTestPassed Class Reference
+ Inheritance diagram for ilLPStatusTestPassed:
+ Collaboration diagram for ilLPStatusTestPassed:

Public Member Functions

 ilLPStatusTestPassed ($a_obj_id)
 _getInProgress ($a_obj_id)
 _getCompleted ($a_obj_id)
 _getFailed ($a_obj_id)
 _getStatusInfo ($a_obj_id)
 determineStatus ($a_obj_id, $a_user_id, $a_obj=null)
 Determine status.
 determinePercentage ($a_obj_id, $a_user_id, $a_obj=null)
 Determine percentage.
- Public Member Functions inherited from ilLPStatus
 ilLPStatus ($a_obj_id)
 _getCountNotAttempted ($a_obj_id)
 _getNotAttempted ($a_obj_id)
 _getCountInProgress ($a_obj_id)
 _getCountCompleted ($a_obj_id)
 _getCountFailed ()
 _getTypicalLearningTime ($a_obj_id)
 _updateStatus ($a_obj_id, $a_usr_id, $a_obj=null)
 New status handling (st: status, nr: accesses, p: percentage, t: time spent, m: mark)
 refreshStatus ($a_obj_id, $a_users=null)
 Refresh status.
 _lookupStatus ($a_obj_id, $a_user_id)
 Lookup status.
 _lookupStatusChanged ($a_obj_id, $a_user_id)
 Lookup status changed.

Additional Inherited Members

- Static Public Member Functions inherited from ilLPStatus
static checkStatusForObject ($a_obj_id, $a_users=false)
 This function checks whether the status for a given number of users is dirty and must be recalculated.
static writeStatus ($a_obj_id, $a_user_id, $a_status, $a_percentage=false, $a_force_per=false)
 Write status for user and object.
static setInProgressIfNotAttempted ($a_obj_id, $a_user_id)
 This function shoudl be clalled for normal "read events".
static setAllDirty ()
 Sets all status to dirty.
static setDirty ($a_obj_id)
 Sets status of an object to dirty.
- Data Fields inherited from ilLPStatus
 $obj_id = null
 $db = null

Detailed Description

Definition at line 35 of file class.ilLPStatusTestPassed.php.

Member Function Documentation

ilLPStatusTestPassed::_getCompleted (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 72 of file class.ilLPStatusTestPassed.php.

References $ilBench, $ilDB, and _getStatusInfo().

{
global $ilDB;
global $ilBench;
$ilBench->start('LearningProgress','9183_LPStatusTestPassed_completed');
include_once './Modules/Test/classes/class.ilObjTestAccess.php';
include_once './Services/Tracking/classes/class.ilTestResultCache.php';
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
foreach($status_info['results'] as $user_data)
{
if($user_data['passed'])
{
$user_ids[] = $user_data['user_id'];
}
}
$ilBench->stop('LearningProgress','9183_LPStatusTestPassed_completed');
return $user_ids ? $user_ids : array();
}

+ Here is the call graph for this function:

ilLPStatusTestPassed::_getFailed (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 94 of file class.ilLPStatusTestPassed.php.

References _getStatusInfo().

{
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
foreach($status_info['results'] as $user_data)
{
if($user_data['failed'])
{
$user_ids[] = $user_data['user_id'];
}
}
return $user_ids ? $user_ids : array();
}

+ Here is the call graph for this function:

ilLPStatusTestPassed::_getInProgress (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 46 of file class.ilLPStatusTestPassed.php.

References $ilBench, $ilDB, $query, $res, $row, ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getFailed(), and DB_FETCHMODE_OBJECT.

{
global $ilDB;
global $ilBench;
$ilBench->start('LearningProgress','9182_LPStatusTestPassed_inProgress');
include_once './Modules/Test/classes/class.ilObjTestAccess.php';
$query = "SELECT DISTINCT(user_fi) FROM tst_active ".
"WHERE test_fi = '".ilObjTestAccess::_getTestIDFromObjectID($a_obj_id)."'";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$user_ids[] = $row->user_fi;
}
$users = array_diff((array) $user_ids,ilLPStatusWrapper::_getCompleted($a_obj_id));
$users = array_diff((array) $users,ilLPStatusWrapper::_getFailed($a_obj_id));
$ilBench->stop('LearningProgress','9182_LPStatusTestPassed_inProgress');
return $users ? $users : array();
}

+ Here is the call graph for this function:

ilLPStatusTestPassed::_getStatusInfo (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 107 of file class.ilLPStatusTestPassed.php.

References ilObjTestAccess\_getPassedUsers().

Referenced by _getCompleted(), and _getFailed().

{
include_once './Modules/Test/classes/class.ilObjTestAccess.php';
$status_info['results'] = ilObjTestAccess::_getPassedUsers($a_obj_id);
return $status_info;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPStatusTestPassed::determinePercentage (   $a_obj_id,
  $a_user_id,
  $a_obj = null 
)

Determine percentage.

Parameters
integerobject id
integeruser id
objectobject (optional depends on object type)
Returns
integer percentage

Reimplemented from ilLPStatus.

Definition at line 183 of file class.ilLPStatusTestPassed.php.

References $ilDB.

{
global $ilDB;
$set = $ilDB->query("SELECT tst_result_cache.*, tst_active.user_fi FROM ".
"tst_result_cache JOIN tst_active ON (tst_active.active_id = tst_result_cache.active_fi)".
" JOIN tst_tests ON (tst_tests.test_id = tst_active.test_fi) ".
" WHERE tst_tests.obj_fi = ".$ilDB->quote($a_obj_id, "integer").
" AND tst_active.user_fi = ".$ilDB->quote($a_user_id, "integer"));
$per = 0;
if ($rec = $ilDB->fetchAssoc($set))
{
if ($rec["max_points"] > 0)
{
$per = min(100, 100 / $rec["max_points"] * $rec["reached_points"]);
}
else
{
$per = 100;
}
}
return (int) $per;
}
ilLPStatusTestPassed::determineStatus (   $a_obj_id,
  $a_user_id,
  $a_obj = null 
)

Determine status.

Behaviour of "old" 4.0 learning progress:

Setting "Multiple Pass Scoring": Score the last pass

  • Test not started: No entry
  • First question opened: Icon/Text: Failed, Score 0%
  • First question answered (correct, points enough for passing): Icon/Text: Completed, Score 66%
  • No change after successfully finishing the pass. (100%)
  • 2nd Pass, first question opened: Still Completed/Completed
  • First question answered (incorrect, success possible): Icon/Text Failed, Score 33%
  • Second question answered (correct): Icon/Text completed
  • 3rd pass, like 2nd, but two times wrong answer: Icon/Text: Failed

Setting "Multiple Pass Scoring": Score the best pass

  • Test not started: No entry
  • First question opened: Icon/Text: Failed, Score 0%
  • First question answered (correct, points enough for passing): Icon/Text: Completed, Score 66%
  • No change after successfully finishing the pass. (100%)
  • 2nd Pass, first question opened: Still Completed/Completed
  • First question answered (incorrect, success possible): Still Completed/Completed

Due to this behaviour in 4.0 we do not have a "in progress" status. During the test the status is "failed" unless the score is enough to pass the test, which makes the learning progress status "completed".

Parameters
integerobject id
integeruser id
objectobject (optional depends on object type)
Returns
integer status

Reimplemented from ilLPStatus.

Definition at line 146 of file class.ilLPStatusTestPassed.php.

References $ilDB, $ilLog, $res, ilObjTestAccess\_getTestIDFromObjectID(), ilObjTestAccess\_isPassed(), LP_STATUS_COMPLETED_NUM, LP_STATUS_FAILED_NUM, and LP_STATUS_NOT_ATTEMPTED_NUM.

{
global $ilObjDataCache, $ilDB, $ilLog;
include_once './Modules/Test/classes/class.ilObjTestAccess.php';
$res = $ilDB->query("SELECT tries FROM tst_active".
" WHERE user_fi = ".$ilDB->quote($a_user_id, "integer").
" AND test_fi = ".$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id)));
if ($rec = $ilDB->fetchAssoc($res))
{
include_once './Modules/Test/classes/class.ilObjTestAccess.php';
if (ilObjTestAccess::_isPassed($a_user_id, $a_obj_id))
{
}
else
{
}
}
return $status;
}

+ Here is the call graph for this function:

ilLPStatusTestPassed::ilLPStatusTestPassed (   $a_obj_id)

Definition at line 38 of file class.ilLPStatusTestPassed.php.

References $ilDB, and ilLPStatus\ilLPStatus().

{
global $ilDB;
parent::ilLPStatus($a_obj_id);
$this->db =& $ilDB;
}

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: