Common Editor Errors
- use of TeX commands in any ans[1-9 variables]
- Declared variable not used in subsequent code
- Variable not declared
- @@@ symbols in the distractors
use of TeX commands in any ans[1-9] variables
Explanation Only affects the variables that the system uses for the correct answer, ans1, ans2, etc. Worked at some point (a fair percentage of old items opened for editing have at least one TeX command in the unit spec), hasn't worked in at least 5 years.
Resolution Simply rewrite the units without the TeX command.
Example 1 // erroneous code /* global double ans1 u={\degC} */ Uses a Quest TeX Master file definition "\degC" which shows the shorthand for degrees Celsius. I believe there are also definitions for Kelvin and Farenheit. // working code /* global double ans1 u={Celsius} */
Example 2 // erroneous code /* global double ans1 u={\mu g} */ Uses a TeX default symbol "\mu" for the Greek letter. Either write out the intended unit, or add the expected units to the body of the question and remove it from the code: // working code /* global double ans1 u={micrograms} */
Example 3 // erroneous code /* global double ans1 u={J/mol \, K} */ Uses a TeX default symbol "\," to force a space between mole and Kelvin, these can just be removed, but may need a different symbol to prevent : // working code /* global double ans1 u={J/mol*K} */
Declared variable not used in subsequent code
Explanation The processor expects all declared variables to be utilized in the code portion.
Resolution Remove the declaration of any unused variables, or set as a placeholder if to be used in further editing, i.e. you're writing a question and haven't gotten to that variable yet but want to eventually (I would recommend not declaring it until you're ready to set it just to avoid cluttering up code in progress).
Example // erroneous code /* global double ans1 u={} */ /* global double i u={} */ ans1 = 1; Here "i" is declared but not set: // working code /* global double ans1 u={} */ ans1 = 1;
Variable not declared
Explanation The opposite of the prior issue, if you use a variable without declaring it, you won't be able to use it outside of the code portion (in Javascript anyways, C will yell at you for not declaring it before calling it in the code).
Resolution Add a global declaration for the variable
Example 1 // erroneous code function js_answer(){ /* global double ans1 u={} */ i = 5; ans1 = i; } In Javascript this creates a local variable 'i', but it isn't accessible in the body portion of the item. Still good practice to declare all variables, either local or global: // working code // local declaration for Javascript function js_answer(){ /* global double ans1 u={} */ var i = 5; // JS uses var and isn't strict about variable type (why there's // discussion about implementing TypeScript into Quest to be strict // about variable declarations more similar to C ans1 = i; }
Example 2 // erroneous code void answer(void){ /* global double ans1 u={} */ i = 5; ans1 = i; } In C, the variable must be declared locally or globally before use: // working code //local declaration in C, the global declaration is the typical formatting void answer(void){ /* global double ans1 u={} */ int i; // or float i, or char i for strings; i = 5; ans1 = i; }
@@@ symbols in the distractors
Explanation This one seems obvious, but needs to be considered. The use of "@@@" in the code body previously pulled the correct answers from other unique parm sets to list as distractors. Hasn't worked in many years, but a fair number of untouched items still have them in the code.
Resolution The code body has to have the distractors re-written, which may require help from a content expert, however one option would be to write the code to replicate the old method of the @@@ machinery and use some of the other correct answers.
Welcome to the University Wiki Service! Please use your IID (yourEID@eid.utexas.edu) when prompted for your email address during login or click here to enter your EID. If you are experiencing any issues loading content on pages, please try these steps to clear your browser cache.