MDL-29970 question preview: Fill correct only if qtype supports it

This commit is contained in:
Charles Fulton
2011-11-03 10:38:04 +00:00
committed by Tim Hunt
parent f08f22c267
commit d76a78afae
+8 -5
View File
@@ -153,12 +153,13 @@ if (data_submitted() && confirm_sesskey()) {
} 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 @@ $filldisabled = '';
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"';