MDL-13982 - Performance problem when deleting questions from large question banks. Thanks to Michael Spall for this fix.

This commit is contained in:
tjhunt
2008-04-23 13:44:29 +00:00
parent 3c956dbd60
commit 443fd25436
+2 -4
View File
@@ -76,8 +76,7 @@
if ($questionlist = explode(',', $deleteselected)) {
// for each question either hide it if it is in use or delete it
foreach ($questionlist as $questionid) {
if (record_exists('quiz_question_instances', 'question', $questionid) or
record_exists('question_states', 'originalquestion', $questionid)) {
if (record_exists('quiz_question_instances', 'question', $questionid)) {
if (!set_field('question', 'hidden', 1, 'id', $questionid)) {
error('Was not able to hide question');
}
@@ -102,8 +101,7 @@
if (substr($key, 0, 1) == "q") {
$key = substr($key,1);
$questionlist .= $key.',';
if (record_exists('quiz_question_instances', 'question', $key) or
record_exists('question_states', 'originalquestion', $key)) {
if (record_exists('quiz_question_instances', 'question', $key)) {
$questionnames .= '* ';
$inuse = true;
}