Public Member Functions | |
| __sleep () | |
| ilTestEvaluationData () | |
| Constructor. | |
| 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) | |
| & | getStatistics () |
| getParticipantIds () | |
Data Fields | |
| $questionTitles | |
| $participants | |
| $statistics | |
| $filterby | |
| $filtertext | |
| $datasets | |
Private Member Functions | |
| getMembershipByType ($a_usr_id, $a_type) | |
Definition at line 34 of file class.ilTestEvaluationData.php.
| ilTestEvaluationData::__sleep | ( | ) |
Definition at line 77 of file class.ilTestEvaluationData.php.
{
return array('questionTitles', 'participants', 'statistics', 'filterby', 'filtertext', 'datasets');
}
| ilTestEvaluationData::addParticipant | ( | $ | active_id, | |
| $ | participant | |||
| ) |
Definition at line 233 of file class.ilTestEvaluationData.php.
{
$this->participants[$active_id] = $participant;
}
| ilTestEvaluationData::addQuestionTitle | ( | $ | question_id, | |
| $ | question_title | |||
| ) |
Definition at line 103 of file class.ilTestEvaluationData.php.
{
$this->questionTitles[$question_id] = $question_title;
}
| ilTestEvaluationData::calculateStatistics | ( | ) |
Definition at line 125 of file class.ilTestEvaluationData.php.
{
include_once "./Modules/Test/classes/class.ilTestStatistics.php";
$this->statistics = new ilTestStatistics($this);
}
| ilTestEvaluationData::getDatasets | ( | ) |
Definition at line 98 of file class.ilTestEvaluationData.php.
{
return $this->datasets;
}
| ilTestEvaluationData::getMembershipByType | ( | $ | a_usr_id, | |
| $ | a_type | |||
| ) | [private] |
Definition at line 131 of file class.ilTestEvaluationData.php.
References $res.
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 238 of file class.ilTestEvaluationData.php.
{
return $this->participants[$active_id];
}
| ilTestEvaluationData::getParticipantIds | ( | ) |
Definition at line 253 of file class.ilTestEvaluationData.php.
{
return array_keys($this->participants);
}
| ilTestEvaluationData::getParticipants | ( | ) |
Definition at line 153 of file class.ilTestEvaluationData.php.
References 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("%$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("%$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
{
return $this->participants;
}
}
Here is the call graph for this function:| ilTestEvaluationData::getQuestionTitle | ( | $ | question_id | ) |
Definition at line 113 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 108 of file class.ilTestEvaluationData.php.
{
return $this->questionTitles;
}
| & ilTestEvaluationData::getStatistics | ( | ) |
Definition at line 248 of file class.ilTestEvaluationData.php.
{
return $this->statistics;
}
| ilTestEvaluationData::ilTestEvaluationData | ( | ) |
Constructor.
public
Definition at line 87 of file class.ilTestEvaluationData.php.
{
$this->participants = array();
$this->questionTitles = array();
}
| ilTestEvaluationData::participantExists | ( | $ | active_id | ) |
Definition at line 243 of file class.ilTestEvaluationData.php.
{
return array_key_exists($active_id, $this->participants);
}
| ilTestEvaluationData::resetFilter | ( | ) |
Definition at line 215 of file class.ilTestEvaluationData.php.
{
$this->filterby = "";
$this->filtertext = "";
}
| ilTestEvaluationData::setDatasets | ( | $ | datasets | ) |
Definition at line 93 of file class.ilTestEvaluationData.php.
References $datasets.
{
$this->datasets = $datasets;
}
| ilTestEvaluationData::setFilter | ( | $ | by, | |
| $ | text | |||
| ) |
Definition at line 227 of file class.ilTestEvaluationData.php.
{
$this->filterby = $by;
$this->filtertext = $text;
}
| ilTestEvaluationData::$datasets |
Definition at line 75 of file class.ilTestEvaluationData.php.
Referenced by setDatasets().
| ilTestEvaluationData::$filterby |
Definition at line 62 of file class.ilTestEvaluationData.php.
| ilTestEvaluationData::$filtertext |
Definition at line 69 of file class.ilTestEvaluationData.php.
| ilTestEvaluationData::$participants |
Definition at line 48 of file class.ilTestEvaluationData.php.
| ilTestEvaluationData::$questionTitles |
Definition at line 41 of file class.ilTestEvaluationData.php.
| ilTestEvaluationData::$statistics |
Definition at line 55 of file class.ilTestEvaluationData.php.
1.7.1