source: iPeer/app/views/evaluations/student_view_rubric_evaluation_results.ctp

dev
Last change on this file was ee8d406, checked in by Compass <pan.luo@…>, 4 years ago

Update translation file, removed _t function and add phing task

_t function will cause cake extract task to ignore those strings. All
the strings has to use () function in order to be scanned by cake i18n
task. Also added a phing task "extract" to update the translation file.

  • Property mode set to 100644
File size: 4.4 KB
Line 
1<?php echo $this->element('evaluations/view_event_info', array('controller'=>'evaluations', 'event'=>$event));?>
2
3<h2><?php __('Summary')?></h2>
4
5<table class="standardtable">
6<tr><th><?php __('Rating')?></th></tr>
7<tr>
8    <td>
9    <?php
10    if (isset($status)) {
11        $gradeReleased = $status['autoRelease'] || $status['grade'];
12        $commentReleased = $status['autoRelease'] || $status['comment'];
13    } else {
14        $gradeReleased = 0;
15        $commentReleased = 0;
16    }
17    if ($gradeReleased) {
18        $ave = count($evaluateeDetails) > 0 ? number_format(array_sum(Set::extract($evaluateeDetails, '/EvaluationRubric/score')) / count($evaluateeDetails), 2) : '0.00';
19        $deduction = number_format($ave * $penalty / 100, 2);
20        $finalAvg = number_format($ave * (100 - $penalty) / 100, 2);
21        ($penalty > 0) ? ($stringAddOn = ' - '.'('.'<font color=\'red\'>'.$deduction.'</font>'.
22            ')'.'<font color=\'red\'>*</font>'.' = '.$finalAvg) : $stringAddOn = '';
23
24        echo $ave.$stringAddOn;
25        $penalty > 0 ? $penaltyNote = '&nbsp &nbsp &nbsp &nbsp &nbsp ( )'.'<font color=\'red\'>*</font>'.' : '.$penalty.
26            '% late penalty.' : $penaltyNote = '';
27        echo $penaltyNote;
28    } else {
29        echo __('Not Released', true);
30    }
31    ?>
32    </td>
33</tr>
34</table>
35
36<?php if ($event['Event']['enable_details']) { ?>
37<?php echo $html->script('ricobase')?>
38<?php echo $html->script('ricoeffects')?>
39<?php echo $html->script('ricoanimation')?>
40<?php echo $html->script('ricopanelcontainer')?>
41<?php echo $html->script('ricoaccordion')?>
42<?php echo empty($params['data']['Evaluation']['id']) ? null : $html->hidden('Evaluation/id'); ?>
43
44<div id="accordion">
45    <!-- Panel of Evaluations Results -->
46    <div id="panelResults" class="panelName">
47        <div id="panelResultsHeader" class="panelheader">
48            <?php echo __('Evaluation Results From Your Teammates. (Randomly Ordered)', true);?>
49            <font color="red">
50            <?php if ( !$gradeReleased && !$commentReleased) {
51                echo __('Comments/Grades Not Released Yet.', true);
52            } else if ( !$gradeReleased) {
53                echo __('Grades Not Released Yet.', true);
54            } else if ( !$commentReleased) {
55                echo __('Comments Not Released Yet.', true);
56            }
57            ?>
58            </font>
59        </div>
60        <div style="height: 200px;" id="panelResultsContent" class="panelContent">
61            <?php
62            $params = array('controller'=>'evaluations', 'rubric'=>$rubric, 'membersList'=>$membersList, 'details'=>$evaluateeDetails, 'penalty'=> $penalty, 'release'=>$status);
63            echo $this->element('evaluations/student_view_rubric_details', $params);
64            ?>
65        </div>
66    </div>
67    <!-- Panel of Evaluations Reviews -->
68    <div id="panelReviews" class="panelName">
69        <div id="panelReviewsHeader" class="panelheader">
70            <?php echo 'Review Evaluations From You.'?>
71        </div>
72        <div style="height: 200px;" id="panelReviewsContent" class="panelContent">
73            <?php
74            $params = array('controller'=>'evaluations', 'rubric'=>$rubric, 'membersList'=>$membersList, 'details'=>$evaluatorDetails, 'penalty'=>$penalty);
75            echo $this->element('evaluations/student_view_rubric_details', $params);
76            ?>
77        </div>
78    </div>
79</div>
80
81<script type="text/javascript">
82    new Rico.Accordion( 'accordion',
83            {panelHeight:500,
84            hoverClass: 'mdHover',
85            selectedClass: 'mdSelected',
86            clickedClass: 'mdClicked',
87            unselectedClass: 'panelheader'});
88
89</script>
90<?php } else {
91    $grades = array();
92    foreach ($evaluateeDetails as $details) {
93        foreach ($details['EvaluationRubricDetail'] as $grade) {
94            $grades[$grade['criteria_number']][] = $grade['grade'];
95        }
96    }
97    foreach ($grades as $num => $marks) {
98        $grades[$num] = $this->Evaluation->array_avg($marks);
99    }
100    echo "<br><table class='standardtable'>";
101    echo "<tr>";
102    echo "<th width=50%>".__('Criteria', true)."</th>";
103    echo "<th width=50%>".__('Grade', true)."</th>";
104    echo "</tr>";
105    foreach ($rubric['RubricsCriteria'] as $ques) {
106        echo "<tr>";
107        echo "<td width=50%>".$ques['criteria']."</th>";
108        echo "<td width=50%>".number_format($grades[$ques['criteria_num']], 2)."</td>";
109        echo "</tr>";
110    }
111    echo "</table>";
112} ?>
Note: See TracBrowser for help on using the repository browser.