Permalink
Browse files

Merge branch 'MDL-29970' of git://github.com/timhunt/moodle

  • Loading branch information...
2 parents 3730e07 + 8f725ad commit 3c905de59d9f6a3a77f75f31271c2b8df02284cc @nebgor nebgor committed Nov 8, 2011
Showing with 8 additions and 5 deletions.
  1. +8 −5 question/preview.php
View
@@ -153,12 +153,13 @@
} else if (optional_param('fill', null, PARAM_BOOL)) {
$correctresponse = $quba->get_correct_response($slot);
- $quba->process_action($slot, $correctresponse);
-
- $transaction = $DB->start_delegated_transaction();
- question_engine::save_questions_usage_by_activity($quba);
- $transaction->allow_commit();
+ if (!is_null($correctresponse)) {
+ $quba->process_action($slot, $correctresponse);
+ $transaction = $DB->start_delegated_transaction();
+ question_engine::save_questions_usage_by_activity($quba);
+ $transaction->allow_commit();
+ }
redirect($actionurl);
} else if (optional_param('finish', null, PARAM_BOOL)) {
@@ -210,6 +211,8 @@
if ($quba->get_question_state($slot)->is_finished()) {
$finishdisabled = ' disabled="disabled"';
$filldisabled = ' disabled="disabled"';
+} else if (is_null($quba->get_correct_response($slot))) {
+ $filldisabled = ' disabled="disabled"';
}
if (!$previewid) {
$restartdisabled = ' disabled="disabled"';

0 comments on commit 3c905de

Please sign in to comment.