Skip to content

Commit

Permalink
MDL-19813 Upgraded calls to choose_from_menu
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasconnault committed Aug 18, 2009
1 parent 955ee33 commit e6f33a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 9 additions & 6 deletions mod/quiz/edit.php
Expand Up @@ -76,7 +76,7 @@ function module_specific_buttons($cmid, $cmoptions) {
* (which is called from showbank())
*/
function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmoptions) {
global $QTYPES;
global $QTYPES, $OUTPUT;
$out = '';
$catcontext = get_context_instance_by_id($category->contextid);
if (has_capability('moodle/question:useall', $catcontext)) {
Expand All @@ -98,8 +98,10 @@ function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmo
$straddtoquiz = get_string('addtoquiz', 'quiz');
$out = '<strong><label for="menurandomcount">'.get_string('addrandomfromcategory', 'quiz').
'</label></strong><br />';
$out .= get_string('addrandom', 'quiz', choose_from_menu($randomcount,
'randomcount', '1', '', '', '', true, $cmoptions->hasattempts));
$select = html_select::make($randomcount, 'randomcount', '1', false);
$select->nothingvalue = '';
$select->disabled = $cmoptions->hasattempts;
$out .= get_string('addrandom', 'quiz', $OUTPUT->select($select));
$out .= '<input type="hidden" name="recurse" value="'.$recurse.'" />';
$out .= '<input type="hidden" name="categoryid" value="' . $category->id . '" />';
$out .= ' <input type="submit" name="addrandom" value="'.
Expand Down Expand Up @@ -562,9 +564,10 @@ function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmo
//YUI does not submit the value of the submit button so
//we need to add the value:
echo '<input type="hidden" name="repaginate" value="'.$gostring.'" />';
print_string('repaginate', 'quiz',
choose_from_menu($perpage, 'questionsperpage',
$quiz->questionsperpage, '', '', '', true, $repaginatingdisabled));
$select = html_select::make($perpage, 'questionsperpage', $quiz->questionsperpage, false);
$select->nothingvalue = '';
$select->disabled = $repaginatingdisabledhtml;
print_string('repaginate', 'quiz', $OUTPUT->select($select));
echo '<div class="quizquestionlistcontrols">';
echo ' <input type="submit" name="repaginate" value="'. $gostring .'" '.$repaginatingdisabledhtml.' />';
echo '</div></fieldset></form></div></div>';
Expand Down
4 changes: 3 additions & 1 deletion mod/quiz/report/statistics/report.php
Expand Up @@ -419,7 +419,9 @@ function output_quiz_info_table($course, $cm, $quiz, $quizstats, $usingattemptss
$quizinformationtablehtml .= '<div class="mdl-align">';
$quizinformationtablehtml .= '<input type="hidden" name="everything" value="1"/>';
$quizinformationtablehtml .= '<input type="submit" value="'.get_string('downloadeverything', 'quiz_statistics').'"/>';
$quizinformationtablehtml .= choose_from_menu ($downloadoptions, 'download', $this->table->defaultdownloadformat, '', '', '', true);
$select = html_select::make($downloadoptions, 'download', $this->table->defaultdownloadformat, false);
$select->nothingvalue = '';
$quizinformationtablehtml .= $OUTPUT->select($select);;
$quizinformationtablehtml .= helpbutton('tableexportformats', get_string('tableexportformats', 'table'), 'moodle', true, false, '', true);
$quizinformationtablehtml .= '</div></form>';
}
Expand Down

0 comments on commit e6f33a0

Please sign in to comment.