Skip to content

Commit

Permalink
Exercises: Fix missing NoFeedback option BT#17585
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Jul 28, 2020
1 parent eefc71d commit e936e64
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions main/exercise/exercise.class.php
Expand Up @@ -2564,8 +2564,6 @@ public function createForm($form, $type = 'full')

public function setResultFeedbackGroup(FormValidator $form, $checkFreeze = true)
{
$freeze = false;

// Feedback type.
$feedback = [];
$feedback[] = $form->createElement(
Expand All @@ -2580,6 +2578,17 @@ public function setResultFeedbackGroup(FormValidator $form, $checkFreeze = true)
]
);

$noFeedBack = $form->createElement(
'radio',
'exerciseFeedbackType',
null,
get_lang('NoFeedback'),
EXERCISE_FEEDBACK_TYPE_EXAM,
[
'id' => 'exerciseType_'.EXERCISE_FEEDBACK_TYPE_EXAM,
]
);

$freeze = true;
if ('true' === api_get_setting('enable_quiz_scenario')) {
if (0 === $this->getQuestionCount()) {
Expand All @@ -2606,8 +2615,10 @@ public function setResultFeedbackGroup(FormValidator $form, $checkFreeze = true)

if ($freeze) {
$direct->freeze();
$noFeedBack->freeze();
}

$feedback[] = $noFeedBack;
$feedback[] = $direct;

$feedback[] = $form->createElement(
Expand Down

0 comments on commit e936e64

Please sign in to comment.