- Timestamp:
- 08/21/08 18:11:48 (3 months ago)
- Location:
- trunk/app
- Files:
-
- 9 modified
-
config/sql/postgresql/reports.sql (modified) (1 diff)
-
controllers/participations_controller.php (modified) (2 diffs)
-
controllers/tests_controller.php (modified) (1 diff)
-
locale/spa/LC_MESSAGES/default.po (modified) (2 diffs)
-
models/vclassroom.php (modified) (7 diffs)
-
views/vclassrooms/admin_record.ctp (modified) (5 diffs)
-
views/vclassrooms/upload.ctp (modified) (1 diff)
-
webroot/css/basic/styles.css (modified) (1 diff)
-
webroot/css/rubyx/rubyx.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/config/sql/postgresql/reports.sql
r605 r732 2 2 id serial NOT NULL PRIMARY KEY, 3 3 filename varchar(80) NOT NULL UNIQUE, 4 description varchar(40) NOT NULL, 4 5 student_id int NOT NULL REFERENCES users(id) ON DELETE CASCADE, 5 6 points smallint NOT NULL DEFAULT 2, -
trunk/app/controllers/participations_controller.php
r605 r732 34 34 35 35 $this->data['Participation']['user_id'] = $this->Auth->user('id'); 36 // die( debug($this->data['Participation']));36 37 37 $this->Participation->create(); 38 38 39 39 if ($this->Participation->save($this->data['Participation'])): 40 40 $url = '/vclassrooms/show/'.$this->data['Participation']['blogger_id'].'/'.$this->data['Participation']['vclassroom_id']; 41 $this->msgFlash( 'Your participation has been saved.',$url);41 $this->msgFlash(__('Your participation has been saved', true), $url); 42 42 endif; 43 43 endif; … … 54 54 $this->data['Participation']['points'] = $points; 55 55 56 if ($this->Participation->save($this->data ['Participation'])):56 if ($this->Participation->save($this->data)): 57 57 $this->set('points', $points); 58 58 $this->render('points', 'ajax'); -
trunk/app/controllers/tests_controller.php
r729 r732 68 68 public function result() 69 69 { 70 try { 70 if ( !$this->Auth->user()): 71 $this->redirect('/'); 72 endif; 73 74 try { 71 75 //die(debug($this->data['Test'])); 72 76 -
trunk/app/locale/spa/LC_MESSAGES/default.po
r731 r732 5 5 msgstr "Si" 6 6 7 msgid "No reports found" 8 msgstr "No hay reportes" 9 10 msgid "Your participation has been saved" 11 msgstr "Tu participación ha sido registrada" 12 7 13 msgid "See participation" 8 14 msgstr "Ver participación" … … 16 22 msgid "Participations in forums" 17 23 msgstr "Participaciones en foros" 24 25 msgid "Participations" 26 msgstr "Participaciones" 18 27 19 28 msgid "You have been registered" -
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); -
trunk/app/views/vclassrooms/admin_record.ctp
r731 r732 6 6 echo $html->getCrumbs(' / '); 7 7 8 echo '<br /><br />'; 9 echo '<div style="border: 1px dotted black;width:80%;padding:9px;margin:0 auto;">'; 8 echo '<div style="border: 1px dotted black;width:80%;padding:9px;margin:15px auto;">'; 10 9 echo $html->div('title_section', $data['User']['name']); 11 10 echo $html->div(null, $html->link($data['User']['email'], $data['User']['email'])); … … 136 135 endif; 137 136 138 139 137 echo '<h1>'.__('Participations in forums', true).'</h1>'; 140 141 138 if ( count($data['replies']) > 0 ): 142 139 // Replies on forums. Model: Topic … … 173 170 174 171 // Participations, model: Participation 175 $ppoints = (int) 0; // participation points 172 $ppoints = (int) 0; // participation points 173 echo '<h1>'.__('Participations', true).'</h1>'; 176 174 if ( count($data['participations']) > 0 ): 177 echo '<h1>'.__('Participations', true).'</h1>';178 175 foreach ($data['participations'] as $p): 179 176 e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">'); … … 204 201 e('</div>'); 205 202 endforeach; 206 e($html->div(null, $html->image('static/loading.gif', array('alt'=>'Loading'), array('id'=>'loadingpa', 'style'=>'display:none')))); 203 204 e($html->div(null, $html->image('static/loading.gif', array('alt'=>'Loading')), array('style'=>'display:none;', 'id'=>'loadingpa'))); 207 205 208 206 else: 209 207 echo $html->para(null, __('No participation found', true)); 208 endif; 209 210 // Reports, model: Report 211 $repoints = (int) 0; // participation points 212 echo '<h1>'.__('Reports', true).'</h1>'; 213 if ( count($data['reports']) > 0 ): 214 foreach ($data['reports'] as $r): 215 e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">'); 216 217 $div_id = 're'.$r['Report']['id']; 218 219 $repoints += (int) $r['Report']['points']; 220 221 echo $html->div(null, $r['Report']['points'].' '.__('points',true), array('id'=>$div_id,'style'=>'width:150px;float:left;')); 222 223 echo '<div style="width:450px;float:right;">'; 224 echo __('Report', true).': '. $html->link($r['Report']['description'], '#', array('title'=>__('View reply', true), 'onclick'=>"window.open('/admin/participations/show/".$r['Report']['id']."','mywin','left=20,top=20,width=700,height=700,toolbar=0,resizable=1')")).' '; 225 226 echo $ajax->link($html->image('static/adownmod.png', array('alt'=>__('Points down', true), 'title'=>__('Points down', true))) , 227 '/admin/reports/points/'.$r['Report']['id'].'/down', 228 array('update' => $div_id, 229 'loading' =>"Element.show('loadingrep');", 230 'interactive'=>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 231 'complete' =>"Element.hide('loadingrep');Effect.Appear(".$div_id.");"),null,false); 232 echo $ajax->link($html->image('static/aupmod.png', array('alt'=>__('Points up', true), 'title'=>__('Points up', true))), 233 '/admin/reports/points/'.$r['Report']['id'].'/up', 234 array('update' => $div_id, 235 'loading' =>"Element.show('loadingrep');", 236 'interactive'=>'tp('.$data['User']['id'].','.$data['Vclassroom']['id'].')', 237 'complete' =>"Element.hide('loadingrep');Effect.Appear(".$div_id.");"),null,false); 238 239 e('</div>'); 240 e('</div>'); 241 endforeach; 242 243 e($html->div(null, $html->image('static/loading.gif', array('alt'=>'Loading')), array('style'=>'display:none;', 'id'=>'loadingrep'))); 244 245 else: 246 echo $html->para(null, __('No reports found', true)); 210 247 endif; 211 248 … … 213 250 echo $html->div(null, 'Webquests ' .__('points', true) .': '. $wpoints); 214 251 echo $html->div(null, __('Participations', true) .' '. __('points', true) .': '. $ppoints, array('id'=>'parpoints')); 215 216 $points = ($tpoints + $wpoints + $rpoints + $ppoints); 252 echo $html->div(null, __('Reports', true) .' '. __('points', true) .': '. $repoints, array('id'=>'reppoints')); 253 254 $points = ($tpoints + $wpoints + $rpoints + $ppoints + $repoints); 217 255 218 256 echo $ajax->div('totalpoints') . '<b>'.__('Total points', true).': ' . $points .'</b>'. $ajax->divEnd('totalpoints'); -
trunk/app/views/vclassrooms/upload.ctp
r675 r732 9 9 <?php 10 10 echo $form->label('Report.file', __('File', true). ': '); 11 echo $form->file('Report.file').'<br /><br />'; 12 11 echo $form->file('Report.file').'<br /><br />'; 13 12 14 echo $form->input('Report.description', array('size'=>40, 'maxlength'=> 100, 'label'=>__('Description', true)));13 echo $form->input('Report.description', array('size'=>40, 'maxlength'=>40, 'label'=>__('Description', true))); 15 14 echo $form->end(__('Upload', true)); 16 15 ?> -
trunk/app/webroot/css/basic/styles.css
r720 r732 112 112 margin:4px; 113 113 } 114 115 /* Message by flash CakePHP stuff */ 116 .message 117 { 118 position:absolute; 119 top:20px; 120 left:800px; 121 width:200px; 122 font-size:7pt; 123 font-weight:bold; 124 color:white; 125 border: solid 1px orange; 126 padding:2px; 127 background-color:#66cc00; 128 text-align:center; 129 } 130 /* Hint text on Tests */ 131 .hint{font-size:7pt; padding:3px;margin:2px;border:1px dotted gray;} -
trunk/app/webroot/css/rubyx/rubyx.css
r721 r732 271 271 } 272 272 273 /* Used in tests */ 273 274 .hint{font-size:7pt; padding:3px;margin:2px;border:1px dotted gray;} 274 275
