| 91 | | $record = (string) ''; |
| 92 | | |
| 93 | | $conditions = array('Result.vclassroom_id'=>$vclassroom_id, 'Result.user_id'=>$user_id); |
| 94 | | $fields = array('Result.percentage', 'Test.title'); //null; |
| 95 | | $tests = $this->Test->Result->findAll($conditions, $fields); |
| | 104 | $record = array(); |
| | 105 | |
| | 106 | $record['user'] = $this->User->find(array('User.id'=>$user_id), array('id', 'username', 'name', 'email')); |
| | 107 | |
| | 108 | $conditions = array('Result.vclassroom_id'=>$vclassroom_id, 'Result.user_id'=>$user_id); |
| | 109 | $fields = array('Result.percentage', 'Test.title'); //null; |
| | 110 | $record['tests'] = $this->Test->Result->findAll($conditions, $fields); |
| 107 | | $treasures = $this->Treasure->ResultTreasure->findAll($conditions, $fields); |
| 108 | | |
| 109 | | foreach ($treasures as $tr) |
| 110 | | { |
| 111 | | $record .= 'Treasure: '. $tr['Treasure']['title'] . '<br />'; |
| 112 | | $record .= 'Points: ' . $tr['ResultTreasure']['points'] . '<br />'; |
| 113 | | } |
| 114 | | |
| 115 | | $conditions = array('Topic.vclassroom_id'=>$vclassroom_id, 'Topic.user_id'=>$user_id); |
| 116 | | $fields = array('Forum.title', 'Topic.subject'); //null; |
| 117 | | $topics = $this->Forum->Topic->findAll($conditions, $fields); |
| 118 | | |
| 119 | | $num_topics = (int) 0; |
| 120 | | |
| 121 | | foreach ($topics as $p) |
| 122 | | { |
| 123 | | $record .= 'Forum: '. $p['Forum']['title'] . '<br />'; |
| 124 | | $num_topics++; |
| 125 | | } |
| 126 | | |
| 127 | | $record .= 'Participations on Forums: ' . $num_topics . '<br />'; |
| 128 | | |
| | 115 | $record['treasures'] = $this->Treasure->ResultTreasure->findAll($conditions, $fields); |
| | 116 | |
| | 117 | $conditions = array('Topic.vclassroom_id'=>$vclassroom_id, 'Topic.user_id'=>$user_id); |
| | 118 | $fields = array('Forum.title', 'Topic.subject'); //null; |
| | 119 | $record['topics'] = $this->Forum->Topic->findAll($conditions, $fields); |
| | 120 | |
| 130 | | $fields = array('Participation.title', 'Participation.points'); //null; |
| 131 | | |
| 132 | | $participations = $this->Participation->findAll($conditions, $fields); |
| 133 | | |
| 134 | | $points = (int) 0; |
| 135 | | |
| 136 | | foreach ($participations as $pr) |
| 137 | | { |
| 138 | | $record .= 'Part title: '. $pr['Participation']['title'] . ' Points '. $pr['Participation']['points'] .'<br />'; |
| 139 | | $points += $pr['Participation']['points']; |
| 140 | | } |
| 141 | | $record .= ' Total participation points: '. $points .'<br />'; |
| 142 | | // die(debug($treasures)); |
| | 122 | $fields = array('Participation.title', 'Participation.id', 'Participation.points'); //null; |
| | 123 | |
| | 124 | $record['participations'] = $this->Participation->findAll($conditions, $fields); |
| | 125 | |
| | 126 | $conditions = array('ResultWebquest.vclassroom_id'=>$vclassroom_id, 'ResultWebquest.user_id'=>$user_id); |
| | 127 | $fields = array('Webquest.title', 'Webquest.id', 'ResultWebquest.points'); //null; |
| | 128 | |
| | 129 | $record['webquests'] = $this->Webquest->ResultWebquest->findAll($conditions, $fields); |
| | 130 | |
| | 131 | //die(debug($record)); |
| 145 | | |
| 146 | | //Check if the user already exist in the classroom |
| | 134 | /** |
| | 135 | * Get student evaluation, return integer |
| | 136 | * |
| | 137 | * @param integer $user_id description |
| | 138 | * @param integer $vclassroom_id description |
| | 139 | * @return array $record description |
| | 140 | * @access public |
| | 141 | * @author author Manuel Montoya |
| | 142 | **/ |
| | 143 | public function getEval($user_id, $vclassroom_id) |
| | 144 | { |
| | 145 | return $record; |
| | 146 | } |
| | 147 | /** |
| | 148 | * Check if the student already exist in the classroom |
| | 149 | * |
| | 150 | * @param integer $user_id description |
| | 151 | * @param integer $vclassroom_id description |
| | 152 | * @return boolean description |
| | 153 | * @access public |
| | 154 | * @author author Manuel Montoya |
| | 155 | **/ |