Permalink
Browse files

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

…OODLE_21_STABLE
  • Loading branch information...
2 parents 40b9013 + d76a78a commit b57566d3beeaf1c2f74e0584ee5fae7acd780bc5 @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 b57566d

Please sign in to comment.