// Numbas version: finer_feedback_settings {"name": "Tick box for \"this is impossible\"", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Tick box for \"this is impossible\"", "tags": [], "metadata": {"description": "
The student is asked to write a number with a certain property, or tick a box labelled \"this is impossible\" if it can't be done.
\nA custom marking algorithm on the gap-fill part first checks if the student ticked the box. If they did, their answer is marked correct if it really is impossible. If they didn't tick it, their number is checked against the required property.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {"want_positive": {"name": "want_positive", "group": "Ungrouped variables", "definition": "random(true,false)", "description": "Should the square of the student's number be positive? If false, it should be negative.
", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["want_positive"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "student_impossible (Did the student tick \"This is impossible\"?): studentanswer[1][0][0]\n\nmark:\n if(student_impossible,\n assert(studentanswer[0]=\"\",\n fail(\"If you tick 'This is impossible', leave the number box blank.\")\n );\n correctif(not want_positive)\n ,\n let(\n number_res,mark_part(gaps[0][\"path\"],studentAnswer[0]),\n student_number, number_res[\"values\"][\"interpreted_answer\"],\n assert(number_res[\"valid\"], \n fail(\"You must either write a valid number or tick 'This is impossible'.\")\n );\n correctif(if(want_positive, student_number^2>0, student_number^2<0))\n )\n )\n\ninterpreted_answer: studentanswer", "extendBaseMarkingAlgorithm": false, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Write a number whose square is {if(want_positive,'positive','negative')}.
\nOr if it can't be done, tick \"this is impossible\" and leave the box blank.
\n\n[[0]]
\n[[1]]
", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Number", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "if(want_positive,1,0)", "maxValue": "if(want_positive,1,0)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "m_n_2", "useCustomName": true, "customName": "Is it impossible?", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "checkbox", "displayColumns": 0, "minAnswers": 0, "maxAnswers": 0, "warningType": "none", "showCellAnswerState": true, "choices": ["This is impossible."], "matrix": [0], "distractors": [""]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "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/"}]}