mirror of
https://github.com/moodle/moodle.git
synced 2025-03-22 08:30:04 +01:00
MDL-77550 lesson: Format decimals in feedback page
This commit is contained in:
parent
f49f934786
commit
c90c9b04f6
@ -347,6 +347,21 @@ class lesson_page_type_numerical extends lesson_page {
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom formats the answer to display
|
||||
*
|
||||
* @param string $answer
|
||||
* @param context $context
|
||||
* @param int $answerformat
|
||||
* @param array $options Optional param for additional options.
|
||||
* @return string Returns formatted string
|
||||
*/
|
||||
public function format_answer($answer, $context, $answerformat, $options = []) {
|
||||
$answer = helper::lesson_format_numeric_value($answer);
|
||||
|
||||
return parent::format_answer($answer, $context, $answerformat, $options);
|
||||
}
|
||||
}
|
||||
|
||||
class lesson_add_page_form_numerical extends lesson_add_page_form_base {
|
||||
|
@ -57,6 +57,7 @@ Feature: In a lesson activity, I need to edit pages in the lesson taking into ac
|
||||
| Your answer | 2#87 |
|
||||
And I press "Submit"
|
||||
Then I should see "Correct answer"
|
||||
And I should see "2#87"
|
||||
And I should not see "Incorrect answer"
|
||||
And I press "Continue"
|
||||
And I should see "Congratulations - end of lesson reached"
|
||||
@ -69,6 +70,7 @@ Feature: In a lesson activity, I need to edit pages in the lesson taking into ac
|
||||
| Your answer | 2#7 |
|
||||
And I press "Submit"
|
||||
Then I should not see "Correct answer"
|
||||
And I should see "2#7"
|
||||
And I should see "Incorrect answer"
|
||||
And I press "Continue"
|
||||
And I should see "Congratulations - end of lesson reached"
|
||||
@ -81,6 +83,7 @@ Feature: In a lesson activity, I need to edit pages in the lesson taking into ac
|
||||
| Your answer | 2#87 |
|
||||
And I press "Submit"
|
||||
Then I should see "Correct answer"
|
||||
And I should see "2#87"
|
||||
And I should not see "Incorrect answer"
|
||||
And I press "Continue"
|
||||
And I should see "Congratulations - end of lesson reached"
|
||||
@ -106,6 +109,7 @@ Feature: In a lesson activity, I need to edit pages in the lesson taking into ac
|
||||
| Your answer | 2,7 |
|
||||
And I press "Submit"
|
||||
And I should see "Incorrect answer"
|
||||
And I should see "2,7"
|
||||
And I should not see "Correct answer"
|
||||
And I press "Continue"
|
||||
And I should see "Congratulations - end of lesson reached"
|
||||
|
Loading…
x
Reference in New Issue
Block a user