Changeset 732 for trunk

Show
Ignore:
Timestamp:
08/21/08 18:11:48 (3 months ago)
Author:
aarkerio
Message:

Little bugs fixed

Location:
trunk/app
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/config/sql/postgresql/reports.sql

    r605 r732  
    22   id serial NOT NULL PRIMARY KEY, 
    33   filename varchar(80) NOT NULL UNIQUE, 
     4   description varchar(40) NOT NULL,  
    45   student_id int NOT NULL REFERENCES users(id) ON DELETE CASCADE, 
    56   points smallint NOT NULL DEFAULT 2, 
  • trunk/app/controllers/participations_controller.php

    r605 r732  
    3434       
    3535      $this->data['Participation']['user_id']  = $this->Auth->user('id'); 
    36       // die( debug($this->data['Participation'])); 
     36      
    3737      $this->Participation->create(); 
    3838      
    3939      if ($this->Participation->save($this->data['Participation'])): 
    4040      $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); 
    4242      endif; 
    4343   endif; 
     
    5454   $this->data['Participation']['points']   = $points; 
    5555      
    56    if ($this->Participation->save($this->data['Participation'])): 
     56   if ($this->Participation->save($this->data)): 
    5757             $this->set('points', $points); 
    5858         $this->render('points', 'ajax'); 
  • trunk/app/controllers/tests_controller.php

    r729 r732  
    6868 public function result() 
    6969 {  
    70  try { 
     70  if ( !$this->Auth->user()): 
     71    $this->redirect('/'); 
     72  endif;  
     73 
     74  try { 
    7175   //die(debug($this->data['Test'])); 
    7276    
  • trunk/app/locale/spa/LC_MESSAGES/default.po

    r731 r732  
    55msgstr "Si" 
    66 
     7msgid  "No reports found" 
     8msgstr "No hay reportes" 
     9 
     10msgid  "Your participation has been saved" 
     11msgstr "Tu participación ha sido registrada" 
     12 
    713msgid  "See participation" 
    814msgstr "Ver participación" 
     
    1622msgid  "Participations in forums" 
    1723msgstr "Participaciones en foros" 
     24 
     25msgid  "Participations" 
     26msgstr "Participaciones" 
    1827 
    1928msgid  "You have been registered" 
  • trunk/app/models/vclassroom.php

    r731 r732  
    3535                      'Participation' => 
    3636               array('className'     => 'Participation', 
     37                 'conditions'    => null, 
     38                 'order'         => null, 
     39                 'limit'         => null, 
     40                 'foreignKey'    => 'vclassroom_id' 
     41                 ), 
     42                      'Report' => 
     43               array('className'     => 'Report', 
    3744                 'conditions'    => null, 
    3845                 'order'         => null, 
     
    97104      'status'  => VALID_NOT_EMPTY 
    98105   ); 
     106 
    99107/* 
    100108public $validate = array( 
     
    120128                               ) 
    121129                       ); */  
    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) 
    124132 * 
    125133 * @param  integer $user_id:  in $fact student_id 
     
    128136 * @access public 
    129137 * @author Manuel Montoya  
    130  **/ 
     138**/ 
    131139 public function studentRecord($user_id, $vclassroom_id) 
    132140 { 
    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{    
    135144     $record                  = array(); 
    136145    
    137      $this->User->unbindAll();  // unbind unnecesaries tables 
     146     $this->User->unbindAll();  // unbind unnecesary tables 
    138147      
    139148     //Get the student data 
     
    147156     $record['tests']   = $this->TestsVclassroom->findAll($conditions, $fields); 
    148157     // die(debug($record)); 
    149     
     158 
     159     // foreach test check in Result model 
    150160     foreach($record['tests'] as $k => $t): 
    151161       $record['tests'][$k]['TestsVclassroom']['title'] = $t['Test']['title']; 
     
    174184     //die(debug($record['tests'])); 
    175185 
    176      // Now Treasure Model 
     186     // Now Treasure model 
    177187     $conditions = array('ResultTreasure.vclassroom_id'=>$vclassroom_id, 'ResultTreasure.user_id'=>$user_id); 
    178188     $fields     = array('ResultTreasure.points', 'Treasure.title', 'Treasure.id'); //null; 
    179189     $record['treasures']  =  $this->Treasure->ResultTreasure->findAll($conditions, $fields); 
    180    
    181      // Consult Reply Model     
     190      
     191     // Consult Reply model to know student participation in forums     
    182192     $conditions        = array('Reply.vclassroom_id'=>$vclassroom_id, 'Reply.user_id'=>$user_id); 
    183193     $fields            = array('Reply.topic_id', 'Reply.vclassroom_id', 'Reply.id', 'Reply.points'); //null; 
     
    188198     $fields         = array('Participation.title', 'Participation.id', 'Participation.points'); //null;  
    189199     $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      
    191206     // Webquest 
    192207     $conditions     = array('ResultWebquest.vclassroom_id'=>$vclassroom_id, 'ResultWebquest.user_id'=>$user_id); 
  • trunk/app/views/vclassrooms/admin_record.ctp

    r731 r732  
    66 echo $html->getCrumbs(' / '); 
    77 
    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;">'; 
    109 echo $html->div('title_section', $data['User']['name']); 
    1110 echo $html->div(null, $html->link($data['User']['email'], $data['User']['email'])); 
     
    136135 endif; 
    137136    
    138  
    139137 echo '<h1>'.__('Participations in forums', true).'</h1>'; 
    140  
    141138 if ( count($data['replies']) > 0 ): 
    142139   // Replies on forums. Model: Topic 
     
    173170 
    174171 // Participations, model:  Participation 
    175  $ppoints = (int) 0;  // participation points  
     172 $ppoints = (int) 0;  // participation points 
     173 echo '<h1>'.__('Participations', true).'</h1>';  
    176174 if ( count($data['participations']) > 0 ): 
    177    echo '<h1>'.__('Participations', true).'</h1>'; 
    178175   foreach ($data['participations'] as $p): 
    179176   e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">'); 
     
    204201    e('</div>'); 
    205202    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'))); 
    207205       
    208206 else: 
    209207    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)); 
    210247 endif; 
    211248 
     
    213250 echo  $html->div(null, 'Webquests ' .__('points', true) .': '. $wpoints); 
    214251 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); 
    217255  
    218256 echo  $ajax->div('totalpoints') . '<b>'.__('Total points', true).': ' . $points .'</b>'. $ajax->divEnd('totalpoints'); 
  • trunk/app/views/vclassrooms/upload.ctp

    r675 r732  
    99<?php 
    1010 echo $form->label('Report.file', __('File', true). ': '); 
    11  echo $form->file('Report.file').'<br /><br />'; 
    12    
     11 echo $form->file('Report.file').'<br /><br />';   
    1312 
    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))); 
    1514 echo $form->end(__('Upload', true));  
    1615?> 
  • trunk/app/webroot/css/basic/styles.css

    r720 r732  
    112112   margin:4px; 
    113113} 
     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  
    271271} 
    272272 
     273/* Used in tests */ 
    273274.hint{font-size:7pt; padding:3px;margin:2px;border:1px dotted gray;} 
    274275