source: iPeer/app/views/evaluations/view_mixeval_evaluation_results_detail.ctp @ 6602514

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

Change the styles for evaluation result pages

  • Property mode set to 100644
File size: 19.4 KB
Line 
1<?php
2$rowspan = count($groupMembersNoTutors) + 3;
3$numerical_index = 1;  //use numbers instead of words; get users to refer to the legend
4$color = array("", "#FF3366","#ff66ff","#66ccff","#66ff66","#ff3333","#00ccff","#ffff33");
5$membersAry = array();  //used to format result (students)
6$withTutorsAry = array(); //used to format result (students,tutors)
7$groupAve = 0;
8$groupAverage = array_fill(1, $mixeval['Mixeval']['lickert_question_max'], 0);
9$averagePerQuestion = array();
10
11echo $html->script('ricobase');
12echo $html->script('ricoeffects');
13echo $html->script('ricoanimation');
14echo $html->script('ricopanelcontainer');
15echo $html->script('ricoaccordion');
16?>
17
18<div class="content-container">
19
20<?php echo $this->element('evaluations/view_event_info', array('controller'=>'evaluations', 'event'=>$event));?>
21<?php echo $this->element('evaluations/summary_info', array('controller'=>'evaluations', 'event'=>$event));?>
22
23
24<!-- summary table -->
25<table width="100%" align="center" class="outer-table">
26    <tr>
27        <td width="25%" valign="middle" class="result-header-td">Student Name:</td>
28        <td width="75%" rowspan="<?php echo $rowspan?>" class="inner-table-cell"><div class="scrollbar">
29            <table class="inner-table"><tr class="result-header-td">
30            <?php for ($i = 1; $i <= $mixeval['Mixeval']["lickert_question_max"]; $i++):?>
31                <td width='200' class='inner-table-cell'>
32                    <font color="<?php echo $color[ $numerical_index % sizeof($color) ]?>"><?php echo $numerical_index ?></font>(/<?php echo $mixevalQuestion[$i]['multiplier'];?>)
33                </td>
34                <?php $numerical_index++;?>
35            <?php endfor; ?>
36        <td width="250" class="inner-table-cell">
37            <?php echo __("Total:( /", true).number_format($mixeval['Mixeval']['total_marks'], 2)?>)
38        </td>
39    </tr>
40            <?php  if ($groupMembersNoTutors) {
41                foreach ($groupMembersNoTutors as $member) {
42                    $aveScoreSum = 0;
43                    echo "<tr class='result-cell'>";
44                    if (isset($memberScoreSummary[$member['User']['id']]['received_ave_score'])) {
45                        $totalScore = $memberScoreSummary[$member['User']['id']]['received_total_score'];
46                        $penalty = ($penalties[$member['User']['id']] / 100) * $totalScore;
47                            $questionIndex = 0;
48                            $avgPerQuestion = 0;
49                            for ($j = 1; $j <= $mixeval['Mixeval']["lickert_question_max"]; $j++) {
50                            if (!empty($scoreRecords[$member['User']['id']]['mixeval_question_ave'])) {
51                                $criteriaAveGrade = $scoreRecords[$member['User']['id']]['mixeval_question_ave'][$j];
52                            } else {
53                                $criteriaAveGrade = 0;
54                            }
55                                $scaledQuestionGrade = $criteriaAveGrade * (1 - $penalties[$member['User']['id']] / 100);
56                                $questionPenalty = $criteriaAveGrade * $penalties[$member['User']['id']] / 100;
57                            // for adding up the average percentage per question
58                            $avgPerQuestion += $criteriaAveGrade / $mixevalQuestion[$j]['multiplier'];
59                                $questionIndex++;
60                                $penalty > 0 ? $stringAddOn = ' - '."<font color=\"red\">".$questionPenalty.
61                                                                                "</font> = ".number_format($scaledQuestionGrade, 2).'</td>' :
62                                                      $stringAddOn = '</td>';
63                                        $aveScoreSum += $criteriaAveGrade;
64                                        echo '<td class="result-cell">' . number_format($criteriaAveGrade, 2).$stringAddOn;
65                                        $groupAverage[$j] += $scaledQuestionGrade;
66                        }
67                        // for calculating the average percentage per question
68                        $averagePerQuestion[$member['User']['id']] = $avgPerQuestion / $mixeval['Mixeval']['lickert_question_max'];
69                    } else {
70                            for ($i = 1; $i <= $mixeval['Mixeval']["lickert_question_max"]; $i++) {
71                                    echo "<td class='result-cell'>-</td>";
72                            }
73                        }
74                        echo '<td class="total-cell">';
75                    if (isset($memberScoreSummary[$member['User']['id']]['received_ave_score'])) {
76                            $finalAvgScore = $aveScoreSum - $penalty;
77                            $penalty > 0 ? $penaltyAddOn = ' - '."<font color=\"red\">".number_format($penalty, 2).
78                                                                                "</font> = ".number_format($finalAvgScore, 2) :
79                                                 $penaltyAddOn = '';
80                            echo number_format($aveScoreSum, 2).$penaltyAddOn;
81
82                            $receviedAvePercent = ($memberScoreSummary[$member['User']['id']]['received_total_score'] - $penalty)
83                                / $mixeval['Mixeval']['total_marks'] * 100;
84
85                        echo ' ('.number_format($receviedAvePercent) . '%)';
86                        $membersAry[$member['User']['id']]['received_total_score'] = $memberScoreSummary[$member['User']['id']]['received_total_score'];
87                        $membersAry[$member['User']['id']]['received_count'] = $memberScoreSummary[$member['User']['id']]['received_count'];
88                            $membersAry[$member['User']['id']]['received_ave_score'] = $averagePerQuestion[$member['User']['id']];
89                            //$membersAry[$member['User']['id']]['received_ave_score_%'] = $averagePerQuestion[$member['User']['id']];
90                    } else {
91                            echo '-';
92                    }
93                    echo "</td>";
94                    echo "</tr>";
95                }
96            }
97            for ($j = 1; $j <= $mixeval['Mixeval']['lickert_question_max']; $j++) {
98                $scoreRecords['group_question_ave'][$j-1] = $groupAverage[$j] / count($groupMembersNoTutors);
99            }
100            ?> <tr class="tablesummary"> <?php
101            $groupAve = 0;
102            for ($j = 1; $j <= $mixeval['Mixeval']["lickert_question_max"]; $j++) {
103                echo "<td class='total-cell'>";
104                if(isset($scoreRecords['group_question_ave'][$j-1])){
105                    $groupAveGrade = $scoreRecords['group_question_ave'][$j-1];
106                    $groupAve += $scoreRecords['group_question_ave'][$j-1];
107                    echo number_format($groupAveGrade, 2);
108                }
109                echo "</td>";
110            }
111            echo "<td><b>";
112            echo number_format($groupAve, 2);
113            echo ' ('.number_format($groupAve / $mixeval['Mixeval']['total_marks'] * 100) . '%)';
114            echo "</b></td>"; ?>
115                </tr>
116        </table></div></td>
117    </tr>
118    <?php
119    if ($groupMembersNoTutors) {
120        foreach ($groupMembersNoTutors as $member) {
121            echo '<tr cellpadding="4" cellspacing="2" >';
122            $membersAry[$member['User']['id']]['member'] = $member;
123            echo '<td width="25%" class="group-members">' . $member['User']['first_name']." ".$member['User']['last_name'] . '</td></tr>' . "\n";
124        }
125    }
126    if ($groupMembers) {
127        foreach ($groupMembers as $member) {
128            $withTutorsAry[$member['User']['id']]['member'] = $member;
129        }
130    }
131
132    echo '<tr class="tablesummary"><td class="group-members"><b>';
133    echo __("Group Average: ", true);
134    echo "</b></td></tr><tr><td>  </td></tr>";
135    ?>
136<!-- end of summary table -->
137<tr><td>  </td></tr>    <!-- adding space between the submit button and the table -->
138    <tr align="center"><td colspan="<?php echo ($mixeval['Mixeval']["lickert_question_max"] +2); ?>">
139        <form name="evalForm" id="evalForm" method="POST" action="<?php echo $html->url('markEventReviewed') ?>">
140            <input type="hidden" name="event_id" value="<?php echo $event['Event']['id']?>" />
141            <input type="hidden" name="group_id" value="<?php echo $event['Group']['id']?>" />
142            <input type="hidden" name="course_id" value="<?php echo $event['Event']['course_id']?>" />
143            <input type="hidden" name="group_event_id" value="<?php echo $event['GroupEvent']['id']?>" />
144            <input type="hidden" name="display_format" value="Detail" />
145        <?php
146            if ($event['GroupEvent']['marked'] == "reviewed") {
147                echo "<input class=\"reviewed\" type=\"submit\" name=\"mark_not_reviewed\" value=\" ".__('Mark Peer Evaluations as Not Reviewed', true)."\" />";
148            } else {
149                echo "<input class=\"reviewed\" type=\"submit\" name=\"mark_reviewed\" value=\" ".__('Mark Peer Evaluations as Reviewed', true)."\" />";
150            }
151        ?>
152        </form></td>
153    </tr>
154</table>
155
156<h3><?php __('Evaluation Results')?></h3>
157
158<div id="accordion">
159    <?php $i = 0;
160    foreach($groupMembersNoTutors as $row):
161        $user = $row['User']; ?>
162        <div id="panel<?php echo $user['id']?>">
163        <div id="panel<?php echo $user['id']?>Header" class="panelheader">
164        <?php echo 'Evaluatee: '.$user['first_name']." ".$user['last_name']?>
165        </div>
166        <div style="height: 200px;text-align: center;" id="panel1Content" class="panelContent">
167        <br><b><?php
168            $deduction = number_format($membersAry[$user['id']]['received_total_score'] * $penalties[$user['id']]/100, 2);
169            $scaled = number_format($membersAry[$user['id']]['received_total_score'] * (1 - $penalties[$user['id']]/100), 2);
170            $percent = number_format($scaled/$mixeval['Mixeval']['total_marks'] * 100);
171            $ave_deduction = number_format($membersAry[$user['id']]['received_ave_score'] * $penalties[$user['id']]/100, 2);
172            $ave_scaled = number_format($membersAry[$user['id']]['received_ave_score'] * (1 - $penalties[$user['id']]/100), 2);
173            echo __("(Number of Evaluator(s): ",true).$membersAry[$user['id']]['received_count'].")<br/>";
174            echo __("Final Total: ",true).number_format($membersAry[$user['id']]['received_total_score'], 2);
175            $penalties[$user['id']] > 0 ? $penaltyAddOn = ' - '."<font color=\"red\">".$deduction."</font> = ".$scaled :
176                $penaltyAddOn = '';
177            echo $penaltyAddOn.' ('.$percent.'%)';
178
179            if (isset($membersAry[$user['id']]['received_ave_score'])) {
180                $memberAve = number_format($membersAry[$user['id']]['received_ave_score'], 2);
181                $memberAvePercent = number_format($ave_scaled * 100);
182            } else {
183                $memberAve = '-';
184                $memberAvePercent = '-';
185            }
186            $penalties[$user['id']] > 0 ? $ave_penaltyAddOn = ' - '."<font color=\"red\">".$ave_deduction."</font> = ".$ave_scaled :
187                $ave_penaltyAddOn = '';
188            $memberAverageAve = number_format($membersAry[$user['id']]['received_total_score'], 2);
189            if ($memberAverageAve == $groupAve) {
190                echo "&nbsp;&nbsp;<< ".__('Same Mark as Group Average', true)." >>";
191            } else if ($memberAverageAve < $groupAve) {
192                echo "&nbsp;&nbsp;<font color='#cc0033'><< ".__('Below Group Average', true)." >></font>";
193            } else if ($memberAverageAve > $groupAve) {
194                echo "&nbsp;&nbsp;<font color='#000099'><< ".__('Above Group Average', true)." >></font>";
195            }
196            ?> </b><br>
197            <?php echo __("Average Percentage Per Question: ", true);
198            echo $memberAve.$ave_penaltyAddOn;
199            echo ' ('.$memberAvePercent .'%)';
200
201            $penalties[$user['id']] > 0 ? $penaltyNotice = '<br>'.__('NOTE: ', true).'<font color=\'red\'>'.$penalties[$user['id']].
202                '%</font>'.__(' Late Penalty', true) : $penaltyNotice = '';
203            echo $penaltyNotice;
204            ?>
205            <br><br>
206    <!-- Section One -->
207    <table class="standardtable">
208        <tr>
209            <td colspan="<?php echo $mixeval['Mixeval']["lickert_question_max"]+1 ?>"><b> <?php __('Section One:')?> </b></td>
210        </tr>
211        <tr align="center">
212            <th width="100" valign="top"><?php __('Evaluator')?></th>
213            <?php
214                for ($i=0; $i<$mixeval['Mixeval']["lickert_question_max"]; $i++) {
215                    echo "<th><strong><font color=" . $color[ ($i+1) % sizeof($color) ] . ">" . ($i+1) . ". "  . "</font></strong>";
216                    echo $mixevalQuestion[$i+1]['title'];
217                    echo "</th>";
218                }
219            ?>
220        </tr>
221        <?php
222        //Retrieve the individual mixeval detail
223        if (isset($evalResult[$user['id']])) {
224            $memberResult = $evalResult[$user['id']];
225                foreach ($memberResult AS $row): $memberMixeval = $row['EvaluationMixeval'];
226                    $evalutor = $withTutorsAry[$memberMixeval['evaluator']];
227                    echo "<tr class=\"tablecell2\">";
228                    echo "<td width='15%'>".$evalutor['member']['User']['first_name']." ".$evalutor['member']['User']['last_name']."</td>";
229                    $width = 85 / $mixeval['Mixeval']['lickert_question_max'];
230                    $resultDetails = $memberMixeval['details'];
231                    for ($j = 1; $j <= $mixeval['Mixeval']["lickert_question_max"]; $j++) {
232                        $rubDet = $resultDetails[$j-1]['EvaluationMixevalDetail'];
233                        echo '<td valign="middle" width="'.$width.'%">';
234                        //Point Description Detail
235                        if (isset($mixevalQuestion[$j-1]['Description'][$rubDet['selected_lom']-1]['descriptor'])) {
236                            echo $mixevalQuestion[$j-1]['Description'][$rubDet['selected_lom']-1]['descriptor'];
237                        }
238                        echo "<br />";
239
240                        //Points Detail
241                        echo "<strong>".__('Points:', true)."</strong>";
242                        if (isset($rubDet)) {
243                            $lom = $rubDet["grade"];
244                            $empty = $mixevalQuestion[$i-1]['multiplier'];
245                            for ($v = 0; $v < $lom; $v++) {
246                                echo $html->image('evaluations/circle.gif', array('align'=>'middle', 'vspace'=>'1', 'hspace'=>'1','alt'=>'circle'));
247                                $empty--;
248                            }
249                            for ($t=0; $t < $empty; $t++) {
250                                echo $html->image('evaluations/circle_empty.gif', array('align'=>'middle', 'vspace'=>'1', 'hspace'=>'1','alt'=>'cicle_empty'));
251                            }
252                            echo "<br />";
253                        } else {
254                            echo "n/a<br />";
255                        }
256
257                        //Grade Detail
258                        echo "<strong>".__('Grade', true).": </strong>";
259                        if (isset($rubDet)) {
260                            echo $rubDet["grade"] . " / " . $mixevalQuestion[$j]['multiplier'] . "<br />";
261                        } else {
262                            echo "n/a<br />";
263                        }
264
265                        echo "<br /><br /></td>";
266                    }
267                echo "</tr>";
268
269            endforeach;
270        } ?>
271</table>
272            <!-- Section Two -->
273            <table class="standardtable">
274                <tr>
275                    <td colspan="<?php echo $mixeval['Mixeval']["total_question"] ?>"><b> Section Two: </b></td>
276                </tr>
277                <tr align="center">
278                    <th width="100" valign="top"><?php __('Evaluator')?></th>
279                    <?php
280                    for ($i=$numerical_index; $i<=$mixeval['Mixeval']["total_question"]; $i++) {
281                        if (isset($mixevalQuestion[$i-1])) {
282                            echo "<th><strong><font color=" . $color[ $i % sizeof($color) ] . ">" . ($i) . ". "  . "</font></strong>";
283                            echo $mixevalQuestion[$i-1]['title'];
284                            echo "</th>";
285                        }
286                    }
287                    ?>
288                </tr>
289                <?php
290                //Retrieve the individual mixeval detail
291                if (isset($evalResult[$user['id']])) {
292                    $memberResult = $evalResult[$user['id']];
293                    foreach ($memberResult AS $row): $memberMixeval = $row['EvaluationMixeval'];
294                        $evalutor = $withTutorsAry[$memberMixeval['evaluator']];
295                        echo "<tr class=\"tablecell2\">";
296                        echo "<td width='15%'>".$evalutor['member']['User']['first_name']." ".$evalutor['member']['User']['last_name']."</td>";
297                        $width = 85 / ($mixeval['Mixeval']["total_question"] - $mixeval['Mixeval']["lickert_question_max"]);
298                        $resultDetails = $memberMixeval['details'];
299                        for ($j = $numerical_index; $j <= $mixeval['Mixeval']["total_question"]; $j++) {
300                            if (isset($resultDetails[$j-1])) {
301                                $rubDet = $resultDetails[$j-1]['EvaluationMixevalDetail'];
302                                echo '<td valign="middle" width="'.$width.'%">';
303                                //Comments
304                                echo "<strong>".__('Comment', true).": </strong>";
305                                if (isset($rubDet)) {
306                                    echo $rubDet["question_comment"];
307                                } else {
308                                    echo "n/a";
309                                }
310
311                                echo "<br /><br /></td>";
312                            }
313                        }
314                        echo "</tr>";
315                    endforeach;
316                }
317                ?>
318        </table>
319        <?php
320            echo "<br>";
321            //Grade Released
322            if (isset($scoreRecords[$user['id']]['grade_released']) && $scoreRecords[$user['id']]['grade_released']) {?>
323                <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'; ?>'">
324            <?php } else {?>
325                <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'; ?>'">
326            <?php }
327
328            //Comment Released
329            if (isset($scoreRecords[$user['id']]['comment_released']) && $scoreRecords[$user['id']]['comment_released']) {?>
330                <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'; ?>'">
331            <?php } else {?>
332                <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'; ?>'">
333            <?php } ?>
334        </div>
335    </div>
336
337    <?php $i++;?>
338<?php endforeach; ?>
339</div>
340
341<script type="text/javascript"> new Rico.Accordion( 'accordion',
342            {panelHeight:500,
343            hoverClass: 'mdHover',
344            selectedClass: 'mdSelected',
345            clickedClass: 'mdClicked',
346            unselectedClass: 'panelheader'});
347
348</script>
349</div>
Note: See TracBrowser for help on using the repository browser.