All interactions between Objects in CourseLab learning modules are based on the "Event – Action" mechanism.
An Event is a signal originated either by the Object or during the course by the user. Generally, Events are generated when the state of an Object changes (for example, at the moment of Object appearance) otherwise Events are generated externally (for example, by mouse click on the Object).
Actions are predefined changes of an Object state and/or Module variables which are used for creating complex Object behavior.
The Events are used to trigger execution of Actions.
The Event source could be :
In the first case, All Events are generated by the CourseLab player; in the second case, the common Events for all Objects are generated by the CourseLab player and all Object-specific Events are generated directly in the Object’s code.
For illustration purposes, and to better understand the “Event – Action” mechanism, let us review the following example: Picture a street with a pedestrian crosswalk equipped with two traffic lights - one for pedestrians, and another one for vehicles. At the red signal of the vehicle traffic light the traffic stops, and starts again when red signal switches its color to green. Respectively, the pedestrians start crossing the crosswalk on the green signal and stop at red. In the example described above in the Event of “red signal of the traffic light for vehicles”, the “Car” type of Objects performed the Action “Stop”. In the Event of “green signal of the traffic light for vehicles” , the “Car” type of Objects performed the Action “Start”. “Pedestrians” type of Objects performs similar Actions but using Events of its own traffic light. The source for the Events in both cases is the two traffic lights.