Changeset 746 for trunk/app/views

Show
Ignore:
Timestamp:
09/01/08 20:58:25 (3 months ago)
Author:
aarkerio
Message:

Little Bugs fixed

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/vclassrooms/admin_record.ctp

    r745 r746  
    3030 
    3131 // Tests 
     32 $test_points = (int) 0; 
    3233 if ( count($data['tests']) > 0 ): 
    3334  echo '<h1>'. __('Tests', true).'</h1>'; 
     
    3839    if ($t['TestsVclassroom']['points'] === null):  // not answered yet 
    3940      e($html->div(null, __('Not answered this test yet', true), array('id'=>$div_id,'style'=>'width:220px;float:left;font-size:7pt;'))); 
    40       e($html->div(null, $t['TestsVclassroom']['title'], array('style'=>'width:350px;float:right;'))); 
     41      e($html->div(null, $t['Test']['title'], array('style'=>'width:350px;float:right;'))); 
    4142    else: 
    4243      e($html->div(null, $t['TestsVclassroom']['points'].' '.__('points',true),array('id'=>$div_id,'style'=>'width:180px;float:left;'))); 
    4344      e('<div style="width:450px;float:right;">'); 
    44       echo $html->link($t['TestsVclassroom']['title'], '#'.$div_id, array('title'=>'View test', 'onclick'=> 
     45      echo $html->link($t['Test']['title'], '#'.$div_id, array('title'=>'View test', 'onclick'=> 
    4546        "window.open('/admin/tests/see/".$data['User']['id']."/".$t['TestsVclassroom']['test_id']."/".$data['Vclassroom']['id']."','mywin','left=20,top=10,width=700,height=700,scrollbars=1,toolbar=0,resizable=1')")) . '&nbsp;&nbsp;'; 
    4647        e('</div>'); 
    4748      endif; 
    4849      e('</div>'); 
     50      $test_points += (int) $t['TestsVclassroom']['points']; 
    4951    endforeach; 
    5052 else: 
     
    5355 
    5456 // Webquests --> ResultWebquest 
    55  $wpoints = (int) 0; // webquest points 
     57 $webquest_points = (int) 0; // webquest points 
    5658 if ( count($data['webquests']) > 0 ): 
    5759   echo '<h1>Webquests</h1>'; 
    5860   foreach ($data['webquests'] as $w): 
    59      $wpoints += $w['ResultWebquest']['points']; 
     61     $webquest_points += $w['ResultWebquest']['points']; 
    6062     $div_id   = 'w'.$w['Webquest']['id']; 
    6163     e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">'); 
     
    8789  
    8890 // Treasures. Model: Treasure   
    89  $tpoints = (int) 0; // tresure points 
     91 $treasure_points = (int) 0; // tresure points 
    9092 echo '<h1>'. __('Scavengers hunts', true).'</h1>'; 
    9193 if ( count($data['treasures']) > 0 ): 
    9294  foreach ($data['treasures'] as $tr): 
     95     $treasure_points += (int) $tr['ResultTreasure']['points']; 
    9396     $div_id   = 'tr'.$tr['Treasure']['id']; 
    9497     e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">'); 
     
    120123 // Replies on forums. Model: Topic   
    121124 echo '<h1>'.__('Participations in forums', true).'</h1>'; 
    122  $rpoints = (int) 0; 
     125 $reply_points = (int) 0; 
    123126 if ( count($data['replies']) > 0 ): 
    124127   foreach ($data['replies'] as $re):   
     
    145148        e('</div>');  
    146149       e('</div>'); 
    147        $rpoints += (int) $re['Reply']['points']; 
     150       $reply_points += (int) $re['Reply']['points']; 
    148151    endforeach; 
    149152  e($html->div(null, $html->image('static/loading.gif', array('alt'=>'Loading')), array('style'=>'display:none', 'id'=>'lorep'))); 
     
    153156  
    154157 // Participations, model:  Participation 
    155  $ppoints = (int) 0;  // participation points 
     158 $participation_points = (int) 0;  // participation points 
    156159 echo '<h1>'.__('Participations', true).'</h1>';  
    157160 if ( count($data['participations']) > 0 ): 
     
    159162   e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">'); 
    160163   $div_id = 'pa'.$p['Participation']['id']; 
    161    $ppoints += $p['Participation']['points']; 
     164   $participation_points += (int) $p['Participation']['points']; 
    162165   
    163166   echo $html->div(null, $p['Participation']['points'].' '.__('points', true), array('id'=>$div_id,'style'=>'width:150px;float:left;')); 
     
    189192  
    190193 // Reports, model:  Report 
    191  $repoints = (int) 0;  // report points 
     194 $report_points = (int) 0;  // report points 
    192195 echo '<h1>'.__('Reports', true).'</h1>';  
    193196 if ( count($data['reports']) > 0 ): 
     
    195198   e('<div style="border:1px dotted gray;padding:4px;margin:2px;height:20px;">'); 
    196199   $div_id = 're'.$r['Report']['id']; 
    197    $repoints += (int) $r['Report']['points']; 
     200   $report_points += (int) $r['Report']['points']; 
    198201   echo $html->div(null, $r['Report']['points'].' '.__('points',true),  array('id'=>$div_id,'style'=>'width:150px;float:left;')); 
    199202 
     
    224227 endif; 
    225228 
    226  echo  $html->div(null, __('Scavengers hunts', true) .' ' .__('points', true) .': '. $tpoints); 
    227  echo  $html->div(null, 'Webquests ' .__('points', true) .': '. $wpoints); 
    228  echo  $html->div(null, __('Replies', true). ' ' .__('points', true) .': '. $rpoints); 
    229  echo  $html->div(null, __('Participations', true) .' '. __('points', true) .': '. $ppoints, array('id'=>'parpoints')); 
    230  echo  $html->div(null, __('Reports', true) .' '. __('points', true) .': '. $repoints, array('id'=>'reppoints')); 
    231   
    232  $points = ($tpoints + $wpoints + $rpoints + $ppoints + $repoints); 
     229 echo  $html->div(null, __('Test', true) .' ' .__('points', true) .': '. $test_points); 
     230 echo  $html->div(null, __('Scavengers hunts', true) .' ' .__('points', true) .': '. $treasure_points); 
     231 echo  $html->div(null, 'Webquests ' .__('points', true) .': '. $webquest_points); 
     232 echo  $html->div(null, __('Replies', true). ' ' .__('points', true) .': '. $reply_points); 
     233 echo  $html->div(null, __('Participations', true) .' '. __('points', true) .': '. $participation_points, array('id'=>'parpoints')); 
     234 echo  $html->div(null, __('Reports', true) .' '. __('points', true) .': '. $report_points, array('id'=>'reppoints')); 
     235  
     236 $points = ($test_points + $treasure_points + $webquest_points + $reply_points + $participation_points + $report_points); 
    233237  
    234238 echo  $ajax->div('totalpoints') .'<b>'.__('Total points', true).': ' . $points .'</b>'. $ajax->divEnd('totalpoints');