--- loncom/homework/bridgetask.pm 2006/06/09 22:31:36 1.163 +++ loncom/homework/bridgetask.pm 2006/06/09 23:09:01 1.164 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.163 2006/06/09 22:31:36 albertel Exp $ +# $Id: bridgetask.pm,v 1.164 2006/06/09 23:09:01 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -614,6 +614,10 @@ DONESCREEN $result.=''.&mt("Stopped grading.").''.$back; } elsif ($status_code eq 'cancel') { $result.=''.&mt("Cancelled grading.").''.$back; + } elsif ($status_code eq 'never_versioned') { + $result.=''. + &mt("Requested user has never accessed the task."). + ''.$back; } elsif ($status_code eq 'lock_failed') { $result.=''.&mt("Failed to lock the requested record.") .''.$back; @@ -726,8 +730,10 @@ sub get_key_todo { if (!$queue) { $env{'form.queue'} = $queue = 'none'; #not queued so doing either a re or pre grade - #FIXME don't allow pregrade - &Apache::lonxml::debug("not in queue no lock"); + my %status = &Apache::lonnet::restore($symb,$cid,$udom,$uname); + if ($status{'resource.0.version'} < 1) { + return (undef,'never_versioned'); + } return ($gradingkey); }