source: iPeer/app/views/elements/evaluations/student_view_mixeval_details.ctp @ aee5515

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

Updated the result pages for missing indexes, also close #406

For #406, it seems all the result pages have grade shown.

  • Property mode set to 100644
File size: 5.9 KB
Line 
1<?php
2    $gradeReleased = isset($scoreRecords[User::get('id')]['grade_released']) ?
3        $scoreRecords[User::get('id')]['grade_released'] : 1;
4    $commentReleased = isset($scoreRecords[User::get('id')]['comment_released']) ?
5        $scoreRecords[User::get('id')]['comment_released'] : 1;
6    $color = array("", "#FF3366","#ff66ff","#66ccff","#66ff66","#ff3333","#00ccff","#ffff33");
7
8    $pos = 1;
9?>
10<br/><br/>
11<table class="standardtable">
12        <tr>
13    <td width="100" valign="top" colspan="<?php echo ($mixeval['Mixeval']["lickert_question_max"]+1)?>"><?php __('Section One')?>:</td>
14    </tr>
15        <tr>
16    <td width="100" valign="top"><?php __('Person Being Evaluated')?></td>
17    <?php
18      for ($i=1; $i<=$mixeval['Mixeval']["lickert_question_max"]; $i++) {
19        if (isset($mixevalQuestion[$i])) { ?>
20                <td>
21                <?php echo $i.' '.$mixevalQuestion[$i]['title'] ?>
22                </td>
23                <?php $pos++;
24        }
25        }
26    ?>
27    </tr>
28 <?php
29if (!$gradeReleased && !$commentReleased) {
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'];
41
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 User::get('full_name') ?></td>
50    <?php } else { ?>
51        <td width='15%'><?php echo $member['User']['first_name'].' '.$member['User']['last_name']?></td>
52    <?php }
53
54    $resultDetails = $memberMixeval['details'];
55
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)) {
61            if (isset($mixevalQuestion[$i-1]['Description'][$mixevalDet['selected_lom']-1]['descriptor'])) {
62                echo $mixevalQuestion[$i-1]['Description'][$mixevalDet['selected_lom']-1]['descriptor'];
63            } ?>
64        <br />
65        <?php } ?>
66
67        <!-- Points Detail -->
68        <strong>Points: </strong>
69        <?php if ($gradeReleased && isset($mixevalDet)) {
70            $lom = $mixevalDet['grade'];
71                $empty = $mixeval["Question"][$i-1]["multiplier"];
72                for ($v = 0; $v < $lom; $v++) {
73                        echo $html->image('evaluations/circle.gif', array('align'=>'middle', 'vspace'=>'1', 'hspace'=>'1','alt'=>'circle'));
74                        $empty--;
75                }
76                for ($t=0; $t < $empty; $t++) {
77                        echo $html->image('evaluations/circle_empty.gif', array('align'=>'middle', 'vspace'=>'1', 'hspace'=>'1','alt'=>'circle_empty'));
78                } ?>
79                <br />
80        <?php } else { ?>
81                n/a<br />
82        <?php } ?>
83
84        <!-- Grades Detail -->
85        <strong>Grades: </strong>
86        <?php if ($gradeReleased && isset($mixevalDet)) {
87            echo number_format($lom, 2)." / ".number_format($mixeval["Question"][$i-1]["multiplier"], 2)."<br>";
88        } else { ?>
89                n/a<br />
90        <?php } ?>
91
92        </td>
93     <?php } ?>
94     </tr>
95
96     <?php endforeach;
97  }
98}
99 ?>
100</table>
101<br/><br/>
102<table class="standardtable">
103        <tr>
104    <td width="100" valign="top" colspan="<?php echo ($mixeval['Mixeval']["prefill_question_max"]+1)?>"><?php __('Section Two')?>:</td>
105    </tr>
106        <tr>
107    <td width="100" valign="top"><?php __('Person Being Evaluated')?></td>
108    <?php
109      for ($i=$pos; $i<=$mixeval['Mixeval']["total_question"]; $i++) {
110        if (isset($mixevalQuestion[$i-1])) { ?>
111                <td>
112                <?php echo $i.' '.$mixevalQuestion[$i-1]['title'] ?>
113                </td>
114        <?php }
115        }
116    ?>
117    </tr>
118<?php
119if (!$gradeReleased && !$commentReleased) {
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])) {
125   //Retrieve the individual mixeval detail
126   $memberResult = $evalResult[$userId];
127   if (isset($scoreRecords)) {
128     shuffle($memberResult);
129   }
130   foreach ($memberResult AS $row): $memberMixeval = $row['EvaluationMixeval'];
131
132     if ($scoreRecords == null)  {
133        $member = $membersAry[$memberMixeval['evaluatee']];
134     } else {
135        $member = $membersAry[$memberMixeval['evaluator']];
136     } ?>
137
138     <tr id='details'>
139     <?php if (isset($scoreRecords)) { ?>
140       <td width='15%'><?php echo User::get('full_name') ?></td>
141     <?php } else { ?>
142       <td width='15%'><?php echo $member['User']['first_name'].' '.$member['User']['last_name']?></td>
143     <?php }
144
145     $resultDetails = $memberMixeval['details'];
146     //foreach ($resultDetails AS $detail) : $mixevalDet = $detail['EvaluationMixevalDetail'];
147     for ($i=$pos; $i<=$mixeval['Mixeval']["total_question"]; $i++) {
148        if (isset($memberMixeval['details'][$i-1])) {
149          $mixevalDet = $memberMixeval['details'][$i-1]['EvaluationMixevalDetail']; ?>
150          <td valign="middle">
151
152          <!-- Comments -->
153          <br/><strong><?php echo __('Comment', true)?>: </strong>
154          <?php if ($commentReleased && isset($mixevalDet)) {
155                echo $mixevalDet["question_comment"];
156          } else { ?>
157                n/a<br />
158          <?php } ?>
159          <br />
160
161          </td>
162      <?php }
163    } ?>
164     </tr>
165
166     <?php endforeach;
167  }
168}
169
170 ?>
171</table>
Note: See TracBrowser for help on using the repository browser.