2009-11-04 11:58:30 +00:00
|
|
|
<?php
|
2011-02-10 20:44:47 +00:00
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
|
|
//
|
|
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2009-01-19 05:30:01 +00:00
|
|
|
|
2005-05-06 06:24:04 +00:00
|
|
|
/**
|
2007-11-07 15:20:57 +00:00
|
|
|
* Page to edit quizzes
|
|
|
|
*
|
|
|
|
* This page generally has two columns:
|
|
|
|
* The right column lists all available questions in a chosen category and
|
|
|
|
* allows them to be edited or more to be added. This column is only there if
|
|
|
|
* the quiz does not already have student attempts
|
|
|
|
* The left column lists all questions that have been added to the current quiz.
|
|
|
|
* The lecturer can add questions from the right hand list to the quiz or remove them
|
|
|
|
*
|
|
|
|
* The script also processes a number of actions:
|
|
|
|
* Actions affecting a quiz:
|
|
|
|
* up and down Changes the order of questions and page breaks
|
|
|
|
* addquestion Adds a single question to the quiz
|
|
|
|
* add Adds several selected questions to the quiz
|
|
|
|
* addrandom Adds a certain number of random questions to the quiz
|
|
|
|
* repaginate Re-paginates the quiz
|
|
|
|
* delete Removes a question from the quiz
|
|
|
|
* savechanges Saves the order and grades for questions in the quiz
|
|
|
|
*
|
2014-02-16 11:59:15 +13:00
|
|
|
* @package mod_quiz
|
2011-02-21 16:13:25 +00:00
|
|
|
* @copyright 1999 onwards Martin Dougiamas and others {@link http://moodle.com}
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
2011-02-10 20:44:47 +00:00
|
|
|
*/
|
|
|
|
|
2009-01-19 05:30:01 +00:00
|
|
|
|
2009-02-26 08:30:45 +00:00
|
|
|
require_once('../../config.php');
|
|
|
|
require_once($CFG->dirroot . '/mod/quiz/editlib.php');
|
2010-11-22 09:52:42 +00:00
|
|
|
require_once($CFG->dirroot . '/mod/quiz/addrandomform.php');
|
2009-02-26 08:30:45 +00:00
|
|
|
require_once($CFG->dirroot . '/question/category_class.php');
|
2008-11-20 06:59:11 +00:00
|
|
|
|
2012-05-04 12:40:21 +01:00
|
|
|
// These params are only passed from page request to request while we stay on
|
|
|
|
// this page otherwise they would go in question_edit_setup.
|
2011-02-11 17:36:02 +00:00
|
|
|
$scrollpos = optional_param('scrollpos', '', PARAM_INT);
|
2010-05-21 03:15:48 +00:00
|
|
|
|
2008-11-20 06:59:11 +00:00
|
|
|
list($thispageurl, $contexts, $cmid, $cm, $quiz, $pagevars) =
|
2010-04-12 13:31:42 +00:00
|
|
|
question_edit_setup('editq', '/mod/quiz/edit.php', true);
|
2008-11-20 06:59:11 +00:00
|
|
|
|
|
|
|
$defaultcategoryobj = question_make_default_categories($contexts->all());
|
2010-11-22 09:52:42 +00:00
|
|
|
$defaultcategory = $defaultcategoryobj->id . ',' . $defaultcategoryobj->contextid;
|
2009-02-26 08:30:45 +00:00
|
|
|
|
quiz editing: MDL-17454 first attemtp, and MDL-18554
This is a minimal fix for MDL-18554, I have just added a cancel button and made it work.
The more substantial part of this is MDL-17454, trying to make the quiz editing screen behave appropriately when shuffle questions is on. I am sure Olli will have opinions about this and want to change it further. Rought summary:
* When shufflequestions is off, never restrict manual paging, even if questionsperpage is set.
* When shuffle questions is on:
** Always display the quiz with the defined number of questions per page.
** Remove controls to add things except at the end of the quiz.
** Disable most of the order and paging tab, but still allow the question list to be reordered, in case that helps teachers track which questions they have added.
** Still allow questions to be reordered on the edit tab, but when moving the top question on a page up, reorder with the previous question, rather than moving to the previous page.
* Change the status bar, so that the yellow highlight is reserved for alert information. The more informative stuff is now plain, and moved to under the title. To my mind that associates it more closely with the quiz name. Also it moves Total of grades and Maximum grade closer together.
* JavaScript cleaned up. I learn more about YUI every day.
* Some PHP code clean ups that I forgot to commit separately before making substantive changes.
2009-03-17 09:51:34 +00:00
|
|
|
$quizhasattempts = quiz_has_attempts($quiz->id);
|
2008-11-20 06:59:11 +00:00
|
|
|
|
2010-08-04 16:31:54 +00:00
|
|
|
$PAGE->set_url($thispageurl);
|
2008-11-20 06:59:11 +00:00
|
|
|
|
|
|
|
// Get the course object and related bits.
|
MDL-43089 quiz: improved interface for building quizzes
This commit is actually the joint work of Mahmoud Kassaei, Colin
Chambers and Tim Hunt from The Open University. We could only use one
persons name for the commit, and this time Colin gets the credit/blame.
The goal of this work was to increase usability, and also clean up
the page enough that it will be possible to add new features in future.
Display of mod/quiz/edit.php is now entirely generated by
mod_quiz\output\edit_renderer. This uses a helper class
mod_quiz\structure to provide details of the structure of the quiz, and
mod_quiz\repaginate to alter that structure. (Acutally, there are still
some modification methods on mod_quiz\structure. Expect that to be
cleaned up in future.)
The new code uses much more ajax, and there are new scripts
mod/quiz/edit_rest.php and mod/quiz/repaginate.php to handle this.
(Again, don't be surprised if those two scripts get merged in future.)
Also questionbank.ajax.php (which may, in future, be made more generic,
and moved into the core question bank code.)
Most of the new JavaScript code has intentionally copied the way things
are done when editing activities on the course page.
As a result of this, mod/quiz/editlib.php is now much shorter than it
was. (In future, expect the remaining code in here to move into
mod/quiz/classes.)
2013-12-05 16:18:24 +00:00
|
|
|
$course = $DB->get_record('course', array('id' => $quiz->course), '*', MUST_EXIST);
|
|
|
|
$quizobj = new quiz($quiz, $cm, $course);
|
|
|
|
$structure = $quizobj->get_structure();
|
2009-01-22 05:38:18 +00:00
|
|
|
|
2009-02-26 08:30:45 +00:00
|
|
|
// You need mod/quiz:manage in addition to question capabilities to access this page.
|
2008-11-20 06:59:11 +00:00
|
|
|
require_capability('mod/quiz:manage', $contexts->lowest());
|
2002-10-14 12:21:18 +00:00
|
|
|
|
2013-11-18 22:07:09 -08:00
|
|
|
// Log this visit.
|
|
|
|
$params = array(
|
|
|
|
'courseid' => $course->id,
|
|
|
|
'context' => $contexts->lowest(),
|
|
|
|
'other' => array(
|
|
|
|
'quizid' => $quiz->id
|
|
|
|
)
|
|
|
|
);
|
|
|
|
$event = \mod_quiz\event\edit_page_viewed::create($params);
|
|
|
|
$event->trigger();
|
|
|
|
|
MDL-43089 quiz: improved interface for building quizzes
This commit is actually the joint work of Mahmoud Kassaei, Colin
Chambers and Tim Hunt from The Open University. We could only use one
persons name for the commit, and this time Colin gets the credit/blame.
The goal of this work was to increase usability, and also clean up
the page enough that it will be possible to add new features in future.
Display of mod/quiz/edit.php is now entirely generated by
mod_quiz\output\edit_renderer. This uses a helper class
mod_quiz\structure to provide details of the structure of the quiz, and
mod_quiz\repaginate to alter that structure. (Acutally, there are still
some modification methods on mod_quiz\structure. Expect that to be
cleaned up in future.)
The new code uses much more ajax, and there are new scripts
mod/quiz/edit_rest.php and mod/quiz/repaginate.php to handle this.
(Again, don't be surprised if those two scripts get merged in future.)
Also questionbank.ajax.php (which may, in future, be made more generic,
and moved into the core question bank code.)
Most of the new JavaScript code has intentionally copied the way things
are done when editing activities on the course page.
As a result of this, mod/quiz/editlib.php is now much shorter than it
was. (In future, expect the remaining code in here to move into
mod/quiz/classes.)
2013-12-05 16:18:24 +00:00
|
|
|
// Process commands ============================================================.
|
2009-02-27 08:45:05 +00:00
|
|
|
|
|
|
|
// Get the list of question ids had their check-boxes ticked.
|
2014-01-22 18:19:31 +00:00
|
|
|
$selectedslots = array();
|
2009-02-27 08:45:05 +00:00
|
|
|
$params = (array) data_submitted();
|
|
|
|
foreach ($params as $key => $value) {
|
|
|
|
if (preg_match('!^s([0-9]+)$!', $key, $matches)) {
|
2014-01-22 18:19:31 +00:00
|
|
|
$selectedslots[] = $matches[1];
|
2002-10-14 09:07:13 +00:00
|
|
|
}
|
2008-11-20 06:59:11 +00:00
|
|
|
}
|
|
|
|
|
2011-02-11 17:36:02 +00:00
|
|
|
$afteractionurl = new moodle_url($thispageurl);
|
|
|
|
if ($scrollpos) {
|
|
|
|
$afteractionurl->param('scrollpos', $scrollpos);
|
|
|
|
}
|
2009-02-27 08:45:05 +00:00
|
|
|
|
|
|
|
if (optional_param('repaginate', false, PARAM_BOOL) && confirm_sesskey()) {
|
2012-05-04 12:40:21 +01:00
|
|
|
// Re-paginate the quiz.
|
2009-02-27 08:45:05 +00:00
|
|
|
$questionsperpage = optional_param('questionsperpage', $quiz->questionsperpage, PARAM_INT);
|
2014-01-22 18:19:31 +00:00
|
|
|
quiz_repaginate_questions($quiz->id, $questionsperpage );
|
2011-02-10 20:44:47 +00:00
|
|
|
quiz_delete_previews($quiz);
|
2011-02-11 17:36:02 +00:00
|
|
|
redirect($afteractionurl);
|
2008-11-20 06:59:11 +00:00
|
|
|
}
|
2009-02-26 08:30:45 +00:00
|
|
|
|
|
|
|
if (($addquestion = optional_param('addquestion', 0, PARAM_INT)) && confirm_sesskey()) {
|
2012-05-04 12:40:21 +01:00
|
|
|
// Add a single question to the current quiz.
|
2012-03-28 13:55:17 +01:00
|
|
|
quiz_require_question_use($addquestion);
|
2009-02-26 08:30:45 +00:00
|
|
|
$addonpage = optional_param('addonpage', 0, PARAM_INT);
|
2008-11-20 06:59:11 +00:00
|
|
|
quiz_add_quiz_question($addquestion, $quiz, $addonpage);
|
2009-02-27 08:45:05 +00:00
|
|
|
quiz_delete_previews($quiz);
|
2011-02-10 20:44:47 +00:00
|
|
|
quiz_update_sumgrades($quiz);
|
2010-05-01 08:23:28 +00:00
|
|
|
$thispageurl->param('lastchanged', $addquestion);
|
2011-02-11 17:36:02 +00:00
|
|
|
redirect($afteractionurl);
|
2008-11-20 06:59:11 +00:00
|
|
|
}
|
|
|
|
|
2009-02-26 08:30:45 +00:00
|
|
|
if (optional_param('add', false, PARAM_BOOL) && confirm_sesskey()) {
|
MDL-43089 quiz: improved interface for building quizzes
This commit is actually the joint work of Mahmoud Kassaei, Colin
Chambers and Tim Hunt from The Open University. We could only use one
persons name for the commit, and this time Colin gets the credit/blame.
The goal of this work was to increase usability, and also clean up
the page enough that it will be possible to add new features in future.
Display of mod/quiz/edit.php is now entirely generated by
mod_quiz\output\edit_renderer. This uses a helper class
mod_quiz\structure to provide details of the structure of the quiz, and
mod_quiz\repaginate to alter that structure. (Acutally, there are still
some modification methods on mod_quiz\structure. Expect that to be
cleaned up in future.)
The new code uses much more ajax, and there are new scripts
mod/quiz/edit_rest.php and mod/quiz/repaginate.php to handle this.
(Again, don't be surprised if those two scripts get merged in future.)
Also questionbank.ajax.php (which may, in future, be made more generic,
and moved into the core question bank code.)
Most of the new JavaScript code has intentionally copied the way things
are done when editing activities on the course page.
As a result of this, mod/quiz/editlib.php is now much shorter than it
was. (In future, expect the remaining code in here to move into
mod/quiz/classes.)
2013-12-05 16:18:24 +00:00
|
|
|
$addonpage = optional_param('addonpage', 0, PARAM_INT);
|
2012-05-04 12:40:21 +01:00
|
|
|
// Add selected questions to the current quiz.
|
2008-11-20 06:59:11 +00:00
|
|
|
$rawdata = (array) data_submitted();
|
2012-05-04 12:40:21 +01:00
|
|
|
foreach ($rawdata as $key => $value) { // Parse input for question ids.
|
2008-11-20 06:59:11 +00:00
|
|
|
if (preg_match('!^q([0-9]+)$!', $key, $matches)) {
|
|
|
|
$key = $matches[1];
|
2012-03-28 13:55:17 +01:00
|
|
|
quiz_require_question_use($key);
|
MDL-43089 quiz: improved interface for building quizzes
This commit is actually the joint work of Mahmoud Kassaei, Colin
Chambers and Tim Hunt from The Open University. We could only use one
persons name for the commit, and this time Colin gets the credit/blame.
The goal of this work was to increase usability, and also clean up
the page enough that it will be possible to add new features in future.
Display of mod/quiz/edit.php is now entirely generated by
mod_quiz\output\edit_renderer. This uses a helper class
mod_quiz\structure to provide details of the structure of the quiz, and
mod_quiz\repaginate to alter that structure. (Acutally, there are still
some modification methods on mod_quiz\structure. Expect that to be
cleaned up in future.)
The new code uses much more ajax, and there are new scripts
mod/quiz/edit_rest.php and mod/quiz/repaginate.php to handle this.
(Again, don't be surprised if those two scripts get merged in future.)
Also questionbank.ajax.php (which may, in future, be made more generic,
and moved into the core question bank code.)
Most of the new JavaScript code has intentionally copied the way things
are done when editing activities on the course page.
As a result of this, mod/quiz/editlib.php is now much shorter than it
was. (In future, expect the remaining code in here to move into
mod/quiz/classes.)
2013-12-05 16:18:24 +00:00
|
|
|
quiz_add_quiz_question($key, $quiz, $addonpage);
|
2005-03-05 12:55:26 +00:00
|
|
|
}
|
|
|
|
}
|
2009-02-27 08:45:05 +00:00
|
|
|
quiz_delete_previews($quiz);
|
2011-02-10 20:44:47 +00:00
|
|
|
quiz_update_sumgrades($quiz);
|
2011-02-11 17:36:02 +00:00
|
|
|
redirect($afteractionurl);
|
2008-11-20 06:59:11 +00:00
|
|
|
}
|
|
|
|
|
2010-11-22 09:52:42 +00:00
|
|
|
if ((optional_param('addrandom', false, PARAM_BOOL)) && confirm_sesskey()) {
|
2012-05-04 12:40:21 +01:00
|
|
|
// Add random questions to the quiz.
|
2008-11-20 06:59:11 +00:00
|
|
|
$recurse = optional_param('recurse', 0, PARAM_BOOL);
|
2009-02-26 08:30:45 +00:00
|
|
|
$addonpage = optional_param('addonpage', 0, PARAM_INT);
|
2010-11-22 09:52:42 +00:00
|
|
|
$categoryid = required_param('categoryid', PARAM_INT);
|
|
|
|
$randomcount = required_param('randomcount', PARAM_INT);
|
|
|
|
quiz_add_random_questions($quiz, $addonpage, $categoryid, $randomcount, $recurse);
|
2002-10-14 09:07:13 +00:00
|
|
|
|
2009-02-27 08:45:05 +00:00
|
|
|
quiz_delete_previews($quiz);
|
2011-02-10 20:44:47 +00:00
|
|
|
quiz_update_sumgrades($quiz);
|
2011-02-11 17:36:02 +00:00
|
|
|
redirect($afteractionurl);
|
2008-11-20 06:59:11 +00:00
|
|
|
}
|
2009-02-26 08:30:45 +00:00
|
|
|
|
|
|
|
if (optional_param('savechanges', false, PARAM_BOOL) && confirm_sesskey()) {
|
2011-02-10 20:44:47 +00:00
|
|
|
$deletepreviews = false;
|
|
|
|
$recomputesummarks = false;
|
|
|
|
|
quiz editing: MDL-17454 first attemtp, and MDL-18554
This is a minimal fix for MDL-18554, I have just added a cancel button and made it work.
The more substantial part of this is MDL-17454, trying to make the quiz editing screen behave appropriately when shuffle questions is on. I am sure Olli will have opinions about this and want to change it further. Rought summary:
* When shufflequestions is off, never restrict manual paging, even if questionsperpage is set.
* When shuffle questions is on:
** Always display the quiz with the defined number of questions per page.
** Remove controls to add things except at the end of the quiz.
** Disable most of the order and paging tab, but still allow the question list to be reordered, in case that helps teachers track which questions they have added.
** Still allow questions to be reordered on the edit tab, but when moving the top question on a page up, reorder with the previous question, rather than moving to the previous page.
* Change the status bar, so that the yellow highlight is reserved for alert information. The more informative stuff is now plain, and moved to under the title. To my mind that associates it more closely with the quiz name. Also it moves Total of grades and Maximum grade closer together.
* JavaScript cleaned up. I learn more about YUI every day.
* Some PHP code clean ups that I forgot to commit separately before making substantive changes.
2009-03-17 09:51:34 +00:00
|
|
|
$rawdata = (array) data_submitted();
|
2008-11-20 06:59:11 +00:00
|
|
|
$moveonpagequestions = array();
|
quiz editing: MDL-17454 first attemtp, and MDL-18554
This is a minimal fix for MDL-18554, I have just added a cancel button and made it work.
The more substantial part of this is MDL-17454, trying to make the quiz editing screen behave appropriately when shuffle questions is on. I am sure Olli will have opinions about this and want to change it further. Rought summary:
* When shufflequestions is off, never restrict manual paging, even if questionsperpage is set.
* When shuffle questions is on:
** Always display the quiz with the defined number of questions per page.
** Remove controls to add things except at the end of the quiz.
** Disable most of the order and paging tab, but still allow the question list to be reordered, in case that helps teachers track which questions they have added.
** Still allow questions to be reordered on the edit tab, but when moving the top question on a page up, reorder with the previous question, rather than moving to the previous page.
* Change the status bar, so that the yellow highlight is reserved for alert information. The more informative stuff is now plain, and moved to under the title. To my mind that associates it more closely with the quiz name. Also it moves Total of grades and Maximum grade closer together.
* JavaScript cleaned up. I learn more about YUI every day.
* Some PHP code clean ups that I forgot to commit separately before making substantive changes.
2009-03-17 09:51:34 +00:00
|
|
|
$moveselectedonpage = optional_param('moveselectedonpagetop', 0, PARAM_INT);
|
|
|
|
if (!$moveselectedonpage) {
|
|
|
|
$moveselectedonpage = optional_param('moveselectedonpagebottom', 0, PARAM_INT);
|
2008-11-20 06:59:11 +00:00
|
|
|
}
|
2006-03-01 09:30:21 +00:00
|
|
|
|
2014-01-22 18:19:31 +00:00
|
|
|
$newslotorder = array();
|
quiz editing: MDL-17454 first attemtp, and MDL-18554
This is a minimal fix for MDL-18554, I have just added a cancel button and made it work.
The more substantial part of this is MDL-17454, trying to make the quiz editing screen behave appropriately when shuffle questions is on. I am sure Olli will have opinions about this and want to change it further. Rought summary:
* When shufflequestions is off, never restrict manual paging, even if questionsperpage is set.
* When shuffle questions is on:
** Always display the quiz with the defined number of questions per page.
** Remove controls to add things except at the end of the quiz.
** Disable most of the order and paging tab, but still allow the question list to be reordered, in case that helps teachers track which questions they have added.
** Still allow questions to be reordered on the edit tab, but when moving the top question on a page up, reorder with the previous question, rather than moving to the previous page.
* Change the status bar, so that the yellow highlight is reserved for alert information. The more informative stuff is now plain, and moved to under the title. To my mind that associates it more closely with the quiz name. Also it moves Total of grades and Maximum grade closer together.
* JavaScript cleaned up. I learn more about YUI every day.
* Some PHP code clean ups that I forgot to commit separately before making substantive changes.
2009-03-17 09:51:34 +00:00
|
|
|
foreach ($rawdata as $key => $value) {
|
2009-02-27 08:45:05 +00:00
|
|
|
if (preg_match('!^g([0-9]+)$!', $key, $matches)) {
|
2012-05-04 12:40:21 +01:00
|
|
|
// Parse input for question -> grades.
|
2014-01-22 18:19:31 +00:00
|
|
|
$slotnumber = $matches[1];
|
|
|
|
$newgrade = unformat_float($value);
|
|
|
|
quiz_update_slot_maxmark($DB->get_record('quiz_slots',
|
|
|
|
array('quizid' => $quiz->id, 'slot' => $slotnumber), '*', MUST_EXIST), $newgrade);
|
2011-02-10 20:44:47 +00:00
|
|
|
$deletepreviews = true;
|
|
|
|
$recomputesummarks = true;
|
2007-05-03 10:10:01 +00:00
|
|
|
|
quiz editing: MDL-17454 first attemtp, and MDL-18554
This is a minimal fix for MDL-18554, I have just added a cancel button and made it work.
The more substantial part of this is MDL-17454, trying to make the quiz editing screen behave appropriately when shuffle questions is on. I am sure Olli will have opinions about this and want to change it further. Rought summary:
* When shufflequestions is off, never restrict manual paging, even if questionsperpage is set.
* When shuffle questions is on:
** Always display the quiz with the defined number of questions per page.
** Remove controls to add things except at the end of the quiz.
** Disable most of the order and paging tab, but still allow the question list to be reordered, in case that helps teachers track which questions they have added.
** Still allow questions to be reordered on the edit tab, but when moving the top question on a page up, reorder with the previous question, rather than moving to the previous page.
* Change the status bar, so that the yellow highlight is reserved for alert information. The more informative stuff is now plain, and moved to under the title. To my mind that associates it more closely with the quiz name. Also it moves Total of grades and Maximum grade closer together.
* JavaScript cleaned up. I learn more about YUI every day.
* Some PHP code clean ups that I forgot to commit separately before making substantive changes.
2009-03-17 09:51:34 +00:00
|
|
|
} else if (preg_match('!^o(pg)?([0-9]+)$!', $key, $matches)) {
|
2012-05-04 12:40:21 +01:00
|
|
|
// Parse input for ordering info.
|
2014-01-22 18:19:31 +00:00
|
|
|
$slotnumber = $matches[2];
|
quiz editing: MDL-17454 first attemtp, and MDL-18554
This is a minimal fix for MDL-18554, I have just added a cancel button and made it work.
The more substantial part of this is MDL-17454, trying to make the quiz editing screen behave appropriately when shuffle questions is on. I am sure Olli will have opinions about this and want to change it further. Rought summary:
* When shufflequestions is off, never restrict manual paging, even if questionsperpage is set.
* When shuffle questions is on:
** Always display the quiz with the defined number of questions per page.
** Remove controls to add things except at the end of the quiz.
** Disable most of the order and paging tab, but still allow the question list to be reordered, in case that helps teachers track which questions they have added.
** Still allow questions to be reordered on the edit tab, but when moving the top question on a page up, reorder with the previous question, rather than moving to the previous page.
* Change the status bar, so that the yellow highlight is reserved for alert information. The more informative stuff is now plain, and moved to under the title. To my mind that associates it more closely with the quiz name. Also it moves Total of grades and Maximum grade closer together.
* JavaScript cleaned up. I learn more about YUI every day.
* Some PHP code clean ups that I forgot to commit separately before making substantive changes.
2009-03-17 09:51:34 +00:00
|
|
|
// Make sure two questions don't overwrite each other. If we get a second
|
|
|
|
// question with the same position, shift the second one along to the next gap.
|
2012-05-11 10:49:51 +08:00
|
|
|
$value = clean_param($value, PARAM_INT);
|
2014-01-22 18:19:31 +00:00
|
|
|
while (array_key_exists($value, $newslotorder)) {
|
2008-11-20 06:59:11 +00:00
|
|
|
$value++;
|
|
|
|
}
|
quiz editing: MDL-17454 first attemtp, and MDL-18554
This is a minimal fix for MDL-18554, I have just added a cancel button and made it work.
The more substantial part of this is MDL-17454, trying to make the quiz editing screen behave appropriately when shuffle questions is on. I am sure Olli will have opinions about this and want to change it further. Rought summary:
* When shufflequestions is off, never restrict manual paging, even if questionsperpage is set.
* When shuffle questions is on:
** Always display the quiz with the defined number of questions per page.
** Remove controls to add things except at the end of the quiz.
** Disable most of the order and paging tab, but still allow the question list to be reordered, in case that helps teachers track which questions they have added.
** Still allow questions to be reordered on the edit tab, but when moving the top question on a page up, reorder with the previous question, rather than moving to the previous page.
* Change the status bar, so that the yellow highlight is reserved for alert information. The more informative stuff is now plain, and moved to under the title. To my mind that associates it more closely with the quiz name. Also it moves Total of grades and Maximum grade closer together.
* JavaScript cleaned up. I learn more about YUI every day.
* Some PHP code clean ups that I forgot to commit separately before making substantive changes.
2009-03-17 09:51:34 +00:00
|
|
|
if ($matches[1]) {
|
|
|
|
// This is a page-break entry.
|
2014-01-22 18:19:31 +00:00
|
|
|
$newslotorder[$value] = 0;
|
quiz editing: MDL-17454 first attemtp, and MDL-18554
This is a minimal fix for MDL-18554, I have just added a cancel button and made it work.
The more substantial part of this is MDL-17454, trying to make the quiz editing screen behave appropriately when shuffle questions is on. I am sure Olli will have opinions about this and want to change it further. Rought summary:
* When shufflequestions is off, never restrict manual paging, even if questionsperpage is set.
* When shuffle questions is on:
** Always display the quiz with the defined number of questions per page.
** Remove controls to add things except at the end of the quiz.
** Disable most of the order and paging tab, but still allow the question list to be reordered, in case that helps teachers track which questions they have added.
** Still allow questions to be reordered on the edit tab, but when moving the top question on a page up, reorder with the previous question, rather than moving to the previous page.
* Change the status bar, so that the yellow highlight is reserved for alert information. The more informative stuff is now plain, and moved to under the title. To my mind that associates it more closely with the quiz name. Also it moves Total of grades and Maximum grade closer together.
* JavaScript cleaned up. I learn more about YUI every day.
* Some PHP code clean ups that I forgot to commit separately before making substantive changes.
2009-03-17 09:51:34 +00:00
|
|
|
} else {
|
2014-01-22 18:19:31 +00:00
|
|
|
$newslotorder[$value] = $slotnumber;
|
quiz editing: MDL-17454 first attemtp, and MDL-18554
This is a minimal fix for MDL-18554, I have just added a cancel button and made it work.
The more substantial part of this is MDL-17454, trying to make the quiz editing screen behave appropriately when shuffle questions is on. I am sure Olli will have opinions about this and want to change it further. Rought summary:
* When shufflequestions is off, never restrict manual paging, even if questionsperpage is set.
* When shuffle questions is on:
** Always display the quiz with the defined number of questions per page.
** Remove controls to add things except at the end of the quiz.
** Disable most of the order and paging tab, but still allow the question list to be reordered, in case that helps teachers track which questions they have added.
** Still allow questions to be reordered on the edit tab, but when moving the top question on a page up, reorder with the previous question, rather than moving to the previous page.
* Change the status bar, so that the yellow highlight is reserved for alert information. The more informative stuff is now plain, and moved to under the title. To my mind that associates it more closely with the quiz name. Also it moves Total of grades and Maximum grade closer together.
* JavaScript cleaned up. I learn more about YUI every day.
* Some PHP code clean ups that I forgot to commit separately before making substantive changes.
2009-03-17 09:51:34 +00:00
|
|
|
}
|
2011-02-10 20:44:47 +00:00
|
|
|
$deletepreviews = true;
|
2008-11-20 06:59:11 +00:00
|
|
|
}
|
|
|
|
}
|
2009-02-27 08:45:05 +00:00
|
|
|
|
|
|
|
if ($moveselectedonpage) {
|
2014-01-22 18:19:31 +00:00
|
|
|
|
|
|
|
// Make up a $newslotorder, then let the next if statement do the work.
|
|
|
|
$oldslots = $DB->get_records('quiz_slots', array('quizid' => $quiz->id), 'slot');
|
|
|
|
|
|
|
|
$beforepage = array();
|
|
|
|
$onpage = array();
|
|
|
|
$afterpage = array();
|
|
|
|
foreach ($oldslots as $oldslot) {
|
|
|
|
if (in_array($oldslot->slot, $selectedslots)) {
|
|
|
|
$onpage[] = $oldslot;
|
|
|
|
} else if ($oldslot->page <= $moveselectedonpage) {
|
|
|
|
$beforepage[] = $oldslot;
|
|
|
|
} else {
|
|
|
|
$afterpage[] = $oldslot;
|
2008-11-21 17:08:36 +00:00
|
|
|
}
|
|
|
|
}
|
2009-02-26 08:30:45 +00:00
|
|
|
|
2014-01-22 18:19:31 +00:00
|
|
|
$newslotorder = array();
|
|
|
|
$currentpage = 1;
|
|
|
|
$index = 10;
|
|
|
|
foreach ($beforepage as $slot) {
|
|
|
|
while ($currentpage < $slot->page) {
|
|
|
|
$newslotorder[$index] = 0;
|
|
|
|
$index += 10;
|
|
|
|
$currentpage += 1;
|
|
|
|
}
|
|
|
|
$newslotorder[$index] = $slot->slot;
|
|
|
|
$index += 10;
|
|
|
|
}
|
2011-12-15 19:32:37 +00:00
|
|
|
|
2014-01-22 18:19:31 +00:00
|
|
|
while ($currentpage < $moveselectedonpage) {
|
|
|
|
$newslotorder[$index] = 0;
|
|
|
|
$index += 10;
|
|
|
|
$currentpage += 1;
|
|
|
|
}
|
|
|
|
foreach ($onpage as $slot) {
|
|
|
|
$newslotorder[$index] = $slot->slot;
|
|
|
|
$index += 10;
|
2011-12-15 19:32:37 +00:00
|
|
|
}
|
|
|
|
|
2014-01-22 18:19:31 +00:00
|
|
|
foreach ($afterpage as $slot) {
|
|
|
|
while ($currentpage < $slot->page) {
|
|
|
|
$newslotorder[$index] = 0;
|
|
|
|
$index += 10;
|
|
|
|
$currentpage += 1;
|
|
|
|
}
|
|
|
|
$newslotorder[$index] = $slot->slot;
|
|
|
|
$index += 10;
|
|
|
|
}
|
|
|
|
}
|
2011-12-15 19:32:37 +00:00
|
|
|
|
2014-01-22 18:19:31 +00:00
|
|
|
// If ordering info was given, reorder the questions.
|
|
|
|
if ($newslotorder) {
|
|
|
|
ksort($newslotorder);
|
|
|
|
$currentpage = 1;
|
|
|
|
$currentslot = 1;
|
|
|
|
$slotreorder = array();
|
|
|
|
$slotpages = array();
|
|
|
|
foreach ($newslotorder as $slotnumber) {
|
|
|
|
if ($slotnumber == 0) {
|
|
|
|
$currentpage += 1;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$slotreorder[$slotnumber] = $currentslot;
|
|
|
|
$slotpages[$currentslot] = $currentpage;
|
|
|
|
$currentslot += 1;
|
|
|
|
}
|
|
|
|
$trans = $DB->start_delegated_transaction();
|
|
|
|
update_field_with_unique_index('quiz_slots',
|
|
|
|
'slot', $slotreorder, array('quizid' => $quiz->id));
|
|
|
|
foreach ($slotpages as $slotnumber => $page) {
|
|
|
|
$DB->set_field('quiz_slots', 'page', $page, array('quizid' => $quiz->id, 'slot' => $slotnumber));
|
|
|
|
}
|
|
|
|
$trans->allow_commit();
|
2011-02-10 20:44:47 +00:00
|
|
|
$deletepreviews = true;
|
2008-11-20 06:59:11 +00:00
|
|
|
}
|
quiz editing: MDL-17454 first attemtp, and MDL-18554
This is a minimal fix for MDL-18554, I have just added a cancel button and made it work.
The more substantial part of this is MDL-17454, trying to make the quiz editing screen behave appropriately when shuffle questions is on. I am sure Olli will have opinions about this and want to change it further. Rought summary:
* When shufflequestions is off, never restrict manual paging, even if questionsperpage is set.
* When shuffle questions is on:
** Always display the quiz with the defined number of questions per page.
** Remove controls to add things except at the end of the quiz.
** Disable most of the order and paging tab, but still allow the question list to be reordered, in case that helps teachers track which questions they have added.
** Still allow questions to be reordered on the edit tab, but when moving the top question on a page up, reorder with the previous question, rather than moving to the previous page.
* Change the status bar, so that the yellow highlight is reserved for alert information. The more informative stuff is now plain, and moved to under the title. To my mind that associates it more closely with the quiz name. Also it moves Total of grades and Maximum grade closer together.
* JavaScript cleaned up. I learn more about YUI every day.
* Some PHP code clean ups that I forgot to commit separately before making substantive changes.
2009-03-17 09:51:34 +00:00
|
|
|
|
2012-05-04 12:40:21 +01:00
|
|
|
// If rescaling is required save the new maximum.
|
2012-06-07 12:55:53 +01:00
|
|
|
$maxgrade = unformat_float(optional_param('maxgrade', -1, PARAM_RAW));
|
2008-11-20 06:59:11 +00:00
|
|
|
if ($maxgrade >= 0) {
|
quiz editing: MDL-17454 first attemtp, and MDL-18554
This is a minimal fix for MDL-18554, I have just added a cancel button and made it work.
The more substantial part of this is MDL-17454, trying to make the quiz editing screen behave appropriately when shuffle questions is on. I am sure Olli will have opinions about this and want to change it further. Rought summary:
* When shufflequestions is off, never restrict manual paging, even if questionsperpage is set.
* When shuffle questions is on:
** Always display the quiz with the defined number of questions per page.
** Remove controls to add things except at the end of the quiz.
** Disable most of the order and paging tab, but still allow the question list to be reordered, in case that helps teachers track which questions they have added.
** Still allow questions to be reordered on the edit tab, but when moving the top question on a page up, reorder with the previous question, rather than moving to the previous page.
* Change the status bar, so that the yellow highlight is reserved for alert information. The more informative stuff is now plain, and moved to under the title. To my mind that associates it more closely with the quiz name. Also it moves Total of grades and Maximum grade closer together.
* JavaScript cleaned up. I learn more about YUI every day.
* Some PHP code clean ups that I forgot to commit separately before making substantive changes.
2009-03-17 09:51:34 +00:00
|
|
|
quiz_set_grade($maxgrade, $quiz);
|
2006-03-01 09:30:21 +00:00
|
|
|
}
|
2005-05-06 06:24:04 +00:00
|
|
|
|
2011-02-10 20:44:47 +00:00
|
|
|
if ($deletepreviews) {
|
|
|
|
quiz_delete_previews($quiz);
|
|
|
|
}
|
|
|
|
if ($recomputesummarks) {
|
|
|
|
quiz_update_sumgrades($quiz);
|
|
|
|
quiz_update_all_attempt_sumgrades($quiz);
|
|
|
|
quiz_update_all_final_grades($quiz);
|
|
|
|
quiz_update_grades($quiz, 0, true);
|
|
|
|
}
|
2011-02-11 17:36:02 +00:00
|
|
|
redirect($afteractionurl);
|
2008-11-20 06:59:11 +00:00
|
|
|
}
|
2006-02-17 17:15:17 +00:00
|
|
|
|
MDL-43089 quiz: improved interface for building quizzes
This commit is actually the joint work of Mahmoud Kassaei, Colin
Chambers and Tim Hunt from The Open University. We could only use one
persons name for the commit, and this time Colin gets the credit/blame.
The goal of this work was to increase usability, and also clean up
the page enough that it will be possible to add new features in future.
Display of mod/quiz/edit.php is now entirely generated by
mod_quiz\output\edit_renderer. This uses a helper class
mod_quiz\structure to provide details of the structure of the quiz, and
mod_quiz\repaginate to alter that structure. (Acutally, there are still
some modification methods on mod_quiz\structure. Expect that to be
cleaned up in future.)
The new code uses much more ajax, and there are new scripts
mod/quiz/edit_rest.php and mod/quiz/repaginate.php to handle this.
(Again, don't be surprised if those two scripts get merged in future.)
Also questionbank.ajax.php (which may, in future, be made more generic,
and moved into the core question bank code.)
Most of the new JavaScript code has intentionally copied the way things
are done when editing activities on the course page.
As a result of this, mod/quiz/editlib.php is now much shorter than it
was. (In future, expect the remaining code in here to move into
mod/quiz/classes.)
2013-12-05 16:18:24 +00:00
|
|
|
// Get the question bank view.
|
|
|
|
$questionbank = new quiz_question_bank_view($contexts, $thispageurl, $course, $cm, $quiz);
|
|
|
|
$questionbank->set_quiz_has_attempts($quizhasattempts);
|
2009-01-19 05:30:01 +00:00
|
|
|
$questionbank->process_actions($thispageurl, $cm);
|
2005-02-05 21:03:04 +00:00
|
|
|
|
MDL-43089 quiz: improved interface for building quizzes
This commit is actually the joint work of Mahmoud Kassaei, Colin
Chambers and Tim Hunt from The Open University. We could only use one
persons name for the commit, and this time Colin gets the credit/blame.
The goal of this work was to increase usability, and also clean up
the page enough that it will be possible to add new features in future.
Display of mod/quiz/edit.php is now entirely generated by
mod_quiz\output\edit_renderer. This uses a helper class
mod_quiz\structure to provide details of the structure of the quiz, and
mod_quiz\repaginate to alter that structure. (Acutally, there are still
some modification methods on mod_quiz\structure. Expect that to be
cleaned up in future.)
The new code uses much more ajax, and there are new scripts
mod/quiz/edit_rest.php and mod/quiz/repaginate.php to handle this.
(Again, don't be surprised if those two scripts get merged in future.)
Also questionbank.ajax.php (which may, in future, be made more generic,
and moved into the core question bank code.)
Most of the new JavaScript code has intentionally copied the way things
are done when editing activities on the course page.
As a result of this, mod/quiz/editlib.php is now much shorter than it
was. (In future, expect the remaining code in here to move into
mod/quiz/classes.)
2013-12-05 16:18:24 +00:00
|
|
|
// End of process commands =====================================================.
|
|
|
|
|
|
|
|
$PAGE->set_pagelayout('incourse');
|
|
|
|
$PAGE->set_pagetype('mod-quiz-edit');
|
|
|
|
|
|
|
|
$output = $PAGE->get_renderer('mod_quiz', 'edit');
|
2008-11-20 06:59:11 +00:00
|
|
|
|
2011-05-12 00:30:25 +01:00
|
|
|
$PAGE->requires->skip_link_to('questionbank',
|
|
|
|
get_string('skipto', 'access', get_string('questionbank', 'question')));
|
|
|
|
$PAGE->requires->skip_link_to('quizcontentsblock',
|
|
|
|
get_string('skipto', 'access', get_string('questionsinthisquiz', 'quiz')));
|
2012-06-08 11:46:59 +01:00
|
|
|
$PAGE->set_title(get_string('editingquizx', 'quiz', format_string($quiz->name)));
|
2010-05-21 03:15:48 +00:00
|
|
|
$PAGE->set_heading($course->fullname);
|
2010-08-04 16:31:54 +00:00
|
|
|
$node = $PAGE->settingsnav->find('mod_quiz_edit', navigation_node::TYPE_SETTING);
|
|
|
|
if ($node) {
|
|
|
|
$node->make_active();
|
|
|
|
}
|
2009-09-08 01:57:28 +00:00
|
|
|
echo $OUTPUT->header();
|
2009-07-17 06:54:58 +00:00
|
|
|
|
2008-11-25 12:31:59 +00:00
|
|
|
// Initialise the JavaScript.
|
2011-02-21 18:10:19 +00:00
|
|
|
$quizeditconfig = new stdClass();
|
2010-01-17 09:50:55 +00:00
|
|
|
$quizeditconfig->url = $thispageurl->out(true, array('qbanktool' => '0'));
|
quiz editing: MDL-17454 first attemtp, and MDL-18554
This is a minimal fix for MDL-18554, I have just added a cancel button and made it work.
The more substantial part of this is MDL-17454, trying to make the quiz editing screen behave appropriately when shuffle questions is on. I am sure Olli will have opinions about this and want to change it further. Rought summary:
* When shufflequestions is off, never restrict manual paging, even if questionsperpage is set.
* When shuffle questions is on:
** Always display the quiz with the defined number of questions per page.
** Remove controls to add things except at the end of the quiz.
** Disable most of the order and paging tab, but still allow the question list to be reordered, in case that helps teachers track which questions they have added.
** Still allow questions to be reordered on the edit tab, but when moving the top question on a page up, reorder with the previous question, rather than moving to the previous page.
* Change the status bar, so that the yellow highlight is reserved for alert information. The more informative stuff is now plain, and moved to under the title. To my mind that associates it more closely with the quiz name. Also it moves Total of grades and Maximum grade closer together.
* JavaScript cleaned up. I learn more about YUI every day.
* Some PHP code clean ups that I forgot to commit separately before making substantive changes.
2009-03-17 09:51:34 +00:00
|
|
|
$quizeditconfig->dialoglisteners = array();
|
2014-01-22 18:19:31 +00:00
|
|
|
$numberoflisteners = $DB->get_field_sql("
|
|
|
|
SELECT COALESCE(MAX(page), 1)
|
|
|
|
FROM {quiz_slots}
|
|
|
|
WHERE quizid = ?", array($quiz->id));
|
|
|
|
|
2008-11-25 12:31:59 +00:00
|
|
|
for ($pageiter = 1; $pageiter <= $numberoflisteners; $pageiter++) {
|
|
|
|
$quizeditconfig->dialoglisteners[] = 'addrandomdialoglaunch_' . $pageiter;
|
|
|
|
}
|
MDL-43089 quiz: improved interface for building quizzes
This commit is actually the joint work of Mahmoud Kassaei, Colin
Chambers and Tim Hunt from The Open University. We could only use one
persons name for the commit, and this time Colin gets the credit/blame.
The goal of this work was to increase usability, and also clean up
the page enough that it will be possible to add new features in future.
Display of mod/quiz/edit.php is now entirely generated by
mod_quiz\output\edit_renderer. This uses a helper class
mod_quiz\structure to provide details of the structure of the quiz, and
mod_quiz\repaginate to alter that structure. (Acutally, there are still
some modification methods on mod_quiz\structure. Expect that to be
cleaned up in future.)
The new code uses much more ajax, and there are new scripts
mod/quiz/edit_rest.php and mod/quiz/repaginate.php to handle this.
(Again, don't be surprised if those two scripts get merged in future.)
Also questionbank.ajax.php (which may, in future, be made more generic,
and moved into the core question bank code.)
Most of the new JavaScript code has intentionally copied the way things
are done when editing activities on the course page.
As a result of this, mod/quiz/editlib.php is now much shorter than it
was. (In future, expect the remaining code in here to move into
mod/quiz/classes.)
2013-12-05 16:18:24 +00:00
|
|
|
|
ajaxlib/require_js: MDL-16693 $PAGE->requires->... deprecates require_js etc.
There is a new implementation of require_js in lib/deprecatedlib.php,
based on $PAGE->requires.
There were a few other recently introduced functions in lib/weblib.php,
namely print_js_call, print_delayed_js_call, print_js_config and
standard_js_config. These have been removed, since they were never in
a stable branch, and all the places that used them have been changed
to use the newer $PAGE->requires->... methods.
get_require_js_code is also gone, and the evil places that were calling
it, even though it is an internal function, have been fixed.
Also, I made some minor improvements to the code I committed yesterday
for MDL-16695.
All that remains is to update all the places in core code that are
still using require_js.
(This commit also fixes the problem where the admin tree would not
start with the right categories expanded.)
2009-06-12 12:13:07 +00:00
|
|
|
$PAGE->requires->data_for_js('quiz_edit_config', $quizeditconfig);
|
2011-02-11 17:36:02 +00:00
|
|
|
$PAGE->requires->js('/question/qengine.js');
|
2010-11-15 17:00:38 +00:00
|
|
|
|
MDL-43089 quiz: improved interface for building quizzes
This commit is actually the joint work of Mahmoud Kassaei, Colin
Chambers and Tim Hunt from The Open University. We could only use one
persons name for the commit, and this time Colin gets the credit/blame.
The goal of this work was to increase usability, and also clean up
the page enough that it will be possible to add new features in future.
Display of mod/quiz/edit.php is now entirely generated by
mod_quiz\output\edit_renderer. This uses a helper class
mod_quiz\structure to provide details of the structure of the quiz, and
mod_quiz\repaginate to alter that structure. (Acutally, there are still
some modification methods on mod_quiz\structure. Expect that to be
cleaned up in future.)
The new code uses much more ajax, and there are new scripts
mod/quiz/edit_rest.php and mod/quiz/repaginate.php to handle this.
(Again, don't be surprised if those two scripts get merged in future.)
Also questionbank.ajax.php (which may, in future, be made more generic,
and moved into the core question bank code.)
Most of the new JavaScript code has intentionally copied the way things
are done when editing activities on the course page.
As a result of this, mod/quiz/editlib.php is now much shorter than it
was. (In future, expect the remaining code in here to move into
mod/quiz/classes.)
2013-12-05 16:18:24 +00:00
|
|
|
// Questions wrapper start.
|
|
|
|
echo html_writer::start_tag('div', array('class' => 'mod-quiz-edit-content'));
|
2008-11-20 06:59:11 +00:00
|
|
|
|
MDL-43089 quiz: improved interface for building quizzes
This commit is actually the joint work of Mahmoud Kassaei, Colin
Chambers and Tim Hunt from The Open University. We could only use one
persons name for the commit, and this time Colin gets the credit/blame.
The goal of this work was to increase usability, and also clean up
the page enough that it will be possible to add new features in future.
Display of mod/quiz/edit.php is now entirely generated by
mod_quiz\output\edit_renderer. This uses a helper class
mod_quiz\structure to provide details of the structure of the quiz, and
mod_quiz\repaginate to alter that structure. (Acutally, there are still
some modification methods on mod_quiz\structure. Expect that to be
cleaned up in future.)
The new code uses much more ajax, and there are new scripts
mod/quiz/edit_rest.php and mod/quiz/repaginate.php to handle this.
(Again, don't be surprised if those two scripts get merged in future.)
Also questionbank.ajax.php (which may, in future, be made more generic,
and moved into the core question bank code.)
Most of the new JavaScript code has intentionally copied the way things
are done when editing activities on the course page.
As a result of this, mod/quiz/editlib.php is now much shorter than it
was. (In future, expect the remaining code in here to move into
mod/quiz/classes.)
2013-12-05 16:18:24 +00:00
|
|
|
echo $output->edit_page($quizobj, $structure, $contexts, $thispageurl, $pagevars);
|
2008-11-20 06:59:11 +00:00
|
|
|
|
MDL-43089 quiz: improved interface for building quizzes
This commit is actually the joint work of Mahmoud Kassaei, Colin
Chambers and Tim Hunt from The Open University. We could only use one
persons name for the commit, and this time Colin gets the credit/blame.
The goal of this work was to increase usability, and also clean up
the page enough that it will be possible to add new features in future.
Display of mod/quiz/edit.php is now entirely generated by
mod_quiz\output\edit_renderer. This uses a helper class
mod_quiz\structure to provide details of the structure of the quiz, and
mod_quiz\repaginate to alter that structure. (Acutally, there are still
some modification methods on mod_quiz\structure. Expect that to be
cleaned up in future.)
The new code uses much more ajax, and there are new scripts
mod/quiz/edit_rest.php and mod/quiz/repaginate.php to handle this.
(Again, don't be surprised if those two scripts get merged in future.)
Also questionbank.ajax.php (which may, in future, be made more generic,
and moved into the core question bank code.)
Most of the new JavaScript code has intentionally copied the way things
are done when editing activities on the course page.
As a result of this, mod/quiz/editlib.php is now much shorter than it
was. (In future, expect the remaining code in here to move into
mod/quiz/classes.)
2013-12-05 16:18:24 +00:00
|
|
|
// Questions wrapper end.
|
|
|
|
echo html_writer::end_tag('div');
|
2010-05-21 03:15:48 +00:00
|
|
|
|
2009-08-06 14:13:48 +00:00
|
|
|
echo $OUTPUT->footer();
|