Changeset 425
- Timestamp:
- 04/24/08 14:44:46 (9 months ago)
- Location:
- trunk/app
- Files:
-
- 3 modified
-
app_controller.php (modified) (1 diff)
-
controllers/results_controller.php (modified) (2 diffs)
-
views/tests/view.ctp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/app_controller.php
r407 r425 12 12 class AppController extends Controller { 13 13 14 public $components = array('Auth', 'Cookie', 'Session', 'Security'); 14 public $components = array('Auth', 'Cookie', 'Session', 'Security'); // set Security component later 15 15 16 16 public $helpers = array('Html', 'Form', 'Session'); -
trunk/app/controllers/results_controller.php
r422 r425 17 17 18 18 public $components = array('Edublog'); 19 20 public function beforeFilter() 19 20 public function isAuthorized() 21 { return true; } 22 /* 23 if (isset( $this->params[Configure::read('Routing.admin')] )) 24 { 25 if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ) // admin and teachers 26 { 27 return true; 28 } 29 } 30 return false; // go away !! 31 } 32 */ 33 /*public function beforeFilter() 21 34 { 22 35 $this->Auth->allow(array('result')); 23 36 parent::beforeFilter(); 24 } 37 }*/ 25 38 26 public function isAuthorized()27 {28 if (isset( $this->params[Configure::read('Routing.admin')] ))29 {30 if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ) // admin and teachers31 {32 return true;33 }34 }35 return false; // go away !!36 }37 38 39 public function result() 39 40 { 40 d ie(debug($this->data));41 debug($this->data);exit; 41 42 42 43 $this->pageTitle = 'Results'; … … 46 47 $this->Edublog->blog($user_id); // set edublog components 47 48 48 49 49 $answers = $this->Resukts->Question->findAll($conditions, $fields, $order); 50 50 -
trunk/app/views/tests/view.ctp
r424 r425 22 22 23 23 echo $form->create('Result', array('action'=>'result', 'onsubmit'=>'return chkTest()')); 24 echo $form->hidden('Result.test_id', array('value'=>$data['Test']['id']));24 // echo $form->hidden('Result.test_id', array('value'=>$data['Test']['id'])); 25 25 26 26 foreach ($data['Question'] as $val): … … 33 33 $options[$v['id']] = $v['answer']; 34 34 endforeach; 35 36 echo $form->radio('Result.'. $val['worth'] .' points, '.$val['question'], $options); 35 36 echo $form->label('Result.'.$v['id'], $val['worth'] .' points, '.$val['question']); 37 echo $form->radio('Result.'.$v['id'], $options); 37 38 38 39 echo $html->para(null, $val['hint']); … … 52 53 function chkTest() 53 54 { 55 var formObj = document.getElementById('formid'); 56 57 for (var i = 1; i <= formObj.num_questions.value; i++) 58 { 59 radioGroupLength = document.getElementById('A' + i + "_num_responses").value; 60 61 for(var x = 1; x <= radioGroupLength; x++) 62 { 63 el = document.getElementById('A' + i + '_' + x); 64 65 alert('Do The Rest Of Your Checking Here - check if radio is checked, etc'); 66 } 67 } 54 68 // set var radio_choice to false 55 69 var radio_choice = false;
