[LON-CAPA-cvs] cvs: loncom /homework bridgetask.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 07 Nov 2006 21:31:23 -0000


albertel		Tue Nov  7 16:31:23 2006 EDT

  Modified files:              
    /loncom/homework	bridgetask.pm 
  Log:
  - call sub Dimension/questions subquestion
  
  
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.195 loncom/homework/bridgetask.pm:1.196
--- loncom/homework/bridgetask.pm:1.195	Tue Nov  7 15:07:10 2006
+++ loncom/homework/bridgetask.pm	Tue Nov  7 16:31:22 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.195 2006/11/07 20:07:10 albertel Exp $
+# $Id: bridgetask.pm,v 1.196 2006/11/07 21:31:22 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2097,8 +2097,10 @@
 	    &Apache::lonxml::get_param('Mandatory',$parstack,$safeeval);
 	push(@{$dimension{$previous_dim}{'criterias'}},$dim);
 	$dimension{$dim}{'nested'}=$previous_dim;
+	$dimension{$dim}{'depth'} = 1 + $dimension{$previous_dim}{'depth'};
 	&Apache::lonxml::debug("adding $dim as criteria to $previous_dim");
     } else {
+	$dimension{$top}{'depth'}=0;
 	$dimension{$top}{'criteria.'.$dim.'.type'}='dimension';
 	$dimension{$top}{'criteria.'.$dim.'.mandatory'}=
 	    &Apache::lonxml::get_param('Mandatory',$parstack,$safeeval);
@@ -2227,11 +2229,14 @@
 		    $mandatory='Optional';
 		}
 		my $dim_info="<div class='LC_$dim_status LC_question_grade'>\n";
+		my $question = ('sub' x $dimension{$dim}{'depth'}).'question';
+		my $ucquestion = $question;
+		$ucquestion =~ s/^(.)/uc($1)/e;
 		if ($dim_status eq 'pass') {
-		    $dim_info.='<h3>Question : you passed this '.$mandatory.' question</h3>';
+		    $dim_info.='<h3>'.$ucquestion.' : you passed this '.$mandatory.' '.$question.'</h3>';
 		}
 		if ($dim_status eq 'fail') {
-		    $dim_info.='<h3>Question : you did not pass this '.$mandatory.' question</h3>';
+		    $dim_info.='<h3>'.$ucquestion.' : you did not pass this '.$mandatory.' '.$question.'</h3>';
 		}
 		my $man_count=0;
 		my $man_passed=0;