Skip to content

Fix several issues with the contextInteger.pl macro. #1297

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

drgrice1
Copy link
Member

Several times in the file the variable $self is used where it is not defined. So if the $self->Error method is actually called it results in the error "can't call Error on an undefined value".

Also the wrong counts are used in the randomPrime method resulting in unexpected behavior.

Finally, if the $end parameter to the _getPrimesInRange is prime, then include it in the returned primes in the range. Thus, the randomPrime method will potentially be the $end parameter. I.e., randomPrime(1, 11) could return 11.

This is to address the things discussed in #1296.

@drgrice1 drgrice1 force-pushed the context-integer-fixes branch from e98ba98 to 815b571 Compare July 23, 2025 01:07
Several times in the file the variable `$self` is used where it is not
defined.  So if the `$self->Error` method is actually called it results
in the error "can't call Error on an undefined value".

Also the wrong counts are used in the `randomPrime` method resulting in
unexpected behavior.

Finally, if the `$end` parameter to the `_getPrimesInRange` is prime,
then include it in the returned primes in the range.  Thus, the
`randomPrime` method will potentially be the `$end` parameter.  I.e.,
`randomPrime(1, 11)` could return 11.

This is to address the things discussed in openwebwork#1296.
@drgrice1 drgrice1 force-pushed the context-integer-fixes branch from 815b571 to 5e6734f Compare July 23, 2025 01:08
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

Successfully merging this pull request may close these issues.

2 participants