version 1.2, 2007/05/30 15:35:14
|
version 1.3, 2016/08/20 16:06:50
|
Line 4 To create difference versions of Bridge
|
Line 4 To create difference versions of Bridge
|
|
|
All variables are placed inside a Setup element. Each setup element has an id attribute which contains the name of the variable. The possible instances or values of those variables are placed inside the setup element inside an Instance tag. Each Instance element has two mandatory attributes, the OptionalRequired attribute which should be set to 0, and the unique id of that instance. The value of the id attribute can be any text as long as it is unique throughout the document. |
All variables are placed inside a Setup element. Each setup element has an id attribute which contains the name of the variable. The possible instances or values of those variables are placed inside the setup element inside an Instance tag. Each Instance element has two mandatory attributes, the OptionalRequired attribute which should be set to 0, and the unique id of that instance. The value of the id attribute can be any text as long as it is unique throughout the document. |
|
|
The actual data of the instance is placed inside InstanceText tags. Currently the instance data is created with a loncapa/perl script. In this script the parameters of the variable are set. The syntax to set the parameter of a variable is '\$variableName \{fieldname\} = "fieldValues"'. The variable name is taken from the attribute id from the Setup element, the field 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. |
The actual data of the instance is placed inside InstanceText tags. Currently the instance data is created with a loncapa/perl script. In this script the parameters of the variable are set. The syntax to set the parameter of a variable is '\$variableName \{fieldname\} = ``fieldValues'''. The variable name is taken from the attribute id from the Setup element, the field 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. |
|
|
The example below shows a portion of the bridge task XML file. This portion should be placed inside the task element :Lines between $<!--$ and $-->$ or $/*$ and $*/$ are comments and should not be typed into the editor. |
The example below shows a portion of the bridge task XML file. This portion should be placed inside the task element :Lines between $<!--$ and $-->$ or $/*$ and $*/$ are comments and should not be typed into the editor. |
|
|
Line 47 The example below shows a portion of the
|
Line 47 The example below shows a portion of the
|
</Setup> |
</Setup> |
\end{verbatim} |
\end{verbatim} |
|
|
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. |
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. |
The first line $<$Setup id="entitySubject"$>$ creates a variable named entitySubject (based on the id attribute of this line). |
The first line $<$Setup id=``entitySubject''$>$ creates a variable named entitySubject (based on the id attribute of this line). |
|
|
The first instance of this variable is shown from lines 2 to 10. Line two $<$Instance OptionalRequired="0" id="instanceHarry"$>$ marks the beginning of the instance element named instanceHarry (based on the id attribute). The OptionalRequired is given a value of 0. Lines 3-9 determine the actual value of this variable. Lines 3 and 4 must be typed as shown. Lines 5-7 define the instance properties, which must be of the form \$ $<$variable\_name$>$ \{$<$property\_name$>$ \} = $<$value$>$. The first line of the property must be the instance property (see line 5 of example), with the value being the id of the instance. Other lines (6-7) can be used for any attributes you wish to define. The closing $<$/script$>$, $<$/InstanceText$>$ and $<$/Instance$>$ tags must be typed as shown. |
The first instance of this variable is shown from lines 2 to 10. Line two $<$Instance OptionalRequired=``0'' id=``instanceHarry''$>$ marks the beginning of the instance element named instanceHarry (based on the id attribute). The OptionalRequired is given a value of 0. Lines 3-9 determine the actual value of this variable. Lines 3 and 4 must be typed as shown. Lines 5-7 define the instance properties, which must be of the form \$ $<$variable\_name$>$ \{$<$property\_name$>$ \} = $<$value$>$. The first line of the property must be the instance property (see line 5 of example), with the value being the id of the instance. Other lines (6-7) can be used for any attributes you wish to define. The closing $<$/script$>$, $<$/InstanceText$>$ and $<$/Instance$>$ tags must be typed as shown. |
|
|
Line 12-21 shows the second instance with the same rules as the first instance. Line 23 $<$/Setup$>$ gives the closing Setup tag which must be as shown.. |
Line 12-21 shows the second instance with the same rules as the first instance. Line 23 $<$/Setup$>$ gives the closing Setup tag which must be as shown.. |
The example of the usage of this variable inside the question is this text: |
The example of the usage of this variable inside the question is this text: |