<samplePrimeNumbers/>
<samplePrimeNumbers/> is a Math
component that samples random prime numbers from a specified range of values.
Attributes and Properties
Attributes for <samplePrimeNumbers>
Other (6)
asListboolean. Default value: true. Whether to render the items separated by commas (true) or with no separator (false).
numberList. Primes to exclude from the sample.
integer. Default value: 2. Lower bound (inclusive) of the prime range to sample from.
number. Default value: 1. Number of prime samples to draw.
integer. Default value: 100. Upper bound (inclusive) of the prime range to sample from.
variantDeterminesSeedboolean. Whether the document's variant index determines the random seed.
Common to all components (9)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
hideboolean. Default value: false. Whether to hide this component from the rendered output.
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <samplePrimeNumbers name="s">
Other (5)
$s.excludenumberList. Primes to exclude from the sample.
$s.frominteger. Lower bound (inclusive) of the prime range to sample from.
$s.numSamplesnumber. Number of prime samples to draw.
$s.tointeger. Upper bound (inclusive) of the prime range to sample from.
$s.variantDeterminesSeedboolean. Whether the document's variant index determines the random seed.
Common to all components (4)
$s.doenetMLtext. The DoenetML source code that produced this component.
$s.hideboolean. Whether to hide this component from the rendered output.
$s.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$s.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Default <samplePrimeNumbers
Without any attributes specified, the default sampling range is . In this example, there are two ways to view different samples: selecting another variant, or refreshing the page.
Example: Using a re-sampling button
Without any attributes specified, the default sampling range is . The <callAction>
button can be used to resample the value.
Attribute Examples
Attribute Example: numSamples
The <samplePrimeNumbers/> component is used with the numSamples attribute
to select multiple random values in the default interval .
Attribute Example: from, to
The <samplePrimeNumbers/> component is used with the from and the to attributes
to modify the default selection interval. Note that the interval endpoints provided do not need to
be primes.
Attribute Example: exclude
Values can be excluded from the sampled range using the exclude attribute.