Skip to main content

Type Alias: Restriction

type Restriction =
| {
from?: Date | string;
type: "date";
until?: Date | string;
}
| {
activityId: number;
max?: number;
min?: number;
type: "grade";
}
| {
activityId: number;
state: CompletionState;
type: "completion";
}
| {
groupId: number;
type: "group";
}
| {
json: unknown;
type: "other";
};

Defined in: areas/activities/conditions.ts:17

One access condition: a date range (from, until or both), a grade in another activity (min, max as percentages of its maximum grade), another activity's completion state, or a group's members. Read back, a condition the driver has no terms for (a grouping, a user profile field, a nested set) is { type: "other", json }, Moodle's own; it's written back as given.