From: tjhunt Date: Thu, 26 Feb 2009 06:33:18 +0000 (+0000) Subject: quiz editing: MDL-18355 Try to improve the discoverability of Description again. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b974f94757fea0ee9059533f5145f05382a44a56;p=moodle.git quiz editing: MDL-18355 Try to improve the discoverability of Description again. --- diff --git a/question/editlib.php b/question/editlib.php index aae0529394..fdbbab6b28 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -1837,13 +1837,25 @@ function print_choose_qtype_to_add_form($hiddenparams) { echo '' . "\n"; } echo "\n"; - $types = question_type_menu(); echo '
' . "\n"; echo '
' . get_string('selectaqtypefordescription', 'question') . "
\n"; + echo '
' . "\n"; + $types = question_type_menu(); + $fakeqtypes = array(); foreach ($types as $qtype => $localizedname) { + if ($QTYPES[$qtype]->is_real_question_type()) { + print_qtype_to_add_option($qtype, $localizedname); + } else { + $fakeqtypes[$qtype] = $localizedname; + } + } + echo "
\n"; + echo '
' . "\n"; + foreach ($fakeqtypes as $qtype => $localizedname) { print_qtype_to_add_option($qtype, $localizedname); } echo "
\n"; + echo "
\n"; echo '
' . "\n"; echo '' . "\n"; echo '' . "\n"; diff --git a/question/type/description/questiontype.php b/question/type/description/questiontype.php index dd948045c7..e1dfff3900 100644 --- a/question/type/description/questiontype.php +++ b/question/type/description/questiontype.php @@ -1,16 +1,33 @@ penalty = 0; return true; } - } -//// END OF CLASS //// - -////////////////////////////////////////////////////////////////////////// -//// INITIATION - Without this line the question type is not in use... /// -////////////////////////////////////////////////////////////////////////// +// Register this question type with questionlib.php. question_register_questiontype(new description_qtype()); ?> diff --git a/question/type/questiontype.php b/question/type/questiontype.php index ccf4ad0ee4..23e33de9e1 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -84,6 +84,15 @@ class default_questiontype { return $this->local_name(); } + /** + * @return boolean override this to return false if this is not really a + * question type, for example the description question type is not + * really a question type. + */ + function is_real_question_type() { + return true; + } + /** * @return boolean true if this question type may require manual grading. */ diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index 34d4d38519..4b522f6cbf 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -2916,6 +2916,9 @@ body.notes .notesgroup { #chooseqtype .instruction { display: none; } +#chooseqtype .fakeqtypes { + border-top: 1px solid silver; +} #chooseqtype .qtypeoption { margin-bottom: 0.5em; }