How to display numbers with thousand separators in quiz?

How to display numbers with thousand separators in quiz?

by Nobuyuki Fujioka -
Number of replies: 8

Moodle 2.7

Hi, all

I am creating some numerical questions in quiz at the moment.

I do not know how to show numbers with thousand separators.

For example,

Question: 12345 x 98765 = 

as it is difficult for students to read big numbers, I would like to add thousand separators as below:

Question:12,345 x 98,765 = 

I tried to look for an answer in Moodle forums, but I have not been able to find an answer.

Could you kindly tell me how to achieve this?


Kind regards,

Noby Fujioka

Average of ratings: -
In reply to Nobuyuki Fujioka

Re: How to display numbers with thousand separators in quiz?

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Noby,

There are multiple ways you can do this.

For instance, you can do just like you did in your post and type the numbers. The down side is you would need to create a short answer question for each possible math problem.

Since you mentioned "numerical" in your post, I presume you would like to have the questions generate some random numbers so you get a different question/answer each time the question is used, similar to this.

This was done using the Variable Numeric type question (has to be installed along with Variable Numeric Set) along with some Mathjax notation. Note: the multiple \; are there only for spacing the problem over the answer box. Your desired thousands separators are just commas between the variables.


The question uses four variables t1, h1, t2, h2.
Each is set like the following:
t1=rand_int(1,99)
h1=rand_int(100,999)
t2=rand_int(1,99)
h2=rand_int(100,999)

The calculated answer is (t1*1000+h1)*(t2*1000+h2) with an Accepted error of 0.

I am sure you could use something similar with the built in Moodle questions, but I like the random number generate capability of the Variable Numeric question type.

There is one limitation in this particular example in that it will not ever have a zero in the tens or hundreds positions, However, it is possible to come up with them by using some more variables units and tens.

HTH,
AL
Average of ratings: Useful (1)
In reply to AL Rachels

Re: How to display numbers with thousand separators in quiz?

by Nobuyuki Fujioka -

Hi, Al

Thank you very much for your help.

I tried your method, and it works.  The only issue is students cannot type in answers with thousand separators.  It will be better if students have a choice of using or not using thousand separators for their answers.

I managed to do this with short answer question type, but I cannot randomise the numbers for questions.

Do you have any solution to give a choice for students to give answers with or without thousand separators?

Kind regards,

Noby

In reply to Nobuyuki Fujioka

Re: How to display numbers with thousand separators in quiz?

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Noby,

Sorry for the delayed answer, but I've been out of town for a couple of days. I don't know of any "random" number type question that can do what you want. The only way I can think of is by creating LOTS of individual "text based" questions so you can set up for exact matches in answers.

The option to use commas in an answer is possible using the Variable Numeric type question. But in reality, it just seems to ignore the commas no matter whether used correctly or incorrectly, as you can see in the two pictures.

commas used right commas used wrong

Using the Variable Numeric and having students place commas can be manually checked for correctness by the teacher. The teacher can "Review" the students quiz and make a comment or override the mark just the same as you do with an essay type question.

The only other possibility I can think of is maybe using WIRIS. I have not specifically tried it using WIRIS, but you might try it yourself.

HTH,

AL



In reply to AL Rachels

Re: How to display numbers with thousand separators in quiz?

by Nobuyuki Fujioka -

Hi, Al

Thank you very much for your advice.

For now, I will stick with the short answer questions with two answers - one with comma, and another one without it.

But, later on I will use your advice for "random" number type questions. - it is good as I can at least use it for the question parts to display the commas(thousand separators).


Kind regards,

Noby



In reply to AL Rachels

Re: How to display numbers with thousand separators in quiz?

by WIRIS team -
Picture of Plugin developers
Hi AL and Noby,


You can check how this works using WIRIS here http://www.wiris.com/quizzes/docs/moodle/manual/separators

In reply to WIRIS team

Re: How to display numbers with thousand separators in quiz?

by Nobuyuki Fujioka -

Dear WIRIS team SUPPORT,

Thank you for your information.  I may use it some time in the near future.

Kind regards,

Noby

In reply to Nobuyuki Fujioka

Re: How to display numbers with thousand separators in quiz?

by Ray Morris -

You used the example 98,765.  Is that number larger or smaller than 100?  To most people in the world, 98,765 comes between 98 and 99.  Only if you were raised in the US or UK is that a large number.


To students raised in the US and UK, 98,765 is "ninety eight thousand  seven hundred sixty five".  Students raised most other places will see that as "ninety eight and 765 thousands", what people in the US would write as 98.765. 


This has been discussed A LOT among Moodle users and developers over the course of many years.  The short form of the story is that there's no way to use a thousands separator that won't confuse many of the students. The decimal separator is required, even though it has mostly the same problem, but the thousands separator isn't, so it's probably a good idea to leave it out.




Average of ratings: Useful (1)
In reply to Ray Morris

Re: How to display numbers with thousand separators in quiz?

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Tell me there is a metric standard for this, please.......