numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
207 stars 122 forks source link

When asking for an answer to 0 decimal places, the hint should say "Round your answer to the nearest whole number". #464

Closed christianp closed 7 years ago

christianp commented 7 years ago

"Round your answer to 0 decimal places" doesn't make sense.

One quibble is that apparently some school teachers think only strictly positive integers -- the natural numbers -- are 'whole numbers'. I've asked twitter if there's a less controversial term than 'whole number'.

christianp commented 7 years ago

Twitter says it should be 'to the nearest integer'. I suppose a theme designed for kids could add an explanation of what an integer is.

anbarasiu commented 7 years ago

Hi! Can I start contributing to this? I just took a look at the locales files, where the message seems to be configured.

christianp commented 7 years ago

Thanks for offering! You'll need to add in a separate string for this case, though i18next may let you add _0 to the end of the key - see http://i18next.com/translate/pluralMulti/. If that doesn't work, you'll have to add some logic in https://github.com/numbas/Numbas/blob/master/themes/default/files/scripts/parts/numberentry-display.js#L90 to use the alternative string when this.part.settings.precision = 0.

anbarasiu commented 7 years ago

I've setup the project on my machine and when I try to preview a new question I created, I'm getting a FileNotFound error. Am I doing something wrong here?

FileNotFoundError at /question/1/decimal-addition/preview/ [WinError 2] The system cannot find the file specified

Traceback: File "C:\Users\Anbu\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\handlers\base.py" in get_response

  1. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\Users\Anbu\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\views\generic\base.py" in view
  2. return self.dispatch(request, *args, **kwargs) File "C:\Users\Anbu\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\views\generic\base.py" in dispatch
  3. return handler(request, *args, **kwargs) File "D:\Git\numbas_editor\editor\views\question.py" in get
  4. return self.preview(q.editoritem) File "D:\Git\numbas_editor\editor\views\editoritem.py" in preview
  5. fsLocation = self.compile(numbasobject, switches, location, obj,locale=self.get_locale(obj)) File "D:\Git\numbas_editor\editor\views\editoritem.py" in compile
  6. process = subprocess.Popen(numbas_command, stdout = subprocess.PIPE, stdin=subprocess.PIPE, stderr = subprocess.PIPE) File "C:\Users\Anbu\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py" in init
  7. restore_signals, start_new_session) File "C:\Users\Anbu\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py" in _execute_child
  8. startupinfo)

Exception Type: FileNotFoundError at /question/1/decimal-addition/preview/ Exception Value: [WinError 2] The system cannot find the file specified

christianp commented 7 years ago

What's your PYTHON_EXEC setting in numbas/settings.py?

anbarasiu commented 7 years ago

Figured that I missed creating the previews directory. Working fine now.