Expand description
Agent changesets: one user’s unpublished agent changes in one course.
Structs§
- Agent
Changeset - Agent
Changeset Counts - What the course management view shows of the user’s changesets in a course without listing them.
Enums§
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
RecordNotFoundif 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
NotFoundif 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
AgentChangesetCountsin 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_limitmost 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_updateand 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 toLIFETIME_AFTER_LAST_WRITE_DAYSfrom now.