ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestEvaluationData Class Reference
+ Collaboration diagram for ilTestEvaluationData:

Public Member Functions

 __sleep ()
 ilTestEvaluationData ($test="")
 Constructor.
 generateOverview ()
 getTest ()
 setTest ($test)
 setDatasets ($datasets)
 getDatasets ()
 addQuestionTitle ($question_id, $question_title)
 getQuestionTitles ()
 getQuestionTitle ($question_id)
 calculateStatistics ()
 getParticipants ()
 resetFilter ()
 setFilter ($by, $text)
 addParticipant ($active_id, $participant)
getParticipant ($active_id)
 participantExists ($active_id)
 removeParticipant ($active_id)
getStatistics ()
 getParticipantIds ()

Data Fields

 $questionTitles
 $participants
 $statistics
 $filterby
 $filtertext
 $datasets

Private Member Functions

 getMembershipByType ($a_usr_id, $a_type)

Private Attributes

 $test

Detailed Description

Definition at line 34 of file class.ilTestEvaluationData.php.

Member Function Documentation

ilTestEvaluationData::__sleep ( )

Definition at line 84 of file class.ilTestEvaluationData.php.

{
return array('questionTitles', 'participants', 'statistics', 'filterby', 'filtertext', 'datasets', 'test');
}
ilTestEvaluationData::addParticipant (   $active_id,
  $participant 
)

Definition at line 309 of file class.ilTestEvaluationData.php.

Referenced by generateOverview().

{
$this->participants[$active_id] = $participant;
}

+ Here is the caller graph for this function:

ilTestEvaluationData::addQuestionTitle (   $question_id,
  $question_title 
)

Definition at line 179 of file class.ilTestEvaluationData.php.

{
$this->questionTitles[$question_id] = $question_title;
}
ilTestEvaluationData::calculateStatistics ( )

Definition at line 201 of file class.ilTestEvaluationData.php.

{
include_once "./Modules/Test/classes/class.ilTestStatistics.php";
$this->statistics = new ilTestStatistics($this);
}
ilTestEvaluationData::generateOverview ( )

Definition at line 105 of file class.ilTestEvaluationData.php.

References $data, $ilLog, $pass, $result, ilObjTest\_getQuestionCountAndPointsForPassOfParticipant(), addParticipant(), DB_FETCHMODE_ASSOC, getParticipant(), getTest(), and participantExists().

Referenced by ilTestEvaluationData().

