quiz editing: MDL-17285 This is Olli Savolainen's new interface for editing quizzes.
This was started and usability tested as a Finnish Summer of Code project, and then Olli did further work on it in his own time to get it in shape for inclusion in Moodle 2.0. I reviewed all the code. There are a number of minor outstanding issues that will be fixed soon. See the subtasks of MDL-17284 for a list. The goal of these changes is to: * help teachers new to Moodle, so when they first see the quiz editing page, they don't go "Huh! What on earth am I supposed to do here?" * help novice Moodle users understand and learn to use some of the more advanced quiz feature; * but, without slowing down more experienced quiz users. Naturally, with ambitous goals like that, we won't have managed to satisy everybody, but I think this change is a big step in the right direction. There is extensive documentation on this project at http://docs.moodle.org/en/Development:Quiz_UI_redesign.
This commit is contained in:
+15
-10
@@ -158,7 +158,7 @@ function question_list($contexts, $pageurl, $categoryandcontext, $cm = null,
|
||||
$straddquestions = get_string("addquestions", "quiz");
|
||||
$strimportquestions = get_string("importquestions", "quiz");
|
||||
$strexportquestions = get_string("exportquestions", "quiz");
|
||||
$strnoquestions = get_string("noquestions", "quiz");
|
||||
$strnoquestions = get_string("noquestionsincategory", "quiz");
|
||||
$strselect = get_string("select", "quiz");
|
||||
$strselectall = get_string("selectall", "quiz");
|
||||
$strselectnone = get_string("selectnone", "quiz");
|
||||
@@ -244,7 +244,7 @@ function question_list($contexts, $pageurl, $categoryandcontext, $cm = null,
|
||||
list($usql, $params) = $DB->get_in_or_equal($categorylist_array);
|
||||
if (!$totalnumber = $DB->count_records_select('question', "category $usql AND parent = '0' $showhidden", $params)) {
|
||||
echo "<p style=\"text-align:center;\">";
|
||||
print_string("noquestions", "quiz");
|
||||
echo $strnoquestions;
|
||||
echo "</p>";
|
||||
return;
|
||||
}
|
||||
@@ -255,14 +255,13 @@ function question_list($contexts, $pageurl, $categoryandcontext, $cm = null,
|
||||
if (!$questions = $DB->get_records_select('question', "category $usql AND parent = '0' $showhidden", $params, $sortorderdecoded, '*', 0, $perpage)) {
|
||||
// There are no questions at all
|
||||
echo "<p style=\"text-align:center;\">";
|
||||
print_string("noquestions", "quiz");
|
||||
echo $strnoquestions;
|
||||
echo "</p>";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
print_paging_bar($totalnumber, $page, $perpage, $pageurl, 'qpage');
|
||||
|
||||
echo question_sort_options($pageurl, $sortorder);
|
||||
|
||||
|
||||
@@ -397,15 +396,21 @@ function question_list($contexts, $pageurl, $categoryandcontext, $cm = null,
|
||||
function question_sort_options($pageurl, $sortorder){
|
||||
global $USER;
|
||||
//sort options
|
||||
$html = "<div class=\"mdl-align\">";
|
||||
$html .= '<form method="post" action="edit.php">';
|
||||
$html = "<div class=\"mdl-align questionsortoptions\">";
|
||||
// POST method should only be used for parameters that change data
|
||||
// or if POST method has to be used, the user must be redirected immediately to
|
||||
// non-POSTed page to not break the back button
|
||||
$html .= '<form method="get" action="edit.php">';
|
||||
$html .= '<fieldset class="invisiblefieldset" style="display: block;">';
|
||||
$html .= '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
|
||||
$html .= $pageurl->hidden_params_out(array('qsortorder'));
|
||||
$sortoptions = array('alpha' => get_string("sortalpha", "quiz"),
|
||||
'typealpha' => get_string("sorttypealpha", "quiz"),
|
||||
'age' => get_string("sortage", "quiz"));
|
||||
$html .= choose_from_menu ($sortoptions, 'qsortorder', $sortorder, false, 'this.form.submit();', '0', true);
|
||||
//choose_from_menu concatenates the form name with
|
||||
//"menu" so the label is for menuqsortorder
|
||||
$sortoptions = array('alpha' => get_string("qname", "quiz"),
|
||||
'typealpha' => get_string("qtypename", "quiz"),
|
||||
'age' => get_string("age", "quiz"));
|
||||
$a = choose_from_menu ($sortoptions, 'qsortorder', $sortorder, false, 'this.form.submit();', '0', true);
|
||||
$html .= '<label for="menuqsortorder">'.get_string('sortquestionsbyx', 'quiz', $a).'</label>';
|
||||
$html .= '<noscript><div><input type="submit" value="'.get_string("sortsubmit", "quiz").'" /></div></noscript>';
|
||||
$html .= '</fieldset>';
|
||||
$html .= "</form>\n";
|
||||
|
||||
Reference in New Issue
Block a user