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

raeburn raeburn@source.lon-capa.org
Wed, 12 Aug 2009 22:57:14 -0000


raeburn		Wed Aug 12 22:57:14 2009 EDT

  Modified files:              (Branch: version_2_9_X)
    /loncom/homework	structuretags.pm 
  Log:
  - Backport 1.448, 1.449, 1.452, 1.457.
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.444 loncom/homework/structuretags.pm:1.444.4.1
--- loncom/homework/structuretags.pm:1.444	Mon May 11 16:51:22 2009
+++ loncom/homework/structuretags.pm	Wed Aug 12 22:57:14 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.444 2009/05/11 16:51:22 bisitz Exp $
+# $Id: structuretags.pm,v 1.444.4.1 2009/08/12 22:57:14 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -243,10 +243,11 @@
 
 	my ($symb,undef,undef,undef,$publicuser)= &Apache::lonnet::whichuser();
 	if ($symb eq '' && !$publicuser) {
-	    my $help = &Apache::loncommon::help_open_topic("Ambiguous_Reference");
-	    $help=&mt("Browsing resource, all submissions are temporary.")."<br />";
-	    $page_start .= $help;
-	}
+        if ($symb eq '' && !$publicuser) {
+            $page_start .= '<p class="LC_info">'
+                          .&mt('Browsing resource, all submissions are temporary.')
+                          .'</p>';
+        }
     }
 
     if (!defined($found{'body'}) && $env{'request.state'} ne 'construct') {
@@ -418,14 +419,16 @@
 	    '</div>';
     }
     
-    my $show_all_foils_text = 
-	($Apache::lonhomework::parsing_a_task) ?
-	&mt('&nbsp;Show&nbsp;All&nbsp;Instances')
-	: &mt('&nbsp;Show&nbsp;All&nbsp;Foils');
+    my $show_all_foils_text =
+        ($Apache::lonhomework::parsing_a_task) ?
+        &mt('Show All Instances')
+        : &mt('Show All Foils');
 
-    my $show_all= '<span class="LC_nobreak"><label><input type="checkbox" name="showallfoils"';
+    my $show_all= '<span class="LC_nobreak"><label for="showallfoils">'
+                 .'<input type="checkbox" name="showallfoils"';
     if (defined($env{'form.showallfoils'})) { $show_all.=' checked="checked"'; }
-    $show_all.= ' />'.$show_all_foils_text.'</label></span>';
+    $show_all.= ' /> '.$show_all_foils_text
+               .'</label></span>';
 
 
 
@@ -674,9 +677,7 @@
     return (<<ENDCHECKOUT);
 <h2>$lt{'resource'}</h2>
     <p>$lt{'id_expln'}</p>
-<font color="red">
-<p>$lt{'warning'}</p>
-</font>
+<p class="LC_warning">$lt{'warning'}</p>
 <form name="checkout" method="post" action="$uri">
 <input type="hidden" name="doescheckout" value="yes" />
 <input type="button" name="checkoutbutton" value="$lt{'checkout'}" onClick="javascript:if (confirm('$lt{'checkout?'}')) { document.checkout.submit(); }" />
@@ -902,14 +903,16 @@
 		    '<input type="hidden" name="username"
                              value="'.$env{'form.username'}.'" />';
 	    }
-	    if ($env{'request.role.adv'}) {
-		$form_tag_start.=
-		    ' <label><input type="checkbox" name="showallfoils"';
-		if (defined($env{'form.showallfoils'})) {
-		    $form_tag_start.=' checked="checked"';
-		}
-		$form_tag_start.= ' />'.&mt('&nbsp;Show&nbsp;All&nbsp;Foils').
-		    '</label>';
+            if ($env{'request.role.adv'}) {
+                $form_tag_start.= ' <label class="LC_nobreak">'
+                         .'<input type="checkbox" name="showallfoils"';
+                if (defined($env{'form.showallfoils'})) {
+                    $form_tag_start.=' checked="checked"';
+                }
+                $form_tag_start.= ' /> '
+                                 .&mt('Show All Foils')
+                                 .'</label>';
+
 	    }
             if ($Apache::lonhomework::type eq 'practice') {
                 $form_tag_start.=&practice_problem_header();
@@ -1066,8 +1069,10 @@
 	#  it in the problem header.  We have been logging the
 	#  last due date written to file. 
 	
-	my $duetime = &Apache::lonnet::EXT("resource.$id.duedate"); 
+	my $duetime = &Apache::lonnet::EXT("resource.$id.duedate");
 	my $duedate = POSIX::strftime("%c",localtime($duetime));
+        my $duedate_text = &mt('Due date: [_1]'
+                              ,&Apache::lonlocal::locallocaltime($duetime));
 	my $temp_file;
 	my $filename = "/home/httpd/prtspool/$env{'user.name'}_$env{'user.domain'}_printout.due";
 	
@@ -1099,13 +1104,13 @@
 	    if (not $env{'request.symb'} =~ m/\.page_/) {
 		if(not $duedate=~m/1969/ and $Apache::lonhomework::type ne 'exam') {
 		    $frontmatter .= $begin_doc.
-			'\textit{Due date: '.$duedate.'} '.$toc_line;
+			'\textit{'.$duedate_text.'} '.$toc_line;
 		} else {
 		    $frontmatter.= $begin_doc.$toc_line;
 		    if ($Apache::lonhomework::type eq 'exam' and $allow_print_points==1) { $frontmatter .= '\fbox{\textit{'.$weight.' pt}}';}
 		}
 	    } else {
-		$frontmatter .= '\vskip 1mm\textit{Due date: '.$duedate.'} \\\\\\\\'.$startminipage;
+		$frontmatter .= '\vskip 1mm\textit{'.$duedate_text.'} \\\\\\\\'.$startminipage;
 	    }
 	} else {
 	    if (not $env{'request.symb'} =~ m/\.page_/) {