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

sampling does not typically create variants #265

Merged
merged 3 commits into from
Dec 2, 2024

Conversation

dqnykamp
Copy link
Member

@dqnykamp dqnykamp commented Dec 2, 2024

This PR changes the behavior of <sampleRandomNumbers> and <samplePrimeNumbers> under the typical use case where the variantDeterminesSeed attribute is not set. In this case, these "sample" component no longer create variants. This is the correct behavior because there is no interaction between the sampled numbers and the variants. The previous behavior was confusing as these components created variants even though there was no difference between the variants.

If the variantDeterminesSeed attribute is set, then the sampled numbers do depend on the variants, and the old behavior is maintained.

To allow the detection of the value of variantDeterminesSeed before components are created, the attribute can now accept only the literal values "true" or "false"; it no longer accepts references to components, as such values could change dynamically.

@dqnykamp dqnykamp merged commit 4c99980 into Doenet:main Dec 2, 2024
3 checks passed
@dqnykamp dqnykamp deleted the sample-no-variants branch December 2, 2024 05:04
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.

1 participant