Skip to content

ControlStructureT

Stian Håklev edited this page Sep 7, 2017 · 1 revision

A control operator is an operator which receives the standard input (ObjectT), and produces a control describing which activities should be open for which students.

The data structure for issuing a single control (to one activity, or a number of activities all getting the same command), is based on the activityDataT structure, however we also specify whether the mode is include or exclude. With include, only students/groups listed are included. With exclude, all students, other than the ones listed, are included.

export type ControlT = {
  structure: structureDefT,
  mode: 'include' | 'exclude',
  payload: {
    [attributeKey: string]: true
  }
};

This is then wrapped in another structure, which determines whether the same command will be sent to all connected activities, or whether each activity will receive a different `ControlT` structure.

export type ControlStructureT =
  | { 'all': ControlT }
  | { 'list': { [activityId: string]: ControlT } };