source: iPeer/app/views/evaluations/view_rubric_evaluation_results_detail.ctp @ 9df04ef0

3.1.xdevhotfixpagodaboxticket463
Last change on this file since 9df04ef0 was 9df04ef0, checked in by Compass <pan.luo@…>, 6 years ago

fixed the view evaluation result ctp files

  • Property mode set to 100644
File size: 16.9 KB
Line 
1<?php echo $html->script('ricobase');
2echo $html->script('ricoeffects');
3echo $html->script('ricoanimation');
4echo $html->script('ricopanelcontainer');
5echo $html->script('ricoaccordion');
6?>
7<div class="content-container">
8<!-- Render Event Info table -->
9<?php echo $this->element('evaluations/view_event_info', array('controller'=>'evaluations', 'event'=>$event));?>
10
11<div class="event-summary">
12    <span class="instruction-icon"><?php __('Summary:')?> ( <?php echo $this->Html->link(__('Basic', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['Group']['id']."/Basic")?> |
13    <?php echo $html->link(__('Detail', true), "/evaluations/viewEvaluationResults/".$event['Event']['id']."/".$event['Group']['id']."/Detail")?> )</span>
14    <font size = "1" face = "arial" color = "red" >*Numerics in red denotes late submission penalty.</font>
15    <?php if (!$allMembersCompleted): ?>
16        <div class="incompleted">
17          <?php __('These people have not yet submit their evaluations:')?>
18            <ul>
19                <?php foreach($inCompletedMembers as $row): $user = $row['User']; ?>
20                    <li><?php echo $user['first_name']." ".$user['last_name'] . ($row['Role']['role_id']==4 ? ' (TA)' : ' (student)');?></li>
21                <?php endforeach; ?>
22            </ul>
23        </div>
24    <?php endif; ?>
25</div>
26
27<div id='rubric_result'>
28
29<?php
30$rowspan = count($groupMembersNoTutors) + 3;
31$numerical_index = 1;  //use numbers instead of words; get users to refer to the legend
32$color = array("", "#FF3366","#ff66ff","#66ccff","#66ff66","#ff3333","#00ccff","#ffff33");
33$membersAry = array();  //used to format result (students)
34$withTutorsAry = array(); //used to format result (students,tutors)
35$groupAve = 0;
36$groupAverage = array_fill(1, $rubric['Rubric']['criteria'], 0);
37?>
38<!-- summary table -->
39<?php echo '<table width="100%" border="0" align="center" cellpadding="4" cellspacing="2" class="outer-table">'; ?>
40    <tr>
41        <td width="25%" valign="middle" class="result-header-td"><?php __('Student Name:')?></td>
42                <?php echo '<td width="75%" rowspan="'.$rowspan.'" class="inner-table-cell"><div class="scrollbar"><table class="inner-table"><tr class="result-header-td">';
43            for ($i = 1; $i <= $rubric['Rubric']["criteria"]; $i++) {
44                echo "<td width='200' class='inner-table-cell'>";
45                echo '<strong><font color="' . $color[ $i % sizeof($color) ] . '">' . $numerical_index . ". </font></strong>";
46                echo "(" .$rubricCriteria[$i-1]['multiplier']. ")";
47                echo "</td>";
48                $numerical_index++;
49            }
50
51        echo '<td width="250" class="inner-table-cell">'.__("Total:( /", true).number_format($rubric['Rubric']['total_marks'], 2).')' ?></td>
52    </tr>
53    <?php
54    $aveScoreSum = 0;
55    //This section will display the evaluatees' name
56    //as display the average scores their peers gave them
57    //for various criteria
58    $questionSum = array_fill(0, $rubric['Rubric']['criteria'], 0);
59    if ($groupMembersNoTutors) {
60        foreach ($groupMembersNoTutors as $member) {
61            $membersAry[$member['User']['id']] = $member;
62            echo '<tr class="result-cell">';
63            if (isset($memberScoreSummary[$member['User']['id']]['received_ave_score'])) {
64                $avgScore = $memberScoreSummary[$member['User']['id']]['received_ave_score'];
65                $penalty = number_format(($penalties[$member['User']['id']] / 100) * $avgScore, 2);
66                $penalty_percent = $penalties[$member['User']['id']] / 100;
67                $questionIndex = 0;
68                foreach ($scoreRecords[$member['User']['id']]['rubric_criteria_ave'] AS $criteriaAveIndex => $criteriaAveGrade) {
69                    $scaledQuestionGrade = $criteriaAveGrade * (1 - $penalty_percent);
70                    $groupAverage[$criteriaAveIndex] += $scaledQuestionGrade;
71                    $deduction = $criteriaAveGrade * $penalty_percent;
72                    $questionSum[$questionIndex] += $scaledQuestionGrade;
73                    $questionIndex++;
74                    $penalty > 0 ? $stringAddOn = ' - '."<font color=\"red\">".number_format($deduction, 2).
75                        "</font> = ".number_format($scaledQuestionGrade, 2).'</td>' :
76                        $stringAddOn = '';
77                    echo '<td class="result-cell">' . number_format($criteriaAveGrade, 2).$stringAddOn;
78                }
79            } else {
80                for ($i = 1; $i <= $rubric['Rubric']["criteria"]; $i++) {
81                    echo "<td class='result-cell'>-</td>";
82                }
83            }
84                // for calculating average percentage per question (ratio)
85        $ratio = 0;
86        for ($i = 0; $i < $rubric['Rubric']["criteria"]; $i++) {
87            if (!empty($scoreRecords[$member['User']['id']]['rubric_criteria_ave']))
88                $ratio += $scoreRecords[$member['User']['id']]['rubric_criteria_ave'][$i+1] / $rubricCriteria[$i]['multiplier'];
89        }
90        $avgPerQues[$member['User']['id']] = $ratio /  $rubric['Rubric']['criteria'];
91        //totals section
92        echo '<td class="total-cell">';
93        if (isset($memberScoreSummary[$member['User']['id']]['received_ave_score'])) {
94            $finalAvgScore = $avgScore - $penalty;
95            $penalty > 0 ? $stringAddOn = ' - '."<font color=\"red\">".$penalty."</font> = ".number_format($finalAvgScore, 2) :
96                $stringAddOn = '';
97            $aveScoreSum += $finalAvgScore;
98            echo number_format($avgScore, 2).$stringAddOn;
99            $receviedAvePercent = $finalAvgScore / $rubric['Rubric']['total_marks'] * 100;
100            echo ' ('.number_format($receviedAvePercent) . '%)';
101            $membersAry[$member['User']['id']]['received_ave_score'] = $memberScoreSummary[$member['User']['id']]['received_ave_score'];
102            $membersAry[$member['User']['id']]['received_ave_score_%'] = $receviedAvePercent;
103        } else {
104            echo '-';
105        }
106        echo "</td>";
107        echo "</tr>";
108        //end scores
109        }
110
111        //averages
112        echo '<tr class="tablesummary">';
113        $questionIndex = 0;
114        foreach ($groupAverage AS $sum) {
115            echo '<td class="total-cell">' . number_format($sum / count($groupMembersNoTutors), 2). "</td>";
116        }
117        echo "<td><b>";
118        $groupAve = number_format($aveScoreSum / count($groupMembersNoTutors), 2);
119        echo $groupAve;
120        echo ' ('.number_format($groupAve / $rubric['Rubric']['total_marks'] * 100) . '%)';
121
122        echo "</b></td>";
123    } ?>
124    </tr></table></td></tr>
125    <?php
126    if ($groupMembers) {
127        foreach ($groupMembers as $member) {
128            $withTutorsAry[$member['User']['id']]['first_name'] = $member['User']['first_name'];
129            $withTutorsAry[$member['User']['id']]['last_name'] = $member['User']['last_name'];
130        }
131    }
132    if ($groupMembersNoTutors) {
133        foreach ($groupMembersNoTutors as $member) {
134            echo '<tr class="tablecell2" cellpadding="4" cellspacing="2" >';
135            $membersAry[$member['User']['id']]['member'] = $member;
136            echo '<td width="25%" class="group-members">' . $member['User']['first_name']." ".$member['User']['last_name'] . '</td></tr>' . "\n";
137        }
138    }
139    echo '<tr class="tablesummary"><td class="group-members"><b>';
140    echo __("Group Average: ", true);
141    echo "</b></td></tr><tr><td> </td></tr>";
142    ?>
143    <tr><td>  </td></tr>
144    <tr class="tablecell2" align="center"><td colspan="<?php echo $rubric['Rubric']["criteria"] +2; ?>">
145        <form name="evalForm" id="evalForm" method="POST" action="<?php echo $html->url('markEventReviewed') ?>">
146            <input type="hidden" name="event_id" value="<?php echo $event['Event']['id']?>" />
147            <input type="hidden" name="group_id" value="<?php echo $event['Group']['id']?>" />
148            <input type="hidden" name="course_id" value="<?php echo $event['Event']['course_id']; ?>" />
149            <input type="hidden" name="group_event_id" value="<?php echo $event['GroupEvent']['id']?>" />
150            <input type="hidden" name="display_format" value="Detail" />
151
152        <?php
153            if ($event['GroupEvent']['marked'] == "reviewed") {
154                echo "<input class=\"reviewed\" type=\"submit\" name=\"mark_not_reviewed\" value=\" ".__('Mark Peer Evaluations as Not Reviewed', true)."\" />";
155            } else {
156                echo "<input class=\"reviewed\" type=\"submit\" name=\"mark_reviewed\" value=\" ".__('Mark Peer Evaluations as Reviewed', true)."\" />";
157            }
158        ?>
159        </form></td>
160    </tr>
161</table>
162<table width="100%" border="0" align="center" cellpadding="4" cellspacing="2">
163    <tr>
164        <td align="center">
165<div id="accordion">
166    <?php $i = 0;
167    foreach($groupMembersNoTutors as $row):
168        $user = $row['User']; ?>
169        <div id="panel<?php echo $user['id']?>">
170        <div id="panel<?php echo $user['id']?>Header" class="panelheader">
171            <?php echo __('Evaluatee: ', true).$user['first_name']." ".$user['last_name']?>
172        </div>
173        <div style="height: 200px;" id="panel1Content" class="panelContent">
174            <br><b><?php
175                $scaled = $membersAry[$user['id']]['received_ave_score'] * (1 - ($penalties[$user['id']] / 100));
176                $deduction = number_format($membersAry[$user['id']]['received_ave_score'] * ($penalties[$user['id']] / 100), 2);
177                $percent = number_format($membersAry[$user['id']]['received_ave_score_%']);
178
179                echo __(" (Number of Evaluator(s): ",true).count($evalResult[$user['id']]).")<br/>";
180                echo __("Final Total: ",true).number_format($memberScoreSummary[$row['User']['id']]['received_ave_score'],2);
181                $penalties[$user['id']] > 0 ? $penaltyAddOn = ' - '."<font color=\"red\">".$deduction."</font> = ".number_format($scaled, 2) :
182                    $penaltyAddOn = '';
183                echo $penaltyAddOn.' ('.$percent.'%)';
184                if (isset($membersAry[$user['id']]['received_ave_score'])) {
185                    $memberAvgScore = number_format($avgPerQues[$user['id']], 2);
186                    $memberAvgScoreDeduction = number_format($avgPerQues[$user['id']] * $penalties[$user['id']] / 100, 2);
187                    $memberAvgScoreScaled = number_format($avgPerQues[$user['id']] * (1 - ($penalties[$user['id']] / 100)), 2);
188                    $memberAvgScorePercent = number_format($avgPerQues[$user['id']] * (1 - ($penalties[$user['id']] / 100)) * 100);
189                } else {
190                    $memberAvgScore = '-';
191                    $memberAvgScorePercent = '-';
192                }
193                if ($scaled == $groupAve) {
194                    echo "&nbsp;&nbsp;((".__("Same Mark as Group Average", true)." ))<br>";
195                } else if ($scaled < $groupAve) {
196                    echo "&nbsp;&nbsp;<font color='#cc0033'><< ".__('Below Group Average', true)." >></font><br>";
197                } else if ($scaled > $groupAve) {
198                    echo "&nbsp;&nbsp;<font color='#000099'><< ".__('Above Group Average', true)." >></font><br>";
199                }
200                echo __("Average Percentage Per Question: ", true);
201                echo $memberAvgScore;
202                $penalties[$user['id']] > 0 ? $penaltyAddOn = ' - '."<font color=\"red\">".$memberAvgScoreDeduction."</font> = ".$memberAvgScoreScaled :
203                    $penaltyAddOn = '';
204                echo $penaltyAddOn.' ('.$memberAvgScorePercent.'%)<br>';
205                $penalties[$user['id']] > 0 ? $penaltyNotice = 'NOTE: <font color=\'red\'>'.$penalties[$user['id']].'% </font>Late Penalty<br>' :
206                    $penaltyNotice = '<br>';
207                echo $penaltyNotice;
208                ?> </b>
209            <br><br>
210        <table width="95%" border="0" align="center" cellpadding="4" cellspacing="2">
211            <tr class="tableheader" align="center">
212                <td width="100" valign="top"><?php __('Evaluator')?></td>
213                <?php
214                for ($i=1; $i<=$rubric['Rubric']["criteria"]; $i++) {
215                    echo "<td><strong><font color=" . $color[ $i % sizeof($color) ] . ">" . ($i) . ". "  . "</font></strong>";
216                    echo $rubricCriteria[$i-1]['criteria'];
217                    echo "</td>";
218                }
219                ?>
220            </tr>
221            <?php
222            //Retrieve the individual rubric detail
223            if (isset($evalResult[$user['id']])) {
224
225                $memberResult = $evalResult[$user['id']];
226
227                foreach ($memberResult AS $row): $memberRubric = $row['EvaluationRubric'];
228                    $evalutor = $withTutorsAry[$memberRubric['evaluator']];
229                    echo "<tr class=\"tablecell2\">";
230                    echo "<td width='15%'>".$evalutor['first_name']." ".$evalutor['last_name'] ."</td>";
231
232                    $resultDetails = $memberRubric['details'];
233                    foreach ($resultDetails AS $detail) : $rubDet = $detail['EvaluationRubricDetail'];
234                    $i = 0;
235                    echo '<td valign="middle">';
236                    echo "<br />";
237                    //Points Detail
238                    echo "<strong>".__('Points', true).": </strong>";
239                    if (isset($rubDet)) {
240                        $lom = $rubDet["selected_lom"];
241                        $empty = $rubric["Rubric"]["lom_max"];
242                        for ($v = 0; $v < $lom; $v++) {
243                            echo $html->image('evaluations/circle.gif', array('align'=>'middle', 'vspace'=>'1', 'hspace'=>'1','alt'=>'circle'));
244                            $empty--;
245                        }
246                        for ($t=0; $t < $empty; $t++) {
247                            echo $html->image('evaluations/circle_empty.gif', array('align'=>'middle', 'vspace'=>'1', 'hspace'=>'1','alt'=>'circle_empty'));
248                        }
249                        echo "<br />";
250                    } else {
251                        echo "n/a<br />";
252                    }
253                //Grade Detail
254                echo "<strong>".__('Grade:', true)." </strong>";
255                if (isset($rubDet)) {
256                    echo $rubDet["grade"] . " / " . $rubricCriteria[$i]['multiplier'] . "<br />";
257                    $i++;
258                } else {
259                    echo "n/a<br />";
260                }
261                //Comments
262                echo "<br/><strong>".__('Comment:', true)." </strong>";
263                if (isset($rubDet)) {
264                    echo $rubDet["criteria_comment"];
265                } else {
266                    echo "n/a<br />";
267                }
268                echo "</td>";
269            endforeach;
270
271            echo "</tr>";
272            //General Comment
273            echo "<tr class=\"tablecell2\">";
274            echo "<td></td>";
275            $col = $rubric['Rubric']['criteria'] + 1;
276            echo "<td colspan=".$col.">";
277            echo "<strong>".__('General Comment:', true)." </strong><br>";
278            echo $memberRubric['general_comment'];
279            echo "<br><br></td>";
280            echo "</tr>";
281        endforeach;
282        } ?>
283    </table>
284    <?php
285        echo "<br>";
286        //Grade Released
287        if (isset($scoreRecords[$user['id']]['grade_released']) && $scoreRecords[$user['id']]['grade_released']) {?>
288
289            <input type="button" name="UnreleaseGrades" value="<?php __('Unrelease Grades')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markGradeRelease/'.$event['Event']['id'].';'.$event['Group']['id'].';'.$user['id'].';'.$event['GroupEvent']['id'].';0'; ?>'">
290        <?php } else {?>
291            <input type="button" name="ReleaseGrades" value="<?php __('Release Grades')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markGradeRelease/'.$event['Event']['id'].';'.$event['Group']['id'].';'.$user['id'].';'.$event['GroupEvent']['id'].';1'; ?>'">
292        <?php }
293
294        //Comment Released
295        if (isset($scoreRecords[$user['id']]['comment_released']) && $scoreRecords[$user['id']]['comment_released']) {?>
296            <input type="button" name="UnreleaseComments" value="<?php __('Unrelease Comments')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markCommentRelease/'.$event['Event']['id'].';'.$event['Group']['id'].';'.$user['id'].';'.$event['GroupEvent']['id'].';0'; ?>'">
297        <?php } else { ?>
298            <input type="button" name="ReleaseComments" value="<?php __('Release Comments')?>" onClick="location.href='<?php echo $this->webroot.$this->theme.'evaluations/markCommentRelease/'.$event['Event']['id'].';'.$event['Group']['id'].';'.$user['id'].';'.$event['GroupEvent']['id'].';1'; ?>'">
299        <?php } ?>
300    </div>
301    </div>
302
303    <?php $i++;?>
304    <?php endforeach; ?>
305</div>
306    </td>
307    </tr>
308</table>
309
310<script type="text/javascript"> new Rico.Accordion( 'accordion',
311                                    {panelHeight:500,
312                                    hoverClass: 'mdHover',
313                                    selectedClass: 'mdSelected',
314                                    clickedClass: 'mdClicked',
315                                    unselectedClass: 'panelheader'});
316</script>
317</div>
318</div>
Note: See TracBrowser for help on using the repository browser.