pub struct Progress {
pub typed: String,
pub verdict: Verdict,
pub solved: Vec<&'static str>,
/* private fields */
}Expand description
The reader’s position in the material.
Fields§
§typed: StringThe answer typed so far.
verdict: VerdictWhether the current question has been answered.
solved: Vec<&'static str>Questions answered correctly, by identifier.
Implementations§
Source§impl Progress
impl Progress
Sourcepub fn current_lesson(&self) -> Option<&'static Lesson>
pub fn current_lesson(&self) -> Option<&'static Lesson>
The lesson currently open, when the item is one.
Sourcepub fn current_question(&self) -> Option<&'static Question>
pub fn current_question(&self) -> Option<&'static Question>
The question currently open, when the item is one.
Sourcepub fn is_question(&self) -> bool
pub fn is_question(&self) -> bool
Whether the open item expects an answer.
Sourcepub fn jump_to_questions(&mut self)
pub fn jump_to_questions(&mut self)
Jumps to the first question, for a reader who wants to test themselves.
Sourcepub fn submit(&mut self)
pub fn submit(&mut self)
Judges the typed answer.
A wrong answer does not move on: the worked explanation appears and the reader can try again, which is the point of asking in the first place.
Sourcepub fn reset_answer(&mut self)
pub fn reset_answer(&mut self)
Clears the typed answer and the verdict.
Sourcepub fn solved_count(&self) -> usize
pub fn solved_count(&self) -> usize
How many questions have been answered correctly.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Whether every question has been answered correctly.
Trait Implementations§
impl Eq for Progress
impl StructuralPartialEq for Progress
Auto Trait Implementations§
impl Freeze for Progress
impl RefUnwindSafe for Progress
impl Send for Progress
impl Sync for Progress
impl Unpin for Progress
impl UnsafeUnpin for Progress
impl UnwindSafe for Progress
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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