Changeset 687 for trunk/app/controllers
- Timestamp:
- 08/02/08 00:10:46 (4 months ago)
- Files:
-
- 1 modified
-
trunk/app/controllers/treasures_controller.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/treasures_controller.php
r570 r687 9 9 10 10 uses('sanitize'); 11 uses('L10n');12 11 13 12 class TreasuresController extends AppController { … … 24 23 25 24 /* 25 * chksw() 26 26 * check if tresure string is OK, if so, save student data on ResultTreasure model 27 27 * 28 28 */ 29 29 30 public function chksw()30 public function chksw() 31 31 { 32 32 $this->layout = 'ajax'; … … 81 81 82 82 public function view($treasure_id, $vclassroom_id) 83 { 84 if ( $this->Test->chk($test_id, $this->Auth->user('id'), $vclassroom_id) === true ): 85 $username = $this->Test->User->field('User.username', array("User.id"=>$user_id)); 86 $this->flash('You already have answered this test', '/users/portfolio/'.$username); 83 { 84 if ( $this->Treasure->chk($treasure_id, $this->Auth->user('id'), $vclassroom_id) === false ): 85 $this->set('already', false); 86 $this->set('data', false); 87 else: 88 $this->set('already', true); 87 89 endif; 88 90 89 91 // student belongs to this class? 90 if ( $this->Auth->user() && $this->Auth->user('group_id') == 3):92 if ( $this->Auth->user() ): 91 93 $this->set('belongs', $this->Treasure->Vclassroom->belongs($this->Auth->user('id'), $vclassroom_id)); 92 94 else: … … 104 106 $this->Edublog->blog($data['Treasure']['user_id']); // blogger elements 105 107 106 $this->set('data', $data); 108 $this->set('data', $data); 109 110 $this->set('vclassroom_id', $vclassroom_id); 107 111 } 108 112
