This content has been marked as final. Show 5 replies
Create a short list of predefined input words (PI, SQRT,...) and process them at runtime.
You are asking for something that you are not likely going to be able to
do. I mean, how are you going to parse these answers? There are plenty
of notations that can be used to symbolize math concepts, but basically
you are asking the students to not only correctly solve the problem, but
they also need to master whatever answering scheme you come up with.
For example, the standard way to say "x squared" is "x^2" The carat (^)
character means 'to the power of'. So now your student needs to know
that this is how you want the answer framed.
Let's say the correct answer is "2x squared + 5y". That would be
Of course, that is not the proper "computer" method... since
multiplication generally requires an asterisk * as opposed to simply
mashing the characters together like you can on paper. So another way
of correctly stating the same thing is
And of course, parentheses are commonly used to define the order of
operations, and sometimes just to make something look neater or more
easy to follow... so this would be correct also
also, some people may put in spaces to make things more readable
2 * x^2 + 5*y
so, unless you want to make simply entering the student's answer more
difficult than figuring out the answer to the question, you would need
to make your scoring script able to read in multiple variants of the
answer syntax. This is not a trivial task.
You may be better off doing a multiple choice type answer where you can
put in the correctly syntaxed answer using the more advanced text
capabilities of a text member or bitmaps pulled in from other programs.
Wow. The newsgroup automatically changed all my carat syntax to actual
superscripts. whenever you see x^2 and it is written as a superscript,
it should be x ^ 2 (x <carat> 2)
You can always go with multiple choice.
Th easiest way is to provide an onscreen 'calculator' so the user clicks buttons (like a real world calculator) to enter their equations. You could use a custom font to display the formula - though with some equations you are going to have to do some gymnastics to do the layout (might be easier to create bitmaps of each character and symbol and use imaging lingo to do the layout - see http://www.lingoworkshop.com/Codelib/pixelfonts.php for an idea how this might work for normal characters).
For simple superscript and subscript, you can also set the HTML or RTF of text members.