// 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": {"showfrontpage": false, "preventleave": false, "allowregen": true}, "question_groups": [{"questions": [{"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}

", "extensions": [], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "functions": {}, "rulesets": {}, "tags": [], "ungrouped_variables": ["formula", "num_professors", "factor", "num_students"], "parts": [{"marks": 0, "gaps": [{"marks": "0", "vsetRangePoints": 5, "checkingType": "absdiff", "variableReplacements": [], "failureRate": 1, "unitTests": [], "showPreview": true, "variableReplacementStrategy": "originalfirst", "checkingAccuracy": 0.001, "vsetRange": [0, 1], "scripts": {}, "extendBaseMarkingAlgorithm": true, "answer": "{formula}", "showFeedbackIcon": true, "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 )", "expectedVariableNames": [], "checkVariableNames": false, "type": "jme", "showCorrectAnswer": true}], "variableReplacements": [], "type": "gapfill", "steps": [{"showCellAnswerState": true, "marks": 0, "distractors": ["", ""], "unitTests": [], "choices": ["More students", "More professors"], "minMarks": 0, "variableReplacements": [], "type": "1_n_2", "displayColumns": 0, "shuffleChoices": false, "maxMarks": 0, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "scripts": {}, "extendBaseMarkingAlgorithm": true, "displayType": "radiogroup", "showFeedbackIcon": true, "matrix": ["1", 0], "prompt": "

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

", "showCorrectAnswer": true}, {"variableReplacements": [], "marks": 0, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "scripts": {}, "type": "information", "unitTests": [], "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$.

", "showCorrectAnswer": true, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst"}], "unitTests": [], "variableReplacementStrategy": "alwaysreplace", "scripts": {}, "sortAnswers": false, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "stepsPenalty": 0, "prompt": "

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

\n

[[0]]

", "showCorrectAnswer": true}, {"correctAnswerStyle": "plain", "marks": 1, "unitTests": [], "minValue": "num_students", "maxValue": "num_students", "variableReplacements": [{"must_go_first": false, "part": "p0g0", "variable": "formula"}], "type": "numberentry", "mustBeReducedPC": 0, "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 )", "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "allowFractions": false, "correctAnswerFraction": false, "prompt": "

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

\n

Use your formula to calculate the number of students.

", "showCorrectAnswer": true, "mustBeReduced": false}], "type": "question", "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "

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

", "preamble": {"css": "", "js": ""}, "name": "Write a formula based on a word statement and apply it to a given value", "variables": {"num_students": {"name": "num_students", "description": "", "templateType": "anything", "definition": "factor*num_professors", "group": "Ungrouped variables"}, "formula": {"name": "formula", "description": "", "templateType": "anything", "definition": "expression(\"S={factor}P\")", "group": "Ungrouped variables"}, "num_professors": {"name": "num_professors", "description": "", "templateType": "anything", "definition": "random(5*factor..300#(5*factor))", "group": "Ungrouped variables"}, "factor": {"name": "factor", "description": "", "templateType": "anything", "definition": "random(2..10)", "group": "Ungrouped variables"}}, "variable_groups": [], "metadata": {"description": "

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"}}], "pickingStrategy": "all-ordered"}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}