// Numbas version: exam_results_page_options {"name": "Add weight to a randomly picked number", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Add weight to a randomly picked number", "tags": [], "metadata": {"description": "
Pick from the range -5..5, but make 0 more likely.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {"weighted_random": {"name": "weighted_random", "group": "Ungrouped variables", "definition": "random(list(-5..5)+repeat(0,5))", "description": "Turn the range -5..5
into a list, then add some extra zeros on to make 0 more likely.
Try setting the variable testing condition to weighted_random=0
to see how often 0 comes up.