From 443fd25436612548a7a2ea98ee8527f12716fa42 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 23 Apr 2008 13:44:29 +0000 Subject: [PATCH] MDL-13982 - Performance problem when deleting questions from large question banks. Thanks to Michael Spall for this fix. --- question/showbank.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/question/showbank.php b/question/showbank.php index 3c8497dfcc5..65b73040601 100644 --- a/question/showbank.php +++ b/question/showbank.php @@ -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; }