Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly marked answers when using numerical questions and with 'any order' #27

Open
austin48 opened this issue Oct 10, 2018 · 2 comments

Comments

@austin48
Copy link
Contributor

austin48 commented Oct 10, 2018

  • create a new test in Assignments, Tests and Surveys (mneme)
  • add a Fill in the blank question
  • create two fill in the blanks to the ckeditor

What is your favorite number: {3568}
Pick a number 3 or 4: {3|4}

  • In the question settings, set the question to be "Numerical"
  • In the question settings, choose "Any Order"
  • Save and publish
  • take the test as a student
  • for the first fill in the blank use a comma in your answer
  • choose 3 or 4 for the 2nd question

What is your favorite number: 3,568
Pick a number 3 or 4: 3

  • Finish the test
  • View the grades as an instructor
  • the 2nd question will be marked wrong even though 3 was a correct choice.
@austin48
Copy link
Contributor Author

The reason the {3|4} question fails is because earlier there's a question with {3568}, but when you answer it with a thousands place comma "3,568", because the question type is "numerical" (vs text), mneme, will convert the comma into a decimal point because it assumes commas are decimal separators (which is common in other countries), so the answer becomes 3.568. Then it searches through ALL of the possible answers in the test and because 3.568 is in the range of {3|4}, it marks the answer correct... which is wrong (but a coincidence) because it should have validated it agains {3568}. Then, because it found a match (again an incorrect one), it removes the {3|4} answer from the list of possible answers... so when the actual answer for the {3|4} fill in the blank is evaluated, that {3|4} is no longer in the list of possible answers so it fails and marks it incorrect!

@austin48
Copy link
Contributor Author

austin48 commented Oct 10, 2018

I believe the issue is happening in FillBlanksAnswerImpl.java (line 202)

// allow dot or comma for decimal point
// TODO: this needs to be changed to respect locale, not just replace commas! -ggolden
answer = answer.replace(',', '.');
correct = correct.replace(',', '.');

and possibly also in FillBlanksQuestionImpl.java (line 1038)

// allow dot or comma for decimal point
// TODO: this needs to be changed to respect locale, not just replace commas! -ggolden
answer = answer.replace(',', '.');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant