+
+ class="inprogress"
+ style="width:@users.completion@%;"
+
+
+ class="flagged"
+
+
+ class="ok"
+
+ >
+
+ }
+ }
+ n_artifacts {
+ label "[_ proctoring-support.n_artifacts_label]"
+ }
+ n_reviewed {
+ label "[_ proctoring-support.n_reviewed_label]"
+ }
+ n_flagged {
+ label "[_ proctoring-support.n_flagged_label]"
+ }
+ }
+
db_multirow -extend {
student_id
proctoring_url
portrait_url
filter
+ completion
} -unclobber users get_users {
- select distinct a.user_id,
- p.first_names,
- p.last_name
+ with reviewed_picture_name as (
+ select name from proctoring_object_artifacts
+ where object_id = :object_id
+ order by metadata is not null desc
+ fetch first 1 rows only
+ )
+ select a.user_id,
+ p.last_name || ' ' || p.first_names as name,
+ count(*) as n_artifacts,
+ count(a.metadata->'revisions') as n_reviewed,
+ count(
+ (select 1 from
+ jsonb_path_query(a.metadata->'revisions',
+ '$[*] ? (@.flag == "true")')
+ fetch first 1 rows only
+ )
+ ) as n_flagged
from proctoring_object_artifacts a,
persons p
where object_id = :object_id
+ and (a.type = 'audio' or
+ a.name = (select name from reviewed_picture_name))
and a.user_id = p.person_id
- order by last_name asc, first_names asc
+ group by a.user_id, p.person_id
+ order by p.last_name asc, p.first_names asc
} {
set student_id [::party::email -party_id $user_id]
set proctoring_url [export_vars -no_base_encode -base $base_url { user_id object_id }]
set portrait_url /shared/portrait-bits.tcl?user_id=$user_id
- set filter [string tolower "$last_name $first_names $student_id"]
+ set filter [string tolower "$name $student_id"]
+
+ if {$n_artifacts > 0} {
+ set completion [expr {round(100 * (($n_reviewed * 1.0) / ($n_artifacts * 1.0)))}]
+ }
}
}