Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-28686 QE2 upgrade: recognize manually graded, deleted questions

  • Loading branch information...
commit 987e0e915c0fcdbfb88d208ba8882770e6a1a75e 1 parent 4ad6128
@bostelm bostelm authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 question/engine/upgrade/upgradelib.php
View
9 question/engine/upgrade/upgradelib.php
@@ -342,6 +342,15 @@ public function get_question_states($attempt, $question, moodle_recordset $quest
}
protected function get_converter_class_name($question, $quiz, $qsessionid) {
+ global $DB;
+ if ($question->qtype == 'deleted') {
+ $where = '(question = :questionid OR '.$DB->sql_like('answer', ':randomid').') AND event = 7';
+ $params = array('questionid'=>$question->id, 'randomid'=>"random{$question->id}-%");
+ if ($DB->record_exists_select('question_states', $where, $params)) {
+ $this->logger->log_assumption("Assuming that deleted question {$question->id} was manually graded.");
+ return 'qbehaviour_manualgraded_converter';
+ }
+ }
if ($question->qtype == 'essay') {
return 'qbehaviour_manualgraded_converter';
} else if ($question->qtype == 'description') {
Please sign in to comment.
Something went wrong with that request. Please try again.