Dialog Architecture

The architecture of ISAC's Dialog Guide separates the dialogs clearly from the other components in ISAC. This is shown in this figure:

Dialog Components
The relevant components are
 * WorksheetDialog manages the dialog for exactly one Worksheet. That means, that each Worksheet has it's own WorksheetDialog. All the WorksheetDialogs are served by the DialogGuide
 * Worksheet displays exactly one calculation, which might consist of sub-problems. Within the Worksheet also the specification phase is done in a separate window.
 * MathEngine does all calculations requested by the learner (via Worksheet) and by the WorksheetDialog. The latter, for instance, wants to check which error patterns are related to the current step of calculation. This check involves "matching" of formulas, which can only be done by the MathEngine.
 * DialogGuide serves all dialogs, in particular the WorksheetDialogs and the dialogs for the browsers for examples, theories, problems and methods. The DialogGuide manages the hint-pages, several counters etc.

Connections of the Dialog
The WorksheetDialog's connections to the other components of ISAC are given by these methods:


 * 1) notifyUserAction notifies the WorksheetDialog about an action of the user on the Worksheet. All possible actions are described in src/java/isac/useractions/EUIElement.java.
 * 2) doUIAction notifies the Worksheet about what to display. This methods uses the same actions as (1.) compound with appropriate data. The actions are src/java/isac/useractions/UIAction*.java; the identifiers for the respective actions are defined in src/java/isac/useractions/EUIElement.java, too (i.e. the actions between Worksheet (learner) and WorksheetDialog (the 'system') are symmetrical.).
 * 3) CalcEvent notifies the WorksheetDialog about the result of the MathEngine for the last request for calculation from the WorksheetDialog. The returned result can be of 2 kinds
 * 4) CalcChanged notifies about a successful step of calculation.
 * 5) CalcMessage notifes about a failure of the MathEngine trying to do the last requested step of calculation. This message reports error-patterns, fill-patterns and other information.
 * 6) CalcTree#methods request services from the MathEngine, which is addressed via the CalcTree, an abstraction of the calculation on the Worksheet with respective positions, formulas and tactics/rules. These methods can be found in the file src/java/isac/interfaces/IToCalc.java. These methods have 2 kinds of effect: (1) they return a value directly to the dialog, or (2) they trigger a CalcEvent.
 * 7) Services from UserGuide are access to hint-pages, update of counters etc.

The use of the above methods can be studied in src/java/isac/wsdialog/WorksheetDialog.java; collections of rules are at Rule-based_Dialog.

Rule-based Dialog Guidance
The above diagram describes the architectural prerequisites for designing dialogs. Dialogs are described by rules, see Rule-based_Dialog. The diagram shows two locations where the rules reside, in the method notifyUserAction and in the method calcResponse obseerving the CalcEvent; the former is triggered by the learners actions, the latter is triggered by the MathEngines feed-back.

The two different locations for rules require coordination; such coordination is done by instance variables in each WorksheetDialog and by other variables managed by the UserGuide. The former concern dialog behaviour which is concerned with only the one specific calculations, the latter supports consistent dialog behaviour across several calculations (and including the browser-dialogs).

TODO instance variables of the WorksheetDialog

TODO Variables managed by the UserGuide