Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00034 class ilTestEvaluationData
00035 {
00041 var $questionTitles;
00042
00048 var $participants;
00049
00055 var $statistics;
00056
00062 function ilTestEvaluationData($test_id)
00063 {
00064 $this->participants = array();
00065 $this->questionTitles = array();
00066 }
00067
00068 function addQuestionTitle($question_id, $question_title)
00069 {
00070 $this->questionTitles[$question_id] = $question_title;
00071 }
00072
00073 function getQuestionTitles()
00074 {
00075 return $this->questionTitles;
00076 }
00077
00078 function getQuestionTitle($question_id)
00079 {
00080 if (array_key_exists($question_id, $this->questionTitles))
00081 {
00082 return $this->questionTitles[$question_id];
00083 }
00084 else
00085 {
00086 return "";
00087 }
00088 }
00089
00090 function &getParticipants()
00091 {
00092 return $this->participants;
00093 }
00094
00095 function addQuestionForParticipant($active_id, $question_id, $max_points, $sequence = NULL, $pass = 0, $type = "", $copy_id = "")
00096 {
00097 if (array_key_exists($active_id, $this->participants))
00098 {
00099 $this->participants[$active_id]->addQuestion($question_id, $max_points, $sequence, $pass, $type, $copy_id);
00100 }
00101 }
00102
00103 function getLastPassOfParticipant($active_id)
00104 {
00105 if (array_key_exists($active_id, $this->participants))
00106 {
00107 return $this->participants[$active_id]->getLastPass();
00108 }
00109 else
00110 {
00111 return 0;
00112 }
00113 }
00114
00115 function getParticipantIds()
00116 {
00117 return array_keys($this->participants);
00118 }
00119
00120 function addParticipant($active_id, $participant)
00121 {
00122 $this->participants[$active_id] = $participant;
00123 }
00124
00125 function &getParticipant($active_id)
00126 {
00127 if ($this->participantExists($active_id))
00128 {
00129 return $this->participants[$active_id];
00130 }
00131 else
00132 {
00133 return null;
00134 }
00135 }
00136
00137 function participantExists($active_id)
00138 {
00139 return array_key_exists($active_id, $this->participants);
00140 }
00141
00142 function &getStatistics()
00143 {
00144 return $this->statistics;
00145 }
00146
00147 function calculateStatistics()
00148 {
00149 include_once "./assessment/classes/class.ilTestStatistics.php";
00150 $this->statistics = new ilTestStatistics($this);
00151 }
00152
00153 function sortParticipants($order)
00154 {
00155 function sortAscending($a, $b)
00156 {
00157 $result = strcmp($a->getName(), $b->getName());
00158 return $result;
00159 }
00160
00161 function sortDescending($b, $a)
00162 {
00163 $result = strcmp($a->getName(), $b->getName());
00164 return $result;
00165 }
00166 if (strcmp(strtolower($order), "asc") == 0)
00167 {
00168 uasort($this->participants, "sortAscending");
00169 }
00170 else
00171 {
00172 uasort($this->participants, "sortDescending");
00173 }
00174 }
00175 }
00176
00177 ?>