Changeset 732 for trunk/app/models
- Timestamp:
- 08/21/08 18:11:48 (3 months ago)
- Files:
-
- 1 modified
-
trunk/app/models/vclassroom.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/models/vclassroom.php
r731 r732 35 35 'Participation' => 36 36 array('className' => 'Participation', 37 'conditions' => null, 38 'order' => null, 39 'limit' => null, 40 'foreignKey' => 'vclassroom_id' 41 ), 42 'Report' => 43 array('className' => 'Report', 37 44 'conditions' => null, 38 45 'order' => null, … … 97 104 'status' => VALID_NOT_EMPTY 98 105 ); 106 99 107 /* 100 108 public $validate = array( … … 120 128 ) 121 129 ); */ 122 /**123 * Get student record in Vclassroom , return array usd in admin_record method (vclassrooms_controller.php)130 /** 131 * Get student record in Vclassroom , return array used in admin_record method (vclassrooms_controller.php) 124 132 * 125 133 * @param integer $user_id: in $fact student_id … … 128 136 * @access public 129 137 * @author Manuel Montoya 130 **/138 **/ 131 139 public function studentRecord($user_id, $vclassroom_id) 132 140 { 133 try 134 { 141 // 1) wee need check tree models: Test, Webquest and Treasures ans results associated to them: 142 // Result, ResultTreasure and ResultWebquest, so will get the stundents answer 143 try{ 135 144 $record = array(); 136 145 137 $this->User->unbindAll(); // unbind unnecesar iestables146 $this->User->unbindAll(); // unbind unnecesary tables 138 147 139 148 //Get the student data … … 147 156 $record['tests'] = $this->TestsVclassroom->findAll($conditions, $fields); 148 157 // die(debug($record)); 149 158 159 // foreach test check in Result model 150 160 foreach($record['tests'] as $k => $t): 151 161 $record['tests'][$k]['TestsVclassroom']['title'] = $t['Test']['title']; … … 174 184 //die(debug($record['tests'])); 175 185 176 // Now Treasure Model186 // Now Treasure model 177 187 $conditions = array('ResultTreasure.vclassroom_id'=>$vclassroom_id, 'ResultTreasure.user_id'=>$user_id); 178 188 $fields = array('ResultTreasure.points', 'Treasure.title', 'Treasure.id'); //null; 179 189 $record['treasures'] = $this->Treasure->ResultTreasure->findAll($conditions, $fields); 180 181 // Consult Reply Model190 191 // Consult Reply model to know student participation in forums 182 192 $conditions = array('Reply.vclassroom_id'=>$vclassroom_id, 'Reply.user_id'=>$user_id); 183 193 $fields = array('Reply.topic_id', 'Reply.vclassroom_id', 'Reply.id', 'Reply.points'); //null; … … 188 198 $fields = array('Participation.title', 'Participation.id', 'Participation.points'); //null; 189 199 $record['participations'] = $this->Participation->findAll($conditions, $fields); 190 200 201 // Reports 202 $conditions = array('Report.vclassroom_id'=>$vclassroom_id, 'Report.student_id'=>$user_id); 203 $fields = array('Report.filename', 'Report.description', 'Report.id', 'Report.points'); //null; 204 $record['reports'] = $this->Report->findAll($conditions, $fields); 205 191 206 // Webquest 192 207 $conditions = array('ResultWebquest.vclassroom_id'=>$vclassroom_id, 'ResultWebquest.user_id'=>$user_id);
