--- loncom/homework/bridgetask.pm 2007/02/23 01:04:05 1.227 +++ loncom/homework/bridgetask.pm 2007/04/06 21:22:24 1.230 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.227 2007/02/23 01:04:05 albertel Exp $ +# $Id: bridgetask.pm,v 1.230 2007/04/06 21:22:24 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -38,7 +38,6 @@ use Apache::lonlocal; use Apache::lonxml; use Apache::slotrequest(); use Time::HiRes qw( gettimeofday tv_interval ); -use lib '/home/httpd/lib/perl/'; use LONCAPA; @@ -2839,35 +2838,6 @@ sub start_Criteria { push(@{$dimension{$dim}{'criterias'}},$id); } } elsif ($target eq 'edit') { - if (0) { - $result = &Apache::edit::tag_start($target,$token); - my $text=&Apache::lonxml::get_all_text("/criteria",$parser); - &Apache::lonnet::logthis("get_all_text criteria \n$text"); - my $local_parser = HTML::LCParser->new(\$text); - $local_parser->xml_mode(1); - $local_parser->marked_sections(1); - while (1) { - my $criteria_text = - &Apache::lonxml::get_all_text('gradernote',$local_parser); - $result.= - &Apache::edit::editfield($token->[1],$criteria_text,'',80,4); - - # check for a next might be end - my $token = $local_parser->get_token(); - # is the end - last if (!$token); - my $gradernote = &Apache::lonxml::get_all_text('/gradernote', - $local_parser); - # purge the end tag - my $token = $local_parser->get_token(); - $gradernote = ''.$gradernote.''; - @Apache::scripttag::parser_env = @_; - $result .= - &Apache::edit::end_row().&Apache::edit::start_spanning_row(). - &Apache::scripttag::xmlparse($gradernote). - &Apache::edit::end_row().&Apache::edit::start_spanning_row(); - } - } $result .=&Apache::edit::tag_start($target,$token); $result.= &Apache::edit::text_arg('Id:','id',$token,10).' '. @@ -3044,19 +3014,43 @@ 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 = ""; + } else { + undef($url); + } + my $name=&Apache::loncommon::plainname($user,$domain); my $msg; if ($env{'form.proctorpassword'}) { - $msg='

'.&mt("Failed to authenticate the proctor.") - .'

'; + $msg.='

' + .&mt("Failed to authenticate the proctor.") + .'

'; } + + my $valid; + my @possible_proctors=split(",",$slot->{'proctor'}); + foreach my $proctor (@possible_proctors) { + if ($proctor =~ /$LONCAPA::username_re:$LONCAPA::domain_re/) { + $valid = 1; + last; + } + } + if (!$valid) { + $msg.='

' + .&mt("No valid poctors are defined.") + .'

'; + } + if (!$env{'form.proctordomain'}) { $env{'form.proctordomain'}=$domain; } + my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'}); + $uri = &HTML::Entities::encode($uri,'<>&"'); my $result= (<Proctor Validation

Your room's proctor needs to validate your access to this resource.

$msg -
+ @@ -3072,7 +3066,7 @@ sub proctor_validation_screen { - + $url
Name:$name
Student ID:$env{'environment.id'}
Usename$user:$domain