forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_instance.html
81 lines (81 loc) · 3.46 KB
/
config_instance.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<table cellpadding="9" cellspacing="0">
<?php if($this->instance->pagetype != 'mod-quiz-view') { ?>
<tr valign="top">
<td align="right">
<?php print_string('config_select_quiz', 'block_quiz_results') ?>
</td>
<td>
<?php
$quizzes = get_records('quiz', 'course', $this->instance->pageid, '', 'id, name');
if(empty($quizzes)) {
echo '<strong>'.get_string('config_no_quizzes_in_course', 'block_quiz_results').'</strong>';
echo '<p><input type="hidden" name="quizid" value="0" /></p>';
}
else {
$options = array();
foreach($quizzes as $quiz) {
$options[$quiz->id] = $quiz->name;
}
choose_from_menu($options, 'quizid', empty($this->config->quizid) ? 0 : $this->config->quizid);
}
?>
</td>
</tr>
<?php } // end if($this->instance->pagetype != PAGE_QUIZ_VIEW) ?>
<tr valign="top">
<td align="right">
<?php print_string('config_show_best', 'block_quiz_results') ?>
</td>
<td>
<input name="showbest" type="text" size="3" value="<?php
p(empty($this->config->showbest) ? 0 : max(0, intval($this->config->showbest)));
?>" />
</td>
</tr>
<tr valign="top">
<td align="right">
<?php print_string('config_show_worst', 'block_quiz_results') ?>
</td>
<td>
<input name="showworst" type="text" size="3" value="<?php
p(empty($this->config->showworst) ? 0 : max(0, intval($this->config->showworst)));
?>" />
</td>
</tr>
<tr valign="top">
<td align="right">
<?php print_string('config_use_groups', 'block_quiz_results') ?>
</td>
<td>
<input name="usegroups" type="radio" id="usegroups_yes" <?php if(!empty($this->config->usegroups)) echo 'checked="checked"'; ?> value="1" /> <label for="usegroups_yes"><?php print_string('yes'); ?></label>
<input name="usegroups" type="radio" id="usegroups_no" <?php if(empty($this->config->usegroups)) echo 'checked="checked"'; ?> value="0" /> <label for="usegroups_no"><?php print_string('no'); ?></label>
</td>
</tr>
<tr valign="top">
<td align="right">
<?php print_string('config_name_format', 'block_quiz_results') ?>
</td>
<td>
<?php
$usenames = array(B_QUIZRESULTS_NAME_FORMAT_FULL => get_string('config_names_full', 'block_quiz_results'), B_QUIZRESULTS_NAME_FORMAT_ID => get_string('config_names_id', 'block_quiz_results'), B_QUIZRESULTS_NAME_FORMAT_ANON => get_string('config_names_anon', 'block_quiz_results'));
choose_from_menu($usenames, 'nameformat', empty($this->config->nameformat) ? B_QUIZRESULTS_NAME_FORMAT_FULL : $this->config->nameformat, '');
?>
</td>
</tr>
<tr valign="top">
<td align="right">
<?php print_string('config_grade_format', 'block_quiz_results') ?>
</td>
<td>
<?php
$formats = array(B_QUIZRESULTS_GRADE_FORMAT_PCT => get_string('config_format_percentage', 'block_quiz_results'), B_QUIZRESULTS_GRADE_FORMAT_FRA => get_string('config_format_fraction', 'block_quiz_results'), B_QUIZRESULTS_GRADE_FORMAT_ABS => get_string('config_format_absolute', 'block_quiz_results'));
choose_from_menu($formats, 'gradeformat', empty($this->config->gradeformat) ? 0 : $this->config->gradeformat, '');
?>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="<?php print_string('savechanges') ?>">
</td>
</tr>
</table>