OTrunk activities may be created by
- directly writing OTML files, either by hand or using a template system
- creating and editing OTrunk components from within the OTrunk system and saving the resulting OTML file
- some hybrid combination of the two
OTML files may be written directly by hand, or they may be produced with the help of a template system that will create a basic OTML file and allow the author to fill in the content. Some work has been done to assist hand-writing OTML files by using schemas, which can then be used in conjunction with XML editors to produce valid OTML files.
When an OTrunk activity is run, all changes to the OTrunk components are saved, and the resulting changes can be exported as an OTML file.
Currently there are two modes that an OTrunk activity can be run in: Learner mode and Author mode. When an activity is run in Learner mode, all changes are saved into a database which is separate from the main database containing all the OTrunk components. When the learner saves their data, the resulting OTML file represents only the changes to the components made by that learner. When an activity is run in Author mode, in contrast, all changes are reflected directly in the main database. When an author saves their data, the resulting OTML file consists of the entire activity, with their changes included. This allows an author to create and edit new OTrunk activities.
Author mode and view mode are controlled by the system property otrunk.view.author, which must be set to true for authoring.
While any changes to an object while in author mode will be saved directly into the complete OTML file generated, most default views of OTrunk components allow very few changes to be made. For example, the default view of a Data Table, OTDataTableView, allows text to be entered into the table's cells, but does not allow the author to change the table's title, or the number of columns in the table. For this reason, authoring views of most OTrunk components have been created which allow an author to change attributes of a component that would normally be inaccessible to a student.
By using authoring views, authors can change the attributes of embedded OTrunk components. However, this alone does not provide a way to embed new components into an activity, or to start an activity from scratch. Fortunately, the Document authoring view provides this functionality, which enables complete WYSYWYG authoring.