Differentiation in the STACK question type

Differentiation in the STACK question type

by Yorick Spenrath -
Number of replies: 6

Hi all,

On the advice of the kind respodents on this thread, I have installed the STACK question type to create questions that require students to reason algebraically. One of the questions is to give the time derivative of an expression.

The expresion is : [l1*sin(theta(t)), -l1*cos(theta(t)),0] (which is the position of a point mass at a distance l1 from the origin, under an angle of theta(t) with the negative y-axis).

I sucessfully differentiated this in the STACK question editor, the quiz attempt review shows that the answer is supposed to be:


Which is correct, but now I would like the student to be able to answer that, since we do not want to provide a value or function for theta, but we do explicitly want it to depend on t. In the student review, the suggested way to type the answer is given as:

[l1*cos(theta(t))*'diff(theta(t),t,1),l1*sin(theta(t))*'diff(theta(t),t,1),0]

However, this is not allowed, since "Apostrophes are not permitted in responses" (as far as I know this is not something I prohibited). Leaving out the two apostrophes is interpreted as:


Which is neither the correct answer, nor an appropriate way to display the first derivative. Using diff on the original position vector in the students response does not work either (nor would it be educative).

My first question: is this in any way solvable?

My current workaround is by defining the first derivative of theta(t) as phi(t). Though this is not desirable, the idea is similar to the default course notation, where:

phi(t) := d/dt theta(t) = \dot{theta}(t)

This workaround works fine, though it does not allow the ease of using diff in the question editor (my task is to create the concept for testing, but at some point the responsible lecturers and their student assistants should be able to create questions). Furthermore the workaround deviates too much from the course notation.


My questions are:

Is there a way to overcome the first problem, i.e. allow students to enter the derivative of theta(t) with respect to t (ans also without allowing students to use diff on the whole equation)?

Is there a way to use the symbol $\dot{\theta}\(t\)$ (to replace the work-around using $\phi\(t\)$)?

Is there a way to combine the ease of the teacher using diff that allows the resulting d/dt $\theta$ (t) to be equal to $\phi$(t)?


I am using Moodle version 3.5 (as a standalone Windows version for testing, but likely on a version 3.5 moodle on a server once it is deployed) and STACK version 4.2.1 for Moodle 3.0+ (2018080600)


Many thanks in advance,

With kind regards,

Yorick

Average of ratings: -
In reply to Yorick Spenrath

Re: Differentiation in the STACK question type

by Yorick Spenrath -

I see something got messed up in the last two questions, here they are again without latex attempt:


Is there a way to use the symbol theta^dot (t) (to replace the work-around using phi (t))?

Is there a way to combine the ease of the teacher using diff that allows the resulting d/dt theta t to be equal to phi (t)?



In reply to Yorick Spenrath

Re: Differentiation in the STACK question type

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

I am going to move this thread to the Mathematics tools forum, becuase that is where most STACK discussion takes place, so you are more likely to get an answer there.

In reply to Tim Hunt

Re: Differentiation in the STACK question type

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

Yorick

I fixed the bug in the display of differentiation signs recently:

https://github.com/maths/moodle-qtype_stack/commit/8d01440ce509cf39293fc63b678387a1d1232e32

This is caused because student's answers are always interpreted with simplification off (simp:false in Maxima).

The display function needs to simplify its arguments to the diff function, and I've fixed this.

For this reason, students don't need to type in 'diff, they just type diff.

See the screen shot below.

There is currently no way to have dots.  But Maxima does have the function "derivabbrev" (have a look at the docs).

If you'd like to add an option for dots, and write the code, I'll happily incorporate it.  We just haven't got that far yet!  For pointers of where to look in the Maxima code, and in STACK, see the commit above for hints.  If you, or anyone else, is serious about adding this functionality I'll happily help, but we are in week 0 of term and I have 550 students to look after for a couple of weeks....

Chris


Attachment STACKDiff.png
In reply to Christopher Sangwin

Re: Differentiation in the STACK question type

by Yorick Spenrath -

Dear Chris,

Thank you for the response and the solution, it works like a charm.

If I understand correctly (I am still figuring out the working of Stack), Stack converts the Maxima expression ("interpreted as follows"), but not all Maxima expressions are implemented (yet). Would that, similar to the dots, mean that for example the following expression could be interpreted correctly (as \theta_1) if implemented?

[l1*cos(theta1(t))*diff(theta1(t),t,1),l1*sin(theta1(t))*diff(theta1(t),0)]

(Stack hints the student that asterisks should be added betweet "theta1" and "(t)")

(I am aiming at using a subscript to allow the teacher add another angle in the question)

I will see if I can make any steps in that implementation, if my supervisor allows me to invest the time. Thank you for the pointers!

With kind regards,

Yorick

In reply to Yorick Spenrath

Re: Differentiation in the STACK question type

by Yorick Spenrath -

I have been using the updated Stack plugin to allow students to enter diff(theta(t),t,1), as described. However, this introduces the possibility to simply apply diff to the full answer (i.e. diff([l1*sin(theta(t)), l1 * cos(theta(t)),0],t,1), I was wondering if I can make the distinction between the two, allowing the former and prohibiting the latter, i.e.:


diff([l1*sin(theta(t)), l1*cos(theta(t)), 0],t,1) is not accepted as input.

[l1*cos(theta(t)) * diff(theta(t),t,1), -l1*sin(theta(t)) * diff(theta(t),t,1), 0] is accepted as input.


As I expected, forbidding "diff" did work, since then the second option is not allowed anymore. Anyone ideas on this topic?


In reply to Yorick Spenrath

Re: Differentiation in the STACK question type

by Stephan Bach -

Hey Yorick,

I would say, just use EqualComAss as the answer test and do not forbid to use "diff". This should work fine.

Stephan.