Skip to main content
Known Participant
June 1, 2007
Answered

Max Text in Textbox

  • June 1, 2007
  • 3 replies
  • 379 views
Hi there,

I am creating a maths quiz for student and one of the questions requires student to write numbers into words.
I've created a variable to store the answer the student's input. The answer for this particular question is
'Four million, three hundred and seventy thousand and ten'. At the end of the quiz i will show the student her answer and the correct answer but it seems that the number of text cannot be stored in the variable i have created.

May i ask how do i make it that such a long text of words can be stored in a variable?
Also, i need to check the answer for the upper and lower case.

X_x

This topic has been closed for replies.
Correct answer kglad
it means there's a carriage return after the last character. if you watch your output panel carefully you'll notice the text from the textfield isn't on the last line of the output panel.

it's easy to miss that though so i find it easier to check the text.length property and see if that matches the number of visible characters and expected spaces.

3 replies

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 4, 2007
it means there's a carriage return after the last character. if you watch your output panel carefully you'll notice the text from the textfield isn't on the last line of the output panel.

it's easy to miss that though so i find it easier to check the text.length property and see if that matches the number of visible characters and expected spaces.
Inspiring
June 1, 2007
Also if the number is supposed to be 4,370,010 I was taught that should be:

Four million three hundred seventy thousand ten

Ands were only to be used to denote the decimal point as in (49.5)

Fortynine and five tenths

I had a middle-school math teacher who really was quite mean about it. What were you taught kglad?

As for the number of characters in text, there may be a limit, but you are a long ways from it. Numbers like 65536 jump into my head. (Although I have no specific knowledge that would make me say that.) Another thing that might be happening is that you are getting an invisible return at the end of the input string? So check for that.
kglad
Community Expert
Community Expert
June 1, 2007
i don't remember anyone teaching anything about the grammar of numbers. but i would think this would be something taught in grammar and not taught in mathematics. in fact, it's hard to imagine a greater waste of time in a mathematics/arithmatic course.
kglad
Community Expert
Community Expert
June 1, 2007
if you really want to check for an exact match, your code is ok. but that's really checking for spelling, spacing and casing in addition to checking for a concept.