source: iPeer/app/views/elements/rubrics/ajax_rubric_view.ctp @ 4901d1f

3.1.xdev
Last change on this file since 4901d1f was 4901d1f, checked in by mwytang <michael.tang@…>, 6 years ago

modified rubric evaluation form to not have default Likert answers

The rubric evaluation form has been modified to not have the lowest
rating set as default for the Likert question. Due to this change
all likert questions have to be answered before saving. A javascript
validation has been added. If a Likert question is left unanswered,
the question would be marked red and a warning message will appear
below the save button telling the student to answer all the questions
marked red before saving.

  • Property mode set to 100644
File size: 4.0 KB
Line 
1<!-- elements::ajax_rubric_view start -->
2<?php
3$LOM_num = $data['Rubric']['lom_max'];
4$criteria_num = $data['Rubric']['criteria'];
5$rubric_type = $data['Rubric']['template'];
6$zero_mark = $data['Rubric']['zero_mark'];
7isset($user)? $userId = $user['id'] : $userId = '';
8isset($user['Evaluation'])? $evaluation = $user['Evaluation'] : $evaluation = null;
9$reqCom = $event['Event']['com_req'] ? '<br><font color="red">('.__('required', true).')</font>' : '';
10?>
11<table class="standardtable">
12    <tr>
13        <th width=150 valign="top"></th>
14        <!-- // horizontal template type -->
15        <?php if ( $rubric_type == "horizontal" ):?>
16            <?php foreach($data['RubricsLom'] as $lom): ?>
17                <th><?php __('Level of Mastery')?> <?php echo $lom['lom_num']?>:<br><?php echo $lom['lom_comment']?></th>
18            <?php endforeach ?>
19            <!-- //Comment for Evaluation Form -->
20            <?php if ($evaluate):?>
21                <th><?php echo __('Comments', true).$reqCom ?></th>
22            <?php endif ?>
23    </tr>
24
25    <?php foreach ($data['RubricsCriteria'] as $criteria): $i = $criteria['criteria_num']; ?>
26        <?php if (isset($evaluation)) :?>
27            <input type="hidden" name="selected_lom_<?php echo $userId.'_'.$i?>" value="<?php echo $evaluation['EvaluationDetail'][$i-1]['EvaluationRubricDetail']['selected_lom']?>">
28        <?php else: ?>
29            <input type="hidden" name="selected_lom_<?php echo $userId.'_'.$i?>" value="" size="4" >
30        <?php endif ?>
31    <tr>
32        <th style="text-align: left; padding: 0.5em;">
33            <?php echo '<font id="'.$userId.'criteria'.$i.'">'.$criteria['criteria']?></font><br><br>
34            <i><?php echo $criteria['multiplier']?><?php __(' mark(s)')?></i>
35        </th>
36
37        <?php foreach($data['RubricsLom'] as $lom): ?>
38        <?php $mark_value = round( ($criteria['multiplier']/(count($data['RubricsLom']) - ('1' == $zero_mark ? 1 : 0))*($lom['lom_num'] - ('1' == $zero_mark ? 1 : 0))) , 2);?>
39        <td>
40            <div class="green"><?php echo (!empty($criteria['RubricsCriteriaComment'][$lom['lom_num']-1]['criteria_comment']) ? $criteria['RubricsCriteriaComment'][$lom['lom_num']-1]['criteria_comment'] : '')?></div>
41            <?php
42            $check = '';
43            if (isset($evaluation)) {
44                if ($evaluation['EvaluationDetail'][$i-1]['EvaluationRubricDetail']['selected_lom'] == $lom['lom_num']) $check = "checked";
45            }?>
46            <div>
47                <input name="<?php echo $userId.'criteria_points_'.$i?>" type="radio" value="<?php echo $mark_value?>"
48                onClick="document.evalForm.selected_lom_<?php echo $userId."_".$i?>.value=<?php echo $lom['lom_num']?>;" <?php echo $check?>/>
49            </div>
50
51            <?php if (!$evaluate): ?>
52                <div><?php __('Mark')?>: <?php echo $mark_value?></div>
53            <?php endif; ?>
54        </td>
55        <?php endforeach ?>
56
57        <?php if ($evaluate): ?>
58        <td>
59            <textarea cols="20" rows="2" name="<?php echo $userId?>comments[]"><?php echo (isset($evaluation) ? $evaluation['EvaluationDetail'][$i-1]['EvaluationRubricDetail']['criteria_comment'] : '')?></textarea>
60        </td>
61        <?php endif;?>
62    </tr>
63    <?php endforeach;?>
64    <?php endif; ?>
65    <tr>
66        <?php if (!$evaluate): ?>
67        <td colspan="<?php echo $LOM_num+1?>" align="right"><?php __('Total Marks')?>: <?php echo $data['Rubric']['total_marks']?></td>
68        <?php else: ?>
69        <td colspan="<?php echo $LOM_num+2?>" align="center" class="tableheader2"><?php __('General Comments')?><br>
70            <textarea cols="80" rows="2" name="<?php echo $userId?>gen_comment" ><?php echo (isset($evaluation) ? $evaluation['EvaluationRubric']['comment'] : '')?></textarea>
71        </td>
72        <?php endif;?>
73    </tr>
74</table>
75<!-- elements::ajax_rubric_preview end -->
76<script type="text/javascript">
77jQuery().ready(function() {
78    var userId = <?php echo $userId ?>;
79    jQuery("input[type='submit'][name='"+userId+"']").click(function() {
80        return saveButtonVal(userId);
81    });
82});
83</script>
Note: See TracBrowser for help on using the repository browser.