Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / blocks / quiz_results / config_instance.html
blobd7b6be2d9bb67a1968e4c59f3c51f21a86c3e4d7
1 <table cellpadding="9" cellspacing="0">
2 <?php if($this->instance->pagetype != 'mod-quiz-view') { ?>
3 <tr valign="top">
4 <td align="right">
5 <?php print_string('config_select_quiz', 'block_quiz_results') ?>
6 </td>
7 <td>
8 <?php
9 $quizzes = get_records('quiz', 'course', $this->instance->pageid, '', 'id, name');
10 if(empty($quizzes)) {
11 echo '<strong>'.get_string('config_no_quizzes_in_course', 'block_quiz_results').'</strong>';
12 echo '<p><input type="hidden" name="quizid" value="0" /></p>';
14 else {
15 $options = array();
16 foreach($quizzes as $quiz) {
17 $options[$quiz->id] = $quiz->name;
19 choose_from_menu($options, 'quizid', empty($this->config->quizid) ? 0 : $this->config->quizid);
22 </td>
23 </tr>
24 <?php } // end if($this->instance->pagetype != PAGE_QUIZ_VIEW) ?>
25 <tr valign="top">
26 <td align="right">
27 <?php print_string('config_show_best', 'block_quiz_results') ?>
28 </td>
29 <td>
30 <input name="showbest" type="text" size="3" value="<?php
31 p(empty($this->config->showbest) ? 0 : max(0, intval($this->config->showbest)));
32 ?>" />
33 </td>
34 </tr>
35 <tr valign="top">
36 <td align="right">
37 <?php print_string('config_show_worst', 'block_quiz_results') ?>
38 </td>
39 <td>
40 <input name="showworst" type="text" size="3" value="<?php
41 p(empty($this->config->showworst) ? 0 : max(0, intval($this->config->showworst)));
42 ?>" />
43 </td>
44 </tr>
45 <tr valign="top">
46 <td align="right">
47 <?php print_string('config_use_groups', 'block_quiz_results') ?>
48 </td>
49 <td>
50 <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>
51 <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>
52 </td>
53 </tr>
54 <tr valign="top">
55 <td align="right">
56 <?php print_string('config_name_format', 'block_quiz_results') ?>
57 </td>
58 <td>
59 <?php
60 $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'));
61 choose_from_menu($usenames, 'nameformat', empty($this->config->nameformat) ? B_QUIZRESULTS_NAME_FORMAT_FULL : $this->config->nameformat, '');
63 </td>
64 </tr>
65 <tr valign="top">
66 <td align="right">
67 <?php print_string('config_grade_format', 'block_quiz_results') ?>
68 </td>
69 <td>
70 <?php
71 $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'));
72 choose_from_menu($formats, 'gradeformat', empty($this->config->gradeformat) ? 0 : $this->config->gradeformat, '');
74 </td>
75 </tr>
76 <tr>
77 <td colspan="2" align="center">
78 <input type="submit" value="<?php print_string('savechanges') ?>" />
79 </td>
80 </tr>
81 </table>