pub async fn html_view_specific_asynchronous_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 => {
            match get_teacher_async_task_summary(task_id, class_id, auth.0, &conn).await {
                Ok((class_task, student_tasks)) => {
                    render_teacher_task_summary(class_task, student_tasks)
                }
                Err(e) => match e {
                    ViewAsyncTaskSummaryError::DatabaseError => database_error(),
                },
            }
        }
        crate::class::ClassMemberRole::Student => {
            match get_student_async_task_summary(task_id, class_id, auth.0, &conn).await {
                Ok((class_task, student_task)) => {
                    render_student_task_summary(class_task, student_task)
                }
                Err(e) => match e {
                    ViewAsyncTaskSummaryError::DatabaseError => database_error(),
                },
            }
        }
    }
}
/// Retrieve information about a specific asynchronous task.
Retrieve information about a specific asynchronous task.
Retrieve information about a specific asynchronous task .
pub async fn html_view_specific_asynchronous_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 => {
            match get_teacher_async_task_summary(task_id, class_id, auth.0, &conn).await {
                Ok((class_task, student_tasks)) => {
                    render_teacher_task_summary(class_task, student_tasks)
                }
                Err(e) => match e {
                    ViewAsyncTaskSummaryError::DatabaseError => database_error(),
                },
            }
        }
        crate::class::ClassMemberRole::Student => {
            match get_student_async_task_summary(task_id, class_id, auth.0, &conn).await {
                Ok((class_task, student_task)) => {
                    render_student_task_summary(class_task, student_task)
                }
                Err(e) => match e {
                    ViewAsyncTaskSummaryError::DatabaseError => database_error(),
                },
            }
        }
    }
}
pub async fn html_view_specific_asynchronous_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 => { match get_teacher_async_task_summary ( task_id , class_id , auth . 0 , & conn ) . await { Ok ( ( class_task , student_tasks ) ) => { render_teacher_task_summary ( class_task , student_tasks ) } Err ( e ) => match e { ViewAsyncTaskSummaryError :: DatabaseError => database_error ( ) , } , } } crate :: class :: ClassMemberRole :: Student => { match get_student_async_task_summary ( task_id , class_id , auth . 0 , & conn ) . await { Ok ( ( class_task , student_task ) ) => { render_student_task_summary ( class_task , student_task ) } Err ( e ) => match e { ViewAsyncTaskSummaryError :: DatabaseError => database_error ( ) , } , } } } }
Retrieve information about a specific asynchronous task.
Retrieve information about a specific asynchronous task .
class_id
i32
task_id
i32
auth
AuthCookie
conn
Database