<samplePrimeNumbers/>
<samplePrimeNumbers/> is a Math
component that samples random prime numbers from a specified range of values.
Attributes and Properties
Attributes for <samplePrimeNumbers>
Number display (5)
avoidScientificNotationIn developmentboolean. Default value: false. Whether to render numbers in full decimal form rather than scientific notation.
displayDecimalsIn developmentinteger. Default value: 2. Number of decimal places to display when rendering this number.
displayDigitsIn developmentinteger. Default value: 3. Number of significant digits to display when rendering this number.
displaySmallAsZeroIn developmentnumber. Default value: 1e-14. Threshold below which numbers are displayed as zero.
padZerosIn developmentboolean. Default value: false. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
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.
fromAdded in 0.7.13integer. Default value: 2. Lower bound (inclusive) of the prime range to sample from.
number. Default value: 1. Number of prime samples to draw.
toAdded in 0.7.13integer. 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">
Number display (5)
$s.avoidScientificNotationIn developmentboolean. Whether to render numbers in full decimal form rather than scientific notation.
$s.displayDecimalsIn developmentinteger. Number of decimal places to display when rendering this number.
$s.displayDigitsIn developmentinteger. Number of significant digits to display when rendering this number.
$s.displaySmallAsZeroIn developmentnumber. Threshold below which numbers are displayed as zero.
$s.padZerosIn developmentboolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Other (5)
$s.excludenumberList. Primes to exclude from the sample.
$s.fromAdded in 0.7.13integer. Lower bound (inclusive) of the prime range to sample from.
$s.numSamplesnumber. Number of prime samples to draw.
$s.toAdded in 0.7.13integer. 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 (8)
$s.disabledIn developmentboolean. Whether this component is disabled and cannot be interacted with.
$s.doenetMLtext. The DoenetML source code that produced this component.
$s.fixedIn developmentboolean. Whether this component's value is fixed and cannot be modified.
$s.fixLocationIn developmentboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$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.