Changeset b2a3dee in iPeer


Ignore:
Timestamp:
2012-12-20T15:21:25-08:00 (5 years ago)
Author:
Michael Tang <michael.tang@…>
Branches:
3.1.x, dev, hotfix, master, pagodabox, ticket463
Children:
aeda818
Parents:
759b912
git-author:
Michael Tang <michael.tang@…> (12/20/2012 03:17:20 PM)
git-committer:
Michael Tang <michael.tang@…> (12/20/2012 03:21:25 PM)
Message:

removed not used summary table from rubrics result

removed the original summary table from the rubrics table.

NOTE: some of the data in the accordion are calculated within the

original table. I have removed all traces of the original table and
left the calculations. We should combine the calculations done in
the evaluations helper functions and in the view.

have also fixed the total average for mixeval results summary table

to be rounded to 2 decimal places

Location:
app/views
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • app/views/evaluations/view_rubric_evaluation_results_detail.ctp

    r759b912 rb2a3dee  
    4343$groupAve = 0;
    4444$groupAverage = array_fill(1, $rubric['Rubric']['criteria'], 0);
     45$aveScoreSum = 0;
    4546?>
    4647<!-- summary table -->
    47 <?php echo '<table width="100%" border="0" align="center" cellpadding="4" cellspacing="2" class="outer-table">'; ?>
    48     <tr>
    49         <td width="25%" valign="middle" class="result-header-td"><?php __('Student Name:')?></td>
    50                 <?php echo '<td width="75%" rowspan="'.$rowspan.'" class="inner-table-cell"><div class="scrollbar"><table class="inner-table"><tr class="result-header-td">';
    51             for ($i = 1; $i <= $rubric['Rubric']["criteria"]; $i++) {
    52                 echo "<td width='200' class='inner-table-cell'>";
    53                 echo '<strong><font color="' . $color[ $i % sizeof($color) ] . '">' . $numerical_index . ". </font></strong>";
    54                 echo "(" .$rubricCriteria[$i-1]['multiplier']. ")";
    55                 echo "</td>";
    56                 $numerical_index++;
     48<?php
     49if ($groupMembersNoTutors) {
     50    foreach ($groupMembersNoTutors as $member) {
     51        $membersAry[$member['User']['id']] = $member;
     52        if (isset($memberScoreSummary[$member['User']['id']]['received_ave_score'])) {
     53            $avgScore = $memberScoreSummary[$member['User']['id']]['received_ave_score'];
     54            $penalty = number_format(($penalties[$member['User']['id']] / 100) * $avgScore, 2);
     55            $penalty_percent = $penalties[$member['User']['id']] / 100;
     56            $questionIndex = 0;
     57            foreach ($scoreRecords[$member['User']['id']]['rubric_criteria_ave'] AS $criteriaAveIndex => $criteriaAveGrade) {
     58                $scaledQuestionGrade = $criteriaAveGrade * (1 - $penalty_percent);
     59                $groupAverage[$criteriaAveIndex] += $scaledQuestionGrade;
     60                $deduction = $criteriaAveGrade * $penalty_percent;
     61                $questionIndex++;
    5762            }
    58 
    59         echo '<td width="250" class="inner-table-cell">'.__("Total:( /", true).number_format($rubric['Rubric']['total_marks'], 2).')' ?></td>
    60     </tr>
    61     <?php
    62     $aveScoreSum = 0;
    63     //This section will display the evaluatees' name
    64     //as display the average scores their peers gave them
    65     //for various criteria
    66     $questionSum = array_fill(0, $rubric['Rubric']['criteria'], 0);
    67     if ($groupMembersNoTutors) {
    68         foreach ($groupMembersNoTutors as $member) {
    69             $membersAry[$member['User']['id']] = $member;
    70             echo '<tr class="result-cell">';
    71             if (isset($memberScoreSummary[$member['User']['id']]['received_ave_score'])) {
    72                 $avgScore = $memberScoreSummary[$member['User']['id']]['received_ave_score'];
    73                 $penalty = number_format(($penalties[$member['User']['id']] / 100) * $avgScore, 2);
    74                 $penalty_percent = $penalties[$member['User']['id']] / 100;
    75                 $questionIndex = 0;
    76                 foreach ($scoreRecords[$member['User']['id']]['rubric_criteria_ave'] AS $criteriaAveIndex => $criteriaAveGrade) {
    77                     $scaledQuestionGrade = $criteriaAveGrade * (1 - $penalty_percent);
    78                     $groupAverage[$criteriaAveIndex] += $scaledQuestionGrade;
    79                     $deduction = $criteriaAveGrade * $penalty_percent;
    80                     $questionSum[$questionIndex] += $scaledQuestionGrade;
    81                     $questionIndex++;
    82                     $penalty > 0 ? $stringAddOn = ' - '."<font color=\"red\">".number_format($deduction, 2).
    83                         "</font> = ".number_format($scaledQuestionGrade, 2).'</td>' :
    84                         $stringAddOn = '';
    85                     echo '<td class="result-cell">' . number_format($criteriaAveGrade, 2).$stringAddOn;
    86                 }
    87             } else {
    88                 for ($i = 1; $i <= $rubric['Rubric']["criteria"]; $i++) {
    89                     echo "<td class='result-cell'>-</td>";
    90                 }
    91             }
    92                 // for calculating average percentage per question (ratio)
     63        }
     64        // for calculating average percentage per question (ratio)
    9365        $ratio = 0;
    9466        for ($i = 0; $i < $rubric['Rubric']["criteria"]; $i++) {
     
    9769        }
    9870        $avgPerQues[$member['User']['id']] = $ratio /  $rubric['Rubric']['criteria'];
    99         //totals section
    100         echo '<td class="total-cell">';
    10171        if (isset($memberScoreSummary[$member['User']['id']]['received_ave_score'])) {
    10272            $finalAvgScore = $avgScore - $penalty;
    103             $penalty > 0 ? $stringAddOn = ' - '."<font color=\"red\">".$penalty."</font> = ".number_format($finalAvgScore, 2) :
    104                 $stringAddOn = '';
    10573            $aveScoreSum += $finalAvgScore;
    106             echo number_format($avgScore, 2).$stringAddOn;
    10774            $receviedAvePercent = $finalAvgScore / $rubric['Rubric']['total_marks'] * 100;
    108             echo ' ('.number_format($receviedAvePercent) . '%)';
    10975            $membersAry[$member['User']['id']]['received_ave_score'] = $memberScoreSummary[$member['User']['id']]['received_ave_score'];
    11076            $membersAry[$member['User']['id']]['received_ave_score_%'] = $receviedAvePercent;
    111         } else {
    112             echo '-';
    113         }
    114         echo "</td>";
    115         echo "</tr>";
    116         //end scores
    117         }
    118 
    119         //averages
    120         echo '<tr class="tablesummary">';
    121         $questionIndex = 0;
    122         foreach ($groupAverage AS $sum) {
    123             echo '<td class="total-cell">' . number_format($sum / count($groupMembersNoTutors), 2). "</td>";
    124         }
    125         echo "<td><b>";
    126         $groupAve = number_format($aveScoreSum / count($groupMembersNoTutors), 2);
    127         echo $groupAve;
    128         echo ' ('.number_format($groupAve / $rubric['Rubric']['total_marks'] * 100) . '%)';
    129 
    130         echo "</b></td>";
    131     } ?>
    132     </tr></table></td></tr>
    133     <?php
    134     if ($groupMembers) {
    135         foreach ($groupMembers as $member) {
    136             $withTutorsAry[$member['User']['id']]['first_name'] = $member['User']['first_name'];
    137             $withTutorsAry[$member['User']['id']]['last_name'] = $member['User']['last_name'];
    13877        }
    13978    }
    140     if ($groupMembersNoTutors) {
    141         foreach ($groupMembersNoTutors as $member) {
    142             echo '<tr class="tablecell2" cellpadding="4" cellspacing="2" >';
    143             $membersAry[$member['User']['id']]['member'] = $member;
    144             echo '<td width="25%" class="group-members">' . $member['User']['first_name']." ".$member['User']['last_name'] . '</td></tr>' . "\n";
    145         }
     79    $groupAve = number_format($aveScoreSum / count($groupMembersNoTutors), 2);
     80} ?>
     81<?php
     82if ($groupMembers) {
     83    foreach ($groupMembers as $member) {
     84        $withTutorsAry[$member['User']['id']]['first_name'] = $member['User']['first_name'];
     85        $withTutorsAry[$member['User']['id']]['last_name'] = $member['User']['last_name'];
    14686    }
    147     echo '<tr class="tablesummary"><td class="group-members"><b>';
    148     echo __("Group Average: ", true);
    149     echo "</b></td></tr><tr><td> </td></tr>";
    150     ?>
    151     <tr><td>  </td></tr>
    152     <tr class="tablecell2" align="center"><td colspan="<?php echo $rubric['Rubric']["criteria"] +2; ?>">
    153         <form name="evalForm" id="evalForm" method="POST" action="<?php echo $html->url('markEventReviewed') ?>">
    154             <input type="hidden" name="event_id" value="<?php echo $event['Event']['id']?>" />
    155             <input type="hidden" name="group_id" value="<?php echo $event['Group']['id']?>" />
    156             <input type="hidden" name="course_id" value="<?php echo $event['Event']['course_id']; ?>" />
    157             <input type="hidden" name="group_event_id" value="<?php echo $event['GroupEvent']['id']?>" />
    158             <input type="hidden" name="display_format" value="Detail" />
    159 
    160         <?php
    161             if ($event['GroupEvent']['marked'] == "reviewed") {
    162                 echo "<input class=\"reviewed\" type=\"submit\" name=\"mark_not_reviewed\" value=\" ".__('Mark Peer Evaluations as Not Reviewed', true)."\" />";
    163             } else {
    164                 echo "<input class=\"reviewed\" type=\"submit\" name=\"mark_reviewed\" value=\" ".__('Mark Peer Evaluations as Reviewed', true)."\" />";
    165             }
    166         ?>
    167         </form></td>
    168     </tr>
    169 </table>
     87}?>
    17088
    17189<div id="accordion">
  • app/views/helpers/evaluation.php

    r759b912 rb2a3dee  
    6969            }
    7070        }
    71         $tr[] = $totalCounter ? $totalScore/$totalCounter : __('N/A', true);
     71        $tr[] = $totalCounter ? number_format($totalScore/$totalCounter,2) : __('N/A', true);
    7272        $table[] = $tr;
    7373       
Note: See TracChangeset for help on using the changeset viewer.