// Numbas version: exam_results_page_options {"name": "Find position of a number in a sequence of intervals", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"extensions": [], "functions": {}, "advice": "", "tags": [], "type": "question", "ungrouped_variables": ["points", "value", "position"], "name": "Find position of a number in a sequence of intervals", "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.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "", "parts": [], "rulesets": {}, "preamble": {"js": "", "css": ""}, "variables": {"points": {"description": "", "group": "Ungrouped variables", "definition": "[0,4,8,10,15,25]", "templateType": "anything", "name": "points"}, "value": {"description": "", "group": "Ungrouped variables", "definition": "random(min(points)..max(points))", "templateType": "anything", "name": "value"}, "position": {"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.

", "group": "Ungrouped variables", "definition": "filter(points[j]>=value,j,0..len(points)-1)[0]", "templateType": "anything", "name": "position"}}, "variable_groups": [], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}