Reference Home

Java Widgets, v3.0


CTAT_Options

CTAT_Options is a Java class included by default in new tutors that sets options for the tutor. While listed as a Java Bean, CTAT_Options itself has no visual corollary in the tutor interface; however, some of its properties do have visual effects (e.g., showBehaviorRecorder shows the Behavior Recorder when the interface is run).

connectToLispAtStartup
(Boolean) If set to true, the tutor will attempt to connect to a Lisp socket at startup. This option is only necessary for authors using Lisp instead of Jess for a production rule engine. Default is false.
enableLMSLogin
(Boolean) Used for problem selection via the LMS curriculum system. Default is false.
interfaceHeight
(int) The height of the student interface in pixels.
interfaceWidth
(int) The width of the student interface in pixels.
separateHintWindow
(Boolean) If set to true, a separate hint window will be used. This window is only shown when either a hint or buggy message is shown. Note that the integrated hint window contains Hint and Done buttons, both of which should be supplied in the interface if the separateHintWindow option is used. Default is false.
showAdvanceProblemMenu
(Boolean) If set to true, an option (Teacher > Advance Problem) will be displayed in the student interface for advancing the problem via the LMS curriculum management system. Default is false.
showBehaviorRecorder
(Boolean) If set to false, the behavior recorder will not launch when the interface is run. Note that if this option is set, there is no way to view the behavior recorder without recompiling the interface.
showLoginWindow
(Boolean) Used for sequencing problems via the Lisp curriculum system. If set to true, a login dialog is displayed to the user, and the user name is recorded for problem selection.
useDemonstrateMode
(Boolean) If checked, the interface will run with CTAT in Demonstrate author mode.
useExampleTracingTutor
(Boolean) If checked, the interface will run with CTAT set to the Example-tracing Tutor tutor type. This is the default tutor type.
useJESSCognitiveTutor
(Boolean) If checked, the interface will run with CTAT set to the Cognitive Tutor (Jess) tutor type.
useSetStartStateMode
(Boolean) If checked, the interface will run with CTAT in Set Start State author mode. This is the default author mode.
useSimulatedStudent
(Boolean) If checked, the interface will run with CTAT set to the Simulated Student tutor type.
useTDKCognitiveTutor
(Boolean) If checked, the interface will run with CTAT set to the Cognitive Tutor (TDK) tutor type.
useTestTutorMode
(Boolean) If checked, the interface will run with CTAT in Test Tutor author mode.

Circle

Use the Circle widget to display circles, ellipses, and ovals on your interface. Note that shapes created with this widget are not interactive, unlike the other CTAT Java interface widgets; a circle is merely a graphic element on your tutor.

JCommButton

View an example of an interface that uses JCommButton

The JCommButton widget is an interactive button widget. Depending on the current problem state, the JCommButton will either turn green and become disabled (the student cannot undo a correct action), or it will turn red signifying an incorrect action.

A JCommButton can also be configured to act as a 'hint' or 'done' button. This is especially useful if the CTAT_Options property called separateHintWindow is checked, since the user would have no way to signal that they wanted a hint or were done with the problem.

  • To define a hint button, change the name of the JCommButton instance to Hint.
  • To define a done button, change the name of the JCommButton instance to Done.

You can change the name of a widget instance by right-clicking the widget name in the Inspector panel of Eclipse WindowBuilder and selecting Rename.

Properties specific to JCommButton:

changeButtonColor
(Boolean) Determines whether or not the JCommButton will change color after it is pressed.
text
(String) Text that is displayed on the button.

JCommChooser

View an example of an interface that uses JCommChooser

The JCommChooser widget allows students to enter hypotheses. JCommChooser is a list-to-list widget that communicates with the behavior recorder when an item in the left list is selected and the ">>" button is pushed. It consists of two text boxes and a button that is used to select text from the left-hand side box. If a student selects a correct list item, that item moves to the right list, turns green, and is disabled (because the student cannot change a correct answer). In addition, any incorrect selections, which have turned red, turn back to the neutral color (black). If an incorrect list item is selected, the text of that item turns red and is not disabled. Multiple correct list items may be moved from the left to the right. List items are provided to the JCommChooser – and initially placed in the left list – through a comma-delimited list entered in the values property of the widget.

