[LON-CAPA-cvs] cvs: loncom(version_2_1_X) /homework structuretags.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 29 Mar 2006 22:43:29 -0000


albertel		Wed Mar 29 17:43:29 2006 EDT

  Modified files:              (Branch: version_2_1_X)
    /loncom/homework	structuretags.pm 
  Log:
  - backport 1.339
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.332.2.1 loncom/homework/structuretags.pm:1.332.2.2
--- loncom/homework/structuretags.pm:1.332.2.1	Tue Mar 28 13:31:37 2006
+++ loncom/homework/structuretags.pm	Wed Mar 29 17:43:29 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.332.2.1 2006/03/28 18:31:37 albertel Exp $
+# $Id: structuretags.pm,v 1.332.2.2 2006/03/29 22:43:29 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -44,7 +44,7 @@
 sub start_web {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $bodytext=&Apache::lonxml::get_all_text("/web",$parser,$style);
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	return $bodytext;
     }
     return '';
@@ -980,8 +980,8 @@
 
     my $result;
 
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
-	$target eq 'tex' || $target eq 'analyze') {
+    if ($target eq 'web' || $target eq 'grade'   || $target eq 'answer'  ||
+	$target eq 'tex' || $target eq 'analyze' || $target eq 'webgrade') {
 	my $code = $token->[2]->{'condition'};
 	if (defined($code)) {
 	    if (!$Apache::lonxml::default_homework_loaded) {
@@ -1024,8 +1024,8 @@
 
     my $result;
 
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
-	$target eq 'tex' || $target eq 'analyze') {
+    if ($target eq 'web' || $target eq 'grade'   || $target eq 'answer' ||
+	$target eq 'tex' || $target eq 'analyze' || $target eq 'webgrade') {
 	my $include = $token->[2]->{'include'};
 	my $exclude = $token->[2]->{'exclude'};
         my %languages=&Apache::loncommon::display_languages();
@@ -1077,8 +1077,8 @@
 
     my $result;
 
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
-	$target eq 'tex' || $target eq 'analyze') {
+    if ($target eq 'web' || $target eq 'grade'   || $target eq 'answer' ||
+	$target eq 'tex' || $target eq 'analyze' || $target eq 'webgrade') {
         $result=($env{'request.role'}=~/^(in|cc|au|ca|li)/);
 	if ( (! $result) or ($env{'form.instructor_comments'} eq 'hide')) {
 	    my $skip=&Apache::lonxml::get_all_text("/instructorcomment",
@@ -1106,8 +1106,8 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
 
     my $result;
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
-	$target eq 'tex' || $target eq 'analyze') {
+    if ($target eq 'web' || $target eq 'grade'   || $target eq 'answer' ||
+	$target eq 'tex' || $target eq 'analyze' || $target eq 'webgrade') {
 	my $code = $token->[2]->{'condition'};
 
 	push( @Apache::structuretags::whileconds, $code);
@@ -1139,8 +1139,8 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     my $result;
 
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
-	$target eq 'tex' || $target eq 'analyze') {
+    if ($target eq 'web' || $target eq 'grade'   || $target eq 'answer' ||
+	$target eq 'tex' || $target eq 'analyze' || $target eq 'webgrade') {
 	my $code = pop(@Apache::structuretags::whileconds);
 	my $bodytext = pop(@Apache::structuretags::whilebody);
 	my $line = pop(@Apache::structuretags::whileline);
@@ -1173,8 +1173,8 @@
 sub start_randomlist {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result;
-    if ($target eq 'answer' || $target eq 'grade' || $target eq 'web' ||
-	$target eq 'tex' || $target eq 'analyze') {
+    if ($target eq 'answer' || $target eq 'grade'   || $target eq 'web' ||
+	$target eq 'tex'    || $target eq 'analyze' || $target eq 'webgrade') {
 	my $body= &Apache::lonxml::get_all_text("/randomlist",$parser);
 	my $b_parser= HTML::LCParser->new(\$body);
 	$b_parser->xml_mode(1);
@@ -1414,7 +1414,8 @@
 
 sub start_preduedate {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') {
+    if ($target eq 'web' || $target eq 'grade'    || $target eq 'answer' ||
+	$target eq 'tex' || $target eq 'webgrade') {
 	&Apache::lonxml::debug("State in preduedate is ". $Apache::inputtags::status['-1']);
 	if (!$Apache::lonhomework::scantronmode &&
 	    $Apache::inputtags::status['-1'] ne 'CAN_ANSWER' &&
@@ -1432,7 +1433,7 @@
 
 sub start_postanswerdate {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-    if ($target eq 'web' || $target eq 'grade') {
+    if ($target eq 'web' || $target eq 'grade' || $target eq 'webgrade') {
 	if ($Apache::lonhomework::scantronmode ||
 	    $Apache::inputtags::status['-1'] ne 'SHOW_ANSWER') {
 	    &Apache::lonxml::get_all_text("/postanswerdate",$parser,$style);
@@ -1450,7 +1451,7 @@
 sub start_notsolved {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
-	$target eq 'tex') {
+	$target eq 'tex' || $target eq 'webgrade') {
 	my $gradestatus=$Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"};
 	&Apache::lonxml::debug("not solved has :$gradestatus:");
 	if ($gradestatus =~ /^correct/ &&
@@ -1486,8 +1487,8 @@
 sub start_problemtype {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result;
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
-	$target eq 'tex' || $target eq 'analyze') {
+    if ($target eq 'web' || $target eq 'grade'   || $target eq 'answer' ||
+	$target eq 'tex' || $target eq 'analyze' || $target eq 'webgrade') {
 	my $mode=lc(&Apache::lonxml::get_param('mode',$parstack,$safeeval));
 	if (!defined($mode)) { $mode='show'; }
 	my $for=&Apache::lonxml::get_param('for',$parstack,$safeeval);