Show
Setup
Log in as admin.
Customise the English language pack (Site administration > Language > Language customisation - English - langconfig.php) and set core_langconfig/decsep to a cmoma (,) and set core_langconfig/thousandssep to a dot (.)
Create a test course
Go to the test course question bank.
Testing numerical question editing
Create a new 'Numerical' question.
Fill the form with these:
Question name: q1
Question text: q1
Default mark: 1
Answer 1: 2.4
Error: 0.1
Answer 2: 3,5
Error : 0,1
Answer 3 : 5.3,5
Error : 0.1,5
Answer 4: 7,3.5
Error : 0,1.5
Answer 5: 10,5
Error : 0g8
Answer 6: 15,5
Error: (blank)
Do not set any mark for any of the answers and submit the form.
After the form is redisplayed, verify that all the fields that you entered in step 2 still have the exact same value.
Verify that the validation of Answer1 , Answer 3 , Answer 4 and Answer 5 fields have failed.
Set the mark of the Answer1 to 100%.
Change the error field of answer 3 to 0.15 and change the error field of answer 4 to 0,15 and change the error field of answer 5 to 0
Submit the form.
Verify that the question is created successfully.
Edit the question you just created.
Verify that the fields' value is as follows:
Question name: q1
Question text: q1
Default mark: 1
Answer 1: 2,4
Error: 0,1
Answer 2: 3,5
Error : 0,1
Answer 3 : 5,35
Error : 0,15
Answer 4: 73,5
Error : 0,15
Answer 5: 10,5
Error : 0
Answer 6: 15,5
Error: (blank)
Testing calculated question editing
Create a new calculated question
Fill the form with these:
Question name: q2
Question text: {x}+{y} is ...?
Answer 1 formula: {x}+{y}
Tolerance: 0.01
Answer 2 formula: {x}*{y}
Tolerance: 0,01
Answer 3 formula: {x}-{y}
Tolerance: nan
Do not set any mark for any of the answers and submit the form.
After the form is redisplayed, verify that all the fields that you entered in step 2 still have the exact same value.
Verify that the validation of Answer 1 and Answer 3 have failed.
Set the mark of the Answer1 to 100%.
Set the tolerance of Answer3 to 0,01
Submit the form
On the next screen, just click on the next page button.
Verify that all numbers in the "Item to add" section are using "," as the decimal separator
Click on the "Add" button at the bottom of the page
Verify that the new 2 text fields that are added at the bottom of the page contain numbers with "," as the decimal point
Click on the "Add" button again
Set the number that is next to the "Display" button to 10, and then click on the "Display" button
Verify that all text fields that are in "Set 1" and "Set 2" sections contain numbers with "," as the decimal point
Click on the "Sae changes" button
Verify that the question is created successfully
Edit the question you just created
Verify the following fields equal to what is expected
Answer 1 tolerance: 0,01
Answer 2 tolerance: 0,01
Answer 3 tolerance: 0,01
Testing calculated simple question editing
Create a new calculated simple question
Fill the form with these:
Question name: q2
Question text: {x}+{y} is ...?
Answer 1 formula: {x}+{y}
Tolerance: 0.01
Answer 2 formula: {x}*{y}
Tolerance: 0,01
Answer 3 formula: {x}-{y}
Tolerance: nan
Do not set any mark for any of the answers and click on the "save changes" button.
After the form is redisplayed, verify that all the fields that you entered in step 2 still have the exact same value.
Verify that the validation of Answer 1 and Answer 3 have failed.
Set the mark of the Answer1 to 100%.
Set the tolerance of Answer3 to 0,01
Click on the "Find the wild cards {x..} present in the correct answer formulas" button
Click on the "Generate" button to generate 1 new set of wild card values
Expand the "Wild card(s) values" section and then click on "show more..."
Verify that the new 2 text fields that are added at the bottom of the page contain numbers with "," as the decimal point
Set the field that is next to the generate button to 10 and then click on the "Generate" button again to generate 10 new set of wild card values
Set the number that is next to the "Display" button to 10, and then click on the "Display" button
Verify that all text fields that are within the "Wild card(s) values" section contain numbers with "," as the decimal point
Click on the save changes button
Verify that the question is saved successfully
Edit the question you just created
Verify the following fields equal to what is expected
Answer 1 tolerance: 0,01
Answer 2 tolerance: 0,01
Answer 3 tolerance: 0,01
Export and Import
Hopefully, you now have a numerical question and three different types of question in a category in the question bank.
Export that category in Moodle XML format.
Open the file in your text editor, and verify that all the numerical values in the file (except perhaps for the answers themselves, which have not been changed here) are exported using . as decimal separator.
In the question bank for your test course, make a new category called 'Import test'
Import the questions you just exported into that category (expand the General section of the import form to do this).
Edit each of the questions, and verify that all the numerical values have been imported correctly.