Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MDL-37431_24' of git://github.com/timhunt/moodle into M…

…OODLE_24_STABLE
  • Loading branch information...
commit c01b82d4e40f6d623b4cbacf93f84bad81e5bd90 2 parents b3e8f06 + 8c11e08
@stronk7 stronk7 authored
Showing with 8 additions and 6 deletions.
  1. +8 −6 question/previewlib.php
View
14 question/previewlib.php
@@ -341,14 +341,16 @@ function question_preview_cron() {
'quba.component = :qubacomponent
AND NOT EXISTS (
SELECT 1
- FROM {question_attempts} qa
- JOIN {question_attempt_steps} qas ON qas.questionattemptid = qa.id
- WHERE qa.questionusageid = quba.id
- AND (qa.timemodified > :qamodifiedcutoff
- OR qas.timecreated > :stepcreatedcutoff)
+ FROM {question_attempts} subq_qa
+ JOIN {question_attempt_steps} subq_qas ON subq_qas.questionattemptid = subq_qa.id
+ JOIN {question_usages} subq_qu ON subq_qu.id = subq_qa.questionusageid
+ WHERE subq_qa.questionusageid = quba.id
+ AND subq_qu.component = :qubacomponent2
+ AND (subq_qa.timemodified > :qamodifiedcutoff
+ OR subq_qas.timecreated > :stepcreatedcutoff)
)
',
- array('qubacomponent' => 'core_question_preview',
+ array('qubacomponent' => 'core_question_preview', 'qubacomponent2' => 'core_question_preview',
'qamodifiedcutoff' => $lastmodifiedcutoff, 'stepcreatedcutoff' => $lastmodifiedcutoff));
question_engine::delete_questions_usage_by_activities($oldpreviews);

0 comments on commit c01b82d

Please sign in to comment.
Something went wrong with that request. Please try again.