Convert a NFR question to MC manually

We encourage tinkering with problems to make them yours! Please just make a copy of an existing problem so it will be in your personal bank (and feel free to share it in other banks that you see relevant too).


1) use a numeric free response question (which is coded in TeX) as a template. You'll know because there will be just a question, with no choices provided in the upper TeX box question part (the "expl" is the explanation).



2) To convert a TeX open to TeX multiple choice three additions are needed:

In the TeX box, we have to put in answer choices:

tex_answer_choices
\choice{}{1}{@t}
\choice{}{2}{@dist1}
\choice{}{3}{@dist2}
\choice{}{4}{@dist3}
\choice{}{5}{@dist4}

Answer choices can go up to 10! The brackets containing the answer choices can also be inserted with any math functions, text, or variables of your choice. 


Then in the code box, we have to define the variables and describe what those answer variables should be in the comments area:

js_variables
  /* global double dist1 u={units} */
  /* global double dist2 u={} */
  /* global double dist3 u={} */
  /* global double dist4 u={} */

Note that dist1-4 are defined as global doubles, and so will be accessible by both the lower code box and upper TeX box. Units may be specified as indicated above.


4) Now we direct what we want the variables to be set to:

define variables
dist1 = omega*pi/60.0/alpha;
dist2 = omega*2.0*pi/alpha;
dist3 = 2.0*pi/60.0/alpha;
dist4 = omega*2.0*pi/60.0;

Note that omega, pi, and alpha are variables used to simplify each calculation. 


3) The answer itself also needs one tweak

For NFR, the actual answer is identified as ans1 (ex: ans1=@a1). However, for multiple choice, we instead set ans1 as the number of the correct answer choice.

For example, let's say that choice 3 is the correct answer: 

tex_answer_choices
\choice{}{1}{answer choice 1}
\choice{}{2}{answer choice 2}
\choice{}{3}{answer choice 3}
\choice{}{4}{answer choice 4}
\choice{}{5}{answer choice 5}

Then in the code box, we set ans1=3:

js_ans1
ans1 = 3;


If you're getting 'tex validation errors' please check that ans1 is set to an integer.

Pro tip: When first starting a question, set ans = expression on how to calculate the answer. In the upper TeX box, in choice 1, put in ans, and in the bottom Code box, ans1=1.


5) check the upper TeX box explanation to ensure that the final answer displayed will be (in this case, t)

'@' means the variable is being called from the code box to the TeX box–the latter is what is displayed.


Generate parameters, and if there are no errors, proceed to publish!  Feel free to put your question in all relevant category banks so others can use your well crafted question too.