Question: Write a Maplet to Accept and Evaluate Formatted Expressions

If anyone can advise me about how to create the tool that I describe below, that would be great. I am a novice to Maple and object-oriented programming, but I can program in C and I suspect that I can write a Maplet, if that is indeed the best way to achieve my goal. This is what I want to do.

I want to provide my students with a tool that would: accept virtually any algebraic expression (in at least one variable); accept a value for that variable (in another entry area); and then evaluate their expression (on the click of a button) and return the result. Actually, the expressions would be limited to those found in a typical pre-calculus level textbook, and the variable values would be limited to integers or floating point numbers. If I can make such a tool, I would allow the students to use it to help them find instances, in their own writing, of pairs of consecutive expressions that are NOT equivalent (though they were intended to be equivalent). The idea would be to help students find their own mistakes (after I have alluded to their presence) in the work that they submit for grading, and thus to learn that they are indeed mistakes that must be avoided in the future. 

I am too new to writing Maplets to know whether or not a Maplet can be written to do exactly this, but I would think that it's possible.  Surely it's possible if the algebraic expression can be entered as inline text. However, I do NOT want to ask the students to learn how to enter complicated algebraic expressions as inline text (or to learn any Maple programming), and thus it's not so obvious to me as to whether or not I can make a Maplet to accomplish this task.

For clarity, I'll elaborate on what it is that I need for the Maplet to do. Incidentally,  the variable that I am referring to would, in some cases at least, actually be an n-tuple, as opposed to a single scalar-valued variable. But if you can tell me how to do the following for a single variable, then perhaps I can extend the code to work for an n-tuple type variable. Here's what the Maplet must do:

(1) Provide a toolbar and an entry area that enables the user to enter any algebraic expression (with at least one variable) into, say, "Box#1", without requiring the user to enter the expression as text. That is, it must allow the radicals to look like radicals, the division bars to appear horizontal, etc., and all of this must be seen on entry, not just after pressing a button to display the "inline version" in a "pretty format."  

(2) Allow the user to also enter an integer or floating point number in another box (Box#2) to subsequently be used as a variable replacement; actually, I know that this task is rather easily achieved, since a regular decimal number can most likely be entered in a simple text box.

(3) Respond to a button press by evaluating the algebraic expression in Box#1 when the variable assumes the value set in Box#2, and subsequently display the result of the evaluation in a third box (Box#3). 

I know this sounds simple, but I'm really lost when it comes to setting up an area for "the user to enter an arbitrary algebraic expression without having to know how to enter it as inline text."  Sorry to say, but not all of my students are savvy enough to enter any old (pre-calculus level) algebraic expression as text, and it would help immensely to have an MS-Equation-Editor-like feature to let them enter it just as it appears on paper.  

If you know how to do the above with a Maplet, any advice and/or appropriate Maplet code would be greatly appreciated.  Also, if this is not an appropriate place to post this type of question, please accept my apologies and direct me to the right place.  Thank you.

 

Please Wait...