From: Michael G. <ga...@ma...> - 2006-08-27 16:22:51
|
Hi Davide, This stuff all looks very nice. One thing we can do is to redefine BEGIN_TEXT/END_TEXT so that it uses EV3P with the default parameters. There is no reason not to allow the new formula inputs as well as long as things remain backward compatible with EV3. We can make the other versions of EV3P available in the webwork core as well for cases where folks want to fine tune the evaluation abilities. (Just as EV2 is still available if you want to interpolate $ variables before command execution instead of afterwards.) I'd like to tune up translator a bit in any case and structure it so that there is a plugin preprocessor and post processor surrounding the main rendering. Some of this may already be in place -- I don't have the code in front of me -- but I know that I never completed all of the plans. The preprocessor handles things like BEGIN_TEXT/END_TEXT and could handle BEGIN_HINT BEGIN_SOLUTION as well. I've been resisting putting too much stuff in these processors but I think these two would be ok -- particularly if we optimize the grep search. A post processor would handle the work of Latex2HTML (RIP) but it could also do things such as color answer blanks red or green depending on whether the answer is right -- this would be useful for matrices and problems with large numbers of answer blanks. At least some of these hooks are already in place but it would be nice to finish the job. Take care, Mike On Aug 27, 2006, at 11:57 AM, Davide P. Cervone wrote: > Folks: > > While working on my essay-answer tools, I ended up making a modified > version of EV3 that I think might be more generally useful. My > original intent was to include the ability to enter mathematics not > in TeX form but in the answer-checker-style text strings, so that > something like sin(x/(x+1)) would produce \sin\!\left(\frac{x}{x+1} > \right). There are times when that would be a more convenient form. > So I made a copy of EV3 called EV3P and added a feature like \(...\) > and \[...\] where a text string could be passed to the Parser, and > the Parser would produce the TeX form of the result. I used `...` > for in-line math and ``...`` for display math (and if either is used > within math mode already, it uses whatever that mode is). So you can > say > > Suppose \(f(x) = `sin(x/(x+1))`\) is a function of `x` > > for example. > > As I was using this, I found that I wanted to be able to control > which substitutions were being performed (for example, when writing > an answer box that allowed students to preview an essay answer that > includes mathematics, I didn't want them to be able to do command > substition via \{...\}). Rather than have yet another copy of EV3, I > decided to allow my new EV3P to have parameters where you could > control which substitutions are done. If the first argument to EV3P > is a HASH reference, this is taken to be the list of options. These > include processCommands, processVariables, processMath and > processParser. Using EV3P({processCommands=>0},$string) would not do > command substitution, for example. Setting processParser=>0 would > make EV3P functionally equivalent to EV3. > > The code for EVP3 is in my answerEssay.pl file (see http:// > cvs.webwork.rochester.edu/viewcvs.cgi/union_problib/examples/ > answerEssay/?cvsroot=Union+College). I think EV3P could be used to > replace EV3 to allow another simple means of entering mathematics. > (I'm also thinking of defining a parser Context in which more > mathematical notation is available, like limits, sums, integrals, and > so on, to make this more useful.) What do you think? You can try > essay5.pg in the directory linked above to experiment with the > results of EV3P. > > Davide > > > ---------------------------------------------------------------------- > --- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > OpenWeBWorK-Devel mailing list > Ope...@li... > https://lists.sf.net/lists/listinfo/openwebwork-devel |