--- loncom/homework/bridgetask.pm 2005/03/28 21:50:46 1.6 +++ loncom/homework/bridgetask.pm 2005/03/31 21:24:29 1.8 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.6 2005/03/28 21:50:46 albertel Exp $ +# $Id: bridgetask.pm,v 1.8 2005/03/31 21:24:29 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -61,6 +61,14 @@ sub proctor_check_auth { return 0; } +sub add_previous_version_button { + my $result; + $result.=' Show a previously done version: '; + return $result; +} + sub start_Task { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; @@ -73,6 +81,9 @@ sub start_Task { my ($result,$head_tag_start,$body_tag_start,$form_tag_start)= &Apache::structuretags::page_start($target,$token,$tagstack,$parstack,$parser,$safeeval); + if ($target eq 'web') { + $body_tag_start.=&add_previous_version_button(); + } if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') { ($status,$accessmsg,$slot) = @@ -153,6 +164,10 @@ sub end_Task { ($target eq 'answer') || ($target eq 'tex') ) { if ($target eq 'web') { + $result.=''. + &Apache::inputtags::file_selector("bridge","task","*", + 'portfolioonly'). + "
"; $result.=&Apache::lonxml::xmlend().''; } } @@ -173,7 +188,6 @@ sub start_ClosingParagraph { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $result; if ($target eq 'web') { - $result='
Closing
'; } return $result; } @@ -182,7 +196,6 @@ sub end_ClosingParagraph { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $result; if ($target eq 'web') { - $result='
'; } return $result; } @@ -205,14 +218,11 @@ sub end_Dimension { #then start repicking my $instance=$dimension{'instances'}->[0]; $result=$dimension{'intro'}. - $dimension{$instance.'.text'}. - '
Criteria
'; - foreach my $id (@{$dimension{$instance.'.criterias'}}) { - $result.=$dimension{$instance.'.criteria.'.$id}. - '
'; - } - $result=~s/
$//; - $result.='
'; + $dimension{$instance.'.text'}; + #FIXME: don't show the criteria yet + #foreach my $id (@{$dimension{$instance.'.criterias'}}) { + # $result.=$dimension{$instance.'.criteria.'.$id}; + #} } return $result; } @@ -223,8 +233,6 @@ sub start_IntroParagraph { if ($target eq 'web') { if ($tagstack->[-2] eq 'Dimension') { &Apache::lonxml::startredirection(); - } else { - $result='
Intro
'; } } return $result; @@ -236,8 +244,6 @@ sub end_IntroParagraph { if ($target eq 'web') { if ($tagstack->[-2] eq 'Dimension') { $dimension{'intro'}=&Apache::lonxml::endredirection(); - } else { - $result='
'; } } return $result;