- Timestamp:
- 08/20/08 20:54:59 (3 months ago)
- Location:
- trunk/app
- Files:
-
- 6 modified
-
config/core.php (modified) (1 diff)
-
controllers/answers_controller.php (modified) (4 diffs)
-
controllers/vclassrooms_controller.php (modified) (1 diff)
-
locale/spa/LC_MESSAGES/default.po (modified) (1 diff)
-
models/vclassroom.php (modified) (5 diffs)
-
views/vclassrooms/admin_record.ctp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/config/core.php
r617 r730 199 199 * ); 200 200 */ 201 Cache::config('default', array('engine' => 'File')); 201 Cache::config('default', array('engine' => 'File')); 202 203 /* Cache::config('default', array('engine' => 'Xcache', //[required] 204 'duration'=> 3600, //[optional] 205 'probability'=> 100, //[optional] 206 'user' => 'aarkerio', //user from xcache.admin.user settings 207 'password' => 'kunst99' //plaintext password (xcache.admin.pass) 208 ) 209 ); */ 202 210 ?> -
trunk/app/controllers/answers_controller.php
r696 r730 49 49 $this->layout = 'admin'; 50 50 51 if (empty($this->data[ "Answer"])):51 if (empty($this->data['Answer'])): 52 52 $this->data = $this->Answer->read(null, $answer_id ); 53 53 else: … … 56 56 57 57 $this->Sanitize->clean($this->data['Answer']); 58 58 59 59 if ($this->Answer->save($this->data)): 60 $this->msgFlash(__(' Answer updated', true),'/admin/questions/answers/'.$this->data['Answer']['question_id']);60 $this->msgFlash(__('Data saved', true),'/admin/questions/answers/'.$this->data['Answer']['question_id']); 61 61 endif; 62 62 endif; … … 65 65 public function admin_listing($question_id) 66 66 { 67 $this->layout = 'ajax';67 $this->layout = 'ajax'; 68 68 69 $conditions = array("Answer.user_id"=>$this->Auth->user('id'), "Answer.question_id"=>$question_id);69 $conditions = array('Answer.user_id'=>$this->Auth->user('id'), 'Answer.question_id'=>$question_id); 70 70 71 $fields = array("Answer.id", "Answer.user_id", "Answer.correct");71 $fields = array('Answer.id', 'Answer.user_id', 'Answer.correct'); 72 72 73 $order = "Answer.id DESC";73 $order = 'Answer.id DESC'; 74 74 75 75 $this->set('data', $this->Answer->findAll($conditions, $fields, $order)); … … 80 80 public function admin_questions($test_id) 81 81 { 82 $this->pageTitle = 'Answers';82 $this->pageTitle = __('Answers', true); 83 83 84 $conditions = array("Answer.user_id"=>$this->Auth->user('id'), "Answer.id"=>$test_id);84 $conditions = array('Answer.user_id'=>$this->Auth->user('id'), 'Answer.id'=>$test_id); 85 85 86 $fields = array("Answer.id", "Answer.user_id", "Answer.title", "Answer.description");86 $fields = array("Answer.id", "Answer.user_id", "Answer.title", "Answer.description"); 87 87 88 $order = "Answer.id DESC";88 $order = 'Answer.id DESC'; 89 89 90 $this->set('data', $this->Answer->findAll($conditions, $fields, $order));90 $this->set('data', $this->Answer->findAll($conditions, $fields, $order)); 91 91 } 92 92 -
trunk/app/controllers/vclassrooms_controller.php
r729 r730 115 115 $this->set('msg', __('You are already member of this class', true)); 116 116 $this->render('jointoclass', 'ajax'); 117 else:117 else: 118 118 $this->data['UsersVclassroom']['user_id'] = $this->Auth->user('id'); 119 119 -
trunk/app/locale/spa/LC_MESSAGES/default.po
r729 r730 4 4 msgid "Yes" 5 5 msgstr "Si" 6 7 msgid "Points up" 8 msgstr "Subir puntos" 9 10 msgid "Points down" 11 msgstr "Bajar puntos" 12 13 msgid "Participations in forums" 14 msgstr "Participaciones en foros" 6 15 7 16 msgid "You have been registered" -
trunk/app/models/vclassroom.php
r729 r730 120 120 ); */ 121 121 /** 122 * Get student record in Vclassroom , return array 122 * Get student record in Vclassroom , return array usd in admin_record method (vclassrooms_controller.php) 123 123 * 124 * @param integer $user_id description124 * @param integer $user_id: in $fact student_id 125 125 * @param integer $vclassroom_id description 126 126 * @return array $record description 127 127 * @access public 128 * @author authorManuel Montoya128 * @author Manuel Montoya 129 129 **/ 130 130 public function studentRecord($user_id, $vclassroom_id) … … 133 133 $record = array(); 134 134 135 $this->User->unbindAll(); 136 135 $this->User->unbindAll(); // unbind unnecesaries tables 136 137 //Get the student data 137 138 $record = $this->User->find(array('User.id'=>$user_id), array('id', 'username', 'name', 'email')); 138 139 139 // Consult Test Model 140 // Consult Test Model associated to this Vclassroom 140 141 $this->TestsVclassroom->bindModel(array('belongsTo'=>array('Test'))); 141 142 … … 143 144 $fields = array('TestsVclassroom.test_id', 'TestsVclassroom.id', 'Test.title'); 144 145 $record['tests'] = $this->TestsVclassroom->findAll($conditions, $fields); 145 // die(debug($record['tests']));146 // die(debug($record)); 146 147 147 148 foreach($record['tests'] as $k => $t): … … 151 152 152 153 $conditions = array('Result.vclassroom_id'=>$vclassroom_id,'Result.user_id'=>$user_id,'Result.test_id'=>$t['TestsVclassroom']['test_id']); 153 $fields = array('Result.correct', 'Result.answer_id',' Test.title', 'Question.question', 'Question.worth');154 $fields = array('Result.correct', 'Result.answer_id','Question.worth'); 154 155 $results = $this->Test->Result->findAll($conditions, $fields); 155 156 //debug($results); 157 // Get points from answers 156 158 if ( count($results) > 0 ): 157 159 $points = (int) 0; 158 160 else: 159 $points = null; //student has no answered this test yet161 $points = null; //student has not answered this test yet 160 162 endif; 161 163 162 164 foreach($results as $r): 163 165 if ($r['Result']['correct'] == 1): 164 $points += $r['Question']['worth'];166 $points += (int) $r['Question']['worth']; 165 167 endif; 166 168 endforeach; … … 169 171 endforeach; 170 172 //die(debug($record['tests'])); 171 // Consult Treasure Model 173 174 // Now Treasure Model 172 175 $conditions = array('ResultTreasure.vclassroom_id'=>$vclassroom_id, 'ResultTreasure.user_id'=>$user_id); 173 176 $fields = array('ResultTreasure.points', 'Treasure.title', 'Treasure.id'); //null; -
trunk/app/views/vclassrooms/admin_record.ctp
r728 r730 1 1 <?php 2 2 //die(debug($data)); 3 4 3 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 5 4 echo $html->addCrumb(__('Groups', true), '/admin/vclassrooms/listing'); … … 101 100 endforeach; 102 101 else: 103 echo $html->para(null, 'No webquests found');102 echo $html->para(null, __('No Webquests found', true)); 104 103 endif; 105 104 106 105 // Treasures. Model: Treasure 107 106 $tpoints = (int) 0; // tresure points 107 echo '<h1>'. __('Scavengers hunts', true).'</h1>'; 108 108 if ( count($data['treasures']) > 0 ): 109 echo '<h1>Treasures</h1>';110 109 foreach ($data['treasures'] as $tr): 111 112 $tpoints += $tr['ResultTreasure']['points']; 110 $tpoints += (int) $tr['ResultTreasure']['points']; 113 111 $div_id = 'tr'.$tr['Treasure']['id']; 114 112 e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">'); 115 113 e($html->div(null, $tr['ResultTreasure']['points'] .' points', array('id'=>$div_id, 'style'=>'width:150px;float:left;'))); 116 114 e('<div style="width:450px;float:right;">'); 117 echo $html->link($tr['Treasure']['title'], '#', array('title'=> 'View reply', 'onclick'=>115 echo $html->link($tr['Treasure']['title'], '#', array('title'=>__('View text', true), 'onclick'=> 118 116 "window.open('/admin/treasures/see/".$data['User']['id']."/".$tr['Treasure']['id']."','mywin','left=20,top=20,width=700,height=700,toolbar=0,resizable=1')")) . ' '; 119 117 120 echo $ajax->link($html->image('static/adownmod.png', array('alt'=> 'Points down', 'title'=>'Points down')),118 echo $ajax->link($html->image('static/adownmod.png', array('alt'=>__('Points down', true), 'title'=>__('Points down', true))), 121 119 '/admin/treasures/points/'.$tr['Treasure']['id'].'/down', 122 120 array('update' => $div_id, … … 124 122 'after' =>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 125 123 'complete'=>"Element.hide('loadingre');Effect.Appear(".$div_id.")"),null,false); 126 echo $ajax->link($html->image('static/aupmod.png', array('alt'=> 'Points up', 'title'=>'Points up')),124 echo $ajax->link($html->image('static/aupmod.png', array('alt'=>__('Points up', true), 'title'=>__('Points up', true))), 127 125 '/admin/treasures/points/'.$tr['Treasure']['id'].'/up', 128 126 array('update' => $div_id, … … 135 133 endforeach; 136 134 else: 137 echo $html->para(null, 'No treasures found');135 echo $html->para(null, __('No Scavenger hunts found', true)); 138 136 endif; 139 137 140 // Replies on forums. Model: Topic 141 $rpoints = (int) 0; // reply points 138 139 echo '<h1>'.__('Participations in forums', true).'</h1>'; 140 142 141 if ( count($data['replies']) > 0 ): 143 echo '<h1>Replies in forums</h1>';144 foreach ($data['replies'] as $re):145 142 // Replies on forums. Model: Topic 143 $rpoints = (int) 0; // reply points 144 foreach ($data['replies'] as $re): 146 145 $div_id = 're'.$re['Reply']['id']; 147 146 e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">');