Properties specific to JCommChooser:

values
(String) A comma-delimited list of values to appear in the left-hand side of the JCommChooser.

JCommComboBox

View an example of an interface that uses JCommComboBox

A combo box, commonly called a "drop-down list," is a widget with a drop-down arrow that the user clicks to display a list of options. JCommComboBox communicates with the behavior recorder when one of its pull-down items is selected.

If the correct item is selected by a student, the text of all items in the JCommComboBox turns green and the widget is disabled. If an incorrect item is selected, the text of all items in the JCommComboBox turns red.

To add new values to JCommComboBox after your interface has been compiled:

  1. Create a new behavior recorder graph with no start state.
  2. Set the behavior recorder mode to Demonstrate.
  3. In the Java interface, type a value into the JCommComboBox and press enter. That value is now a member of the JCommComboBox's list of values.
  4. When you are done adding values, create a start state in the behavior recorder graph.
  5. Test your interface in Test Tutor mode.

Properties specific to JCommComboBox:

maxRowItemsView
(int) The maximum number of values shown when the combobox is clicked. If the number of values in the combobox is greater than maxRowItemsView, then a scrollbar is used. Default value is 40.
values
A comma-delimited list of values to appear in the JCommComboBox. To add a value with the literal character "," in it, this character must be preceded by a forward slash (/). So to create two values—"dogs,cats" and "mice"—the values string would be dogs/,cats, mice.

JCommComposer

Example: JCommCompser used in an online test for geometry. In this problem, multiple compositions are accepted.

JCommComposer is made up of a variable number of drop-down comboboxes and a list. It provides a way for students to compose sentences by combining phrases from a series of menus. JCommComposer communicates with the Behavior Recorder when the either the 'Add' or 'Delete' button is pressed.

If a correct list item is composed by the student, the composed item moves to the list, turns green, and is disabled (because the student cannot change a correct answer). If an incorrect sentence is composed and placed in the list, the text of that item moves to the list and turns red.

For a single state in the behavior recorder, multiple incorrect list items may be moved to the list, but only one correct item may be moved. It is also possible to create a sequence of correct answers using a single JCommComposer widget and multiple correct action links in a Behavior Recorder graph.

Properties specific to JCommComposer:

allowDeletes
(Boolean) Enables a 'delete' button that appears to the left of the standard 'add' button. Students can then delete compositions they've created by selecting them from the list and pressing 'delete'.
comboBoxesNumber
(int) The number of comboboxes to appear below the main text box.
comboBoxesWidths
(String) A comma-delimited list of integer values (in pixels) that defines the widths for all comboboxes. 0, the default value, specifies an auto-sizing combobox that sizes to the largest value in that combobox. If comboBoxesWidths is set to zero and a combobox contains no items, then the default width of 119 pixels is used.
enableItemToolTips
(Boolean) Enables the display of tool-tips when hovering over a truncated value in a combobox with the mouse. Default value is false (unchecked).
itemValues
(String) A semi-colon-delimited string containing the values for all comboboxes. Semi-colons delimit comboboxes, while commas delimit combobox values. To use the literal characters ";" and ',' for combobox values, precede each with a forward slash (/). An empty combobox can be specified with a space ("; ;").
maxRowItemsView
(int) The maximum number of values shown when the combobox is clicked. If the number of values in the combobox is greater than maxRowItemsView, then a scrollbar is used. Default value is 40.
sentencePanelHeight
(int) The height of the list panel (in pixels). Default value is 60. Each list item occupies one row with a height determined by the font property.
values1 - values4
Deprecated (String) A comma-delimited list of values to appear in the first JCommComboBox. If this property is set, its values will override those set in the itemValues property. Authors are encouraged to move their value settings from this property to the itemValues property.

JCommLabel

JCommLabel is a non-interactive element that can be used to display text or an image in the student interface. JCommLabel can also be updated dynamically.

To add an image to the student interface using JCommLabel:

  1. In the imageName property of the JCommLabel, enter either the absolute file path of the image (e.g., C:\work\picture.jpg on the PC or /Users/myusername/Pictures/picture.jpg on the Mac) or a relative file path (e.g., ./Projects/projectName/image.png) to the image from the Behavior Recorder working directory.
    Your image will be visible once you've compiled your tutor.
  2. Either delete the existing text in the text property of the JCommLabel, or enter a caption for the picture.

