Closed bgailer closed 6 months ago
Well, this is a problem. Currently, STACK-JS limits the targets it can affect to elements inside the `formulation '-class elements, and apparently, those things do not come out within such wrapping. As having dynamic things is something that would be nice to have even with model solutions, I guess we need to find a similar wrapper to detect those.
We cannot allow free access to all the elements on the page but hopefully model solutions are a thing that can be allowed.
A quick look at the DOM says to me that outcome
is probably the wrapper we would allow, but I will need to do some checking.
One thing that won't be supported, however, is targeting "fake inputs" within non "formulation" content using the new restrict to only this questions inputs logic, for such "fake inputs" one should use [[quid]]
(assuming it works with feedback). I am not keeping track of which question maps to a given model solution.
I saw no interesting use of the outcome
class in the Moodle code base, so we now allow targeting things inside that, which should fix this issue.
When I want to show or hide content in my question, I now use the new STACK-KS function
toggle_visibility
for that. This works great in the question text. However, I have a question where I want to show content in the general and specific feedback and in this case,toggle_visibility
does not work. This is the code I use inside the general feedback:The error says it could not find the element with that id (
Error: Failed to find element: "feedback-1"
), but the element is definitely present in the question. Maybe it is because the element is not inside the question text but inside the general feedback?