I teach high school science, and use WebWork extensively for Chemistry and Physics problems. My students have found it to be a valuable resource, but I would like to take it one step further. Currently, only a final answer is evaluated, but students in high school need to develop a good procedure for approaching problems that I would like to setup WebWork to evaluate (i.e. Givens, Unknowns, Formula, Substitution, and a Solution).

For instance, take a typical problem I might ask:

How much current passes through a $R ohm resistor that has a $V V potential difference across it?

DOCUMENT();

...

$R = random(50,1000,10);

$V= random(2,10,0.1);

$I= NumberWithUnits("$V/$R", "amp");

...

BEGIN_TEXT

How much current passes through a $R ohm resistor that has a $V V potential difference across it?

END_TEXT

ANS( $I->cmp() );

ENDDOCUMENT();

On paper, I would have my students answer as follows:

R = 220 ohm

V = 5 V

I = ?

I = V/R

I = 5/220

I = 0.023 A

I would like to setup a multi-line response where they can enter that online and have it evaluated by the system (I don't foresee an issue doing most of the programming myself, but I would appreciate any guidance in how to approach the problem). I had the following in mind:

- All variables used in a response must be defined/declared before use (the givens/unknown) - to me, this is basically a list - type answer. I would like to make it more flexible over time, but initially, I know how many lines should be givens/unknowns, and can simply split on the line break (and somehow evaluate lines 1 to 3 as a list). I want them to use specific variables - e.g. I for current, not allow them to make up their own variables.
- check the equation - I can use ImplicitEquation for this
- check the substitution - I don't need units here (but would like to accept them), I don't want a mathematically equivalent answer to be valid (i.e. I want the actual substitution in the right order, not the final answer)
- final answer - I can use the normal answer evaluator for this

Problems:

- Parsing - I have seen some references to multiline problems on the forums where the parsing creates an array. I don't think I would have too much difficulty with this.
- Passing to the correct evaluator - I think I would start with 4 inputs initially, and then try to move to one input. The issue I would have is that I want to allow a little flexibility in the number of lines. Which somewhat implies determining what type of response is on each line if everything is in one input. For example, to account for the following:
- some students might miss a step - I would like to be able to identify which step is missed and not just mark the entire problem incorrect. e.g. the following should say something like 'variables V and R used without being defined' (like a programming language)
I = V/R

I = 5/220

I = 0.023 A - some students might do some steps in multiple lines (especially a formula/substitution step) - e.g. someone might write:
R = 220 ohm

V = 5 V

I = ?

V = I*R

I = V/R

I = 5/220

I = 0.023 AOR

R = 220 ohm

V = 5 V

I = ?

V = I*R

5 = I*220

5/220 = I

I = 0.023 A

- some students might miss a step - I would like to be able to identify which step is missed and not just mark the entire problem incorrect. e.g. the following should say something like 'variables V and R used without being defined' (like a programming language)
- The equation like structure is something I haven't used WebWork to grade previously (e.g. a normal answer would be 0.023A, not I = 0.023A) - but I don't expect this is that difficult to resolve.

I don't think it is an easy problem - or that it has an easy solution - but it is one I would like to work on over the next few months, and any advice on tackling it would be much appreciated.