// Numbas version: exam_results_page_options {"name": "Pre-submit task: wait for a while", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Pre-submit task: wait for a while", "tags": [], "metadata": {"description": "

This question defines an otherwise-pointless pre-submit task of \"wait for a while\" before marking the student's answer, in order to demonstrate how to use the pre-submit tasks feature.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {"wait": {"parameters": [["time", "number"]], "type": "anything", "language": "javascript", "definition": "var promise = new Promise(function(resolve,reject) {\n setTimeout(function() {\n resolve({\n seconds_waited: new Numbas.jme.types.TNum(time)\n })\n },time*1000);\n});\nreturn new Numbas.jme.types.TPromise(promise);"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "pre_submit: [wait(studentNumber)]\n\nmark:\n feedback(\"I waited {pre_submit['seconds_waited']} seconds before marking your answer.\");\n apply(base_mark)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Write a number of seconds to wait before having your answer marked.

", "minValue": "1", "maxValue": "1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "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/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}