Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplification issue with bespoke validators #1318

Open
bgailer opened this issue Nov 20, 2024 · 1 comment
Open

Simplification issue with bespoke validators #1318

bgailer opened this issue Nov 20, 2024 · 1 comment

Comments

@bgailer
Copy link
Contributor

bgailer commented Nov 20, 2024

Hello,

I have used the bespoke validators quite a lot recently, and I want to say that they are a really nice feature. One thing I noticed though is that when simplification is turned on, or I have simp: true; at the end of the question variables, the student answer that my bespoke validator receives as argument is already simplified. The validation block shows the unsimplified answer, but the bespoke validator receives the simplified answer.

For instance, sin(%pi) gets validated in the block as sin(%pi) but inside the bespoke validator it is 0.
I would normally expect the unsimplified version of the student's answer as bespoke validator argument, unless I use the extra option simp for the input. Is this by design or due to the way bespoke validators are executed?

@sangwinc
Copy link
Member

Yes, I've had a very quick preliminary look.

  1. If you put simp:true in the question variables then I can reproduce the problem.
  2. If you don't put simp:true in the question variables then I can't reproduce the problem.

I can't immediately figure out why this is the case, but simp is not defined as a context variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants