Versions Compared

Key

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

...

TeX formatting is a powerful tool for creating content in Quest.  The upper TeX box serves as a display of the question. Write this code in TeX (and sometimes LaTeX). A standard TeX reference card can be found here, commonly used functions available here, and more tools for finding the appropriate commands for various symbols can be found here: Detexify (external site)

To make a comment in the TeX box (ie leave a note that will not be run or acted upon), use a single % at the front of the line (two examples below).

%%%%%%%%%%%% quest 1
    % the above line denotes part 1 of a question


    % The question text goes here

Javascript (JS) or C

The lower code box (written in JS or C) performs calculations and initialize variables that are used in the top TeX portion. Each question part in the question body must define and initialize an answer in the code portion--it is in this code box where variable, any randomization, and the answer (ans1) are set. (Follow these steps to add more than one part.)

...

We're attempting to convert all these items to Javascript, so if you feel comfortable, please do so in your edits. If you don't feel comfortable, simply shoot us an email (questhelp@austin.utexas.edu) to let us know and one of our staff will assist you in that process.


To make a note in the code box for Javascript (JS), use // 

example:

function js_answer() {

    /* global double ans1 u={} */

    ans1 = 3;   // the third answer choice

}


here "// the third answer choice" is referring to ans1=3 means the correct answer will be the third answer choice in the multiple choice above.

C

When writing the coding portion of the question in C, begin with "void answer(void) { }" and insert all code between the curly braces. Any variables you want to reference in the TeX portion of the problem must be defined as follows: /* global (insert type) (insert name) */ (without the parentheses). You can also specify units you want to be displayed after the variable by typing "u={type}" where type can be m, kg, etc. The rest of the problem can then be coded like a normal C program.

...