Changeset 9030960 in iPeer


Ignore:
Timestamp:
2012-12-05T15:37:23-08:00 (6 years ago)
Author:
Michael Tang <michael.tang@…>
Branches:
3.1.x, dev, hotfix, master, pagodabox, ticket463
Children:
2aec9c8
Parents:
03f9355
Message:

refactored student view of rubrics result

The student view of the rubrics results has been refactored to the

same theme as the mixeval theme.

I have also removed some permissions from the student/tutor roles,

which are no longer valid which include makeSimpleEvaluation because
they have been condensed to be makeEvaluation.

Location:
app
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • app/vendors/shells/create_acl.php

    r03f9355 r9030960  
    567567        $this->Acl->allow($role, 'controllers/guard/guard/logout');
    568568        $this->Acl->allow($role, 'controllers/Evaluations/makeEvaluation');
    569         $this->Acl->allow($role, 'controllers/Evaluations/makeSimpleEvaluation');
    570         $this->Acl->allow($role, 'controllers/Evaluations/makeRubricEvaluation');
    571         $this->Acl->allow($role, 'controllers/Evaluations/makeMixevalEvaluation');
    572         $this->Acl->allow($role, 'controllers/Evaluations/makeSurveyEvaluation');
    573569        $this->Acl->allow($role, 'controllers/Evaluations/studentViewEvaluationResult');
    574570        $this->Acl->allow($role, 'controllers/Evaluations/completeEvaluationRubric');
     
    595591        $this->Acl->allow($role, 'controllers/guard/guard/logout');
    596592        $this->Acl->allow($role, 'controllers/Evaluations/makeEvaluation');
    597         $this->Acl->allow($role, 'controllers/Evaluations/makeSimpleEvaluation');
    598         $this->Acl->allow($role, 'controllers/Evaluations/makeRubricEvaluation');
    599         $this->Acl->allow($role, 'controllers/Evaluations/makeMixevalEvaluation');
    600         $this->Acl->allow($role, 'controllers/Evaluations/makeSurveyEvaluation');
    601593        $this->Acl->allow($role, 'controllers/Evaluations/studentViewEvaluationResult');
    602594        $this->Acl->allow($role, 'controllers/Evaluations/completeEvaluationRubric');
  • app/views/elements/evaluations/student_view_mixeval_details.ctp

    r03f9355 r9030960  
    99?>
    1010<br/><br/>
    11 <table width="100%" border="0" align="center" cellpadding="4" cellspacing="2">
    12         <tr class="tableheader" align="center">
     11<table class="standardtable">
     12        <tr>
    1313    <td width="100" valign="top" colspan="<?php echo ($mixeval['Mixeval']["lickert_question_max"]+1)?>"><?php __('Section One')?>:</td>
    14   </tr>
    15         <tr class="tableheader" align="center">
     14    </tr>
     15        <tr>
    1616    <td width="100" valign="top"><?php __('Person Being Evaluated')?></td>
    1717    <?php
    1818      for ($i=1; $i<=$mixeval['Mixeval']["lickert_question_max"]; $i++) {
    19         if (isset($mixevalQuestion[$i])) {
    20                 echo "<td><strong><font color=" . $color[ $i % sizeof($color) ] . ">" . ($i) . ". "  . "</font></strong>";
    21                 echo $mixevalQuestion[$i]['title'];
    22                 echo "</td>";
    23                 $pos++;
     19        if (isset($mixevalQuestion[$i])) { ?>
     20                <td>
     21                <?php echo $i.' '.$mixevalQuestion[$i]['title'] ?>
     22                </td>
     23                <?php $pos++;
    2424        }
    2525        }
    2626    ?>
    27   </tr>
     27    </tr>
    2828 <?php
    2929if (!$gradeReleased && !$commentReleased) {
    30   $cols = $mixeval['Mixeval']["lickert_question_max"]+1;
    31   echo "<tr class=\"tablecell2\" align=\"center\"><td colspan=".$cols.">";
    32   echo "<font color=\"red\">".__('Comments/Grades Not Released Yet.', true)."</font></td></td>";
    33 }
    34 else if ($gradeReleased || $commentReleased) {
    35  //Retrieve the individual mixeval detail
    36  if (isset($evalResult[$userId])) {
    37    $memberResult = $evalResult[$userId];
    38    if (isset($scoreRecords)) {
    39      shuffle($memberResult);
    40    }
    41    foreach ($memberResult AS $row): $memberMixeval = $row['EvaluationMixeval'];
     30    $cols = $mixeval['Mixeval']["lickert_question_max"]+1; ?>
     31    <tr><td colspan="<?php echo $cols ?>">
     32    <font color="red"><?php __('Comments/Grades Not Released Yet.', true) ?></font></td></tr>
     33<?php } else if ($gradeReleased || $commentReleased) {
     34    //Retrieve the individual mixeval detail
     35    if (isset($evalResult[$userId])) {
     36        $memberResult = $evalResult[$userId];
     37        if (isset($scoreRecords)) {
     38            shuffle($memberResult);
     39        }
     40        foreach ($memberResult AS $row): $memberMixeval = $row['EvaluationMixeval'];
    4241
    43      if ($scoreRecords == null) { // renders self evaluation
    44         $member = $membersAry[$memberMixeval['evaluatee']];
     42        if ($scoreRecords == null) { // renders self evaluation
     43            $member = $membersAry[$memberMixeval['evaluatee']];
     44        } else { // renders evaluations from peers
     45            $member = $membersAry[$memberMixeval['evaluator']];
     46        } ?>
     47        <tr id='details'>
     48        <?php if (isset($scoreRecords)) { ?>
     49        <td width='15%'><?php echo $currentUser['full_name'] ?></td>
     50    <?php } else { ?>
     51        <td width='15%'><?php echo $member['User']['first_name'].' '.$member['User']['last_name']?></td>
     52    <?php }
    4553
    46      } else { // renders evaluations from peers
    47         $member = $membersAry[$memberMixeval['evaluator']];
    48      }
     54    $resultDetails = $memberMixeval['details'];
    4955
    50      echo "<tr class=\"tablecell2\">";
    51      if (isset($scoreRecords)) {
    52        echo "<td width='15%'>".$currentUser['full_name']."</td>";
    53      } else {
    54        echo "<td width='15%'>".$member['User']['full_name']."</td>";
    55      }
    56 
    57      $resultDetails = $memberMixeval['details'];
    58 
    59      //foreach ($resultDetails AS $detail) : $mixevalDet = $detail['EvaluationMixevalDetail'];
    60      for ($i=1; $i<=$mixeval['Mixeval']["lickert_question_max"]; $i++) {
    61         $mixevalDet = $memberMixeval['details'][$i-1]['EvaluationMixevalDetail'];
    62         echo "<td valign=\"middle\">";
    63         //Point Description Detail
    64         if ($gradeReleased && isset($mixevalDet)) {
     56    for ($i=1; $i<=$mixeval['Mixeval']["lickert_question_max"]; $i++) {
     57        $mixevalDet = $memberMixeval['details'][$i-1]['EvaluationMixevalDetail']; ?>
     58        <td valign="middle">
     59        <!-- Point Description Detail -->
     60        <?php if ($gradeReleased && isset($mixevalDet)) {
    6561            if (isset($mixevalQuestion[$i-1]['Description'][$mixevalDet['selected_lom']-1]['descriptor'])) {
    6662                echo $mixevalQuestion[$i-1]['Description'][$mixevalDet['selected_lom']-1]['descriptor'];
    67             }
    68         echo "<br />";
    69         }
     63            } ?>
     64        <br />
     65        <?php } ?>
    7066
    71         //Points Detail
    72         echo "<strong>Points: </strong>";
    73         if ($gradeReleased && isset($mixevalDet)) {
    74           //if (
    75                 //$lom = $mixeval["Question"][$i-1]["multiplier"]/ $mixevalDet["selected_lom"];
    76                 $lom = $mixevalDet['grade'];
     67        <!-- Points Detail -->
     68        <strong>Points: </strong>
     69        <?php if ($gradeReleased && isset($mixevalDet)) {
     70            $lom = $mixevalDet['grade'];
    7771                $empty = $mixeval["Question"][$i-1]["multiplier"];
    7872                for ($v = 0; $v < $lom; $v++) {
     
    8276                for ($t=0; $t < $empty; $t++) {
    8377                        echo $html->image('evaluations/circle_empty.gif', array('align'=>'middle', 'vspace'=>'1', 'hspace'=>'1','alt'=>'circle_empty'));
    84                 }
    85                 echo "<br />";
    86         } else {
    87                 echo "n/a<br />";
    88         }
     78                } ?>
     79                <br />
     80        <?php } else { ?>
     81                n/a<br />
     82        <?php } ?>
    8983
    90         //Grades Detail
    91         echo "<strong>Grades: </strong>";
    92         if ($gradeReleased && isset($mixevalDet)) {
     84        <!-- Grades Detail -->
     85        <strong>Grades: </strong>
     86        <?php if ($gradeReleased && isset($mixevalDet)) {
    9387            echo number_format($lom, 2)." / ".number_format($mixeval["Question"][$i-1]["multiplier"], 2)."<br>";
    94         } else {
    95                 echo "n/a<br />";
    96         }
     88        } else { ?>
     89                n/a<br />
     90        <?php } ?>
    9791
    98         echo "</td>";
    99      }
    100      echo "</tr>";
     92        </td>
     93     <?php } ?>
     94     </tr>
    10195
    102      endforeach;
     96     <?php endforeach;
    10397  }
    10498}
     
    106100</table>
    107101<br/><br/>
    108 <table width="100%" border="0" align="center" cellpadding="4" cellspacing="2">
    109         <tr class="tableheader" align="center">
     102<table class="standardtable">
     103        <tr>
    110104    <td width="100" valign="top" colspan="<?php echo ($mixeval['Mixeval']["prefill_question_max"]+1)?>"><?php __('Section Two')?>:</td>
    111   </tr>
    112         <tr class="tableheader" align="center">
     105    </tr>
     106        <tr>
    113107    <td width="100" valign="top"><?php __('Person Being Evaluated')?></td>
    114108    <?php
    115109      for ($i=$pos; $i<=$mixeval['Mixeval']["total_question"]; $i++) {
    116         if (isset($mixevalQuestion[$i-1])) {
    117                 echo "<td><strong><font color=" . $color[ $i % sizeof($color) ] . ">" . ($i) . ". "  . "</font></strong>";
    118                 echo $mixevalQuestion[$i-1]['title'];
    119                 echo "</td>";
    120         }
    121         }
     110        if (isset($mixevalQuestion[$i-1])) { ?>
     111                <td>
     112                <?php echo $i.' '.$mixevalQuestion[$i-1]['title'] ?>
     113                </td>
     114        <?php }
     115        }
    122116    ?>
    123   </tr>
    124  <?php
     117    </tr>
     118<?php
    125119if (!$gradeReleased && !$commentReleased) {
    126   $cols = $mixeval['Mixeval']["prefill_question_max"]+1;
    127   echo "<tr class=\"tablecell2\" align=\"center\"><td colspan=".$cols.">";
    128   echo "<font color=\"red\">".__('Comments/Grades Not Released Yet.', true)."</font></td></td>";
    129 }else if ($gradeReleased || $commentReleased) {
    130 
    131  if (isset($evalResult[$userId])) {
     120  $cols = $mixeval['Mixeval']["prefill_question_max"]+1; ?>
     121  <tr><td colspan="<?php $cols ?>">
     122  <font color="red"><?php __('Comments/Grades Not Released Yet.', true) ?></font></td></tr>
     123<?php }else if ($gradeReleased || $commentReleased) {
     124    if (isset($evalResult[$userId])) {
    132125   //Retrieve the individual mixeval detail
    133126   $memberResult = $evalResult[$userId];
     
    141134     } else {
    142135        $member = $membersAry[$memberMixeval['evaluator']];
    143      }
     136     } ?>
    144137
    145      echo "<tr class=\"tablecell2\">";
    146      if (isset($scoreRecords)) {
    147        echo "<td width='15%'>".$currentUser['full_name']."</td>";
    148      } else {
    149        echo "<td width='15%'>".$member['User']['full_name']."</td>";
    150      }
     138     <tr id='details'>
     139     <?php if (isset($scoreRecords)) { ?>
     140       <td width='15%'><?php echo $currentUser['full_name'] ?></td>
     141     <?php } else { ?>
     142       <td width='15%'><?php echo $member['User']['first_name'].' '.$member['User']['last_name']?></td>
     143     <?php }
    151144
    152145     $resultDetails = $memberMixeval['details'];
     
    154147     for ($i=$pos; $i<=$mixeval['Mixeval']["total_question"]; $i++) {
    155148        if (isset($memberMixeval['details'][$i-1])) {
    156           $mixevalDet = $memberMixeval['details'][$i-1]['EvaluationMixevalDetail'];
    157           echo "<td valign=\"middle\">";
     149          $mixevalDet = $memberMixeval['details'][$i-1]['EvaluationMixevalDetail']; ?>
     150          <td valign="middle">
    158151
    159           //Comments
    160           echo "<br/><strong>".__('Comment', true).": </strong>";
    161           if ($commentReleased && isset($mixevalDet)) {
     152          <!-- Comments -->
     153          <br/><strong><?php echo __('Comment', true)?>: </strong>
     154          <?php if ($commentReleased && isset($mixevalDet)) {
    162155                echo $mixevalDet["question_comment"];
    163           } else {
    164                 echo "n/a<br />";
    165           }
    166           echo "<br />";
     156          } else { ?>
     157                n/a<br />
     158          <?php } ?>
     159          <br />
    167160
    168           echo "</td>";
    169        //endforeach;
    170       }
    171     }
    172      echo "</tr>";
     161          </td>
     162      <?php }
     163    } ?>
     164     </tr>
    173165
    174      endforeach;
     166     <?php endforeach;
    175167  }
    176168}
  • app/views/evaluations/student_view_mixeval_evaluation_results.ctp

    r03f9355 r9030960  
     1<h2><?php __('Evaluation Result Detail')?></h2>
     2<!-- Event Details Table -->
     3
     4<table class="standardtable">
     5<tr>
     6    <th><?php __('Event Name')?></th>
     7    <th><?php __('Evaluated By')?></th>
     8    <th><?php __('Due Date')?></th>
     9    <th><?php __('Self-Evaluation')?></th>
     10</tr>
     11<tr>
     12    <td><?php echo $event['Event']['title'] ?></td>
     13    <td><?php echo $event['group_name'] ?></td>
     14    <td><?php echo Toolkit::formatDate(date("Y-m-d H:i:s", strtotime($event['Event']['due_date']))) ?></td>
     15    <td><?php echo ($event['Event']['self_eval']) ? 'Yes' : 'No' ?></td>
     16</tr>
     17</table>
     18
     19<table class="standardtable">
     20<tr>
     21    <th><?php __('Description')?></th>
     22</tr>
     23<tr>
     24    <td><?php echo $event['Event']['description'] ?></td>
     25</tr>
     26</table>
     27
     28<h2><?php __('Summary')?></h2>
     29<table class="standardtable">
     30<tr>
     31    <th><?php __('Rating')?></th>
     32</tr>
     33<tr>
     34    <td>
     35    <?php
     36    isset($scoreRecords[$currentUser['id']]['grade_released'])? $gradeReleaseStatus = $scoreRecords[$currentUser['id']]['grade_released'] : $gradeReleaseStatus = array();
     37    if ($gradeReleaseStatus) {
     38            $finalAvg = $memberScoreSummary[$currentUser['id']]['received_ave_score'] - number_format($avePenalty, 2);
     39            (number_format($avePenalty, 2) > 0) ? ($stringAddOn = ' - '.'('.'<font color=\'red\'>'.number_format($avePenalty, 2).'</font>'.
     40                ')'.'<font color=\'red\'>*</font>'.' = '.number_format($finalAvg, 2)) : $stringAddOn = '';
     41               
     42            echo number_format($memberScoreSummary[$currentUser['id']]['received_ave_score'], 2).$stringAddOn;
     43            number_format($avePenalty, 2) > 0 ? $penaltyNote = '&nbsp &nbsp &nbsp &nbsp &nbsp ( )'.'<font color=\'red\'>*</font>'.' : '.$studentResult['penalty'].
     44                '% late penalty.' : $penaltyNote = '';
     45            echo $penaltyNote;
     46        } else {
     47            echo __('Not Released', true);
     48        }
     49    ?>
     50    </td>
     51</tr>
     52</table>
     53
    154<table width="100%"  border="0" cellpadding="8" cellspacing="0" bgcolor="#FFFFFF">
    255  <tr>
     
    1770          $releaseStatus = array();
    1871        }
    19     $params = array('controller'=>'evaluations', 'event'=>$event, 'gradeReleaseStatus'=>$releaseStatus, 'ratingPenalty' => number_format($avePenalty, 2),
    20         'penalty' => $penalty, 'aveScore'=>isset($memberScoreSummary[$currentUser['id']]['received_total_score']) ? number_format($memberScoreSummary[$currentUser['id']]['received_total_score'], 2) : 0, 'groupAve'=>null);
    21     echo $this->element('evaluations/student_view_event_info', $params);
    2272    ?>
    2373<div id='mixeval_result'>
Note: See TracChangeset for help on using the changeset viewer.