{
$this->participants = array();
global $ilDB;
global $ilLog;
include_once "./Modules/Test/classes/class.ilTestEvaluationPassData.php";
include_once "./Modules/Test/classes/class.ilTestEvaluationUserData.php";
$query = sprintf("SELECT usr_data.usr_id, usr_data.firstname, usr_data.lastname, usr_data.title, usr_data.login, " .
"tst_test_pass_result.* FROM tst_test_pass_result, tst_active " .
"LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id " .
"WHERE tst_active.active_id = tst_test_pass_result.active_fi " .
"AND tst_active.test_fi = %s " .
"ORDER BY usr_data.lastname, usr_data.firstname, active_id, pass, TIMESTAMP",
$ilDB->quote($this->getTest()->getTestId() . "")
);
$ilLog->write($query);
$result = $ilDB->query($query);
$pass = NULL;
$checked = array();
$thissets = 0;
while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC))
{
$thissets++;
$remove = FALSE;
if (!$this->participantExists($row["active_fi"]))
{
$this->addParticipant($row["active_fi"], new ilTestEvaluationUserData($this->getTest()->getPassScoring()));
$this->getParticipant($row["active_fi"])->setName($this->getTest()->buildName($row["usr_id"], $row["firstname"], $row["lastname"], $row["title"]));
$this->getParticipant($row["active_fi"])->setLogin($row["login"]);
$this->getParticipant($row["active_fi"])->setUserID($row["usr_id"]);
}
if (!is_object($this->getParticipant($row["active_fi"])->getPass($row["pass"])))
{
$pass->setPass($row["pass"]);
$this->getParticipant($row["active_fi"])->addPass($row["pass"], $pass);
}
$this->getParticipant($row["active_fi"])->getPass($row["pass"])->setReachedPoints($row["points"]);
if ($row["questioncount"] == 0)
{
$this->getParticipant($row["active_fi"])->getPass($row["pass"])->setMaxPoints($data['points']);
$this->getParticipant($row["active_fi"])->getPass($row["pass"])->setQuestionCount($data['count']);
}
else
{
$this->getParticipant($row["active_fi"])->getPass($row["pass"])->setMaxPoints($row["maxpoints"]);
$this->getParticipant($row["active_fi"])->getPass($row["pass"])->setQuestionCount($row["questioncount"]);
}
$this->getParticipant($row["active_fi"])->getPass($row["pass"])->setNrOfAnsweredQuestions($row["answeredquestions"]);
$this->getParticipant($row["active_fi"])->getPass($row["pass"])->setWorkingTime($row["workingtime"]);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestEvaluationData::getDatasets ( )

Definition at line 174 of file class.ilTestEvaluationData.php.

References $datasets.

{
}
ilTestEvaluationData::getMembershipByType (   $a_usr_id,
  $a_type 
)
private

Definition at line 207 of file class.ilTestEvaluationData.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by getParticipants().

{
global $ilDB;
$query = "SELECT DISTINCT obd.obj_id,obr.ref_id FROM rbac_ua AS ua ".
"JOIN rbac_fa AS fa ON ua.rol_id = fa.rol_id ".
"JOIN tree AS t1 ON t1.child = fa.parent ".
"JOIN object_reference AS obr ON t1.parent = obr.ref_id ".
"JOIN object_data AS obd ON obr.obj_id = obd.obj_id ".
"WHERE obd.type = ".$ilDB->quote($a_type)." ".
"AND fa.assign = 'y' ".
"AND ua.usr_id = ".$ilDB->quote($a_usr_id)." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$ref_ids[] = $row->obj_id;
}
return $ref_ids ? $ref_ids : array();
}

+ Here is the caller graph for this function:

& ilTestEvaluationData::getParticipant (   $active_id)

Definition at line 314 of file class.ilTestEvaluationData.php.

Referenced by generateOverview().

{
return $this->participants[$active_id];
}

+ Here is the caller graph for this function:

ilTestEvaluationData::getParticipantIds ( )

Definition at line 334 of file class.ilTestEvaluationData.php.

{
return array_keys($this->participants);
}
ilTestEvaluationData::getParticipants ( )

Definition at line 229 of file class.ilTestEvaluationData.php.

References $participants, $result, DB_FETCHMODE_ASSOC, and getMembershipByType().

{
if (strlen($this->filterby) && strlen($this->filtertext))
{
$filteredParticipants = array();
$courseids = array();
$groupids = array();
global $ilDB;
switch ($this->filterby)
{
case "group":
$query = sprintf("SELECT obj_id FROM object_data WHERE type = 'grp' AND title LIKE %s",
$ilDB->quote("%" . $this->filtertext . "%")
);
$result = $ilDB->query($query);
while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC))
{
array_push($groupids, $row["obj_id"]);
}
break;
case "course":
$query = sprintf("SELECT obj_id FROM object_data WHERE type = 'crs' AND title LIKE %s",
$ilDB->quote("%" . $this->filtertext . "%")
);
$result = $ilDB->query($query);
while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC))
{
array_push($courseids, $row["obj_id"]);
}
break;
}
foreach ($this->participants as $active_id => $participant)
{
$remove = FALSE;
switch ($this->filterby)
{
case "name":
if (!(strpos(strtolower($participant->getName()), strtolower($this->filtertext)) !== FALSE)) $remove = TRUE;
break;
case "group":
$groups = $this->getMembershipByType($participant->getUserID(), "grp");
$foundfilter = FALSE;
if (count(array_intersect($groupids, $groups))) $foundfilter = TRUE;
if (!$foundfilter) $remove = TRUE;
break;
case "course":
$courses = $this->getMembershipByType($participant->getUserID(), "crs");
$foundfilter = FALSE;
if (count(array_intersect($courseids, $courses))) $foundfilter = TRUE;
if (!$foundfilter) $remove = TRUE;
break;
}
if (!$remove) $filteredParticipants[$active_id] = $participant;
}
return $filteredParticipants;
}
else
{
}
}

