mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 16:04:25 +02: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.
This commit is contained in:
parent
babcc520a7
commit
3e10e4292d
@ -38,7 +38,7 @@ $string['addrandom2'] = 'random questions';
|
||||
$string['addrandomfromcategory'] = 'Add random questions from category:';
|
||||
$string['addrandomquestion'] = 'Add random question';
|
||||
$string['addarandomquestion'] = 'Add a random question ...';
|
||||
$string['addrandomquestiontoquiz'] = 'Add random question to quiz $a';
|
||||
$string['addrandomquestiontoquiz'] = 'Add a random question to quiz $a';
|
||||
$string['addselectedtoquiz'] = 'Add selected to quiz';
|
||||
$string['addtoquiz'] = 'Add to quiz';
|
||||
$string['affectedstudents'] = 'Affected $a';
|
||||
@ -98,7 +98,7 @@ $string['braceerror'] = 'Could not find {...} around answers';
|
||||
$string['calculated'] = 'Calculated';
|
||||
$string['calculatedquestion'] = 'Calculated Question not supported at line $a. The question will be ignored';
|
||||
$string['cannotcreatepath'] = 'Path cannot be created ($a)';
|
||||
$string['cannoteditafterattempts'] = 'You cannot add or remove questions because there are attempts.';
|
||||
$string['cannoteditafterattempts'] = 'You cannot add or remove questions because this quiz has been attempted. ($a)';
|
||||
$string['cannotfindprevattempt'] = 'Cannot find previous attempt to build on.';
|
||||
$string['cannotfindquestionregard'] = 'Failed to get questions for regrading!';
|
||||
$string['cannotinsert'] = 'Cannot insert question';
|
||||
@ -190,7 +190,7 @@ $string['countdown'] = 'Countdown';
|
||||
$string['countdownfinished'] = 'The quiz is closing, you should submit your answers now.';
|
||||
$string['countdowntenminutes'] = 'The quiz will be closing in ten minutes.';
|
||||
$string['coursetestmanager'] = 'Course Test Manager format';
|
||||
$string['createcategoryfornewrandomquestion'] = 'Create a question category for the new random question';
|
||||
$string['createcategoryfornewrandomquestion'] = 'Create a new question category for the new random question';
|
||||
$string['createfirst'] = 'You must create some short-answer questions first.';
|
||||
$string['createmultiple'] = 'Add several random questions to quiz';
|
||||
$string['createnewquestion'] = 'Create new question';
|
||||
@ -684,7 +684,7 @@ $string['shuffle'] = 'Shuffle';
|
||||
$string['shuffleanswers'] = 'Shuffle answers';
|
||||
$string['shuffledrandomly'] = 'Shuffled randomly';
|
||||
$string['shufflequestions'] = 'Shuffle questions';
|
||||
$string['shufflequestionsselected'] = 'Shuffle questions has been set, so some actions relating to pages are not available. To change the shuffle option go to $a.';
|
||||
$string['shufflequestionsselected'] = 'Shuffle questions has been set, so some actions relating to pages are not available. To change the shuffle option, $a.';
|
||||
$string['shufflewithin'] = 'Shuffle within questions';
|
||||
$string['significantfigures'] = 'with $a';
|
||||
$string['significantfiguresformat'] = 'significant figures';
|
||||
|
@ -8,16 +8,16 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package quiz
|
||||
*/
|
||||
require_once("../../config.php");
|
||||
require_once($CFG->dirroot.'/mod/quiz/editlib.php');
|
||||
require_once($CFG->dirroot."/question/category_class.php");
|
||||
require_once('../../config.php');
|
||||
require_once($CFG->dirroot . '/mod/quiz/editlib.php');
|
||||
require_once($CFG->dirroot . '/question/category_class.php');
|
||||
|
||||
list($thispageurl, $contexts, $cmid, $cm, $quiz, $pagevars) = question_edit_setup('editq', true);
|
||||
|
||||
$defaultcategoryobj = question_make_default_categories($contexts->all());
|
||||
$defaultcategoryid=$defaultcategoryobj->id;
|
||||
$defaultcategorycontext=$defaultcategoryobj->contextid;
|
||||
$defaultcategory="$defaultcategoryid,$defaultcategorycontext";
|
||||
$defaultcategoryid = $defaultcategoryobj->id;
|
||||
$defaultcategorycontext = $defaultcategoryobj->contextid;
|
||||
$defaultcategory = "$defaultcategoryid, $defaultcategorycontext";
|
||||
|
||||
$qcobject = new question_category_object(
|
||||
$pagevars['cpage'],
|
||||
@ -29,19 +29,26 @@ $qcobject = new question_category_object(
|
||||
$contexts->having_cap('moodle/question:add'));
|
||||
|
||||
//setting the second parameter of process_randomquestion_formdata to true causes it to redirect on success
|
||||
//TODO: process if returns false?
|
||||
$newquestioninfo=quiz_process_randomquestion_formdata($qcobject);
|
||||
if($newquestioninfo){
|
||||
$newrandomcategory=$newquestioninfo->newrandomcategory;
|
||||
if (!$newrandomcategory){
|
||||
print_r($newquestioninfo);
|
||||
print_error("cannotcreatecategory");
|
||||
}else{
|
||||
add_to_log($quiz->course, 'quiz', 'addcategory',
|
||||
"view.php?id=$cm->id", "$newrandomcategory", $cm->id);
|
||||
redirect($CFG->wwwroot."/mod/quiz/edit.php?cmid=$cmid&addonpage=$newquestioninfo->addonpage&addrandom=1&categoryid=$newquestioninfo->newrandomcategory&randomcount=1&sesskey=".sesskey());
|
||||
$newquestioninfo = quiz_process_randomquestion_formdata($qcobject);
|
||||
if ($newquestioninfo == 'cancelled') {
|
||||
$returnurl = optional_param('returnurl', 0, PARAM_LOCALURL);
|
||||
if ($returnurl) {
|
||||
redirect($CFG->wwwroot . $returnurl);
|
||||
} else {
|
||||
redirect($CFG->wwwroot . '/mod/quiz/edit.php?cmid=' . $cmid);
|
||||
}
|
||||
}
|
||||
if ($newquestioninfo) {
|
||||
$newrandomcategory = $newquestioninfo->newrandomcategory;
|
||||
if (!$newrandomcategory) {
|
||||
print_error('cannotcreatecategory');
|
||||
} else {
|
||||
add_to_log($quiz->course, 'quiz', 'addcategory',
|
||||
"view.php?id = $cm->id", "$newrandomcategory", $cm->id);
|
||||
redirect($CFG->wwwroot . "/mod/quiz/edit.php?cmid=$cmid&addonpage=$newquestioninfo->addonpage&addrandom=1&categoryid=$newquestioninfo->newrandomcategory&randomcount=1&sesskey=" . sesskey());
|
||||
}
|
||||
}
|
||||
|
||||
//these params are only passed from page request to request while we stay on this page
|
||||
//otherwise they would go in question_edit_setup
|
||||
$quiz_page = optional_param('quiz_page', 0, PARAM_SEQUENCE);
|
||||
@ -49,30 +56,31 @@ $returnurl = optional_param('returnurl', 0, PARAM_LOCALURL);
|
||||
|
||||
$strquizzes = get_string('modulenameplural', 'quiz');
|
||||
$strquiz = get_string('modulename', 'quiz');
|
||||
$streditingquestions = get_string('editquestions', "quiz");
|
||||
$streditingquestions = get_string('editquestions', 'quiz');
|
||||
$streditingquiz = get_string('editinga', 'moodle', $strquiz);
|
||||
|
||||
// Get the course object and related bits.
|
||||
if (! $course = $DB->get_record("course", array("id"=> $quiz->course))) {
|
||||
if (! $course = $DB->get_record('course', array('id' => $quiz->course))) {
|
||||
print_error('invalidcourseid');
|
||||
}
|
||||
//you need mod/quiz:manage in addition to question capabilities to access this page.
|
||||
require_capability('mod/quiz:manage', $contexts->lowest());
|
||||
|
||||
// Print basic page layout.
|
||||
|
||||
$strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
|
||||
? update_module_button($cm->id, $course->id, get_string('modulename', 'quiz'))
|
||||
: "";
|
||||
$strupdatemodule = '';
|
||||
if (has_capability('moodle/course:manageactivities', $contexts->lowest())) {
|
||||
$strupdatemodule = update_module_button($cm->id, $course->id, get_string('modulename', 'quiz'));
|
||||
}
|
||||
$navigation = build_navigation($streditingquiz, $cm);
|
||||
print_header_simple($streditingquiz, '', $navigation, "", "", true, $strupdatemodule);
|
||||
print_header_simple($streditingquiz, '', $navigation, '', '', true, $strupdatemodule);
|
||||
|
||||
if (!$quizname = $DB->get_field($cm->modname, 'name', array('id'=> $cm->instance))) {
|
||||
if (!$quizname = $DB->get_field($cm->modname, 'name', array('id' => $cm->instance))) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
print_heading(get_string("addrandomquestiontoquiz","quiz",$quizname), 'left', 2);
|
||||
print_heading(get_string('addrandomquestiontoquiz', 'quiz', $quizname), 'left', 2);
|
||||
|
||||
$addonpage=optional_param("addonpage_form", 0, PARAM_SEQUENCE);
|
||||
$addonpage = optional_param('addonpage_form', 0, PARAM_SEQUENCE);
|
||||
$qcobject->display_randomquestion_user_interface($addonpage);
|
||||
|
||||
print_footer($course);
|
||||
|
151
mod/quiz/edit.js
151
mod/quiz/edit.js
@ -1,96 +1,85 @@
|
||||
/** JavaScript for /mod/quiz/edit.php
|
||||
*/
|
||||
/** JavaScript for /mod/quiz/edit.php */
|
||||
|
||||
// Initialise everything on the quiz edit/order and paging page.
|
||||
var quiz_edit = {};
|
||||
function quiz_edit_init() {
|
||||
YAHOO.util.Dom.setStyle('randomquestiondialog', 'display', 'block');
|
||||
/* zIndex must be way above 99 to be above the active quiz tab*/
|
||||
quiz_edit.randomquestiondialog = new YAHOO.widget.Dialog("randomquestiondialog",
|
||||
{
|
||||
constraintoviewport : true,
|
||||
visible : false,
|
||||
modal:true,
|
||||
width : "100%",
|
||||
iframe:true,
|
||||
zIndex:1000,
|
||||
fixedcenter : true,
|
||||
close: true,
|
||||
draggable: true,
|
||||
dragOnly: true,
|
||||
postmethod: "form"
|
||||
} );
|
||||
//show the dialog and depending on from which form (corresponding
|
||||
// a specific quiz page) it was triggered, set the value of the form's
|
||||
// rqpage input element to the form number
|
||||
YAHOO.util.Event.addListener(quiz_edit_config.dialoglisteners, "click",
|
||||
function(e){
|
||||
this.show();
|
||||
var rbutton = YAHOO.util.Event.getTarget(e);
|
||||
var rbform = YAHOO.util.Dom.getAncestorByClassName(rbutton,"randomquestionform");
|
||||
//this depends on the fact that the element hierarchy be:
|
||||
// <form class="randomquestionform"><div>[input elements]</div></form>
|
||||
var rbformelements = YAHOO.util.Dom.getChildren
|
||||
(YAHOO.util.Dom.getFirstChild(rbform));
|
||||
var rqpage=YAHOO.util.Dom.get("rform_qpage");
|
||||
|
||||
for (var i = 0; i < rbformelements.length; i++) {
|
||||
if(YAHOO.util.Dom.hasClass(rbformelements[i],"addonpage_formelement")){
|
||||
//why is this not rqpage.value.value, the first "value" being the element property
|
||||
// and the second the value of that property? I don't understand.
|
||||
rqpage.value=rbformelements[i].attributes.value.value;
|
||||
}
|
||||
}
|
||||
YAHOO.util.Event.stopEvent(e);
|
||||
}, quiz_edit.randomquestiondialog,
|
||||
quiz_edit.randomquestiondialog, true);
|
||||
|
||||
quiz_edit.randomquestiondialog.cfg.setProperty("keylisteners", [
|
||||
new YAHOO.util.KeyListener(document,
|
||||
{keys:[27]},
|
||||
function(types, args, obj) { quiz_edit.randomquestiondialog.hide();
|
||||
})
|
||||
]);
|
||||
|
||||
// Add random question dialogue --------------------------------------------
|
||||
|
||||
quiz_edit.randomquestiondialog = new YAHOO.widget.Dialog('randomquestiondialog', {
|
||||
modal: true,
|
||||
width: '100%',
|
||||
iframe: true,
|
||||
zIndex: 1000, // zIndex must be way above 99 to be above the active quiz tab
|
||||
fixedcenter: true,
|
||||
visible: false,
|
||||
close: true,
|
||||
constraintoviewport: true,
|
||||
postmethod: 'form'
|
||||
});
|
||||
quiz_edit.randomquestiondialog.render();
|
||||
|
||||
// Show the form on button click.
|
||||
YAHOO.util.Event.addListener(quiz_edit_config.dialoglisteners, 'click', function(e) {
|
||||
// Transfer the page number from the button form to the pop-up form.
|
||||
var addrandombutton = YAHOO.util.Event.getTarget(e);
|
||||
var addpagehidden = YAHOO.util.Dom.getElementsByClassName('addonpage_formelement', 'input', addrandombutton.form);
|
||||
document.getElementById('rform_qpage').value = addpagehidden.value;
|
||||
|
||||
// Show the dialogue and stop the default action.
|
||||
quiz_edit.randomquestiondialog.show();
|
||||
YAHOO.util.Event.stopEvent(e);
|
||||
});
|
||||
|
||||
// Make escape close the dialogue.
|
||||
quiz_edit.randomquestiondialog.cfg.setProperty('keylisteners', [new YAHOO.util.KeyListener(
|
||||
document, {keys:[27]}, function(types, args, obj) { quiz_edit.randomquestiondialog.hide();
|
||||
})]);
|
||||
|
||||
// Make the form cancel button close the dialogue.
|
||||
YAHOO.util.Event.addListener('id_cancel', 'click', function(e) {
|
||||
quiz_edit.randomquestiondialog.hide();
|
||||
YAHOO.util.Event.preventDefault(e);
|
||||
});
|
||||
|
||||
// Repaginate dialogue -----------------------------------------------------
|
||||
quiz_edit.repaginatedialog = new YAHOO.widget.Dialog('repaginatedialog', {
|
||||
modal: true,
|
||||
width: '30em',
|
||||
iframe: true,
|
||||
zIndex: 1000,
|
||||
context: ['repaginatecommand', 'tr', 'br', ['beforeShow']],
|
||||
visible: false,
|
||||
close: true,
|
||||
constraintoviewport: true,
|
||||
postmethod: 'form'
|
||||
});
|
||||
quiz_edit.repaginatedialog.render();
|
||||
|
||||
// Show the form on button click.
|
||||
YAHOO.util.Event.addListener('repaginatecommand', 'click', function() {
|
||||
quiz_edit.repaginatedialog.show();
|
||||
});
|
||||
|
||||
// Reposition the dialogue when the window resizes. For some reason this was not working automatically.
|
||||
YAHOO.widget.Overlay.windowResizeEvent.subscribe(function() {
|
||||
quiz_edit.repaginatedialog.cfg.setProperty('context', ['repaginatecommand', 'tr', 'br', ['beforeShow']]);
|
||||
});
|
||||
|
||||
// Make escape close the dialogue.
|
||||
quiz_edit.repaginatedialog.cfg.setProperty('keylisteners', [new YAHOO.util.KeyListener(
|
||||
document, {keys:[27]}, function(types, args, obj) { quiz_edit.repaginatedialog.hide();
|
||||
})]);
|
||||
|
||||
// Nasty hack, remove once the YUI bug causing MDL-17594 is fixed.
|
||||
// https://sourceforge.net/tracker/index.php?func=detail&aid=2493426&group_id=165715&atid=836476
|
||||
var elementcauseinglayoutproblem = document.getElementById('_yuiResizeMonitor');
|
||||
if (elementcauseinglayoutproblem) {
|
||||
elementcauseinglayoutproblem.style.left = '0px';
|
||||
}
|
||||
|
||||
quiz_edit.repaginatedialog = new YAHOO.widget.Dialog("repaginatedialog",
|
||||
{
|
||||
modal:true,
|
||||
width : "100%",
|
||||
iframe:true,
|
||||
zIndex:1000,
|
||||
fixedcenter : true,
|
||||
visible : false,
|
||||
close: true,
|
||||
draggable: true,
|
||||
dragOnly: true,
|
||||
constraintoviewport : true,
|
||||
postmethod: "form"
|
||||
} );
|
||||
YAHOO.util.Event.addListener("repaginatecommand", "click",
|
||||
function(e){
|
||||
YAHOO.util.Dom.setStyle('repaginatedialog', 'display', 'block');
|
||||
this.show();
|
||||
}, quiz_edit.repaginatedialog,
|
||||
quiz_edit.repaginatedialog, true);
|
||||
|
||||
quiz_edit.repaginatedialog.cfg.setProperty("keylisteners", [
|
||||
new YAHOO.util.KeyListener(document,
|
||||
{keys:[27]},
|
||||
function(types, args, obj) { quiz_edit.repaginatedialog.hide();
|
||||
})
|
||||
]);
|
||||
|
||||
quiz_edit.repaginatedialog.render();
|
||||
|
||||
}
|
||||
|
||||
// Initialise everything on the quiz settings form.
|
||||
function quiz_settings_init() {
|
||||
var repaginatecheckbox = document.getElementById('id_repaginatenow');
|
||||
if (!repaginatecheckbox) {
|
||||
@ -108,7 +97,7 @@ function quiz_settings_init() {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Depending on which page this is, do the appropriate initialisation.
|
||||
function quiz_edit_generic_init() {
|
||||
switch (document.body.id) {
|
||||
case 'mod-quiz-edit':
|
||||
|
@ -130,7 +130,7 @@ if ($quiz_qbanktool > -1) {
|
||||
}
|
||||
|
||||
//will be set further down in the code
|
||||
$quiz_has_attempts = false;
|
||||
$quizhasattempts = quiz_has_attempts($quiz->id);
|
||||
|
||||
if ($quiz_reordertool != 0) {
|
||||
$thispageurl->param('reordertool', $quiz_reordertool);
|
||||
@ -155,6 +155,7 @@ if (!$course) {
|
||||
}
|
||||
|
||||
$questionbank = new quiz_question_bank_view($contexts, $thispageurl, $course, $cm);
|
||||
$questionbank->set_quiz_has_attempts($quizhasattempts);
|
||||
|
||||
// Log this visit.
|
||||
add_to_log($cm->course, 'quiz', 'editquestions',
|
||||
@ -163,11 +164,16 @@ add_to_log($cm->course, 'quiz', 'editquestions',
|
||||
// You need mod/quiz:manage in addition to question capabilities to access this page.
|
||||
require_capability('mod/quiz:manage', $contexts->lowest());
|
||||
|
||||
if (isset($quiz->instance) && empty($quiz->grades)) { // Construct an array to hold all the grades.
|
||||
if (empty($quiz->grades)) { // Construct an array to hold all the grades.
|
||||
$quiz->grades = quiz_get_all_question_grades($quiz);
|
||||
}
|
||||
|
||||
// Process commands ============================================================
|
||||
if ($quiz->shufflequestions) {
|
||||
// Strip page breaks before processing actions, so that re-ordering works
|
||||
// as expected when shuffle questions is on.
|
||||
$quiz->questions = quiz_repaginate($quiz->questions, 0);
|
||||
}
|
||||
|
||||
// Get the list of question ids had their check-boxes ticked.
|
||||
$selectedquestionids = array();
|
||||
@ -226,7 +232,7 @@ $qcobject = new question_category_object($pagevars['cpage'], $thispageurl,
|
||||
|
||||
$newrandomcategory = false;
|
||||
$newquestioninfo = quiz_process_randomquestion_formdata($qcobject);
|
||||
if ($newquestioninfo) {
|
||||
if ($newquestioninfo && $newquestioninfo != 'cancelled') {
|
||||
$newrandomcategory = $newquestioninfo->newrandomcategory;
|
||||
if (!$newrandomcategory) {
|
||||
print_error('cannotcreatecategory');
|
||||
@ -343,97 +349,79 @@ if (optional_param('quizdeleteselected', false, PARAM_BOOL) && !empty($selectedq
|
||||
if (optional_param('savechanges', false, PARAM_BOOL) && confirm_sesskey()) {
|
||||
$oldquestions = explode(',', $quiz->questions); // the questions in the old order
|
||||
$questions = array(); // for questions in the new order
|
||||
$rawgrades = (array) data_submitted();
|
||||
$rawdata = (array) data_submitted();
|
||||
$moveonpagequestions = array();
|
||||
$moveselectedonpage = 0;
|
||||
$moveselectedonpagetop = optional_param('moveselectedonpagetop', 0, PARAM_INT);
|
||||
$moveselectedonpagebottom = optional_param("moveselectedonpagebottom", 0, PARAM_INT);
|
||||
if ($moveselectedonpagetop) {
|
||||
$moveselectedonpage = $moveselectedonpagetop;
|
||||
} else if($moveselectedonpagebottom) {
|
||||
$moveselectedonpage = $moveselectedonpagebottom;
|
||||
$moveselectedonpage = optional_param('moveselectedonpagetop', 0, PARAM_INT);
|
||||
if (!$moveselectedonpage) {
|
||||
$moveselectedonpage = optional_param('moveselectedonpagebottom', 0, PARAM_INT);
|
||||
}
|
||||
|
||||
foreach ($rawgrades as $key => $value) {
|
||||
foreach ($rawdata as $key => $value) {
|
||||
if (preg_match('!^g([0-9]+)$!', $key, $matches)) {
|
||||
/// Parse input for question -> grades
|
||||
$key = $matches[1];
|
||||
$quiz->grades[$key] = $value;
|
||||
quiz_update_question_instance($quiz->grades[$key], $key, $quiz->instance);
|
||||
$questionid = $matches[1];
|
||||
$quiz->grades[$questionid] = $value;
|
||||
quiz_update_question_instance($quiz->grades[$questionid], $questionid, $quiz->id);
|
||||
quiz_delete_previews($quiz);
|
||||
quiz_update_sumgrades($quiz);
|
||||
|
||||
} else if (preg_match('!^o([0-9]+)$!', $key, $matches)) {
|
||||
} else if (preg_match('!^o(pg)?([0-9]+)$!', $key, $matches)) {
|
||||
/// Parse input for ordering info
|
||||
$key = $matches[1];
|
||||
// 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.
|
||||
$questionid = $matches[2];
|
||||
// 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.
|
||||
while (array_key_exists($value, $questions)) {
|
||||
$value++;
|
||||
}
|
||||
$questions[$value] = $oldquestions[$key];
|
||||
if ($matches[1]) {
|
||||
// This is a page-break entry.
|
||||
$questions[$value] = 0;
|
||||
} else {
|
||||
$questions[$value] = $questionid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If ordering info was given, reorder the questions
|
||||
if ($questions) {
|
||||
ksort($questions);
|
||||
$quiz->questions = implode(',', $questions) . ',0';
|
||||
$quiz->questions = quiz_clean_layout($quiz->questions);
|
||||
$questions[] = 0;
|
||||
$quiz->questions = implode(',', $questions);
|
||||
quiz_save_new_layout($quiz);
|
||||
quiz_delete_previews($quiz);
|
||||
}
|
||||
|
||||
//get a list of questions to move, later to be added in the appropriate
|
||||
//place in the string
|
||||
if ($moveselectedonpage) {
|
||||
$questions = explode(',', $quiz->questions);
|
||||
foreach ($selectedquestionids as $page => $question) {
|
||||
//remove the questions from their original positions first
|
||||
while (($delpos = array_search($question, $questions)) !== FALSE) {
|
||||
//in case there are multiple instances because of an error, remove all
|
||||
unset($questions[$delpos]);
|
||||
$newquestions = array();
|
||||
//remove the questions from their original positions first
|
||||
foreach ($questions as $questionid) {
|
||||
if (!in_array($questionid, $selectedquestionids)) {
|
||||
$newquestions[] = $questionid;
|
||||
}
|
||||
}
|
||||
//reindex
|
||||
foreach ($questions as $question) {
|
||||
$newquestions[] = $question;
|
||||
}
|
||||
$questions = $newquestions;
|
||||
|
||||
//find all pagebreaks
|
||||
$pagecount = quiz_number_of_pages($quiz->questions);
|
||||
if ($moveselectedonpage > $pagecount) {
|
||||
// move to the last page is a page beyond last page was requested
|
||||
$moveselectedonpage = $pagecount;
|
||||
}
|
||||
if ($moveselectedonpage < 1) {
|
||||
$moveselectedonpage = 1;
|
||||
}
|
||||
$pagebreakpositions = array_keys($questions, 0);
|
||||
//move to the end of the selected page
|
||||
$pagebreakpositions = array_keys($questions, 0);
|
||||
$numpages = count($pagebreakpositions);
|
||||
// Ensure the target page number is in range.
|
||||
$moveselectedonpage = max(1, min($moveselectedonpage, $pagebreakpositions));
|
||||
$moveselectedpos = $pagebreakpositions[$moveselectedonpage - 1];
|
||||
foreach ($selectedquestionids as $question) {
|
||||
array_splice($questions, $moveselectedpos, 0, $question);
|
||||
//place the next one after this one:
|
||||
$moveselectedpos++;
|
||||
}
|
||||
array_splice($questions, $moveselectedpos, 0, $selectedquestionids);
|
||||
$quiz->questions = implode(',', $questions);
|
||||
quiz_save_new_layout($quiz);
|
||||
quiz_delete_previews($quiz);
|
||||
}
|
||||
if ($moveselectedonpage || $questions) {
|
||||
if (!$DB->set_field('quiz', 'questions', $quiz->questions,
|
||||
array('id' => $quiz->instance))) {
|
||||
print_error('cannotsavequestion', 'quiz');
|
||||
}
|
||||
}
|
||||
|
||||
// If rescaling is required save the new maximum
|
||||
$maxgrade = optional_param('maxgrade', -1, PARAM_NUMBER);
|
||||
if ($maxgrade >= 0) {
|
||||
if (!quiz_set_grade($maxgrade, $quiz)) {
|
||||
print_error('cannotsetgrade', 'quiz');
|
||||
}
|
||||
quiz_set_grade($maxgrade, $quiz);
|
||||
}
|
||||
|
||||
quiz_update_sumgrades($quiz);
|
||||
quiz_delete_previews($quiz);
|
||||
redirect($thispageurl->out());
|
||||
}
|
||||
|
||||
@ -441,11 +429,6 @@ $questionbank->process_actions($thispageurl, $cm);
|
||||
|
||||
// End of process commands =====================================================
|
||||
|
||||
if (isset($quiz->instance) && $DB->record_exists_select('quiz_attempts',
|
||||
'quiz = ? AND preview = 0', array($quiz->instance))) {
|
||||
$questionbank->set_quiz_has_attempts(true);
|
||||
}
|
||||
|
||||
// Print the header.
|
||||
$questionbankmanagement = '<a href="'.$CFG->wwwroot.
|
||||
'/question/edit.php?courseid='.$course->id.'">'.
|
||||
@ -467,7 +450,7 @@ echo '<a href="#questionbank" class="skip">Question bank</a> '.
|
||||
// Initialise the JavaScript.
|
||||
$quizeditconfig = new stdClass;
|
||||
$quizeditconfig->url = $thispageurl->out(false, array('qbanktool' => '0'));
|
||||
$quizeditconfig->dialoglisteners =array();
|
||||
$quizeditconfig->dialoglisteners = array();
|
||||
$numberoflisteners = max(quiz_number_of_pages($quiz->questions), 1);
|
||||
for ($pageiter = 1; $pageiter <= $numberoflisteners; $pageiter++) {
|
||||
$quizeditconfig->dialoglisteners[] = 'addrandomdialoglaunch_' . $pageiter;
|
||||
@ -514,15 +497,11 @@ echo '</div>';
|
||||
echo '</div>';
|
||||
print_side_block_end();
|
||||
|
||||
if (!$quizname = $DB->get_field($cm->modname, 'name', array('id' => $cm->instance))) {
|
||||
print_error('cannotmodulename');
|
||||
}
|
||||
|
||||
echo '<div class="quizcontents ' . $quizcontentsclass . '" id="quizcontentsblock">';
|
||||
$questionsperpagebool = ($quiz->questionsperpage < 1) ? 0 : 1;
|
||||
if ($questionsperpagebool) {
|
||||
if ($quiz->shufflequestions) {
|
||||
$repaginatingdisabledhtml = 'disabled="disabled"';
|
||||
$repaginatingdisabled = true;
|
||||
$quiz->questions = quiz_repaginate($quiz->questions, $quiz->questionsperpage);
|
||||
} else {
|
||||
$repaginatingdisabledhtml = '';
|
||||
$repaginatingdisabled = false;
|
||||
@ -532,40 +511,31 @@ if ($quiz_reordertool) {
|
||||
get_string('repaginatecommand', 'quiz').'...</button>';
|
||||
echo '</div>';
|
||||
}
|
||||
print_heading($pagetitle.": ".$quizname, 'left', 2);
|
||||
print_heading($pagetitle.": ".$quiz->name, 'left', 2);
|
||||
helpbutton('editconcepts', get_string('basicideasofquiz', 'quiz'), 'quiz',
|
||||
true, get_string('basicideasofquiz', 'quiz'));
|
||||
quiz_print_status_bar($quiz);
|
||||
|
||||
$notifystring = '';
|
||||
if ($quiz_has_attempts) {
|
||||
$string = get_string('cannoteditafterattempts', 'quiz');
|
||||
$string .= '<br /><a href="report.php?mode=overview&id=' . $cm->id . '">' .
|
||||
quiz_num_attempt_summary($quiz, $cm) . '</a><br />' ;
|
||||
$notifystring .= notify($string, 'notifyproblem', 'center', true);
|
||||
$tabindex = 0;
|
||||
if (!$quiz_reordertool) {
|
||||
quiz_print_grading_form($quiz, $thispageurl, $tabindex);
|
||||
}
|
||||
if ($questionsperpagebool && $quiz_reordertool) {
|
||||
|
||||
$notifystrings = array();
|
||||
if ($quizhasattempts) {
|
||||
$reviewlink = '<a href="' . $CFG->wwwroot . '/mod/quiz/report.php?mode=overview&id=' . $cm->id . '">' .
|
||||
quiz_num_attempt_summary($quiz, $cm) . '</a>';
|
||||
$notifystrings[] = get_string('cannoteditafterattempts', 'quiz', $reviewlink);
|
||||
}
|
||||
if ($quiz->shufflequestions) {
|
||||
$updateurl = new moodle_url("$CFG->wwwroot/course/mod.php",
|
||||
array('return' => 'true', 'update' => $quiz->cmid, 'sesskey' => sesskey()));
|
||||
$linkstring = '<a href="'.$updateurl->out().'">';
|
||||
$linkstring .= get_string('updatethis', '', get_string('modulename', 'quiz'));
|
||||
$linkstring .= '</a>';
|
||||
$string = get_string('questionsperpageselected', 'quiz', $linkstring);
|
||||
$notifystring .= notify($string, 'notifyproblem', 'center', true);
|
||||
$updatelink = '<a href="'.$updateurl->out().'">' . get_string('updatethis', '',
|
||||
get_string('modulename', 'quiz')) . '</a>';
|
||||
$notifystrings[] = get_string('shufflequestionsselected', 'quiz', $updatelink);
|
||||
}
|
||||
if ($quiz->shufflequestions && $quiz_reordertool) {
|
||||
$updateurl = new moodle_url("$CFG->wwwroot/course/mod.php",
|
||||
array('return' => 'true', 'update' => $quiz->cmid, 'sesskey' => sesskey()));
|
||||
$linkstring = '<a href="'.$updateurl->out().'">';
|
||||
$linkstring .= get_string('updatethis', '', get_string('modulename', 'quiz'));
|
||||
$linkstring .= '</a>';
|
||||
$string = get_string('shufflequestionsselected', 'quiz', $linkstring);
|
||||
$notifystring .= notify($string, 'notifyproblem', 'center', true);
|
||||
}
|
||||
if (!empty($notifystring)) {
|
||||
//TODO: make the box closable so it is not in the way
|
||||
print_box_start();
|
||||
echo $notifystring;
|
||||
print_box_end();
|
||||
if (!empty($notifystrings)) {
|
||||
print_box('<p>' . implode('</p><p>', $notifystrings) . '</p>', 'statusdisplay');
|
||||
}
|
||||
|
||||
if ($quiz_reordertool) {
|
||||
@ -592,18 +562,11 @@ if ($quiz_reordertool) {
|
||||
echo ' <input type="submit" name="repaginate" value="'. $gostring .'" '.$repaginatingdisabledhtml.' />';
|
||||
echo '</div></fieldset></form></div></div>';
|
||||
}
|
||||
$tabindex = 0;
|
||||
|
||||
if (!$quiz_reordertool) {
|
||||
quiz_print_grading_form($quiz, $thispageurl, $tabindex);
|
||||
}
|
||||
quiz_print_status_bar($quiz);
|
||||
?>
|
||||
<div class="<?php echo $currenttab; ?>">
|
||||
<?php quiz_print_question_list($quiz, $thispageurl, true,
|
||||
$quiz_reordertool, $quiz_qbanktool, $quiz_has_attempts); ?>
|
||||
</div>
|
||||
<?php
|
||||
echo '<div class="' . $currenttab . '">';
|
||||
quiz_print_question_list($quiz, $thispageurl, true,
|
||||
$quiz_reordertool, $quiz_qbanktool, $quizhasattempts);
|
||||
echo '</div>';
|
||||
|
||||
// Close <div class="quizcontents">:
|
||||
echo '</div>';
|
||||
@ -612,7 +575,7 @@ if (!$quiz_reordertool) {
|
||||
// display category adding UI
|
||||
?>
|
||||
<div id="randomquestiondialog">
|
||||
<div class="hd"><?php print_string('addrandomquestiontoquiz', 'quiz', $quizname); ?>
|
||||
<div class="hd"><?php print_string('addrandomquestiontoquiz', 'quiz', $quiz->name); ?>
|
||||
<span id="pagenumber"><!-- TODO: insert pagenumber here via javascript -->
|
||||
</span>
|
||||
</div>
|
||||
|
@ -319,25 +319,18 @@ function quiz_print_question_list($quiz, $pageurl, $allowdelete = true,
|
||||
$order = explode(',', $layout);
|
||||
$lastindex = count($order) - 1;
|
||||
|
||||
$disabled = '';
|
||||
$pagingdisabled = '';
|
||||
if ($hasattempts) {
|
||||
$disabled = 'disabled="disabled"';
|
||||
$movedisabled = '';
|
||||
$pagingdisabled = '';
|
||||
} else {
|
||||
$disabled = '';
|
||||
$movedisabled = '';
|
||||
$pagingdisabled = '';
|
||||
}
|
||||
if ($quiz->shufflequestions) {
|
||||
$movedisabled = 'disabled="disabled"';
|
||||
}
|
||||
if ($quiz->questionsperpage) {
|
||||
if ($hasattempts || $quiz->shufflequestions) {
|
||||
$pagingdisabled = 'disabled="disabled"';
|
||||
}
|
||||
|
||||
$reordercontrolssetdefaultsubmit = '<div style="display:none;">' .
|
||||
'<input type="submit" name="savechanges" value="' .
|
||||
$strreorderquestions . '" ' . $movedisabled . ' /></div>';
|
||||
$strreorderquestions . '" ' . $pagingdisabled . ' /></div>';
|
||||
$reordercontrols1 = '<div class="addnewpagesafterselected">' .
|
||||
'<input type="submit" name="addnewpagesafterselected" value="' .
|
||||
get_string('addnewpagesafterselected', 'quiz') . '" ' .
|
||||
@ -356,10 +349,10 @@ function quiz_print_question_list($quiz, $pageurl, $allowdelete = true,
|
||||
'<input type="submit" name="savechanges" value="' .
|
||||
$strmove . '" ' . $pagingdisabled . ' />' . '
|
||||
<br /><input type="submit" name="savechanges" value="' .
|
||||
$strreorderquestions . '" ' . $movedisabled . ' /></div>';
|
||||
$strreorderquestions . '" /></div>';
|
||||
$reordercontrols2bottom = '<div class="moveselectedonpage">' .
|
||||
'<input type="submit" name="savechanges" value="' .
|
||||
$strreorderquestions . '" ' . $movedisabled . ' /><br />' .
|
||||
$strreorderquestions . '" /><br />' .
|
||||
get_string('moveselectedonpage', 'quiz', $a) .
|
||||
'<input type="submit" name="savechanges" value="' .
|
||||
$strmove . '" ' . $pagingdisabled . ' /> ' . '</div>';
|
||||
@ -482,7 +475,7 @@ function quiz_print_question_list($quiz, $pageurl, $allowdelete = true,
|
||||
echo $questioncountstring;
|
||||
$qno += $question->length;
|
||||
} else {
|
||||
echo "$reordercheckboxlabel * $reordercheckboxlabelclose" .
|
||||
echo "$reordercheckboxlabel ? $reordercheckboxlabelclose" .
|
||||
" $reordercheckbox";
|
||||
}
|
||||
|
||||
@ -528,13 +521,13 @@ function quiz_print_question_list($quiz, $pageurl, $allowdelete = true,
|
||||
<div class="points">
|
||||
<form method="post" action="edit.php"><div>
|
||||
<fieldset class="invisiblefieldset" style="display: block;">
|
||||
<label for="<?php echo "inputq$qnum" ?>"><?php echo $strgrade; ?></label>:<br />
|
||||
<label for="<?php echo "inputq$question->id" ?>"><?php echo $strgrade; ?></label>:<br />
|
||||
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
|
||||
<?php echo $pageurl->hidden_params_out(); ?>
|
||||
<input type="hidden" name="savechanges" value="save" />
|
||||
<?php
|
||||
echo '<input type="text" name="g' . $qnum . '" id="inputq' . $qnum . '" size="' . ($quiz->decimalpoints + 2) . '"
|
||||
value="' . (0 + $quiz->grades[$qnum]) .
|
||||
echo '<input type="text" name="g' . $question->id . '" id="inputq' . $question->id .
|
||||
'" size="' . ($quiz->decimalpoints + 2) . '" value="' . (0 + $quiz->grades[$qnum]) .
|
||||
'" tabindex="' . ($lastindex + $qno) . '" />';
|
||||
?>
|
||||
<input type="submit" class="pointssubmitbutton" value="<?php echo $strsave; ?>" />
|
||||
@ -554,10 +547,10 @@ function quiz_print_question_list($quiz, $pageurl, $allowdelete = true,
|
||||
?>
|
||||
<div class="qorder">
|
||||
<?php
|
||||
echo '<input type="text" name="o' . $i . '" size="2" value="' .
|
||||
echo '<input type="text" name="o' . $question->id . '" size="2" value="' .
|
||||
(10*$count + 10) .
|
||||
'" tabindex="' . ($lastindex + $qno) .
|
||||
'" ' . $movedisabled . ' />';
|
||||
'" />';
|
||||
?>
|
||||
<!-- <input type="submit" class="pointssubmitbutton" value="<?php
|
||||
echo $strsave; ?>" /> -->
|
||||
@ -597,18 +590,18 @@ function quiz_print_question_list($quiz, $pageurl, $allowdelete = true,
|
||||
//a page break: end the existing page.
|
||||
if ($qnum == 0) {
|
||||
if ($pageopen) {
|
||||
if (!$reordertool) {
|
||||
if (!$reordertool && !($quiz->shufflequestions && $i < $questiontotalcount - 1)) {
|
||||
quiz_print_pagecontrols($quiz, $pageurl, $pagecount,
|
||||
$hasattempts);
|
||||
} else if ($i<$questiontotalcount - 1) {
|
||||
} else if ($i < $questiontotalcount - 1) {
|
||||
//do not include the last page break for reordering
|
||||
//to avoid creating a new extra page in the end
|
||||
echo '<input type="hidden" name="o' . $i . '" size="2" value="' .
|
||||
echo '<input type="hidden" name="opg' . $pagecount . '" size="2" value="' .
|
||||
(10*$count + 10) . '" />';
|
||||
}
|
||||
echo "</div></div>";
|
||||
|
||||
if (!$reordertool) {
|
||||
if (!$reordertool && !$quiz->shufflequestions) {
|
||||
echo "<div class=\"addpage\">";
|
||||
print_single_button($pageurl->out(true),
|
||||
array('cmid' => $quiz->cmid,
|
||||
@ -623,7 +616,6 @@ function quiz_print_question_list($quiz, $pageurl, $allowdelete = true,
|
||||
$hasattempts);
|
||||
echo "</div>";
|
||||
}
|
||||
$pagecount;
|
||||
$pageopen = false;
|
||||
$count++;
|
||||
}
|
||||
@ -649,6 +641,8 @@ function quiz_print_question_list($quiz, $pageurl, $allowdelete = true,
|
||||
*/
|
||||
function quiz_print_pagecontrols($quiz, $pageurl, $page, $hasattempts) {
|
||||
global $CFG;
|
||||
static $randombuttoncount = 0;
|
||||
$randombuttoncount++;
|
||||
echo '<div class="pagecontrols">';
|
||||
|
||||
// Get the current context
|
||||
@ -680,8 +674,7 @@ function quiz_print_pagecontrols($quiz, $pageurl, $page, $hasattempts) {
|
||||
<input type="hidden" name="cmid" value="<?php echo $quiz->cmid; ?>" />
|
||||
<input type="hidden" name="courseid" value="<?php echo $quiz->course; ?>" />
|
||||
<input type="hidden" name="returnurl" value="<?php echo urlencode($pageurl->out(true)); ?>" />
|
||||
<input type="submit" id="addrandomdialoglaunch_<?php echo $page; ?>" value="<?php echo get_string('addarandomquestion', 'quiz'); ?>" <?php echo " $disabled"; ?> />
|
||||
<!--<a href="#" id="addrandomdialoglaunch_<?php echo $page; ?>">laa</a>-->
|
||||
<input type="submit" id="addrandomdialoglaunch_<?php echo $randombuttoncount; ?>" value="<?php echo get_string('addarandomquestion', 'quiz'); ?>" <?php echo " $disabled"; ?> />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -704,8 +697,8 @@ function quiz_process_randomquestion_formdata(&$qcobject) {
|
||||
$addonpage = 0;
|
||||
$newquestioninfo = false;
|
||||
if ($qcobject->catform_rand->is_cancelled()) {
|
||||
return false;
|
||||
} elseif ($catformdata = $qcobject->catform_rand->get_data()) {
|
||||
return 'cancelled';
|
||||
} else if ($catformdata = $qcobject->catform_rand->get_data()) {
|
||||
$newquestioninfo = new stdClass;
|
||||
$addonpage = $catformdata->addonpage;
|
||||
$newquestioninfo->addonpage = $catformdata->addonpage;
|
||||
@ -725,7 +718,7 @@ function quiz_process_randomquestion_formdata(&$qcobject) {
|
||||
$newquestioninfo->newrandomcategory = false;
|
||||
}
|
||||
}
|
||||
return($newquestioninfo);
|
||||
return $newquestioninfo;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1167,7 +1160,7 @@ function quiz_print_grading_form($quiz, $pageurl, $tabindex) {
|
||||
function quiz_print_status_bar($quiz) {
|
||||
global $CFG;
|
||||
$numberofquestions = quiz_number_of_questions_in_quiz($quiz->questions);
|
||||
?><div class="statusdisplay"><span class="totalpoints">
|
||||
?><div class="statusbar"><span class="totalpoints">
|
||||
<?php echo get_string('totalpointsx', 'quiz', quiz_format_grade($quiz, $quiz->sumgrades)) ?></span>
|
||||
| <span class="numberofquestions">
|
||||
<?php
|
||||
@ -1202,32 +1195,6 @@ function quiz_print_status_bar($quiz) {
|
||||
$dates = implode(', ', $dates);
|
||||
echo ' | <span class="quizopeningstatus" title="' . $dates . '">' . $currentstatus . '</span>';
|
||||
|
||||
// If questions are shuffled, notify the user about the
|
||||
// question order not making much sense
|
||||
$updateurl = new moodle_url("$CFG->wwwroot/course/mod.php",
|
||||
array('return' => 'true', 'update' => $quiz->cmid, 'sesskey' => sesskey()));
|
||||
echo '<br /><strong><a href="' . $updateurl->out() . '">';
|
||||
print_string('updatethis', '', get_string('modulename', 'quiz'));
|
||||
echo '</a>:</strong> ';
|
||||
if ($quiz->shufflequestions) {
|
||||
echo "*";
|
||||
}
|
||||
if ($quiz->shufflequestions) {
|
||||
$shuffleqs= get_string('yes');
|
||||
}
|
||||
else {
|
||||
$shuffleqs= get_string('no');
|
||||
}
|
||||
echo get_string('shufflequestionsx', 'quiz', $shuffleqs);
|
||||
echo " | ";
|
||||
$questionsperpagebool = ($quiz->questionsperpage < 1) ? 0 : 1;
|
||||
if ($questionsperpagebool) {
|
||||
$valquestionsparpage = $quiz->questionsperpage;
|
||||
} else {
|
||||
$valquestionsparpage = get_string('unlimited');
|
||||
}
|
||||
print_string('questionsperpagex', 'quiz', $valquestionsparpage);
|
||||
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
|
@ -6,15 +6,15 @@ class question_category_edit_form_randomquestion extends moodleform {
|
||||
|
||||
function definition() {
|
||||
global $CFG, $DB;
|
||||
$mform =& $this->_form;
|
||||
$mform =& $this->_form;
|
||||
|
||||
$contexts = $this->_customdata['contexts'];
|
||||
$currentcat = $this->_customdata['currentcat'];
|
||||
$contexts = $this->_customdata['contexts'];
|
||||
$currentcat = $this->_customdata['currentcat'];
|
||||
//--------------------------------------------------------------------------------
|
||||
$mform->addElement('header', 'categoryheader', get_string('createcategoryfornewrandomquestion', 'quiz'));
|
||||
|
||||
$questioncategoryel = $mform->addElement('questioncategory', 'parent', get_string('parentcategory', 'quiz'),
|
||||
array('contexts'=>$contexts, 'top'=>true, 'currentcat'=>$currentcat, 'nochildrenof'=>$currentcat));
|
||||
array('contexts'=>$contexts, 'top'=>true, 'currentcat'=>$currentcat, 'nochildrenof'=>$currentcat));
|
||||
$mform->setType('parent', PARAM_SEQUENCE);
|
||||
$mform->setHelpButton('parent', array('categoryparent', get_string('parent', 'quiz'), 'question'));
|
||||
|
||||
@ -27,7 +27,7 @@ class question_category_edit_form_randomquestion extends moodleform {
|
||||
$mform->setType('info', PARAM_MULTILANG);
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
$this->add_action_buttons(false, get_string('addrandomquestion', 'quiz'));
|
||||
$this->add_action_buttons(true, get_string('addrandomquestion', 'quiz'));
|
||||
//--------------------------------------------------------------------------------
|
||||
$mform->addElement('hidden', 'id', 0);
|
||||
$mform->setType('id', PARAM_INT);
|
||||
|
@ -4645,15 +4645,15 @@ table.quizreviewsummary td.cell {
|
||||
padding-right:1em;
|
||||
}
|
||||
|
||||
#mod-quiz-edit .statusdisplay{
|
||||
clear:both;
|
||||
display:block;
|
||||
border:0.2em #FFF solid;
|
||||
margin-bottom:0.3em;
|
||||
margin-right:1em;
|
||||
margin-top:0.3em;
|
||||
padding:0.1em;
|
||||
#mod-quiz-edit .statusdisplay {
|
||||
clear: both;
|
||||
margin: 0.3em 1em 0.3em 0;
|
||||
padding: 1px ; /* Stop margin collapse. */
|
||||
}
|
||||
#mod-quiz-edit .statusdisplay p {
|
||||
margin: 0.4em;
|
||||
}
|
||||
|
||||
#mod-quiz-edit div.quizpage{
|
||||
display:block;
|
||||
clear:both;
|
||||
@ -4835,7 +4835,7 @@ table.quizreviewsummary td.cell {
|
||||
border-radius:0.2em;
|
||||
border-radius-bottomleft:0;
|
||||
border-radius-topleft:0;
|
||||
z-index:999;
|
||||
z-index:900;
|
||||
display:block;
|
||||
margin:0;
|
||||
}
|
||||
@ -4934,7 +4934,7 @@ table.quizreviewsummary td.cell {
|
||||
position:absolute;
|
||||
right:0.3em;
|
||||
top:0;
|
||||
z-index:999;
|
||||
z-index:900;
|
||||
display:block;
|
||||
padding:0.2em;
|
||||
}
|
||||
@ -4949,7 +4949,7 @@ table.quizreviewsummary td.cell {
|
||||
top:0.2em;
|
||||
right:0.2em;
|
||||
display:inline;
|
||||
z-index:999;
|
||||
z-index:900;
|
||||
}
|
||||
|
||||
#mod-quiz-edit .quizpagedelete img {
|
||||
@ -4987,13 +4987,6 @@ table.quizreviewsummary td.cell {
|
||||
width:90%;
|
||||
}
|
||||
|
||||
#mod-quiz-edit #repaginatedialog .hd{
|
||||
display:none;
|
||||
}
|
||||
|
||||
#mod-quiz-edit div#randomquestiondialog{
|
||||
display:none;
|
||||
}
|
||||
|
||||
#mod-quiz-edit div#randomquestiondialog_c .mform,
|
||||
#mod-quiz-edit div#repaginatedialog .mform{
|
||||
@ -5219,13 +5212,13 @@ table#categoryquestions td,#mod-quiz-edit table#categoryquestions th{
|
||||
padding-top:1em;
|
||||
}
|
||||
|
||||
#mod-quiz-edit #repaginatecommand{
|
||||
display:none;
|
||||
}
|
||||
|
||||
/* these will toggle if js is enabled */
|
||||
body #quizcontentsblock #repaginatedialog{
|
||||
display: none;
|
||||
}
|
||||
body.jsenabled #quizcontentsblock #repaginatedialog{
|
||||
display:none;
|
||||
display: block;
|
||||
}
|
||||
body.jsenabled #quizcontentsblock #repaginatedialog .hd{
|
||||
display:block;
|
||||
|
Loading…
x
Reference in New Issue
Block a user