To change a JCommLabel dynamically (Example-tracing Tutors only):

  1. Ensure that Tool-performed actions is turned on (Edit > Preferences > Allow Tool-Performed Actions should be checked.)
  2. Locate a point in your behavior graph where you'd like JCommLabel to change. This can be any state in your behavior graph.
  3. While at that state, demonstrate a student action using any widget in your student interface. (This is a workaround to create a link, since you can't interact with JCommLabel directly.)
  4. On the label of the link you just demonstrated, right-click and select Edit Student Input Matching. See a screenshot of the Edit Student Input Matching dialog.
  5. Next to Actor, select Tutor.
  6. Change Selection to the name of your JCommLabel. (This value is listed in Eclipse WindowBuilder when you select JCommLabel; the default is jCommLabel1.)
  7. Change Action to UpdateIcon for changing to an image, or UpdateText for changing text. If you want to change from text to image, ensure that JCommLabel's actionName property in Eclipse WindowBuilder is set to UpdateIcon before compiling your student interface.
  8. Change Input to the desired text; alternatively, you can enter a path to an image.
  9. Test your tutor in Example-Tracing mode to see how JCommLabel changes.

Properties specific to JCommLabel:

imageName
(String) Path to an image located on the local machine. Can be absolute or relative. Relative paths are relative to the Behavior Recorder working directory.
text
(String) The text to display in the label.

JCommList

JCommList displays a list of items from which students select their answers. This widget communicates with the behavior recorder when a student double-clicks one of its list items.

If a correct list item is selected, the text of that item turns green and is disabled (i.e., the student cannot change a correct answer). In addition, any incorrect selections, which have turned red, turn back to the neutral color (black). If an incorrect list item is selected, the text of that item turns red and remains enabled. Multiple correct list items may be selected.

Properties specific to JCommList:

values
(String) A comma-delimited list of values to appear in the JCommList. To add a value with the literal character "," in it, precede the character with a forward slash (/).

JCommMultipleChoice

View an example of an interface that uses JCommMultipleChoice

JCommMultipleChoice is a complex widget composed of a text label, which contains the question text, and a group of radio buttons, which represent answers to the question. This widget communicates with the behavior recorder when one of its radio buttons is selected.

If a correct button is selected in the group, the text of the corresponding radio button turns green and other buttons in the group are disabled (i.e., the student cannot change a correct answer). If an incorrect button is selected, the text of the selected radio button turns red and the rest of radio buttons in the group remain active.

This widget does not allow a student to select multiple correct answers. If you have more than one correct answer for a multiple choice question, either define a choice text that includes all the correct answers (e.g., "Both A and D are correct"), or use the widget JCommMultipleChoiceCheckBox.

Properties specific to JCommMultipleChoice:

NChoices
(int) The number of choices (radio buttons).
choiceLayout
(int) 1 is a horizontal radio button layout; 2 is a vertical radio button layout. The default value is 2 (vertical).
choiceTextFont
(Font) The font formatting to be applied to radio button text.
choiceTexts
(String) A comma-delimited list of values to appear beside the radio buttons. The first value is the top radio button text. To add a value with the literal character "," in it, this character must be preceded by a forward slash (/).
questionFont
(Font) The font formatting to be applied to the question text.
questionText
(String) The text label that is displayed above the radio buttons.

JCommMultipleChoiceCheckBox

JCommMultipleChoiceCheckBox provides a method for students to answer a multiple choice question with more than one selection. Using this widget, a student may check and uncheck boxes until the "Submit" button is selected. If the submitted set is correct, the selections turn green and the widget locks. If the submitted set is incorrect--if it is not identical to the correct set of choices--all selections turn red and the widget remains active.

Properties specific to JCommMultipleChoiceCheckBox:

NChoices
(int) The number of choices (checkboxes).
choiceLayout
(int) 1 is a horizontal checkbox layout; 2 is a vertical checkbox layout. The default value is 2 (vertical).
choiceTexts
(String) A comma-delimited list of values to appear beside the checkboxes. The first value is the top checkbox text. To add a value with the literal character "," in it, this character must be preceded by a forward slash (/).
questionText
(String) The text label that is displayed above the checkboxes.

JCommQuestionComboBox

JCommQuestionComboBox is a composite widget composed of one or more label-combo box pairs. If more than one label-combo box pair is specified, a submit button is included in the widget; the widget will only communicate with the behavior recorder when the submit button is pressed. If only one label-combo box pair is specified, then no submit button is included, and the widget will communicate with the behavior recorder when a choice is selected from the combo box list.

A correct set of choices turns the text green, and locks the widget. An incorrect set turns the choices red, and the widget remains active.

Properties specific to JCommQuestionComboBox:

nPairs
(int) The number of label-combobox pairs
questionText
Comma-delimited list of texts for all the labels in this widget
choicesText
Choices for a combo box are enclosed within brackets like this - [] . Also within [], the choices for a combo box are separated by commas
questionLayout
Determines how the label-combo box pairs are arranged, horizontally or vertically. 1: horizontally , 2: Vertically

Example

If [combobox1] and [combobox2] then [combobox3]

Properties for JCommQuestionComboBox would be set as follows:

  • nPairs = 3
  • questionText = if, and, then
  • choicesText = [a, b, c] [x, y, z] [p, q, r]
  • questionLayout: 1

JCommQuestionTextField

JCommQuestionTextField is a widget composed of a text label and a text field.

Properties specific to JCommQuestionTextField:

NCharacters
(int) The width of the text field in characters.
algebraWidget
(Boolean) If set to true, any algebraic variant of the demonstrated answer will be treated as correct input.
answerLayout
questionText
(String) The question text that appears next to the field

JCommRadioButton

JCommRadioButton is a widget that communicates with the Behavior Recorder when a student selects it.

JCommRadioButtons are typically, but not necessarily, grouped together, and only one button in a group may be turned “on” at a time. To emulate this behavior, give each JCommRadioButton an identical group property value.

If the correct button in a group is selected, the text of that button turns green and the other buttons in the group are grayed out and disabled (i.e., the student cannot change a correct answer). If the incorrect button in a group is selected, the text of that button turns red and all buttons remain enabled.

Once a radio button is set in a group, there is no way to return the group to a state where no buttons are selected. A possible workaround is to include a "no-answer" radio button in your button group.

Note: The widget JCommMultipleChoice is a convenient alternative to JCommRadioButton. It allows a question and a set of radio buttons to be grouped into a single widget.

Properties specific to JCommRadioButton:

group
(String) The JCommRadioButton's group. Set this property to an identical value for multiple JCommRadioButtons to have them operate as a group (i.e., only one button can be selected at any time).
text
(String) The text displayed next to the JCommRadioButton

JCommTable

JCommTable contains a variable number of table cells that can be used for editing or displaying data, including mathematical expressions. It communicates with the behavior recorder when a cell in the table contains a new value and the student either presses return/enter/tab, or shifts focus to another cell or widget. If the correct value is provided for a particular cell, the value in that cell turns green and is disabled. If the incorrect value is provided for a particular cell, the text in that cell turns red and remains enabled.

JCommTable can be initialized by entering values into the table before creating a start state in the behavior graph.

Properties specific to JCommTable:

columns
justification
rows

JCommTextArea

JCommTextArea is a multi-line text field commonly used for open-ended questions. It communicates with the Behavior Recorder when a student enters text and either presses enter/return or tab, or clicks off of the text field.

If correct text is provided, the text turns green and the widget is locked. If the incorrect text is provided, the text in that cell turns red and the widget remains editable.

JCommTextArea can be initialized in Eclipse WindowBuilder using the text property, or by adding text to the interface before creating a start state in the behavior graph.

Properties specific to JCommTextArea:

text
editable

JCommTextField

JCommTextField is a single-line text field commonly used for open-ended questions. It communicates with the Behavior Recorder when a student enters text and either presses ENTER or TAB, or clicks off of the text field.

If correct text is provided, the text turns green and the widget is locked. If the incorrect text is provided, the text in that cell turns red and the widget remains editable.

JCommTextField can be initialized in Eclipse WindowBuilder using the text property, or by adding text to the interface before creating a start state in the behavior graph.

Properties specific to JCommTextField:

text

HorizontalLine

This widget displays a horizontal line on your interface. You can set the length of your line but not the height.