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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 08 Nov 2005 21:09:09 -0000


albertel		Tue Nov  8 16:09:09 2005 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm structuretags.pm 
  Log:
  - need to always get an offcial <ody> cause of style info
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.220 loncom/homework/lonhomework.pm:1.221
--- loncom/homework/lonhomework.pm:1.220	Tue Nov  8 15:23:27 2005
+++ loncom/homework/lonhomework.pm	Tue Nov  8 16:09:08 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.220 2005/11/08 20:23:27 albertel Exp $
+# $Id: lonhomework.pm,v 1.221 2005/11/08 21:09:08 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -581,10 +581,8 @@
 
 sub analyze_header {
     my ($request) = @_;
-    my $bodytag='<body bgcolor="#ffffff">';
-    if ($env{'environment.remote'} eq 'off') {
-	$bodytag=&Apache::loncommon::bodytag();
-    }
+    my $bodytag=&Apache::loncommon::bodytag(undef,undef,undef,
+					    ($env{'environment.remote'} ne 'off'));
     my $html=&Apache::lonxml::xmlbegin();
     my $result.=$html.'
             <head><title>'.&mt("Analyzing a problem").'</title></head>
@@ -659,7 +657,7 @@
     foreach my $part (sort(keys(%allparts))) {
 	if (defined(@{ $overall{$part.'.answer'} })) {
 	    my $num_cols=scalar(@{ $overall{$part.'.answer'}->[0] });
-	    $request->print('<table border="1" class="thinborder"><tr><th colspan="'.($num_cols+1).'">'.&mt('Part').' '.$part.'</th></tr>');
+	    $request->print('<table class="thinborder"><tr><th colspan="'.($num_cols+1).'">'.&mt('Part').' '.$part.'</th></tr>');
 	    my %frequency;
 	    foreach my $answer (sort {$a->[0] <=> $b->[0]} (@{ $overall{$part.'.answer'} })) {
 		$frequency{join("\0",@{ $answer })}++;
@@ -717,10 +715,8 @@
 	if ($cols > 80) { $cols = 80; }
 	if ($cols < 70) { $cols = 70; }
 	if ($rows < 20) { $rows = 20; }
-	my $bodytag='<body bgcolor="#ffffff">';
-	if ($env{'environment.remote'} eq 'off') {
-	    $bodytag=&Apache::loncommon::bodytag();
-	}
+	my $bodytag=&Apache::loncommon::bodytag(undef,undef,undef,
+					($env{'environment.remote'} ne 'off'));
 	my $html=&Apache::lonxml::xmlbegin();
 	$result.=$html.$bodytag.
 	    &renderpage($request,$file,['no_output_web'],1).
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.317 loncom/homework/structuretags.pm:1.318
--- loncom/homework/structuretags.pm:1.317	Tue Nov  8 14:35:56 2005
+++ loncom/homework/structuretags.pm	Tue Nov  8 16:09:08 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.317 2005/11/08 19:35:56 albertel Exp $
+# $Id: structuretags.pm,v 1.318 2005/11/08 21:09:08 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -115,11 +115,17 @@
 	    &Apache::lonxml::fontsettings();     
     }
     my $body_tag_start;
-    if (!defined($found{'body'}) && $env{'request.state'} eq 'construct'
-	&& $env{'environment.remote'} eq 'off') {
-	if ($target eq 'web' || $target eq 'edit') {
-	    $body_tag_start=&Apache::loncommon::bodytag();
-	    $body_tag_start.=&Apache::lonxml::message_location();
+    if (!defined($found{'body'}) && $env{'request.state'} eq 'construct') {
+	if ($env{'environment.remote'} eq 'off') {
+	    if ($target eq 'web' || $target eq 'edit') {
+		$body_tag_start=&Apache::loncommon::bodytag();
+		$body_tag_start.=&Apache::lonxml::message_location();
+	    }
+	} else {
+	    if ($target eq 'web' || $target eq 'edit') {
+		$body_tag_start=&Apache::loncommon::bodytag(undef,undef,undef,1);
+		$body_tag_start.=&Apache::lonxml::message_location();
+	    }
 	}
     } elsif (!defined($found{'body'})) {
 	my $background=&Apache::lonxml::get_param('background',$parstack,