Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To create a numeric TeX question, follow the guidelines here to create a Tex Open question. Rather than using the multiple choice template, calculate the answer in the code portion, as seen below, and set the ans1 variable to your final value. If the question has multiple parts, there will be "ans2", "ans3", etc. variables as well.

 

Code Block
languagejs
function js_answer(){
  /* global double ans1 u={h} */
  /* global double hl */

  hl = randomStep(1, 5, .5, 2);

  ans1 = hl;

}

 

void answer(void)
{
  /* global double ans1 u={h} */
  /* global double hl */

  hl = randomStep(1, 5, .5, 2);

  ans1 = hl;

}

 

...

Question tolerance

The answer tolerance for a question can be set in the right-hand box above the code portion of a TeX question.  Only one tolerance can be set for the entire question and applies to all of the question's parts. For any numerical response, a student's submission may be within this tolerance range (+/-) and still be considered correct. The default tolerance for most numerical response questions is 1%. For instance, if a given question has an answer of 32.00 and a tolerance of 1%, a student's response could be between 31.68 and 32.32. A 1% tolerance can usually cover most student rounding errors.

 

...