// Numbas version: exam_results_page_options {"name": "Find position of a number in a sequence of intervals", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"preventleave": false, "allowregen": true, "showfrontpage": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Given an ascending sequence of numbers, finds the index in the sequence of the first number greater than or equal to a given value.

"}, "name": "Find position of a number in a sequence of intervals", "statement": "", "advice": "", "type": "question", "variables": {"position": {"group": "Ungrouped variables", "templateType": "anything", "definition": "filter(points[j]>=value,j,0..len(points)-1)[0]", "description": "

Find the index of the first item in the list greater than or equal to the given value: filter out items less than the given value, then take the first item from what remains.

", "name": "position"}, "points": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[0,4,8,10,15,25]", "description": "", "name": "points"}, "value": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(min(points)..max(points))", "description": "", "name": "value"}}, "tags": [], "preamble": {"js": "", "css": ""}, "rulesets": {}, "extensions": [], "functions": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["points", "value", "position"], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "parts": []}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}