pub struct ExerciseRecord {
pub id: Uuid,
pub page_id: Uuid,
pub name: String,
pub deadline: Option<DateTime<Utc>>,
pub needs_peer_review: bool,
pub needs_self_review: bool,
pub tasks: Vec<ExerciseTaskRecord>,
pub review_config: ExerciseReviewConfig,
}Expand description
What agents may edit of an exercise, and what identifies its tasks and review settings. The
exercise itself is stored in the full PageSnapshot of its page.
Fields§
§id: Uuid§page_id: UuidThe page whose snapshot the record was made from. A call that moves the exercise’s block
leaves it as it was;
CourseState::exercise_page_id has the page that
holds the block.
name: String§deadline: Option<DateTime<Utc>>The exercise’s own deadline; None lets its chapter’s apply.
needs_peer_review: bool§needs_self_review: bool§tasks: Vec<ExerciseTaskRecord>In slide order, then task order.
review_config: ExerciseReviewConfigImplementations§
Source§impl ExerciseRecord
impl ExerciseRecord
Sourcepub fn of_bundle(page_id: Uuid, bundle: &ExerciseBundle) -> Self
pub fn of_bundle(page_id: Uuid, bundle: &ExerciseBundle) -> Self
The record of one exercise of the page page_id.
Sourcepub fn of_page(page: &PageSnapshot) -> Vec<Self>
pub fn of_page(page: &PageSnapshot) -> Vec<Self>
The records of the page’s exercises.
Sourcepub fn has_same_content(&self, other: &ExerciseRecord) -> bool
pub fn has_same_content(&self, other: &ExerciseRecord) -> bool
Whether the records differ only in the page they were made from.
Sourcepub fn has_reviews(&self) -> bool
pub fn has_reviews(&self) -> bool
Whether the exercise has peer or self reviews, whose instructions it then shows.
Sourcepub fn apply_to(
&self,
before: &ExerciseRecord,
bundle: &mut ExerciseBundle,
course_default: Option<&CmsPeerOrSelfReviewConfiguration>,
new_id: impl FnMut() -> Uuid,
) -> Result<(), ExerciseEditError>
pub fn apply_to( &self, before: &ExerciseRecord, bundle: &mut ExerciseBundle, course_default: Option<&CmsPeerOrSelfReviewConfiguration>, new_id: impl FnMut() -> Uuid, ) -> Result<(), ExerciseEditError>
Writes the change from before to this record into bundle. Switching to own review
settings copies course_default, with new_id ids for its questions. Errors if bundle
isn’t the exercise before describes, or the copy needs a default the course lacks.
Trait Implementations§
Source§impl Clone for ExerciseRecord
impl Clone for ExerciseRecord
Source§fn clone(&self) -> ExerciseRecord
fn clone(&self) -> ExerciseRecord
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExerciseRecord
impl Debug for ExerciseRecord
Source§impl PartialEq for ExerciseRecord
impl PartialEq for ExerciseRecord
impl StructuralPartialEq for ExerciseRecord
Auto Trait Implementations§
impl Freeze for ExerciseRecord
impl RefUnwindSafe for ExerciseRecord
impl Send for ExerciseRecord
impl Sync for ExerciseRecord
impl Unpin for ExerciseRecord
impl UnsafeUnpin for ExerciseRecord
impl UnwindSafe for ExerciseRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].