pub struct Trane { /* private fields */ }Expand description
Trane is a library for the acquisition of highly hierarchical knowledge and skills based on the principles of mastery learning and spaced repetition. Given a list of courses, its lessons and corresponding exercises, Trane presents the student with a list of exercises based on the demonstrated mastery of previous exercises. It makes sure that new material and skills are not introduced until the prerequisite material and skills have been sufficiently mastered.
Implementations§
source§impl Trane
impl Trane
sourcepub fn new(library_root: &Path) -> Result<Trane>
pub fn new(library_root: &Path) -> Result<Trane>
Creates a new instance of the library given the path to the root of a course library. The
user data will be stored in a directory named .trane inside the library root directory.
sourcepub fn library_root(&self) -> String
pub fn library_root(&self) -> String
Returns the path to the root of the course library.
sourcepub fn mantra_count(&self) -> usize
pub fn mantra_count(&self) -> usize
Returns the number of mantras that have been recited by the mantra miner.
Trait Implementations§
source§impl Blacklist for Trane
impl Blacklist for Trane
source§fn add_to_blacklist(&mut self, unit_id: &Ustr) -> Result<()>
fn add_to_blacklist(&mut self, unit_id: &Ustr) -> Result<()>
source§fn remove_from_blacklist(&mut self, unit_id: &Ustr) -> Result<()>
fn remove_from_blacklist(&mut self, unit_id: &Ustr) -> Result<()>
source§impl CourseLibrary for Trane
impl CourseLibrary for Trane
source§fn get_course_manifest(&self, course_id: &Ustr) -> Option<CourseManifest>
fn get_course_manifest(&self, course_id: &Ustr) -> Option<CourseManifest>
source§fn get_lesson_manifest(&self, lesson_id: &Ustr) -> Option<LessonManifest>
fn get_lesson_manifest(&self, lesson_id: &Ustr) -> Option<LessonManifest>
source§fn get_exercise_manifest(&self, exercise_id: &Ustr) -> Option<ExerciseManifest>
fn get_exercise_manifest(&self, exercise_id: &Ustr) -> Option<ExerciseManifest>
source§fn get_course_ids(&self) -> Vec<Ustr> ⓘ
fn get_course_ids(&self) -> Vec<Ustr> ⓘ
source§fn get_lesson_ids(&self, course_id: &Ustr) -> Result<Vec<Ustr>>
fn get_lesson_ids(&self, course_id: &Ustr) -> Result<Vec<Ustr>>
source§impl ExerciseScheduler for Trane
impl ExerciseScheduler for Trane
source§fn get_exercise_batch(
&self,
filter: Option<&UnitFilter>
) -> Result<Vec<(Ustr, ExerciseManifest)>>
fn get_exercise_batch(
&self,
filter: Option<&UnitFilter>
) -> Result<Vec<(Ustr, ExerciseManifest)>>
source§fn score_exercise(
&self,
exercise_id: &Ustr,
score: MasteryScore,
timestamp: i64
) -> Result<()>
fn score_exercise(
&self,
exercise_id: &Ustr,
score: MasteryScore,
timestamp: i64
) -> Result<()>
source§fn invalidate_cached_score(&self, unit_id: &Ustr)
fn invalidate_cached_score(&self, unit_id: &Ustr)
source§impl FilterManager for Trane
impl FilterManager for Trane
source§fn get_filter(&self, id: &str) -> Option<NamedFilter>
fn get_filter(&self, id: &str) -> Option<NamedFilter>
source§impl PracticeStats for Trane
impl PracticeStats for Trane
source§fn get_scores(
&self,
exercise_id: &Ustr,
num_scores: usize
) -> Result<Vec<ExerciseTrial>>
fn get_scores(
&self,
exercise_id: &Ustr,
num_scores: usize
) -> Result<Vec<ExerciseTrial>>
num_scores scores of a particular exercise.source§fn record_exercise_score(
&mut self,
exercise_id: &Ustr,
score: MasteryScore,
timestamp: i64
) -> Result<()>
fn record_exercise_score(
&mut self,
exercise_id: &Ustr,
score: MasteryScore,
timestamp: i64
) -> Result<()>
MasteryScore enum instead of a float. Only units of type UnitType::Exercise
should have scores recorded. However, the enforcement of this requirement is left to the
caller. Read moresource§impl ReviewList for Trane
impl ReviewList for Trane
source§impl UnitGraph for Trane
impl UnitGraph for Trane
source§fn add_lesson(&mut self, lesson_id: &Ustr, course_id: &Ustr) -> Result<()>
fn add_lesson(&mut self, lesson_id: &Ustr, course_id: &Ustr) -> Result<()>
add_course for
lessons. It also requires the ID of the course to which this lesson belongs. Read moresource§fn add_exercise(&mut self, exercise_id: &Ustr, lesson_id: &Ustr) -> Result<()>
fn add_exercise(&mut self, exercise_id: &Ustr, lesson_id: &Ustr) -> Result<()>
add_course and
add_lesson for exercises. It also requires the ID of the lesson to which this exercise
belongs. Read moresource§fn add_dependencies(
&mut self,
unit_id: &Ustr,
unit_type: UnitType,
dependencies: &[Ustr]
) -> Result<()>
fn add_dependencies(
&mut self,
unit_id: &Ustr,
unit_type: UnitType,
dependencies: &[Ustr]
) -> Result<()>
unit_type is UnitType::Exercise as only courses and lessons are allowed to have
dependencies. An error is also returned if the unit is not explicitly added by calling one
of add_course or add_lesson. Read moresource§fn get_unit_type(&self, unit_id: &Ustr) -> Option<UnitType>
fn get_unit_type(&self, unit_id: &Ustr) -> Option<UnitType>
source§fn get_course_lessons(&self, course_id: &Ustr) -> Option<UstrSet>
fn get_course_lessons(&self, course_id: &Ustr) -> Option<UstrSet>
source§fn get_course_starting_lessons(&self, course_id: &Ustr) -> Option<UstrSet>
fn get_course_starting_lessons(&self, course_id: &Ustr) -> Option<UstrSet>
source§fn update_starting_lessons(&mut self)
fn update_starting_lessons(&mut self)
source§fn get_lesson_course(&self, lesson_id: &Ustr) -> Option<Ustr>
fn get_lesson_course(&self, lesson_id: &Ustr) -> Option<Ustr>
source§fn get_lesson_exercises(&self, lesson_id: &Ustr) -> Option<UstrSet>
fn get_lesson_exercises(&self, lesson_id: &Ustr) -> Option<UstrSet>
source§fn get_exercise_lesson(&self, exercise_id: &Ustr) -> Option<Ustr>
fn get_exercise_lesson(&self, exercise_id: &Ustr) -> Option<Ustr>
source§fn get_dependencies(&self, unit_id: &Ustr) -> Option<UstrSet>
fn get_dependencies(&self, unit_id: &Ustr) -> Option<UstrSet>
source§fn get_dependents(&self, unit_id: &Ustr) -> Option<UstrSet>
fn get_dependents(&self, unit_id: &Ustr) -> Option<UstrSet>
source§fn get_dependency_sinks(&self) -> UstrSet
fn get_dependency_sinks(&self) -> UstrSet
Auto Trait Implementations§
impl !RefUnwindSafe for Trane
impl Send for Trane
impl !Sync for Trane
impl Unpin for Trane
impl !UnwindSafe for Trane
Blanket Implementations§
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read more§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read more