moodle-qtype_formulas icon indicating copy to clipboard operation
moodle-qtype_formulas copied to clipboard

Access to grading variables and answers in part's feedback?

Open PhilippImhof opened this issue 4 years ago • 3 comments

In the general feedback, we can use all global variables. In the part's feedback, we can also use the part's local variables.

However, we are currently not able to use grading variables or the user's answers in the feedback. This would be a nice improvement to an already great plugin. It would allow, for example, to give more specific feedback in case of partially correct answers.

(I also reported this to the Moodle Tracker. What platform do you prefer?)

PhilippImhof avatar Jan 25 '21 13:01 PhilippImhof

Philipp,

You can use the user's answers in the part's feedback with the following syntax: {=_0}, {=_1}, etc. (you have to put the = sign).

Both global and part's local variables can be used in a part's feedback. With these variables and the students' answers, you can probably build any feedback. However, you are saying that it may be convenient to be able to use the grading variables in the part's feedback. Why not? Note that if the same name is used for a global variable and a part's local variable, the value of the part's local variable supersedes that of the global variable when the variable is used in the part's feedback. With the possibility of again using the same name for a grading variable, the value of this variable should probably supersede that of the part's variable. It will be the responsibility of the teacher to use different names for global, part's local and grading variables if he/she wants to use them in a part's feedback. Of course, at least for now, the scope of the grading variables should remain limited to their part.

dbauer-ets avatar Oct 18 '22 05:10 dbauer-ets

I would like to second the feature request. To me, that would be a great enhancement. Pinpointed feedback would be the only reason for me to start using STACK...

If grading variables could be used in the feedback, one could, for example, stitch together a string that informs why points we subtracted and in which way the solution is incorrect. This would help both, students and developers (with debugging).

FloMiLe avatar Nov 29 '22 14:11 FloMiLe

Hi all, I am using a workaround: I declare global arrays, and overwrite them in grading variables section of the different parts of the question. So I can use the actual value in the feedback. Problems occurring by using adaptive mode! I am using this for explaining errors (like FloMiLo would like) and for taking care of forwarded errors! You can check this on my experimental site; https://moodle.jotro.net/course/view.php?id=43 (or on many examples on that site)

jotroT avatar Feb 21 '23 22:02 jotroT

This will be solved in PR #62

PhilippImhof avatar Jan 28 '25 20:01 PhilippImhof

This is great news, I look forward to using this new feature!

FloMiLe avatar Jan 30 '25 00:01 FloMiLe

@FloMiLe If you want to give it a try on a testing instance, you can find the future version 6.0.0 in this branch. It is fully functional (i. e. no known new bugs) and backwards compatible.

PhilippImhof avatar Jan 31 '25 10:01 PhilippImhof

@PhilippImhof I don't have a testing instance, but would be willing to test it on my production instance (with the option to fall back on a backup). Are the new features of 6.0.0 already documented somewhere?

FloMiLe avatar Jan 31 '25 11:01 FloMiLe

It is possible to test it on a production instance, but I would not recommend it, because there is a change in the way how attempts are stored. Hence, quiz attempts taken with the 6.0.0 would probably not work properly anymore when going back to 5.x. Questions would work, as long as new features are not used. And attempts started with 5.x will work when using 6.0.0.

You can find a summary of the new features in the #62. From the user's perspective, these are not huge changes, but rather some optimisations that eliminate old limitations and workarounds, like the need to use join() to concatenate two strings or pick() instead of a ternary when strings were involved. One new feature not mentioned in that post is the possibility to use variables for the range (and step) of a for loop.

PhilippImhof avatar Jan 31 '25 12:01 PhilippImhof

@FloMiLe I have added some functionality that will allow switching back to 5.x after having tried upcoming 6.0.0. (Of course, switching back only works for attempts that do not contain questions which use any of the new syntax features. Attempts at questions using new syntax would have to be deleted.)

There's one thing to keep in mind: Moodle actively blocks downgrading plugins, based on the version code. Currently, the beta version of 6.0.0 still sues the same version code as 5.3.4.post0. Therefore, if one installs the beta version, Moodle does not realise this and does not start the internal upgrade process. One has to go to Site Administration -> Development -> Purge caches and click "Purge all caches" after installing the new version and after switching back to the old version.

So, if you want to give it a try, I'd appreciate your feedback. Nothing should break, but I highly recommend making a full backup…

PhilippImhof avatar Feb 08 '25 10:02 PhilippImhof