// Numbas version: finer_feedback_settings {"name": "Generate a large random data set for efficient storage", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Generate a large random data set for efficient storage", "tags": [], "metadata": {"description": "

When saving the data necessary to resume an attempt, Numbas only saves the values of variables which use the random number generator.

\n

If you naively generate a large random sample in one variable, it'll be marked as a source of randomness so Numbas will save every value in the sample. Loading this value when you resume the attempt can be very slow.

\n

Instead, you can generate a seed value in one variable and then use it with the seedrandom function in the variable that stores your random list. Only the value of the seed needs to be saved.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Sample 1: {sample}

\n

\n

Another sample: {sample2}

", "advice": "", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"seed": {"name": "seed", "group": "Ungrouped variables", "definition": "random(1..10^9)", "description": "", "templateType": "anything", "can_override": false}, "sample": {"name": "sample", "group": "Ungrouped variables", "definition": "seedrandom(seed, repeat(random(1..1000), 1000))", "description": "

A sample of 1000 random numbers.

", "templateType": "anything", "can_override": false}, "sample2": {"name": "sample2", "group": "Ungrouped variables", "definition": "seedrandom(seed+1, repeat(random(1..1000), 1000))", "description": "

A different random sample, picked by adding 1 to the seed used for the other sample.

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["seed", "sample", "sample2"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "resources": []}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}