Skip to main content

Module agent_changesets

Module agent_changesets 

Source
Expand description

Agent changesets: one user’s unpublished agent changes in one course.

Structs§

AgentChangeset
AgentChangesetCounts
What the course management view shows of the user’s changesets in a course without listing them.

Enums§

AgentChangesetStatus

Constants§

EXPIRY_WARNING_DAYS 🔒
How early before expiry results and the review page start warning about it.
LIFETIME_AFTER_LAST_WRITE_DAYS 🔒
How long an open changeset lives after its last write.

Functions§

discard
Drops an open changeset’s staged changes. Errors with RecordNotFound if it is not open.
get_by_id
The changeset, whatever its status.
get_by_id_for_update
Like get_by_id, locking the row until the transaction ends so that publishing, discarding and staging of one changeset never interleave.
get_by_id_for_user
The user’s changeset. Errors with NotFound if it is someone else’s, so that callers don’t reveal other users’ changesets.
get_by_user_and_course
The user’s changesets in the course, newest first.
get_counts
The user’s AgentChangesetCounts in the course.
get_course_ids_by_user
The courses the user has changesets in.
get_open
The user’s open changeset for the course, if any. See get_or_create_open.
get_open_and_recent_by_user
The user’s open changesets in the courses and their closed_limit most recent closed ones, newest first.
get_open_changing_page
The user’s open changeset that changes the page, if any.
get_or_create_open
The user’s open changeset for the course, created if there is none.
increment_revision
Increments the revision of a changeset the caller has locked with get_by_id_for_update and returns the new revision.
mark_published
Marks an open changeset published. Errors if it is no longer open.
record_write
Records a write to an open changeset the caller has locked with get_by_id_for_update: increments its revision and pushes its expiry to LIFETIME_AFTER_LAST_WRITE_DAYS from now.