diff --git a/help.php b/help.php index 7a89337ae0a1..88fcfd8fefbc 100644 --- a/help.php +++ b/help.php @@ -99,6 +99,9 @@ if ($module == 'moodle' and ($file == 'index.html' or $file == 'mods.html')) { include_help_for_each_module($file, $langs, $helpdir); } + if ($module == 'question' and ($file == 'types.html')) { + include_help_for_each_qtype(); + } // The remaining horrible hardcoded special cases should be delegated to modules somehow. if ($module == 'moodle' and ($file == 'resource/types.html')) { // RESOURCES @@ -208,6 +211,28 @@ function include_help_for_each_module($file, $langs, $helpdir) { } } +function include_help_for_each_qtype() { + global $CFG; + require_once($CFG->libdir . '/questionlib.php'); + global $QTYPES; + $types = question_type_menu(); + $fakeqtypes = array(); + foreach ($types as $qtype => $localizedname) { + if ($QTYPES[$qtype]->is_real_question_type()) { + include_help_for_qtype($qtype, $localizedname); + } else { + $fakeqtypes[$qtype] = $localizedname; + } + } + foreach ($fakeqtypes as $qtype => $localizedname) { + include_help_for_qtype($qtype, $localizedname); + } +} +function include_help_for_qtype($qtype, $localizedname) { + echo '
' . get_string($qtype . 'summary', 'qtype_' . $qtype) . "
\n\n"; +} + function include_help_for_each_resource($file, $langs, $helpdir) { global $CFG; diff --git a/lang/en_utf8/help/question/types.html b/lang/en_utf8/help/question/types.html new file mode 100644 index 000000000000..56c58eabd04a --- /dev/null +++ b/lang/en_utf8/help/question/types.html @@ -0,0 +1,4 @@ +You can create questions of various different types:
+ diff --git a/question/editlib.php b/question/editlib.php index fdbbab6b2876..dbcc783f4e37 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -1901,7 +1901,7 @@ function create_new_question_button($categoryid, $params, $caption, $tooltip = ' $params['category'] = $categoryid; print_single_button($CFG->wwwroot . '/question/addquestion.php', $params, $caption,'get', '', false, $tooltip, $disabled); - helpbutton('questiontypes', get_string('createnewquestion', 'question'), 'question'); + helpbutton('types', get_string('createnewquestion', 'question'), 'question'); require_js(array('yui_yahoo','yui_dom','yui_event', 'yui_dragdrop', 'yui_container')); if (!$choiceformprinted) { echo '