-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mohamed
committed
Feb 5, 2024
1 parent
0014f03
commit 1ebd03c
Showing
27 changed files
with
562 additions
and
59 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
decay_rate_factor_correct: 0.5 # 0.0 no decay 0.1 - 0.9 (positive effect fades faster, requiring more frequent review) | ||
decay_rate_factor_incorrect: 0.3 # 0.1 to 0.5 - up to 0.5 increases the penalty for incorrect answers | ||
consecutive_hours_threshold: 3 # 2 to 6 hours | ||
progress_threshold: 40 # higher means easier to recall 20 to 60 | ||
streak_bonus: 5 | ||
min_score: 2 | ||
max_score: 120 | ||
decimals: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
decay_rate_factor_correct: 0.0 # 0.0 no decay | ||
decay_rate_factor_incorrect: 0.0 | ||
consecutive_hours_threshold: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
decay_rate_factor_correct: 0.0 # 0.0 no decay | ||
decay_rate_factor_incorrect: 0.0 | ||
consecutive_hours_threshold: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use rocket::post; | ||
use rocket::{serde::json::Json, State}; | ||
|
||
use crate::learning::models::{ | ||
user_stat::UserStat, | ||
analytic::Analytic, | ||
learning_config::LearningConfig | ||
}; | ||
use crate::learning::compute_user_stats_analytics::compute_user_stats_analytics; | ||
|
||
#[post("/user-stats-analytics", format = "json", data = "<user_stats>")] | ||
pub fn user_stats_analytics(config: &State<LearningConfig>, user_stats: Json<Vec<UserStat>>) | ||
-> Json<Vec<Analytic>> { | ||
let item_progress = compute_user_stats_analytics(&**config, &user_stats); | ||
|
||
Json(item_progress) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pub fn calculate_decay_rate(elapsed_days: i64, repetitions: Option<i32>) -> f32 { | ||
// Adjust decay rate based on the number of repetitions (if available) | ||
let repetitions_factor = match repetitions { | ||
Some(rep_count) if rep_count > 0 => 1.0 / (rep_count as f32), | ||
_ => 1.0, // Default factor if no repetitions or repetitions is 0 | ||
}; | ||
|
||
// Calculate the decay rate based on elapsed days and repetitions factor | ||
// Adjust these parameters as needed for your specific application | ||
let decay_rate = 1.0 - (elapsed_days as f32 * repetitions_factor * 0.01); | ||
|
||
// Ensure the decay rate is within bounds (between 0 and 1) | ||
decay_rate.clamp(0.0, 1.0) | ||
} |
Oops, something went wrong.