Here is an example of a grade bar with range from 0.0 to 10.0 with one decimal and adjectives:
Here is a list of parameters available for a grade bar:
Parameter | Value | Description | R/O |
---|---|---|---|
class | GradeBar | Class alias for a grade bar component. | Req. |
question | text | The question shown to subject. | Req. |
minimum | number | The minimum of the scale. Default is 0.0. | Opt. |
maximum | number | The maximum of the scale. Default is 5.0. | Opt. |
decimals | number of decimals | Number of decimals in the grade. Default is 1. | Opt. |
questionfont | font name | The font used for question text. | Opt. |
showValue | true or false | Whether to show the current value to the subject. Default is true. | Opt. |
showLabels | true or false | Whether to show the adjectives to the subject. Default is true. | Opt. |
choiceformat | choice format string | Give adjectives to certain ranges of values. Default is no adjectives, only the value is shown. | Opt. |
defaultAnswer | number | Set the initial value (and the position) of the grade bar when
the question is initialized or reset. A special value
'random ' can be used to initialize the value with a
new random number every time the component is reset. If this
option is left out, the default answer is the midpoint of the
minimum and maximum of the scale.
| Opt. |
# Set question text qA.question=Clarity of sample A
The following example sets the scale to from 0 to 5 with one decimals. The question name will be 'qA':
# Set range of grade to [0.0, 10.0] (one decimal). qA.minimum=0.0 qA.maximum=10.0 qA.decimals=1
# The font of the question qA.questionfont=Serif-italic-24You can use the FontTester tool help you select the fonts you want. See also the API of the Java's Font class.
# Do not show grade to subject qA.showValue=falseIf showValue is set to false, only the adjectives (see below) will be shown if they are set.
# Set adjectives qA.choiceformat=0.0#Very unclear|2.0#Rather unclear|4.0#Midway|6.0#Rather clear|8.0#Very ClearThis string tells that the adjective 'Very unclear' will be shown if the value X is between 0.0 and 2.0 (0.0 <= X < 2.0), 'Rather Unclear' will be shown if 2.0 <= X < 4.0, and so on. If X < 0.0 the first adjective will be shown and if X > 8.0 the last adjective is shown.
For adjectives to be shown, the showLabels parameter
must be set to true
(it is true by default).
# Use initial value 1.5 qA.defaultAnswer=1.5The position of the knob is set to the position that matches that value on the range.
To automatically generate a random initial value when the component is reset, set defaultAnswer to string 'random':
# Use random values for initial value qA.defaultAnswer=randomIt generates a new random value between the minimum and maximum of the grade bar's range.
It is also possible to limit the range of the initial random value to a smaller range than minimum and maximum of the component. Use the defaultAnswer.randomMin and defaultAnswer.randomMax parameters to set different limits. For example (lets assume the component's answer value range is [0.0, 10.0]):
# Use random initial values with values between [3.0, 7.0] qA.defaultAnswer=random qA.defaultAnswer.randomMin=3.0 qA.defaultAnswer.randomMax=7.0