Fix an issue with the graphtool default number line interval checker. #1184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The checker for intervals compares the interval graphed by the student to the correct interval as MathObjects. However, the context of the graphtool is a modified
Point
context. This generally is fine. A half open or half closed interval or an unbounded interval is still an interval and the comparison works. However, a bounded open interval or a bounded closed interval both end up being points. As a result if the correct answer is a bounded open interval and the student graphs an interval with the same endpoints, but closed, the current checker counts that as correct.To fix this, this sets the '[' paren to always be an interval the same as in the
Interval
context. The graphtool answers given by javascript will never need that to be anything else, so this works.A minimal working example that demonstrates the issue is the following problem:
For the develop or main branch if you graph the closed interval from 1 to 5, it is counted correct. Of course, with this pull request it is incorrect.
Note that for all branches and this pull request the open interval from 1 to 5 is counted correct. Of course a half open (or half closed) interval from 1 to 5 and all other incorrect answers are counted incorrect.
You can also experiment with other correct answers, and they all should work with this pull request.