mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
The information from question_rqp_types table should not be loaded every time questionlib.php is loaded but only when the questiontype menu is actually needed.
This commit is contained in:
parent
a2c0f03e5e
commit
50530eb782
@ -96,6 +96,13 @@ function question_list($course, $categoryid, $quizid=0,
|
|||||||
$recurse=1, $page=0, $perpage=100, $showhidden=false, $sortorder='qtype, name ASC') {
|
$recurse=1, $page=0, $perpage=100, $showhidden=false, $sortorder='qtype, name ASC') {
|
||||||
global $QTYPE_MENU, $USER, $CFG;
|
global $QTYPE_MENU, $USER, $CFG;
|
||||||
|
|
||||||
|
$qtypemenu = $QTYPE_MENU;
|
||||||
|
if ($rqp_types = get_records('question_rqp_types')) {
|
||||||
|
foreach($rqp_types as $type) {
|
||||||
|
$qtypemenu['rqp_'.$type->id] = $type->name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$strcategory = get_string("category", "quiz");
|
$strcategory = get_string("category", "quiz");
|
||||||
$strquestion = get_string("question", "quiz");
|
$strquestion = get_string("question", "quiz");
|
||||||
$straddquestions = get_string("addquestions", "quiz");
|
$straddquestions = get_string("addquestions", "quiz");
|
||||||
@ -143,7 +150,7 @@ function question_list($course, $categoryid, $quizid=0,
|
|||||||
if (isteacheredit($category->course)) {
|
if (isteacheredit($category->course)) {
|
||||||
echo "<td valign=\"top\"><b>$strcreatenewquestion:</b></td>";
|
echo "<td valign=\"top\"><b>$strcreatenewquestion:</b></td>";
|
||||||
echo '<td valign="top" align="right">';
|
echo '<td valign="top" align="right">';
|
||||||
popup_form ("$CFG->wwwroot/question/question.php?category=$category->id&qtype=", $QTYPE_MENU, "addquestion",
|
popup_form ("$CFG->wwwroot/question/question.php?category=$category->id&qtype=", $qtypemenu, "addquestion",
|
||||||
"", "choose", "", "", false, "self");
|
"", "choose", "", "", false, "self");
|
||||||
echo '</td><td width="10" valign="top" align="right">';
|
echo '</td><td width="10" valign="top" align="right">';
|
||||||
helpbutton("questiontypes", $strcreatenewquestion, "quiz");
|
helpbutton("questiontypes", $strcreatenewquestion, "quiz");
|
||||||
|
@ -547,13 +547,6 @@ class question_rqp_qtype extends default_questiontype {
|
|||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
//// INITIATION - Without this line the question type is not in use... ///
|
//// INITIATION - Without this line the question type is not in use... ///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// define("RQP", "11"); // already defined in questionlib.php
|
|
||||||
$QTYPES[RQP]= new question_rqp_qtype();
|
$QTYPES[RQP]= new question_rqp_qtype();
|
||||||
// The following adds the questiontype to the menu of types shown to teachers
|
|
||||||
if ($rqp_types = get_records('question_rqp_types')) {
|
|
||||||
foreach($rqp_types as $type) {
|
|
||||||
$QTYPE_MENU[100+$type->id] = $type->name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user