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 correspondings exercises, Trane presents the student with a list of exercises based on the demonstrated mastery of previous exercises. It makes sures that new material and skills are not introduced until the prerequisite material and skills have been sufficiently mastered.
Implementations
sourceimpl Trane
impl Trane
sourcepub fn new(library_root: &str) -> Result<Trane>
pub fn new(library_root: &str) -> Result<Trane>
Creates a new entrance 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.
Trait Implementations
sourceimpl Blacklist for Trane
impl Blacklist for Trane
sourcefn add_unit(&mut self, unit_id: &str) -> Result<()>
fn add_unit(&mut self, unit_id: &str) -> Result<()>
Adds the given unit to the list of blacklisted units.
sourcefn remove_unit(&mut self, unit_id: &str) -> Result<()>
fn remove_unit(&mut self, unit_id: &str) -> Result<()>
Removes the given unit from the list of blacklisted units. Do nothing if the unit is not already in the list. Read more
sourcefn blacklisted(&self, unit_id: &str) -> Result<bool>
fn blacklisted(&self, unit_id: &str) -> Result<bool>
Returns whether the given unit should be skipped during scheduling.
sourcefn all_entries(&self) -> Result<Vec<String>>
fn all_entries(&self) -> Result<Vec<String>>
Returns the list of blacklisted units.
sourceimpl CourseLibrary for Trane
impl CourseLibrary for Trane
sourcefn get_course_manifest(&self, course_id: &str) -> Option<CourseManifest>
fn get_course_manifest(&self, course_id: &str) -> Option<CourseManifest>
Returns the manifest for the given course.
sourcefn get_lesson_manifest(&self, lesson_id: &str) -> Option<LessonManifest>
fn get_lesson_manifest(&self, lesson_id: &str) -> Option<LessonManifest>
Returns the manifest for the given lesson.
sourcefn get_exercise_manifest(&self, exercise_id: &str) -> Option<ExerciseManifest>
fn get_exercise_manifest(&self, exercise_id: &str) -> Option<ExerciseManifest>
Returns the manfifest for the given exercise.
sourceimpl DebugUnitGraph for Trane
impl DebugUnitGraph for Trane
sourcefn get_uid(&self, unit_id: &str) -> Option<u64>
fn get_uid(&self, unit_id: &str) -> Option<u64>
Retrieves the assigned uid to the given unit_id.
sourcefn get_id(&self, unit_uid: u64) -> Option<String>
fn get_id(&self, unit_uid: u64) -> Option<String>
Retrieves the human-readable ID of the unit with the given UID.
sourcefn get_unit_type(&self, unit_uid: u64) -> Option<UnitType>
fn get_unit_type(&self, unit_uid: u64) -> Option<UnitType>
Returns the type of the given unit.
sourceimpl ExerciseScheduler for Trane
impl ExerciseScheduler for Trane
sourcefn set_options(&self, options: SchedulerOptions)
fn set_options(&self, options: SchedulerOptions)
Sets the options used while searching for exercise candidates.
sourcefn get_exercise_batch(
&self,
filter: Option<&UnitFilter>
) -> Result<Vec<(String, ExerciseManifest)>>
fn get_exercise_batch(
&self,
filter: Option<&UnitFilter>
) -> Result<Vec<(String, ExerciseManifest)>>
Gets a new batch of exercises scheduled for a new trial.
sourcefn record_exercise_score(
&self,
exercise_id: &str,
score: MasteryScore,
timestamp: i64
) -> Result<()>
fn record_exercise_score(
&self,
exercise_id: &str,
score: MasteryScore,
timestamp: i64
) -> Result<()>
Records the score of the given exercise’s trial.
sourceimpl FilterManager for Trane
impl FilterManager for Trane
sourcefn get_filter(&self, id: &str) -> Option<NamedFilter>
fn get_filter(&self, id: &str) -> Option<NamedFilter>
Gets the filter with the given ID.
sourcefn list_filters(&self) -> Vec<(String, String)>
fn list_filters(&self) -> Vec<(String, String)>
Returns a list of filter IDs and descriptions.
sourceimpl PracticeStats for Trane
impl PracticeStats for Trane
sourcefn get_scores(
&self,
exercise_id: &str,
num_scores: usize
) -> Result<Vec<ExerciseTrial>>
fn get_scores(
&self,
exercise_id: &str,
num_scores: usize
) -> Result<Vec<ExerciseTrial>>
Retrieves the last num_scores scores of a particular exercese.
sourcefn record_exercise_score(
&mut self,
exercise_id: &str,
score: MasteryScore,
timestamp: i64
) -> Result<()>
fn record_exercise_score(
&mut self,
exercise_id: &str,
score: MasteryScore,
timestamp: i64
) -> Result<()>
Records the score assigned to the exercise in a particular trial. Therefore, the score is a value of the 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 more
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more