--- loncom/homework/bridgetask.pm 2016/08/31 19:08:18 1.267 +++ loncom/homework/bridgetask.pm 2025/03/31 13:55:08 1.274 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.267 2016/08/31 19:08:18 raeburn Exp $ +# $Id: bridgetask.pm,v 1.274 2025/03/31 13:55:08 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,12 +32,14 @@ package Apache::bridgetask; use strict; use Apache::lonnet; +use Apache::loncommon; use Apache::File(); use Apache::lonmenu; use Apache::lonlocal; use Apache::lonxml; use Apache::slotrequest(); use Apache::structuretags(); +use HTML::Entities(); use Time::HiRes qw( gettimeofday tv_interval ); use LONCAPA; @@ -65,6 +67,7 @@ sub initialize_bridgetask { sub proctor_check_auth { my ($slot_name,$slot,$type)=@_; my $user=$env{'form.proctorname'}; + $user =~ s/^\s+|\s+$//g; my $domain=$env{'form.proctordomain'}; my @allowed=split(",",$slot->{'proctor'}); @@ -123,7 +126,7 @@ sub check_in_sequence { my ($symb) = &Apache::lonnet::whichuser(); my ($map) = &Apache::lonnet::decode_symb($symb); my @resources = - $navmap->retrieveResources($map, sub { $_[0]->is_problem() },0,0); + $navmap->retrieveResources($map, sub { $_[0]->is_problem() || $_[0]->is_tool() },0,0); my %old_history = %Apache::lonhomework::history; my %old_results = %Apache::lonhomework::results; @@ -131,7 +134,14 @@ sub check_in_sequence { foreach my $res (@resources) { &Apache::lonxml::debug("doing ".$res->src); &Apache::structuretags::initialize_storage($res->symb); - my $type = ($res->is_task()) ? 'Task' : 'problem'; + my $type; + if ($res->is_task()) { + $type = 'Task'; + } elsif ($res->is_tool) { + $type = 'tool'; + } else { + $type = 'problem'; + } my $result = &create_new_version($type,$user,$domain,$slot_name,$res->symb,$ip,$needsiptied); if ($result eq 'ok') { &Apache::structuretags::finalize_storage($res->symb); @@ -187,7 +197,7 @@ sub create_new_version { $domain = $env{'user.domain'}; } - } elsif ($type eq 'problem') { + } elsif (($type eq 'problem') || ($type eq 'tool')) { &Apache::lonxml::debug("authed $slot_name"); } if (!defined($user) || !defined($domain)) { @@ -3270,14 +3280,8 @@ sub proctor_validation_screen { my ($slot) = @_; my (undef,undef,$domain,$user) = &Apache::lonnet::whichuser(); my $url=&Apache::lonnet::studentphoto($domain,$user,'jpg'); - if ($url ne '/adm/lonKaputt/lonlogo_broken.gif') { - $url = "
'
@@ -3305,43 +3309,77 @@ sub proctor_validation_screen {
my %lt = &Apache::lonlocal::texthash(
'prva' => "Proctor Validation",
'yoro' => "Your room's proctor needs to validate your access to this resource.",
- 'prus' => "Proctor's Username:",
- 'pasw' => "Password:",
- 'prdo' => "Proctor's Domain:",
+ 'prus' => "Proctor's Username",
+ 'pasw' => "Password",
+ 'prdo' => "Proctor's Domain",
'vali' => 'Validate',
'stui' => "Student who should be logged in is:",
- 'name' => "Name:",
+ 'name' => "Name",
'sid' => "Student/Employee ID",
- 'unam' => "Username:",
+ 'unam' => "Username",
+ 'phot' => "Photo",
);
- my $result= (< $lt{'yoro'} $msg'.$lt{'name'}.': '.$name.' '.
+ &Apache::loncommon::end_data_table_row()."\n".
+ &Apache::loncommon::start_data_table_row().
+ ''.$lt{'sid'}.': '.$env{'environment.id'}.' '.
+ &Apache::loncommon::end_data_table_row()."\n".
+ &Apache::loncommon::start_data_table_row().
+ ''.$lt{'unam'}.': '.$user.':'.$domain.' '.
+ &Apache::loncommon::end_data_table_row();
+ if ($url ne '/adm/lonKaputt/lonlogo_broken.gif') {
+ $studenttable .= &Apache::loncommon::start_data_table_row().
+ ''.$lt{'phot'}.' '.
+ ' '.
+ &Apache::loncommon::end_data_table_row()."\n";
+ }
+ $studenttable .= &Apache::loncommon::end_data_table()."\n";
+ if ($msg ne '') {
+ $msg = "
';
+ }
+ return (<$lt{'prva'}
+
+$studenttable
+