let show_team env (cgi:Netcgi1_compat.Netcgi_types.cgi_activation) =
let hpr = cgi # output # output_string in
export_type := HtmlJscpt;
handle_export_type cgi;
handle_html_arg cgi "projnum" (fun s -> projectssel := (try pa_of_string s
with _ -> []));
handle_html_arg cgi "teamnum" (fun s -> teamssel := (try (convert_to_int_list s)
with _ -> []));
handle_html_arg cgi "groupnum" (fun s -> groupssel := (try (convert_to_int_list s)
with _ -> !num_groups));
handle_html_arg cgi "grade" (fun s ->
if ((List.length !teamssel) = 1) &
((List.length !groupssel) = 1) then try
Printf.printf "Update : grade '%.1f' to team %d for project %s\n"
(float_of_string s) (List.hd !teamssel)
(pa_to_string !projectssel); flush stdout;
give_mark_to_team (List.hd !groupssel)
!projectssel (List.hd !teamssel)
(float_of_string s)
with _ -> ());
handle_html_arg cgi "name" (fun s ->
if ((List.length !teamssel) = 1) &
((List.length !groupssel) = 1) then try
let groupnum = List.hd !groupssel in
let teamnum = List.hd !teamssel in
Printf.printf "Update : name '%s' in team %d for project %s\n"
s teamnum (pa_to_string !projectssel); flush stdout;
update_group_project_team_name
groupnum !projectssel teamnum s;
with _ -> ());
begin match !export_type with
| HtmlJscpt
| Html -> begin
initialize_html hpr "Display team";
List.iter (fun gnum -> List.iter (fun tnum ->
I.print_team_html (hpr) !student_list !projectssel gnum tnum)
!teamssel) !groupssel;
display_exports_html hpr cgi;
if (!verbose_mode) then begin
hpr "<hr/>";
display_args_html hpr cgi;
display_values_html hpr;
end;
finalize_html hpr;
end;
| _ -> hpr "This export type has not been implemented yet";
end;
cgi # output # commit_work();