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

Problem sometimes fails to check answer with "Can't generate enough valid points for comparison" #596

Open
lahvak opened this issue Sep 19, 2019 · 6 comments

Comments

@lahvak
Copy link
Contributor

lahvak commented Sep 19, 2019

The problem is Library/PCC/BasicAlgebra/ComplexNumber/complexSolutions25.pg

Most of the time the problem seems to work fine, but sometimes, for example with random seed 2151, students get the message about not enough valid points. That would indicate some sort of domain issues, but I do not even see how a domain can enter into the question here.

@jwj61
Copy link
Member

jwj61 commented Sep 19, 2019

Works for me with that seed. Maybe there was an update to the problem or to the macro which is doing the answer checking? When was the last time you pulled the OPL from github?

@lahvak
Copy link
Contributor Author

lahvak commented Sep 20, 2019

Just now! Problem still persists.

@dlglin
Copy link
Member

dlglin commented Sep 20, 2019

I get the same error with that seed on WW2.14,PG2.14. Since the answers are cast as Formula objects, I could see how there is an implicit domain, but I also don't see why that would affect answer checking if the correct answer is a complex constant. I don't know enough about complex answer checkers to suggest a fix. Perhaps @Alex-Jordan can take a look.

Another issue with this problem is that the help text could be misleading. The example answer is 'x=1,x=-1', but the variable name in the question is randomized, so students may have to enter 'r=...' for example. Can the help text be changed to "$var=1,$var=-1"?

@Alex-Jordan
Copy link
Contributor

The problem uses contextLimitedRadicalComplex.pl and the "LimitedRadicalComplex" context. I do not have confidence that this was built well. It goes back to when my understanding of many things was weaker.

The point of using Formula and this context is so that something like sqrt(-4) or sqrt(4)i can be recognized as equal to 2i, but different, and there can be a message about an answer not being in the right form ("most simplified").

Doing this relies on bizarroArithmetic, which originally was not designed for complex numbers. That is when this contextLimitedRadicalComplex.pl was built. Recently-ish, bizarro was upgraded to handle complex numbers. Maybe that is not playing well now with contextLimitedRadicalComplex.pl.

I'd guess what needs doing is cleaning up contextLimitedRadicalComplex.pl to meet its intended purpose. https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/macros/PCC/contextLimitedRadicalComplex.pl

I'm not sure I see a short term patch to the problem itself that doesn't involve gutting it and just using a more basic approach.

@lahvak
Copy link
Contributor Author

lahvak commented Sep 24, 2019

Also, problems using this context accept solutions in form 2i sqrt(5), but when given 2 sqrt(5) i, they will complain that it is not simplified enough. For example PCC/BasicAlgebra/ComplexNumber/complexSolutions26.pg.

@Alex-Jordan
Copy link
Contributor

If anyone feels like diving into context building, I think the right thing to do is to make a version of:
https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/macros/PCC/contextFiniteSolutionSets.pl

that works with complex numbers. This context brought together all that I could muster for answers in basic algebra, where "simplified" form is important, and there are also several common formats that ideally should all be acceptable. The commentary at the start of the file explains what this context is supposed to allow for.

This approach is a more recent effort. contextLimitedRadicalComplex.pl is a very old attempt at similar goals, but the attempt was made long before I had a clue what was really going on.

On the other hand, based on a message from Davide once, to make this work with complex numbers will be a challenge. Unlike in this file, where the context is based on a copy of the Interval context (I think just to get the Set Math Object), for complex numbers it would have to start with something else.

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

4 participants