Tuesday, 1 December 2009

Text Problems now in (not online yet)

Text problems are now working. There are two kinds of such problems: one involving random variables and a numeric answer, and one simply a question/answer type problem. Both of these are supported by the same class, and both problems support solution comments, and a TextProblemSet object can be stored in the database, thus making it easy to add new problems from the web, for instance.
What really happens is that a TextProblemSet contains all of the problem strings, and when one wants a new problem, one can request one from the problem set. A random problem is chosen, and then a TextProblem itself is created with those strings. The TextProblem will take care of randomising numbers and computing the result by parsing and computing the supplied formula (if it is a numerical problem).
My original intention was that we should create TextProblems, and store these, but the way it tuned out might actually be better. We add problems to the TextProblemSet, which is kind of a database, that can spawn TextProblems.

No comments:

Post a Comment