--- loncom/homework/bridgetask.pm 2006/11/09 21:31:11 1.200 +++ loncom/homework/bridgetask.pm 2006/11/14 22:12:58 1.205 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.200 2006/11/09 21:31:11 albertel Exp $ +# $Id: bridgetask.pm,v 1.205 2006/11/14 22:12:58 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2104,7 +2104,9 @@ sub start_Dimension { } push(@Apache::bridgetask::dimension,$dim); &Apache::lonxml::startredirection(); - &enable_dimension_parsing($dim); + if (!&skip_dimension_parsing($dim)) { + &enable_dimension_parsing($dim); + } return &internal_location($dim); } @@ -2193,6 +2195,7 @@ sub end_Dimension { my $instance=&get_instance($dim); my $version=&get_version(); if ($target eq 'web') { + $result .= "\n".'
'."\n"; $result .= &nested_parse(\$dimension{$dim}{'intro'},[@_]); my @instances = $instance; if (&Apache::response::showallfoils()) { @@ -2229,10 +2232,10 @@ sub end_Dimension { my $question = ('sub' x $dimension{$dim}{'depth'}).'question'; $question =~ s/^(.)/uc($1)/e; if ($dim_status eq 'pass') { - $dim_info.='

'.$question.' : you passed this '.$mandatory.' question

'; + $dim_info.='

'.$question.' : you passed the above '.$mandatory.' question

'; } if ($dim_status eq 'fail') { - $dim_info.='

'.$question.' : you did not pass this '.$mandatory.' question

'; + $dim_info.='

'.$question.' : you did not pass the above '.$mandatory.' question

'; } my %counts = &get_counts($dim,$instance,$parstack, $safeeval); @@ -2246,19 +2249,30 @@ sub end_Dimension { @{$dimension{$dim}{'criterias'}}) { my $type = $dimension{$dim}{'criteria.'.$id.'.type'}; if ($type eq 'dimension') { - $result.=$dimension{$id}{'result'}; - next; + if (defined($dimension{$id}{'result'})) { + $result.=$dimension{$id}{'result'}; + next; + } else { + $dim_info .= + &nested_parse(\$dimension{$dim}{'criteria.'.$id}, + [@_],{'set_dim_id' => $id}); + } + } else { + my $criteria = + &nested_parse(\$dimension{$dim}{'criteria.'.$id}, + [@_]); + $dim_info .= &layout_web_Criteria($dim,$id,$criteria); } - my $criteria = - &nested_parse(\$dimension{$dim}{'criteria.'.$id}, - [@_]); - $dim_info .= &layout_web_Criteria($dim,$id,$criteria); } + # puts the results at the end of the dimension + $result .= $dim_info; - my $internal_location=&internal_location($dim); - $result=~s/\Q$internal_location\E/$dim_info/; + # puts the results at the beginning of the dimension + # my $internal_location=&internal_location($dim); + # $result=~s/\Q$internal_location\E/$dim_info/; } } + $result .= "\n
\n"; } elsif ($target eq 'webgrade') { # in case of any side effects that we need &nested_parse(\$dimension{$dim}{'intro'},[@_]); @@ -2633,7 +2647,10 @@ sub layout_web_Criteria { $status_display=~s/^([a-z])/uc($1)/e; my $criteria_info.= '
'."\n\t".'

' - .$mandatory.' Criteria

'."\n\t".'

'."\n"; + .$mandatory.' Criteria'."\n\t".'

' + ."\n"; + $criteria =~ s/^\s*//s; + $criteria =~ s/\s*$//s; $criteria_info.= $criteria; $criteria_info.="\n\t".'

'. "\n\t".'

'.$status_display.'

'; @@ -2666,35 +2683,30 @@ sub layout_webgrade_Criteria { if ($status eq $which) { $checked{$which} = 'checked="checked"'; } } if (!%checked) { $checked{'ungraded'} = 'checked="checked"'; } - + my $buttons; + foreach my $which ('ungraded','fail','pass','review') { + $buttons .= < + + $lt{$which} + +END_BUTTON + } + $criteria =~ s/^\s*//s; + $criteria =~ s/\s*$//s; my $result = < -
- $criteria -
-
- - - - -
- -
+
+
+ $criteria +
+
+$buttons +
+ +
END_CRITERIA $result .= &grading_history($version,$dim,$id); return $result;