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(working_dir: &Path, library_root: &Path) -> Result<Trane>
pub fn new(working_dir: &Path, 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.
The working directory will be used to resolve relative paths.
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§fn remove_prefix_from_blacklist(&mut self, prefix: &str) -> Result<()>
fn remove_prefix_from_blacklist(&mut self, prefix: &str) -> 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§fn get_exercise_ids(&self, lesson_id: &Ustr) -> Result<Vec<Ustr>>
fn get_exercise_ids(&self, lesson_id: &Ustr) -> Result<Vec<Ustr>>
source§fn get_all_exercise_ids(&self) -> Result<Vec<Ustr>>
fn get_all_exercise_ids(&self) -> Result<Vec<Ustr>>
source§fn search(&self, query: &str) -> Result<Vec<Ustr>>
fn search(&self, query: &str) -> Result<Vec<Ustr>>
source§fn get_user_preferences(&self) -> UserPreferences
fn get_user_preferences(&self) -> UserPreferences
source§impl ExerciseScheduler for Trane
impl ExerciseScheduler for Trane
source§fn get_exercise_batch(
&self,
filter: Option<ExerciseFilter>
) -> Result<Vec<(Ustr, ExerciseManifest)>>
fn get_exercise_batch( &self, filter: Option<ExerciseFilter> ) -> 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§fn invalidate_cached_scores_with_prefix(&self, prefix: &str)
fn invalidate_cached_scores_with_prefix(&self, prefix: &str)
invalidate_cached_score apply.source§fn get_scheduler_options(&self) -> SchedulerOptions
fn get_scheduler_options(&self) -> SchedulerOptions
source§fn set_scheduler_options(&mut self, options: SchedulerOptions)
fn set_scheduler_options(&mut self, options: SchedulerOptions)
source§fn reset_scheduler_options(&mut self)
fn reset_scheduler_options(&mut self)
source§impl FilterManager for Trane
impl FilterManager for Trane
source§fn get_filter(&self, id: &str) -> Option<SavedFilter>
fn get_filter(&self, id: &str) -> Option<SavedFilter>
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. The scores are returned in
descending order according to the timestamp.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.source§impl RepositoryManager for Trane
impl RepositoryManager for Trane
source§fn add_repo(&mut self, url: &str, repo_id: Option<String>) -> Result<()>
fn add_repo(&mut self, url: &str, repo_id: Option<String>) -> Result<()>
source§fn remove_repo(&mut self, repo_id: &str) -> Result<()>
fn remove_repo(&mut self, repo_id: &str) -> Result<()>
source§fn update_repo(&self, repo_id: &str) -> Result<()>
fn update_repo(&self, repo_id: &str) -> Result<()>
source§fn update_all_repos(&self) -> Result<()>
fn update_all_repos(&self) -> Result<()>
source§fn list_repos(&self) -> Result<Vec<RepositoryMetadata>>
fn list_repos(&self) -> Result<Vec<RepositoryMetadata>>
source§impl ReviewList for Trane
impl ReviewList for Trane
source§impl StudySessionManager for Trane
impl StudySessionManager for Trane
source§fn get_study_session(&self, id: &str) -> Option<StudySession>
fn get_study_session(&self, id: &str) -> Option<StudySession>
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<()>
source§fn add_exercise(&mut self, exercise_id: &Ustr, lesson_id: &Ustr) -> Result<()>
fn add_exercise(&mut self, exercise_id: &Ustr, lesson_id: &Ustr) -> Result<()>
source§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 was not previously added by calling one
of add_course or add_lesson.source§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_starting_lessons(&self, course_id: &Ustr) -> Option<UstrSet>
fn get_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
source§fn check_cycles(&self) -> Result<()>
fn check_cycles(&self) -> Result<()>
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§
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, 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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§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.§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.