![]() This method bypasses some strange things that happen If using it directly in a calculation, enclose it in parentheses just to be safe.Ĥ) $stuanswers is defined for question scoring, but may not be for question display.ĥ) You can use the function getstuans($stuanswers,N,P) to retrieve a student answer value. For this reason, it is highly recommended that you custom define the $showanswer.ģ) If using the $stuanswers array in a string or in the Question Text, you must enclose it with curly brackets: $showanswer will reflect the random number assigned to $a. If you follow the advice in #1 above, then your ![]() $warning = "You MUST answer question 1 before this question" if ($a=null), then put $warning in the question text.Ģ) If you use $stuanswers in your $answer, $showanswer will generally not be defined. ![]() To prevent divide-by-zero errors and to prevent students from exploiting this, it is highly recommended that you do something like: If used in an equation, it will take on the value 0. Questions, where $stuanswers = "NA" if no selection is made. $stuanswersval or $stuanswersval will contain the numerical value of Calculated question types.ġ) If the student has not answered the question, then $stuanswers = null, with the exception of drop-down select.$stuanswers will refer to the student's answer on the previous question.$stuanswers will refer to the student's answer on the current question, part P.$stuanswers will refer to the student's answer on question N, part P (if multipart).$stuanswers will refer to the student's answer on question N (not zero-indexed: N=1 is question 1).You will only be able to reference the student answer to some question types Students' previous answers in your question code. To create multipart questions that are graded on consistency, or to create a set of lab-type problems that rely on student-provided data, you can reference Theĭisplay of this text is controlled by the same "show hints?" option that controls the display of hints described above. Any text assigned to this variable will show at the bottom of the question. ![]() To provide help of some sort for a question (typically, links to videos, book references, etc), define $helptext To override the default Hint: text, set $hintlabel. This will display the hint after all the parts listed have had the required attempts or are correct. ![]() To have the hint to display based on a set of previous answers, you can use: Then in question text, place each hint using $hintloc If you want per-part hints, define the $hints array as: In multipart questions, you can follow the process above if you just want a single strand of hints for the entire problem. Then in the question text, place the location of the hint using the variable $hintloc. It is fine, for example, to not define $hints if you want nothing to display initially. $hints = "This will show on third and subsequent attempts, since no later values have been defined" $hints = "This will show on second attempt (after 1 missed attempt)" $hints = "This will show on first display" All question types can support these options:įor a single question (not multipart), to use hints, in the common control (or question control) section define the array $hints where: $hints = "hint text" ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |