Random Stellar Magnitude Comparison Quiz Generator
Generate random stellar magnitude comparison quiz generator cards from explicit candidate scenarios by importing astronomy/magnitude-flux-ratio. Validate every candidate, including undrawn ones, and resolve the seed/source once for all draws. Preserves the imported calculator limitations; not a full operational setup plan or guaranteed pedagogical correctness.
Description
Sample supplied magnitude pairs and return the corresponding flux-ratio answers.
Astronomical magnitude comparisons use a logarithmic brightness scale. Sampling magnitude-pair scenarios can support practice with the corresponding flux ratios.
When to use this tool
Sample supplied magnitude pairs and return the corresponding flux-ratio answers.
- Prepare the supplied seed, count, withoutReplacement, candidateInputsJson fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter seed, count, withoutReplacement, candidateInputsJson. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.baseToolId, result.selectedCandidateIndices, result.unusedCandidateIndices, result.exercises. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Parse candidateInputsJson as an explicit corpus of complete inputs for the linked base calculator. Initialize the seeded random source and draw count candidate indexes using the replacement choice. Validate every candidate, including undrawn ones, through the base calculator, then execute each selected candidate and return its input and full answer. Also return baseToolId, selectedCandidateIndices in draw order and unusedCandidateIndices in original inventory order.1, 2
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| seed | Reproducibility seed for sampling; keep it with the inventory and output. | Nonblank text, at most 256 UTF-16 code units |
| count | Number of draws; draws select candidate positions. | Integer from 1 to 64; no more than inventory size without replacement |
| withoutReplacement | Explicit choice for without replacement; supply a boolean rather than a text label. | true or false |
| candidateInputsJson | List of complete JSON object input strings for the linked base calculator; every candidate, including unused ones, must be valid. | 1–128 strings, each at most 8,192 code units; total at most 131,072 |
For the JSON text fields, the following decoded structures show the example records before they are serialized into input strings. Keep field names, list nesting and value types as shown.
[
{
"field": "candidateInputsJson",
"decoded": [
{
"firstMagnitude": 0,
"secondMagnitude": 5
}
]
}
] | Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.baseToolId | Canonical identifier of the calculator used to produce each selected answer. |
| result.selectedCandidateIndices | Zero-based candidate positions in draw order; repeats are possible with replacement. |
| result.unusedCandidateIndices | Original candidate positions never drawn, returned in inventory order. |
| result.exercises | Selected candidate inputs paired with the base calculator’s complete answer objects, in draw order. |
{
"input": {
"seed": "tool.io/batch53",
"count": 1,
"withoutReplacement": true,
"candidateInputsJson": [
"{\"firstMagnitude\": 0, \"secondMagnitude\": 5}"
]
},
"output": {
"result": {
"baseToolId": "astronomy/magnitude-flux-ratio",
"selectedCandidateIndices": [
0
],
"unusedCandidateIndices": [],
"exercises": [
{
"input": {
"firstMagnitude": 0,
"secondMagnitude": 5
},
"answer": {
"firstOverSecondFlux": 100
}
}
]
}
}
} Limitations and assumptions
- Answers come from the linked magnitude/flux calculator and inherit its sign and ratio convention. No observations, extinction corrections or uncertainty measurements are generated.
- Seed must be nonblank and at most 256 UTF-16 code units; count is an integer from 1 through 64. Without replacement, count cannot exceed the available inventory. Sampling is reproducible with the same seed and implementation unless an execution context supplies its own random source.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- Candidate corpora contain 1–128 JSON object strings, each at most 8,192 code units and at most 131,072 code units in total, with nesting at most sixteen levels and no prototype-control keys. Every candidate is validated by the base tool. Nonfinite results and excessively large serialized outputs are rejected.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
Use the linked base calculator directly when you need one known answer, and use a sampled corpus for repeatable practice. Retain the candidate inventory, seed and tool/runtime versions with a result; caller-supplied asset tokens need their own provenance and rendering workflow.
References
Similar or alternative tools
- english adjective comparison quiz
English comparatives can use -er spelling changes or a preceding more.
- grocery unit price comparison quiz
Unit-price comparison requires offers to share a currency and a common quantity unit.