--- loncom/homework/bridgetask.pm 2005/09/09 18:20:16 1.45 +++ loncom/homework/bridgetask.pm 2005/09/29 19:27:19 1.56 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.45 2005/09/09 18:20:16 albertel Exp $ +# $Id: bridgetask.pm,v 1.56 2005/09/29 19:27:19 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -158,6 +158,8 @@ sub add_grading_button { $result.='
'.&mt("Review Queue has [_1] entries. [_2] of them are ready to be graded and [_3] of them are currently being graded",$entries,$ready,$locks); $result.='
'."\n"; + $result.=' '."\n"; } return $result; } @@ -202,6 +204,87 @@ sub preserve_grade_info { return $result; } +sub style { + return (< +STYLE + +} + +sub show_task { + my ($status,$previous)=@_; + if (!$previous && ( + ( $status eq 'CLOSED' ) || + ( $status eq 'BANNED') || + ( $status eq 'UNAVAILABLE') || + ( $status eq 'NOT_IN_A_SLOT') || + ( $status eq 'NEEDS_CHECKIN') || + ( $status eq 'WAITING_FOR_GRADE') || + ( $status eq 'INVALID_ACCESS') )) { + return 0; + } + return 1; +} + +sub internal_location { + my ($id)=@_; + return ''; +} + sub start_Task { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; @@ -245,14 +328,7 @@ sub start_Task { &Apache::run::run($expression,$safeeval); &Apache::lonxml::debug("Got $status"); $body_tag_start.=&add_previous_version_button($status); - if (!$previous && ( - ( $status eq 'CLOSED' ) || - ( $status eq 'BANNED') || - ( $status eq 'UNAVAILABLE') || - ( $status eq 'NOT_IN_A_SLOT') || - ( $status eq 'NEEDS_CHECKIN') || - ( $status eq 'WAITING_FOR_GRADE') || - ( $status eq 'INVALID_ACCESS') )) { + if (!&show_task($status,$previous)) { my $bodytext=&Apache::lonxml::get_all_text("/task",$parser); if ( $target eq "web" ) { $result.= $head_tag_start.''.$body_tag_start; @@ -289,30 +365,21 @@ sub start_Task { } elsif ($target eq 'web') { my $name= &Apache::structuretags::get_resource_name($parstack,$safeeval); $result.="$head_tag_start".&mt('You needed to pass all of the [_1] mandatory components and [_2] of the [_3] optional components on the bridge task.',$man_count,$opt_req,$opt_count)."