pub async fn html_view_specific_synchronous_task(
    class_id: i32,
    task_id: i32,
    auth: AuthCookie,
    conn: Database,
) -> Html {
    let role = if let Some(role) = get_user_role_in_class(auth.0, class_id, &conn).await {
        role
    } else {
        return permission_error();
    };
    match role {
        crate::class::ClassMemberRole::Teacher => {
            let summary =
                match get_teacher_sync_task_summary(task_id, class_id, auth.0, &conn).await {
                    Ok(t) => t,
                    Err(e) => return e.render(),
                };
            RenderTeacherSummary(summary).render()
        }
        crate::class::ClassMemberRole::Student => {
            let task = match get_student_sync_task_summary(task_id, class_id, auth.0, &conn).await {
                Ok(t) => t,
                Err(e) => return e.render(),
            };
            RenderStudentSummary(task).render()
        }
    }
}
/// Retrieve information about a specific synchronous task.
Retrieve information about a specific synchronous task.
Retrieve information about a specific synchronous task .
pub async fn html_view_specific_synchronous_task(
    class_id: i32,
    task_id: i32,
    auth: AuthCookie,
    conn: Database,
) -> Html {
    let role = if let Some(role) = get_user_role_in_class(auth.0, class_id, &conn).await {
        role
    } else {
        return permission_error();
    };
    match role {
        crate::class::ClassMemberRole::Teacher => {
            let summary =
                match get_teacher_sync_task_summary(task_id, class_id, auth.0, &conn).await {
                    Ok(t) => t,
                    Err(e) => return e.render(),
                };
            RenderTeacherSummary(summary).render()
        }
        crate::class::ClassMemberRole::Student => {
            let task = match get_student_sync_task_summary(task_id, class_id, auth.0, &conn).await {
                Ok(t) => t,
                Err(e) => return e.render(),
            };
            RenderStudentSummary(task).render()
        }
    }
}
pub async fn html_view_specific_synchronous_task ( class_id : i32 , task_id : i32 , auth : AuthCookie , conn : Database , ) -> Html { let role = if let Some ( role ) = get_user_role_in_class ( auth . 0 , class_id , & conn ) . await { role } else { return permission_error ( ) ; } ; match role { crate :: class :: ClassMemberRole :: Teacher => { let summary = match get_teacher_sync_task_summary ( task_id , class_id , auth . 0 , & conn ) . await { Ok ( t ) => t , Err ( e ) => return e . render ( ) , } ; RenderTeacherSummary ( summary ) . render ( ) } crate :: class :: ClassMemberRole :: Student => { let task = match get_student_sync_task_summary ( task_id , class_id , auth . 0 , & conn ) . await { Ok ( t ) => t , Err ( e ) => return e . render ( ) , } ; RenderStudentSummary ( task ) . render ( ) } } }
Retrieve information about a specific synchronous task.
Retrieve information about a specific synchronous task .
class_id
i32
task_id
i32
auth
AuthCookie
conn
Database