refactor: Remove lti_deployment_id and state from LTI structs and simplify lesson dependency query.
This commit is contained in:
@@ -1023,13 +1023,11 @@ pub async fn get_lesson_content(
|
||||
// We check if there are any prerequisites that the user hasn't completed yet.
|
||||
#[derive(sqlx::FromRow)]
|
||||
struct UnmetDep {
|
||||
prerequisite_lesson_id: Uuid,
|
||||
prereq_title: String,
|
||||
min_score_percentage: Option<f32>
|
||||
}
|
||||
let unmet_dependencies: Vec<UnmetDep> = sqlx::query_as(
|
||||
r#"
|
||||
SELECT ld.prerequisite_lesson_id, p.title as prereq_title, ld.min_score_percentage::float4 as min_score_percentage
|
||||
SELECT p.title as prereq_title
|
||||
FROM lesson_dependencies ld
|
||||
JOIN lessons p ON ld.prerequisite_lesson_id = p.id
|
||||
LEFT JOIN user_grades ug ON ld.prerequisite_lesson_id = ug.lesson_id AND ug.user_id = $2
|
||||
|
||||
@@ -19,7 +19,6 @@ pub struct LtiLoginParams {
|
||||
pub target_link_uri: String,
|
||||
pub lti_message_hint: Option<String>,
|
||||
pub client_id: Option<String>,
|
||||
pub lti_deployment_id: Option<String>,
|
||||
}
|
||||
|
||||
pub async fn lti_login_initiation(
|
||||
@@ -69,7 +68,6 @@ pub async fn lti_login_initiation(
|
||||
#[derive(Deserialize)]
|
||||
pub struct LtiLaunchParams {
|
||||
pub id_token: String,
|
||||
pub state: String,
|
||||
}
|
||||
|
||||
pub async fn validate_lti_jwt(
|
||||
|
||||
Reference in New Issue
Block a user