Annotation of loncom/html/adm/help/tex/BridgeTask_EditModeVariable.tex, revision 1.1
1.1 ! rezaferr 1: \label{BridgeTask_EditModeVariable}
! 2:
! 3: To create difference versions of Bridge Tasks for each student, parts of the questions are defined using variables. Each variable contains multiple instances of possible values and LON-CAPA randomly selects an instance to give to the student. Figure \ref{BTEdit_Variable} shows a screenshot of this process.
! 4:
! 5: \begin{figure}
! 6: \begin{center}\includegraphics[ width=0.80\paperwidth]{BT_ScreenshotVariable}\end{center}
! 7:
! 8: \caption{Bridge Task variable creation screenshot\label{BTEdit_Variable}}
! 9: \end{figure}
! 10:
! 11: To create a variable:
! 12: \begin{enumerate}
! 13: \item Choose "Setup ..." in the insert pull-down menu (circled 1 in figure). \item Press the Submit Changes and Edit just above the work space.
! 14: \item A new box should appear with the label "Setup ...". In this box, fill out the id box (circled 3) with any text that is unique to unique to the document. This id is the name of the variable and will be used when creating the values for the variable.
! 15: \item The setup box has an insert pull-down menu next to the label (circled 2), select "Specific Question Instance" in this pull down menu, then again press the Submit Changes and Edit button.
! 16: \item This creates one single instance of a set of possible values. For each instance created, a new "Specific Question Instance" must be created.
! 17: \item Right now a box should appear inside the "Setup... " box with the label "Specific Question Instance". Insert a unique id for that instance which can be any unique text (circled 4). This id is the instance name and is used as one of the property of the variable.
! 18: \item In the question instance block, select "Information for the Instance" in the insert pull down (circled 5). Again press submit button.
! 19: \item Add a new script (circled 6) in the insert pull down. A new text block should appear.
! 20: \item In this text box, a perl script will be created (circled 7). A set of parameters for this variable is added. The syntax to set the parameter of a variable is '\$variableName \{fieldname\} = "fieldValue"'. The variable name is taken from the id field of the Setup block, thefield name is the name of the parameter the author sets, and the fieldValue is simply the value of the field. The first parameter that must be set is the instance field, with the value being an identifier of the instance (which is the id of the specific question instance block).
! 21: \end{enumerate}
! 22:
! 23: The example below shows two instances of this script for the variable entitySubject with two instances, 'instanceHarry' and 'instanceBetty'.
! 24:
! 25: The first instance (instanceHarry) is:
! 26: \begin{verbatim}
! 27: $entitySubject{instance} = "instanceHarry";
! 28: $entitySubject{personname} = "Harry";
! 29: $entitySubject{place} = "zoo";
! 30: \end{verbatim}
! 31:
! 32: The second instance (instanceBetty) is:
! 33: \begin{verbatim}
! 34: $entitySubject{instance} = "instanceBetty";
! 35: $entitySubject{personname} = "Betty";
! 36: $entitySubject{place} = "park";
! 37: \end{verbatim}
! 38:
! 39: The example above describes a variable question. It has two different possible values for the entity "subject", Harry and zoo or Betty and park. Variables can be placed inside the questions by using the variable name and field name.
! 40: The example of the usage of this variable inside the question is this text:
! 41:
! 42: This is a test question. \$entitySubject\{personname\}
! 43: went to the \$entitySubject\{place\}. .
! 44:
! 45: The LON-CAPA engine will replace any instance of \$$<$variable\_name$>$ ($<$property\_name$>$) with the correct value, depending on the randomly chosen instance.
! 46:
! 47: Based on this code, two different questions are possible:
! 48: \begin{enumerate}
! 49: \item This is a test question. Harry went to the zoo
! 50: \item This is a test question. Betty went to the park
! 51: \end{enumerate}
! 52:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>