+ Here is the call graph for this function:

ilTestEvaluationData::getQuestionTitle (   $question_id)

Definition at line 189 of file class.ilTestEvaluationData.php.

{
if (array_key_exists($question_id, $this->questionTitles))
{
return $this->questionTitles[$question_id];
}
else
{
return "";
}
}
ilTestEvaluationData::getQuestionTitles ( )

Definition at line 184 of file class.ilTestEvaluationData.php.

References $questionTitles.

{
}
& ilTestEvaluationData::getStatistics ( )

Definition at line 329 of file class.ilTestEvaluationData.php.

References $statistics.

{
}
ilTestEvaluationData::getTest ( )

Definition at line 159 of file class.ilTestEvaluationData.php.

References $test.

Referenced by generateOverview().

{
return $this->test;
}

+ Here is the caller graph for this function:

ilTestEvaluationData::ilTestEvaluationData (   $test = "")

Constructor.

public

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

References $test, and generateOverview().

{
$this->participants = array();
$this->questionTitles = array();
if (is_object($test)) $this->test =& $test;
if (is_object($test))
{
$this->generateOverview();
}
}

+ Here is the call graph for this function:

ilTestEvaluationData::participantExists (   $active_id)

Definition at line 319 of file class.ilTestEvaluationData.php.

Referenced by generateOverview().

{
return array_key_exists($active_id, $this->participants);
}

+ Here is the caller graph for this function:

ilTestEvaluationData::removeParticipant (   $active_id)

Definition at line 324 of file class.ilTestEvaluationData.php.

{
unset($this->participants[$active_id]);
}
ilTestEvaluationData::resetFilter ( )

Definition at line 291 of file class.ilTestEvaluationData.php.

{
$this->filterby = "";
$this->filtertext = "";
}
ilTestEvaluationData::setDatasets (   $datasets)

Definition at line 169 of file class.ilTestEvaluationData.php.

References $datasets.

{
$this->datasets = $datasets;
}
ilTestEvaluationData::setFilter (   $by,
  $text 
)

Definition at line 303 of file class.ilTestEvaluationData.php.

{
$this->filterby = $by;
$this->filtertext = $text;
}
ilTestEvaluationData::setTest (   $test)

Definition at line 164 of file class.ilTestEvaluationData.php.

References $test.

{
$this->test =& $test;
}

Field Documentation

ilTestEvaluationData::$datasets

Definition at line 82 of file class.ilTestEvaluationData.php.

Referenced by getDatasets(), and setDatasets().

ilTestEvaluationData::$filterby

Definition at line 69 of file class.ilTestEvaluationData.php.

ilTestEvaluationData::$filtertext

Definition at line 76 of file class.ilTestEvaluationData.php.

ilTestEvaluationData::$participants

Definition at line 55 of file class.ilTestEvaluationData.php.

Referenced by getParticipants().

ilTestEvaluationData::$questionTitles

Definition at line 41 of file class.ilTestEvaluationData.php.

Referenced by getQuestionTitles().

ilTestEvaluationData::$statistics

Definition at line 62 of file class.ilTestEvaluationData.php.

Referenced by getStatistics().

ilTestEvaluationData::$test
private

Definition at line 48 of file class.ilTestEvaluationData.php.

Referenced by getTest(), ilTestEvaluationData(), and setTest().


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