// Numbas version: finer_feedback_settings {"name": "Time for a journey", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["durationminutes", "endtimehours", "anstotalminutes", "endtimeminutes", "endtimestring", "mph", "ansminutes", "ansstring", "distancekm", "anshours", "kmpermile"], "name": "Time for a journey", "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

See step.

", "rulesets": {}, "parts": [{"stepsPenalty": 0, "prompt": "

You're planning a journey of $\\var{distanceKm}$ km and you want to arrive no later than $\\var{endTimeString}$

\n

You reckon your average speed will be $\\var{mph}$ mph.

\n

If 5 miles is about 8 km, what's the latest you should leave?  Please give your answer in 24-hour clock format (HH:mm)

\n

Answer: you should leave no later than [[0]].

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "displayAnswer": "{ansString}", "scripts": {}, "answer": "{ansString}", "marks": 1, "type": "patternmatch"}], "steps": [{"prompt": "

First  convert  {distanceKm}km  to  miles  by  dividing  by  8  and   multiplying  by  5.

\n

That's  $\\frac {\\var{distanceKm} \\times 5} {8}$

\n

Divide  that  by  your  average  mph  ({mph})  to  work  out  how  many   hours  that   will  take.

\n

That's  $\\frac {\\var{distanceKm} \\times 5} {8 \\times \\var{mph}} $

\n

Multiply  that  by  60  to  calculate  how  many  minutes  that  is.

\n

That's  $\\frac {\\var{distanceKm} \\times 5 \\times 60} {8 \\times \\var{mph}}$  = {durationMinutes}  minutes

\n

So  you  need  to  leave  {durationMinutes}  minutes  before  {endTimeString} =  ?

\n

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "scripts": {}, "marks": 0, "showCorrectAnswer": true, "type": "gapfill"}], "extensions": [], "statement": "

Calculating the time for a journey.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"durationminutes": {"definition": "distanceKm*60/(mph*kmPerMile)", "templateType": "anything", "group": "Ungrouped variables", "name": "durationminutes", "description": ""}, "endtimehours": {"definition": "random(12..15)", "templateType": "anything", "group": "Ungrouped variables", "name": "endtimehours", "description": ""}, "anstotalminutes": {"definition": "(endTimeHours*60+endTimeMinutes)-durationMinutes", "templateType": "anything", "group": "Ungrouped variables", "name": "anstotalminutes", "description": ""}, "endtimeminutes": {"definition": "random(0..5)*10", "templateType": "anything", "group": "Ungrouped variables", "name": "endtimeminutes", "description": ""}, "endtimestring": {"definition": "if(endTimeHours <10,\"0\" + endTimeHours,endTimeHours) + \":\" + if(endTimeMinutes < 10, \"0\" + endTimeMinutes, endTimeMinutes)", "templateType": "anything", "group": "Ungrouped variables", "name": "endtimestring", "description": ""}, "mph": {"definition": "random(2,3)*25", "templateType": "anything", "group": "Ungrouped variables", "name": "mph", "description": ""}, "ansminutes": {"definition": "mod(ansTotalMinutes,60)", "templateType": "anything", "group": "Ungrouped variables", "name": "ansminutes", "description": ""}, "ansstring": {"definition": "if(ansHours <10,\"0\" + ansHours,ansHours) + \":\" + if(ansMinutes < 10, \"0\" + ansMinutes, ansMinutes)", "templateType": "anything", "group": "Ungrouped variables", "name": "ansstring", "description": ""}, "distancekm": {"definition": "random(2,4,5)*40", "templateType": "anything", "group": "Ungrouped variables", "name": "distancekm", "description": ""}, "anshours": {"definition": "floor(ansTotalMinutes/60)", "templateType": "anything", "group": "Ungrouped variables", "name": "anshours", "description": ""}, "kmpermile": {"definition": "8/5", "templateType": "anything", "group": "Ungrouped variables", "name": "kmpermile", "description": ""}}, "metadata": {"description": "

Basic calculation exercise using distance in km, expected mph and desired arrival time (with the conversion factor for km to miles given).

\n


Based on a generic test QTS question.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Rob Cade", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/70/"}]}]}], "contributors": [{"name": "Rob Cade", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/70/"}]}