Changeset 444
- Timestamp:
- 05/01/08 23:19:28 (8 months ago)
- Location:
- trunk/app
- Files:
-
- 4 added
- 5 modified
-
config/sql/postgresql/participations.sql (added)
-
config/sql/postgresql/result_treasures.sql (added)
-
config/sql/postgresql/result_webquests.sql (added)
-
config/sql/postgresql/topics.sql (modified) (1 diff)
-
controllers/vclassrooms_controller.php (modified) (1 diff)
-
models/forum.php (modified) (1 diff)
-
models/participation.php (added)
-
models/vclassroom.php (modified) (3 diffs)
-
views/vclassrooms/admin_record.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/config/sql/postgresql/topics.sql
r436 r444 4 4 message text NOT NULL, 5 5 created timestamp(0) with time zone DEFAULT now() NOT NULL, 6 forum_id integer NOT NULL REFERENCES forums(id) ON DELETE CASCADE, 6 forum_id int NOT NULL REFERENCES forums(id) ON DELETE CASCADE, 7 vclassroom_id int NOT NULL REFERENCES vclassrooms(id) ON DELETE CASCADE, -- just one facility to create student's reports 7 8 user_id integer NOT NULL REFERENCES users(id) ON DELETE CASCADE, 8 status int NOT NULL DEFAULT 1,9 views int NOT NULL DEFAULT 0 -- number of times the topic has been seen9 status smallint NOT NULL DEFAULT 1, 10 views smallint NOT NULL DEFAULT 0 -- number of times the topic has been seen 10 11 ); 11 12 -
trunk/app/controllers/vclassrooms_controller.php
r443 r444 264 264 public function admin_record($student_id, $vclassroom_id) 265 265 { 266 $this->layout = 'admin'; 267 $this->pageTitle = 'Student Record'; 268 266 269 $record = $this->Vclassroom->getRecord($student_id, $vclassroom_id); 267 270 268 271 $this->set('data', $record); 269 272 } -
trunk/app/models/forum.php
r388 r444 16 16 'order' => 'id ASC', 17 17 'fields' => null 18 )); 18 ), 19 'Participation' => 20 array('className' => 'Participation', 21 'foreignkey' => 'forum_id', 22 'conditions' => null, 23 'order' => 'id ASC', 24 'fields' => null 25 ) 26 ); 27 19 28 public $belongsTo = array('Catforum' => 20 29 array('className' => 'Catforum', -
trunk/app/models/vclassroom.php
r443 r444 78 78 ) 79 79 ); 80 80 81 81 // get student record 82 82 public function getRecord($user_id, $vclassroom_id) 83 { 83 { 84 84 $record = (string) ''; 85 85 86 86 $conditions = array('Result.vclassroom_id'=>$vclassroom_id, 'Result.user_id'=>$user_id); 87 87 $fields = array('Result.percentage', 'Test.title'); //null; … … 90 90 foreach ($tests as $t) 91 91 { 92 $record .= $t['Test']['title'];93 $record .= 'Percentage: ' . $t['Result']['percentage'];92 $record .= 'Test: ' . $t['Test']['title'] . '<br />'; 93 $record .= 'Percentage: ' . $t['Result']['percentage'] . '<br />'; 94 94 } 95 96 95 97 96 // $webquests = $this->Webquest->ResultWebquest->findAll($conditions, $fields); … … 101 100 $treasures = $this->Treasure->ResultTreasure->findAll($conditions, $fields); 102 101 103 foreach ($t ests as $t)102 foreach ($treasures as $tr) 104 103 { 105 $record .= $t['Test']['title'];106 $record .= 'P ercentage: ' . $t['Result']['percentage'];104 $record .= 'Treasure: '. $tr['Treasure']['title'] . '<br />'; 105 $record .= 'Points: ' . $tr['ResultTreasure']['points'] . '<br />'; 107 106 } 107 108 $conditions = array('Topic.vclassroom_id'=>$vclassroom_id, 'Topic.user_id'=>$user_id); 109 $fields = array('Forum.title', 'Topic.subject'); //null; 110 $topics = $this->Forum->Topic->findAll($conditions, $fields); 111 112 $participations = (int) 0; 113 114 foreach ($topics as $p) 115 { 116 $record .= 'Forum: '. $p['Forum']['title'] . '<br />'; 117 $participations++; 118 } 119 120 $record .= 'Participations on Forums: ' . $participations . '<br />'; 108 121 // die(debug($treasures)); 109 122 return $record; -
trunk/app/views/vclassrooms/admin_record.ctp
r442 r444 1 1 <?php 2 die(debug($data));2 //die(debug($data)); 3 3 4 4 echo $html->div(null, $data); 5 5 6 6 ?>
