IDIAMath / idiamath.github.io

1 stars 0 forks source link

Moodle STACK connect Question Text and Question Variables (Maxima) #26

Open BlackBlueGreens opened 2 years ago

BlackBlueGreens commented 2 years ago

here is the problem: https://stackoverflow.com/questions/72910342/moodle-stack-connect-question-text-and-question-variables-maxima elaboration: create a question in capquiz --> copy paste the code --> run the question --> type x*y in the input field --> click draw --> press f12 or inspect element. The code the input you wrote (var funcExpr2) and sends it to maxima (ez:funcExpr2). Now there is also other variables in maxima that do different things, i console.log all of them, but they dont provide the expected result.

BlackBlueGreens commented 2 years ago

The problem could very well be for example when you perform diff on funcExpr2, say your input is xy and so funcExpr2 is xy, but when you perform diff it performs it on quit literally funcExpr2 instead of x*y which is what it is equal to.

jonasjul commented 2 years ago

It doesn't look like the value of funcExpr2 is sent to maxima - it simply lives as a javascript variable. You shouldn't need to update it anyway: The function the student gives is stored in "ans1", and is available to maxima when the answer is graded.

BlackBlueGreens commented 2 years ago

Correct. It doesn't seem like its possible to achieve what I am trying to achieve, since i want maxima to run before the answer is submited. The idea was that when the student clicks 'Draw', JS takes whatever function from the input field and draws it, along side some of its partial derivatives. We can only find its partial derivative's via operations in maxima; maxima has to run when the user clicks draw, rather than when they submit.

jonasjul commented 2 years ago

We should have some means for the students to investigate the partial derivatives of the function they are tasked to find. Automatically computing the partial derivatives in maxima and plotting them when the student supplies a function would have been very neat - But I don't see a way to call maxima WHILE the student is working on the question. After submission we can work on the students function with maxima in the "feedback variables" field; Which means perhaps can show an interactive plot from the feedback field in the response tree (I have not checked if jsxgraph-blocks work here). If we change the question behaviour to "interactive with multiple tries" this could perhaps accomplish what we want.

Alternatively, it could perhaps be enough to have jsxgraph also show the tangent plane at a dragable point in the domain - This also eludes to /shows the sign of the partial derivatives. Check out the "3d function graph" example found here: https://jsxgraph.uni-bayreuth.de/~alfred/jsxdev/3D/demo3d.html To accomplish this, we would probably need to use finite differences to approximate the partial derivatives: https://folk.ntnu.no/leifh/teaching/tkt4140/._main007.html