Restatement of question, including code.
numList = {"3 ", "(2)^2 ", "foo", "bar"};
Manipulate[nums = Extract[numList, {{1}, {i}}];
Grid[{{"Perform the following calculation."}, {"input=" <>
StringJoin[nums]}, {"ans=" <>
ToString[ToExpression[StringJoin[nums]]]}}], {i, Range[2, 4]}]
Paste code into Mathematica. Replace foo
with 2, control-6 (to get a superscript), 2. Replace bar
with open paren, 2, close paren, control-6, 2. Execute, and then click on the ButtonBar. When i is 2 or 3, it works fine. If you click on i=4, you get a syntax error.
These should all be legal ways of doing 3 times 2^2.
FullForm[numList]
you'll in the last string that "(2)" is not the base of the superscript. This string does what you wanted:"\!\(\*SuperscriptBox[\((2)\), \(2\)]\)"
-- not sure how enter it tho' $\endgroup$