// Numbas version: exam_results_page_options {"name": "Write a formula based on a word statement and apply it to a given value", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"tags": [], "parts": [{"scripts": {}, "extendBaseMarkingAlgorithm": true, "stepsPenalty": 0, "type": "gapfill", "showCorrectAnswer": true, "prompt": "

Write a formula for the number of students, $S$, in terms of the number of professors, $P$.

\n

[[0]]

", "marks": 0, "showFeedbackIcon": true, "variableReplacements": [], "steps": [{"scripts": {}, "extendBaseMarkingAlgorithm": true, "shuffleChoices": false, "minMarks": 0, "type": "1_n_2", "showCorrectAnswer": true, "prompt": "

Given the relationship stated above, what would you expect there to be more of: students, or professors?

", "marks": 0, "showFeedbackIcon": true, "showCellAnswerState": true, "variableReplacements": [], "choices": ["More students", "More professors"], "distractors": ["", ""], "matrix": ["1", 0], "maxMarks": 0, "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "displayColumns": 0, "displayType": "radiogroup", "unitTests": []}, {"scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "information", "showCorrectAnswer": true, "prompt": "

Try to write your formula in the form

\n

\$S = \\ldots \$

\n

The right-hand side should be in terms of the variable $P$.

", "marks": 0, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "unitTests": [], "variableReplacements": [], "customMarkingAlgorithm": ""}], "sortAnswers": false, "variableReplacementStrategy": "alwaysreplace", "gaps": [{"scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "jme", "showCorrectAnswer": true, "expectedVariableNames": [], "marks": "0", "showFeedbackIcon": true, "variableReplacements": [], "failureRate": 1, "checkingType": "absdiff", "checkVariableNames": false, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkingAccuracy": 0.001, "answer": "{formula}", "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "vrange: 1..100#1\n\n\nvset (The sets of variable values to test against):\n //some values satisfying the formula\n repeat(\n let(p,random(vRange),\n [\"p\":p, \"s\": 6p]\n ),\n settings[\"vsetRangePoints\"]\n )\n +\n //some completely random values, assumed not to satisfy the formula\n repeat(\n [\"p\": random(vRange), \"s\": random(vRange)],\n settings[\"vsetRangePoints\"]\n )\n\nagree (Do the student's answer and the expected answer agree on each of the sets of variable values?):\n map(\n try(\n resultsEqual(\n unset(question_definitions,eval(studentexpr,vars)),\n unset(question_definitions,eval(correctexpr,vars)),\n settings[\"checkingType\"],\n settings[\"checkingAccuracy\"]\n ),\n message,\n warn(translate(\"part.jme.answer invalid\",[\"message\":message]));\n fail(translate(\"part.jme.answer invalid\",[\"message\":message]));\n false\n ),\n vars,\n vset\n )", "showPreview": true, "unitTests": []}], "customMarkingAlgorithm": "", "unitTests": []}, {"scripts": {}, "extendBaseMarkingAlgorithm": true, "minValue": "num_students", "type": "numberentry", "showCorrectAnswer": true, "prompt": "

There are {num_professors} professors at the University of Qwghlm.

\n

Use your formula to calculate the number of students.

", "marks": 1, "mustBeReduced": false, "showFeedbackIcon": true, "variableReplacements": [{"part": "p0g0", "must_go_first": false, "variable": "formula"}], "mustBeReducedPC": 0, "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "variableReplacementStrategy": "alwaysreplace", "customMarkingAlgorithm": "formula_satisfied: eval(formula,[\"s\":studentNumber,\"p\":num_professors])\n\nmark (Mark the student's answer):\n apply(validNumber);\n if(formula_satisfied,\n correct(\"Your number satisfies the formula you gave.\"),\n incorrect(\"Your number does not satisfy the formula you gave.\")\n )", "maxValue": "num_students", "correctAnswerFraction": false, "unitTests": []}], "preamble": {"js": "", "css": ""}, "functions": {}, "advice": "

#### a)

\n

For every professor, there are {factor} students.

\n

\$S = \\simplify[]{{factor} P} \$

\n

#### b)

\n

Substitute $P = \\var{num_professors}$ into the formula:

\n

\\begin{align}
S &= \\simplify[]{{factor} * P} \\\\
&= \\simplify[]{{factor} * {num_professors}} \\\\
&= \\var{num_students}
\\end{align}

Given a statement in words of a relationship between two variables, write down a corresponding formula. It's marked correct if values satisfying the relationship satisfy the formula, and values not satisfying the relationship don't.

\n

Then, given a value for one of the variables, work out the value of the other one. They're substituted into the formula given in the first part and marked correct if it's satisfied.

\n

Both parts use custom marking algorithms.

", "licence": "Creative Commons Attribution 4.0 International"}, "extensions": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "statement": "

At the University of Qwghlm, there are {factor} times as many students as professors.

", "rulesets": {}, "name": "Write a formula based on a word statement and apply it to a given value", "ungrouped_variables": ["formula", "num_professors", "factor", "num_students"], "variables": {"factor": {"name": "factor", "description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..10)"}, "num_professors": {"name": "num_professors", "description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(5*factor..300#(5*factor))"}, "num_students": {"name": "num_students", "description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "factor*num_professors"}, "formula": {"name": "formula", "description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "expression(\"S={factor}P\")"}}, "variable_groups": [], "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/"}]}