pub enum ExerciseBuilder {
ExampleExercise {
ids: ExerciseIds,
assignment_blocks: Vec<GutenbergBlock>,
name: String,
options: Value,
},
Quizzes {
ids: ExerciseIds,
name: String,
needs_peer_review: bool,
deadline: Option<DateTime<Utc>>,
spec: JsonSource,
assignment_blocks: Vec<GutenbergBlock>,
},
Tmc {
ids: ExerciseIds,
name: String,
deadline: Option<DateTime<Utc>>,
spec: JsonSource,
assignment_blocks: Vec<GutenbergBlock>,
},
}
Expand description
Builder for different types of exercises.
Variants§
ExampleExercise
Multiple choice exercise with custom options
Quizzes
Quizzes service exercise with JSON specification
Tmc
Test My Code exercise
Implementations§
Source§impl ExerciseBuilder
impl ExerciseBuilder
pub fn quizzes( name: impl Into<String>, ids: ExerciseIds, needs_pr: bool, deadline: Option<DateTime<Utc>>, spec: JsonSource, assignment_blocks: Vec<GutenbergBlock>, ) -> Self
pub fn tmc( name: impl Into<String>, ids: ExerciseIds, deadline: Option<DateTime<Utc>>, spec: JsonSource, assignment_blocks: Vec<GutenbergBlock>, ) -> Self
pub fn example_exercise( name: impl Into<String>, ids: ExerciseIds, assignment_blocks: Vec<GutenbergBlock>, options: Value, ) -> Self
pub(crate) fn to_cms( &self, _cx: &SeedContext<'_>, ) -> Result<(GutenbergBlock, CmsPageExercise, CmsPageExerciseSlide, CmsPageExerciseTask)>
Trait Implementations§
Source§impl Clone for ExerciseBuilder
impl Clone for ExerciseBuilder
Source§fn clone(&self) -> ExerciseBuilder
fn clone(&self) -> ExerciseBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ExerciseBuilder
impl RefUnwindSafe for ExerciseBuilder
impl Send for ExerciseBuilder
impl Sync for ExerciseBuilder
impl Unpin for ExerciseBuilder
impl UnwindSafe for ExerciseBuilder
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
Converts
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>
Converts
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