STACK Question Tests

STACK Question Tests

by Joshua Bragg -
Number of replies: 4

I'm having some problems getting my question test to work the way I think they should using STACK.  In some cases it appears to evaluate things that I add in ans1 and it others it doesn't...  Everything appears to work fine in the Preview Question view however.

Some examples:

Question 1: from quick start authoring guide

n : rand(5)+3;
v : rand([x,s,t]) /* Set v randomly to x, s, or t */
p : rand([sin(n*v),cos(n*v)]);

Differentiate @p@ with respect to @v@.

Question tests:

Test 1
Test Input = diff(p,v)
Value Entered = +cos(4*t)*(1*4+0*t)
Displayed as = +cos(4*t)*(1*4+0*t)
Scored Correctly and everything looks good

Test 2
Test Input = integrate(p,v)
Value Entered = integrate(p,v)   <---- Why isn't this evaluated?
Displayed as = p*v  <---- Huh?
However this gets scored correctly with the feedback that "You appear to have integrated by mistake" like it should.

Test 3
Test Input = n*p
Value Entered = 4*sin(4*t)
Displayed as = 4*sin(4*t)
This gets scored correctly as incorrect and the test passes as it should.

Now to a different question...

Question 2: 

a:rand_with_prohib(-10,10,[0])
b:rand_with_prohib(-10,10,[0])

Factor @expand((x+a)*(x+b))@

Question Tests:

Test 1
Test Input = (x+a)*(x+b)
Value entered = (x+(-9))*(x+(-6))
Displayed as = (x-9)(x-6)
Passes AlgeEquiv Test and FacForm Test and graded correctly

Test 2
Test Input = expand((x+a)*(x+b))
Value entered = (x+(-9))*(x+(-6))  <----- Why is this not expanded?
Displayed as = (x-9)(x-6)
Passes AlgEquiv Test and FacForm test but this test was designed so that it would fail the FacForm Test...  So we made Test 3...

Test 3
Test Input = x^2+(a+b)*x+(a*b)
Value entered = x^2+(-9+(-6))*x+(-9)*(-6)
Displayed as = x^2 + (-9-6)x-9(-6)
Passes AlgEquiv Test and Fails FacForm test as it should and the test passes.

Now that I've typed all this out, for future reference, if I export a STACK question, say as Moodle XML, does it export the deployed questions and question tests also?

Average of ratings: -
In reply to Joshua Bragg

Re: STACK Question Tests

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Moodle XML export includes deployed versions and question tests.

I can't answer the rest. Hopefully Chris will see this.

In reply to Joshua Bragg

Re: STACK Question Tests

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks for posting such a clear report of the problem, and for taking the time to investigate this. The problem is caused by a combination of "evaluation" and "simplification". Test inputs are always unsimplified regardless of the question or PRT option setting. Please use ev(...,simp) to simplify part or all of the test input expressions. In your case this would mean you enter the test case input as follows

ev(expand((x+a)*(x+b)),simp)

ev(integrate(p,v),simp)

There is a lot more in the maxima documentation about evaluation, e.g. http://maxima.sourceforge.net/docs/manual/en/maxima_8.html#IDX281

I'm not sure why you get p*v in the integration example. This looks like "p" is being treated like a constant and not a variable. I can't reproduce this behaviour on my system. What version of maxima are you using?

Chris

In reply to Christopher Sangwin

Re: STACK Question Tests

by Joshua Bragg -

Ahh... thanks. That makes sense. I had noticed it wasn't simplifying but didn't put it together. 

I'm using Maxima 5.23.2.