ILIAS  Release_4_1_x_branch Revision 61804
 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)
 setFilterArray ($arrFilter)
 addParticipant ($active_id, $participant)
getParticipant ($active_id)
 participantExists ($active_id)
 removeParticipant ($active_id)
getStatistics ()
 getParticipantIds ()

Data Fields

 $questionTitles
 $participants
 $statistics
 $arrFilter
 $datasets

Private Attributes

 $test

Detailed Description

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

Member Function Documentation

ilTestEvaluationData::__sleep ( )

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

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

Definition at line 288 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 170 of file class.ilTestEvaluationData.php.

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

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

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

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

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

Referenced by ilTestEvaluationData().

{
$this->participants = array();
global $ilDB;
include_once "./Modules/Test/classes/class.ilTestEvaluationPassData.php";
include_once "./Modules/Test/classes/class.ilTestEvaluationUserData.php";
$result = $ilDB->queryF("SELECT usr_data.usr_id, usr_data.firstname, usr_data.lastname, usr_data.title, usr_data.login, " .
"tst_pass_result.* FROM tst_pass_result, tst_active " .
"LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id " .
"WHERE tst_active.active_id = tst_pass_result.active_fi " .
"AND tst_active.test_fi = %s " .
"ORDER BY usr_data.lastname, usr_data.firstname, tst_pass_result.active_fi, tst_pass_result.pass, tst_pass_result.tstamp",
array('integer'),
array($this->getTest()->getTestId())
);
$pass = NULL;
$checked = array();
$thissets = 0;
while ($row = $ilDB->fetchAssoc($result))
{
$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 165 of file class.ilTestEvaluationData.php.

References $datasets.

{
}
& ilTestEvaluationData::getParticipant (   $active_id)

Definition at line 293 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 313 of file class.ilTestEvaluationData.php.

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

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

References $ilDB, $participants, ilObject\_getIdsForTitle(), and ilParticipants\_getMembershipByType().

{
if (count($this->arrFilter))
{
$filteredParticipants = array();
$courseids = array();
$groupids = array();
global $ilDB;
if (array_key_exists('group', $this->arrFilter))
{
$ids = ilObject::_getIdsForTitle($this->arrFilter['group'], 'grp', true);
$groupids = array_merge($groupids, $ids);
}
if (array_key_exists('course', $this->arrFilter))
{
$ids = ilObject::_getIdsForTitle($this->arrFilter['course'], 'crs', true);
$courseids = array_merge($courseids, $ids);
}
foreach ($this->participants as $active_id => $participant)
{
$remove = FALSE;
if (array_key_exists('name', $this->arrFilter))
{
if (!(strpos(strtolower($participant->getName()), strtolower($this->arrFilter['name'])) !== FALSE)) $remove = TRUE;
}
if (!$remove)
{
if (array_key_exists('group', $this->arrFilter))
{
include_once "./Services/Membership/classes/class.ilParticipants.php";
$groups = ilParticipants::_getMembershipByType($participant->getUserID(), "grp");
$foundfilter = FALSE;
if (count(array_intersect($groupids, $groups))) $foundfilter = TRUE;
if (!$foundfilter) $remove = TRUE;
}
}
if (!$remove)
{
if (array_key_exists('course', $this->arrFilter))
{
include_once "./Services/Membership/classes/class.ilParticipants.php";
$courses = ilParticipants::_getMembershipByType($participant->getUserID(), "crs");
$foundfilter = FALSE;
if (count(array_intersect($courseids, $courses))) $foundfilter = TRUE;
if (!$foundfilter) $remove = TRUE;
}
}
if (!$remove)
{
if (array_key_exists('active_id', $this->arrFilter))
{
if ($active_id != $this->arrFilter['active_id']) $remove = TRUE;
}
}
if (!$remove) $filteredParticipants[$active_id] = $participant;
}
return $filteredParticipants;
}
else
{
}
}

+ Here is the call graph for this function:

ilTestEvaluationData::getQuestionTitle (   $question_id)

Definition at line 180 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 175 of file class.ilTestEvaluationData.php.

References $questionTitles.

{
}
& ilTestEvaluationData::getStatistics ( )

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

References $statistics.

{
}
ilTestEvaluationData::getTest ( )

Definition at line 150 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 87 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 298 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 303 of file class.ilTestEvaluationData.php.

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

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

{
$this->arrFilter = array();
}
ilTestEvaluationData::setDatasets (   $datasets)

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

References $datasets.

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

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

{
$this->arrFilter = array($by => $text);
}
ilTestEvaluationData::setFilterArray (   $arrFilter)

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

References $arrFilter.

{
$this->arrFilter = $arrFilter;
}
ilTestEvaluationData::setTest (   $test)

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

References $test.

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

Field Documentation

ilTestEvaluationData::$arrFilter

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

Referenced by setFilterArray().

ilTestEvaluationData::$datasets

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

Referenced by getDatasets(), and setDatasets().

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: