From e6f33a04aace8bc4df09febfa0c6c5eefdcd0832 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Tue, 18 Aug 2009 00:13:03 +0000 Subject: [PATCH] MDL-19813 Upgraded calls to choose_from_menu --- mod/quiz/edit.php | 15 +++++++++------ mod/quiz/report/statistics/report.php | 4 +++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/mod/quiz/edit.php b/mod/quiz/edit.php index bf546cf643a..d69b6639e2e 100644 --- a/mod/quiz/edit.php +++ b/mod/quiz/edit.php @@ -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)) { @@ -98,8 +98,10 @@ function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmo $straddtoquiz = get_string('addtoquiz', 'quiz'); $out = '
'; - $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 .= ''; $out .= ''; $out .= ' '; - 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 '
'; echo ' '; echo '
'; diff --git a/mod/quiz/report/statistics/report.php b/mod/quiz/report/statistics/report.php index 383e8cdbdc2..771d45dec37 100644 --- a/mod/quiz/report/statistics/report.php +++ b/mod/quiz/report/statistics/report.php @@ -419,7 +419,9 @@ class quiz_statistics_report extends quiz_default_report { $quizinformationtablehtml .= '
'; $quizinformationtablehtml .= ''; $quizinformationtablehtml .= ''; - $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 .= '
'; }