diff --git a/question/editlib.php b/question/editlib.php
index aae05293947..fdbbab6b287 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 dd948045c7f..e1dfff39009 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 ccf4ad0ee4e..23e33de9e12 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 34d4d385195..4b522f6cbf6 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;
}