ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestEvaluationData Class Reference
+ Collaboration diagram for ilTestEvaluationData:

Public Member Functions

 __sleep ()
 ilTestEvaluationData (ilObjTest $test=null)
 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 35 of file class.ilTestEvaluationData.php.

Member Function Documentation

ilTestEvaluationData::__sleep ( )

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

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

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

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

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

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

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

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

Referenced by ilTestEvaluationData().

{
global $ilDB;
include_once "./Modules/Test/classes/class.ilTestEvaluationPassData.php";
include_once "./Modules/Test/classes/class.ilTestEvaluationUserData.php";
$this->participants = array();
$query = "
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
";
$result = $ilDB->queryF(
$query, 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"]);
$this->getParticipant($row["active_fi"])->getPass($row["pass"])->setObligationsAnswered($row["obligations_answered"]);
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"]);
$this->getParticipant($row['active_fi'])->getPass($row['pass'])->setRequestedHintsCount($row['hint_count']);
$this->getParticipant($row['active_fi'])->getPass($row['pass'])->setDeductedHintPoints($row['hint_points']);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestEvaluationData::getDatasets ( )

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

References $datasets.

{
}
& ilTestEvaluationData::getParticipant (   $active_id)
Parameters
integer$active_id
Returns
ilTestEvaluationUserData

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

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

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

References $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 214 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 209 of file class.ilTestEvaluationData.php.

References $questionTitles.

{
}
& ilTestEvaluationData::getStatistics ( )

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

References $statistics.

{
}
ilTestEvaluationData::getTest ( )

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

References $test.

Referenced by generateOverview().

{
return $this->test;
}

+ Here is the caller graph for this function:

ilTestEvaluationData::ilTestEvaluationData ( ilObjTest  $test = null)

Constructor.

public

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

References $test, and generateOverview().

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

+ Here is the call graph for this function:

ilTestEvaluationData::participantExists (   $active_id)

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

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

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

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

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

References $datasets.

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

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

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

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

References $arrFilter.

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

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

References $test.

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

Field Documentation

ilTestEvaluationData::$arrFilter

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

Referenced by setFilterArray().

ilTestEvaluationData::$datasets

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

Referenced by getDatasets(), and setDatasets().

ilTestEvaluationData::$participants

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

Referenced by getParticipants().

ilTestEvaluationData::$questionTitles

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

Referenced by getQuestionTitles().

ilTestEvaluationData::$statistics

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

Referenced by getStatistics().

ilTestEvaluationData::$test
private

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

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


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