Skip to content

Commit

Permalink
MDL-28686 QE2 upgrade: recognize manually graded, deleted questions
Browse files Browse the repository at this point in the history
  • Loading branch information
bostelm committed Aug 26, 2011
1 parent 4ad6128 commit 987e0e9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions question/engine/upgrade/upgradelib.php
Expand Up @@ -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') {
Expand Down

0 comments on commit 987e0e9

Please sign in to comment.