/// Show a list of all the synchronous tasks have been set in a class, either to a teacher or a
/// student (this is retrieved from the database).
Show a list of all the synchronous tasks have been set in a class, either to a teacher or a
student (this is retrieved from the database).
Show a list of all the synchronous tasks have been set in a class either to a teacher or a student ( this is retrieved from the database ) .
pub async fn html_view_all_sync_tasks_in_class(
    class_id: i32,
    auth: AuthCookie,
    conn: Database,
) -> Html {
    if let Some(role) = get_user_role_in_class(auth.0, class_id, &conn).await {
        match role {
            crate::class::ClassMemberRole::Teacher => {
                let tasks = match show_teacher_sync_tasks_summary(class_id, &conn).await {
                    Ok(t) => t,
                    Err(e) => return e.render(),
                };
                RenderTeacherTaskList(tasks).render()
            }
            crate::class::ClassMemberRole::Student => {
                let tasks = match show_student_sync_tasks_summary(class_id, auth.0, &conn).await {
                    Ok(t) => t,
                    Err(e) => return e.render(),
                };
                RenderClassTaskList(tasks).render()
            }
        }
    } else {
        permission_error()
    }
}
pub async fn html_view_all_sync_tasks_in_class ( class_id : i32 , auth : AuthCookie , conn : Database , ) -> Html { if let Some ( role ) = get_user_role_in_class ( auth . 0 , class_id , & conn ) . await { match role { crate :: class :: ClassMemberRole :: Teacher => { let tasks = match show_teacher_sync_tasks_summary ( class_id , & conn ) . await { Ok ( t ) => t , Err ( e ) => return e . render ( ) , } ; RenderTeacherTaskList ( tasks ) . render ( ) } crate :: class :: ClassMemberRole :: Student => { let tasks = match show_student_sync_tasks_summary ( class_id , auth . 0 , & conn ) . await { Ok ( t ) => t , Err ( e ) => return e . render ( ) , } ; RenderClassTaskList ( tasks ) . render ( ) } } } else { permission_error ( ) } }
Show a list of all the synchronous tasks have been set in a class, either to a teacher or a
student (this is retrieved from the database).
Show a list of all the synchronous tasks have been set in a class either to a teacher or a student ( this is retrieved from the database ) .
class_id
i32
<not_specific>
auth
AuthCookie
<not_specific>
conn
Database
<not_specific>