mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-77550 lesson: Format decimals in feedback page
This commit is contained in:
parent
556208417d
commit
aba460cec9
2 changed files with 19 additions and 0 deletions
|
@ -347,6 +347,21 @@ class lesson_page_type_numerical extends lesson_page {
|
||||||
|
|
||||||
return $data;
|
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 {
|
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 |
|
| Your answer | 2#87 |
|
||||||
And I press "Submit"
|
And I press "Submit"
|
||||||
Then I should see "Correct answer"
|
Then I should see "Correct answer"
|
||||||
|
And I should see "2#87"
|
||||||
And I should not see "Incorrect answer"
|
And I should not see "Incorrect answer"
|
||||||
And I press "Continue"
|
And I press "Continue"
|
||||||
And I should see "Congratulations - end of lesson reached"
|
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 |
|
| Your answer | 2#7 |
|
||||||
And I press "Submit"
|
And I press "Submit"
|
||||||
Then I should not see "Correct answer"
|
Then I should not see "Correct answer"
|
||||||
|
And I should see "2#7"
|
||||||
And I should see "Incorrect answer"
|
And I should see "Incorrect answer"
|
||||||
And I press "Continue"
|
And I press "Continue"
|
||||||
And I should see "Congratulations - end of lesson reached"
|
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 |
|
| Your answer | 2#87 |
|
||||||
And I press "Submit"
|
And I press "Submit"
|
||||||
Then I should see "Correct answer"
|
Then I should see "Correct answer"
|
||||||
|
And I should see "2#87"
|
||||||
And I should not see "Incorrect answer"
|
And I should not see "Incorrect answer"
|
||||||
And I press "Continue"
|
And I press "Continue"
|
||||||
And I should see "Congratulations - end of lesson reached"
|
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 |
|
| Your answer | 2,7 |
|
||||||
And I press "Submit"
|
And I press "Submit"
|
||||||
And I should see "Incorrect answer"
|
And I should see "Incorrect answer"
|
||||||
|
And I should see "2,7"
|
||||||
And I should not see "Correct answer"
|
And I should not see "Correct answer"
|
||||||
And I press "Continue"
|
And I press "Continue"
|
||||||
And I should see "Congratulations - end of lesson reached"
|
And I should see "Congratulations - end of lesson reached"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue