--- loncom/homework/bridgetask.pm 2005/11/21 17:47:37 1.80 +++ loncom/homework/bridgetask.pm 2005/11/21 21:51:29 1.81 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.80 2005/11/21 17:47:37 albertel Exp $ +# $Id: bridgetask.pm,v 1.81 2005/11/21 21:51:29 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -60,7 +60,7 @@ sub initialize_bridgetask { } sub proctor_check_auth { - my ($slot_name,$slot)=@_; + my ($slot_name,$slot,$type)=@_; my $user=$env{'form.proctorname'}; my $domain=$env{'form.proctordomain'}; @@ -79,7 +79,7 @@ sub proctor_check_auth { $authenticated=1; } } - if ($authenticated) { + if ($authenticated && $type eq 'Task') { my $version= $Apache::lonhomework::results{'resource.version'}= ++$Apache::lonhomework::history{'resource.version'}; @@ -93,6 +93,12 @@ sub proctor_check_auth { } } return 1; + } elsif ($authenticated && $type eq 'problem') { + &Apache::lonxml::debug("authed #slot_name"); + $Apache::lonhomework::results{"resource.0.checkedin"}= + $user.'@'.$domain; + $Apache::lonhomework::results{"resource.0.checkedin.slot"}= + $slot_name; } } } @@ -416,7 +422,7 @@ sub start_Task { $target eq 'tex') { my ($version,$previous)=&get_version(); ($status,$accessmsg,my $slot_name,$slot) = - &Apache::lonhomework::check_task_access('0'); + &Apache::lonhomework::check_slot_access('0','Task'); push(@Apache::inputtags::status,$status); $Apache::inputtags::slot_name=$slot_name; my $expression='$external::datestatus="'.$status.'";'; @@ -470,7 +476,7 @@ DONESCREEN } } elsif ($target eq 'grade' && !$env{'form.webgrade'}) { if ($status eq 'NEEDS_CHECKIN') { - if(&proctor_check_auth($slot_name,$slot)) { + if(&proctor_check_auth($slot_name,$slot,'Task')) { my $result=&add_to_queue('gradingqueue', $Apache::inputtags::slot_name); &Apache::lonxml::debug("add_to_queue said $result"); @@ -525,19 +531,23 @@ DONESCREEN } else { if ($target eq 'webgrade') { $result.="\n"; + my $back='

'. + &mt('Return to resource').'

'; if ($status_code eq 'stop') { - $result.=''.&mt("Stopped grading.").''; + $result.=''.&mt("Stopped grading.").''.$back; } elsif ($status_code eq 'lock_failed') { - $result.=''.&mt("Failed to lock the request record.").''; + $result.=''.&mt("Failed to lock the request record.") + .''.$back; } elsif ($status_code eq 'unlock') { - $result.=''.&mt("Unlocked the requested record.").''; + $result.=''.&mt("Unlocked the requested record.") + .''.$back; $result.=&show_queue($env{'form.queue'},1); } elsif ($status_code eq 'show_list') { $result.=&show_queue($env{'form.queue'},1); } elsif ($status_code eq 'select_user') { $result.=&select_user(); } else { - $result.=''.&mt("No user to be graded.").''; + $result.=''.&mt("No user to be graded.").''.$back; } } $webgrade='no';