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

raeburn raeburn at source.lon-capa.org
Fri Sep 23 00:53:49 EDT 2011


raeburn		Fri Sep 23 04:53:49 2011 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - Add some missing localization.
  - CSS styles for paths to handback files
  - Some <br /> tags to improve readability
  
  
-------------- next part --------------
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.651 loncom/homework/grades.pm:1.652
--- loncom/homework/grades.pm:1.651	Thu Sep 22 23:03:09 2011
+++ loncom/homework/grades.pm	Fri Sep 23 04:53:48 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.651 2011/09/22 23:03:09 raeburn Exp $
+# $Id: grades.pm,v 1.652 2011/09/23 04:53:48 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1408,12 +1408,26 @@
 
     my $docopen=&Apache::lonhtmlcommon::javascript_docopen();
     $docopen=~s/^document\.//;
-    my $alertmsg = &mt('Please select a word or group of words from document and then click this link.');
+    my %lt = &Apache::lonlocal::texthash(
+                keyw => 'Keywords list, separated by a space. Add/delete to list if desired.',
+                plse => 'Please select a word or group of words from document and then click this link.',
+                adds => 'Add selection to keyword list? Edit if desired.',
+                comp => 'Compose Message for: ',
+                incl => 'Include',
+                subj => 'Subject',
+                mesa => 'Message',
+                new  => 'New',
+                save => 'Save',
+                canc => 'Cancel',
+                kehi => 'Keyword Highlight Options',
+                txtc => 'Text Color',
+                font => 'Font Size',
+             );
     $request->print(&Apache::lonhtmlcommon::scripttag(<<SUBJAVASCRIPT));
 
 //===================== Show list of keywords ====================
   function keywords(formname) {
-    var nret = prompt("Keywords list, separated by a space. Add/delete to list if desired.",formname.keywords.value);
+    var nret = prompt("$lt{'keyw'}",formname.keywords.value);
     if (nret==null) return;
     formname.keywords.value = nret;
 
@@ -1440,10 +1454,10 @@
     else return;
     var cleantxt = txt.replace(new RegExp('([\\f\\n\\r\\t\\v ])+', 'g')," ");
     if (cleantxt=="") {
-	alert("$alertmsg");
+	alert("$lt{'plse'}");
 	return;
     }
-    var nret = prompt("Add selection to keyword list? Edit if desired.",cleantxt);
+    var nret = prompt("$lt{'adds'}",cleantxt);
     if (nret==null) return;
     document.SCORE.keywords.value = document.SCORE.keywords.value+" "+nret;
     if (document.SCORE.keywords.value != "") {
@@ -1525,16 +1539,16 @@
 
     pDoc.write("<form action=\\"inactive\\" name=\\"msgcenter\\">");
     pDoc.write("<input value=\\""+usrctr+"\\" name=\\"usrctr\\" type=\\"hidden\\">");
-    pDoc.write("<h3><span class=\\"LC_info\\"> Compose Message for \"+fullname+\"<\\/span><\\/h3><br /><br />");
+    pDoc.write("<h3><span class=\\"LC_info\\"> $lt{'comp'}\"+fullname+\"<\\/span><\\/h3><br /><br />");
 
     pDoc.write('<table border="0" width="100%"><tr><td bgcolor="#777777">');
     pDoc.write('<table border="0" width="100%"><tr bgcolor="#DDFFFF">');
-    pDoc.write("<td><b>Type<\\/b><\\/td><td><b>Include<\\/b><\\/td><td><b>Message<\\/td><\\/tr>");
+    pDoc.write("<td><b>Type<\\/b><\\/td><td><b>$lt{'incl'}<\\/b><\\/td><td><b>$lt{'mesa'}<\\/td><\\/tr>");
 }
     function displaySubject(msg,shwsel) {
     pDoc = pWin.document;
     pDoc.write("<tr bgcolor=\\"#ffffdd\\">");
-    pDoc.write("<td>Subject<\\/td>");
+    pDoc.write("<td>$lt{'subj'}<\\/td>");
     pDoc.write("<td align=\\"center\\"><input name=\\"subchk\\" type=\\"checkbox\\"" +shwsel+"><\\/td>");
     pDoc.write("<td><input name=\\"msgsub\\" type=\\"text\\" value=\\""+msg+"\\"size=\\"60\\" maxlength=\\"80\\"><\\/td><\\/tr>");
 }
@@ -1550,7 +1564,7 @@
   function newMsg(newmsg,shwsel) {
     pDoc = pWin.document;
     pDoc.write("<tr bgcolor=\\"#ffffdd\\">");
-    pDoc.write("<td align=\\"center\\">New<\\/td>");
+    pDoc.write("<td align=\\"center\\">$lt{'new'}<\\/td>");
     pDoc.write("<td align=\\"center\\"><input name=\\"newmsgchk\\" type=\\"checkbox\\"" +shwsel+"><\\/td>");
     pDoc.write("<td><textarea name=\\"newmsg\\" cols=\\"60\\" rows=\\"3\\" onchange=\\"javascript:this.form.newmsgchk.checked=true\\" >"+newmsg+"<\\/textarea><\\/td><\\/tr>");
 }
@@ -1559,8 +1573,8 @@
     pDoc = pWin.document;
     pDoc.write("<\\/table>");
     pDoc.write("<\\/td><\\/tr><\\/table> ");
-    pDoc.write("<input type=\\"button\\" value=\\"Save\\" onclick=\\"javascript:checkInput()\\">  ");
-    pDoc.write("<input type=\\"button\\" value=\\"Cancel\\" onclick=\\"self.close()\\"><br /><br />");
+    pDoc.write("<input type=\\"button\\" value=\\"$lt{'save'}\\" onclick=\\"javascript:checkInput()\\">  ");
+    pDoc.write("<input type=\\"button\\" value=\\"$lt{'canc'}\\" onclick=\\"self.close()\\"><br /><br />");
     pDoc.write("<\\/form>");
     pDoc.write('$end_page_msg_central');
     pDoc.close();
@@ -1610,11 +1624,11 @@
     hDoc.$docopen;
     hDoc.write('$start_page_highlight_central');
     hDoc.write("<form action=\\"inactive\\" name=\\"hlCenter\\">");
-    hDoc.write("<h3><span class=\\"LC_info\\"> Keyword Highlight Options<\\/span><\\/h3><br /><br />");
+    hDoc.write("<h3><span class=\\"LC_info\\"> $lt{'kehi'}<\\/span><\\/h3><br /><br />");
 
     hDoc.write('<table border="0" width="100%"><tr><td bgcolor="#777777">');
     hDoc.write('<table border="0" width="100%"><tr bgcolor="#DDFFFF">');
-    hDoc.write("<td><b>Text Color<\\/b><\\/td><td><b>Font Size<\\/b><\\/td><td><b>Font Style<\\/td><\\/tr>");
+    hDoc.write("<td><b>$lt{'txtc'}<\\/b><\\/td><td><b>$lt{'font'}<\\/b><\\/td><td><b>Font Style<\\/td><\\/tr>");
   }
 
   function highlightbody(clrval,clrtxt,clrsel,szval,sztxt,szsel,syval,sytxt,sysel) { 
@@ -1633,8 +1647,8 @@
     var hDoc = hwdWin.document;
     hDoc.write("<\\/table>");
     hDoc.write("<\\/td><\\/tr><\\/table> ");
-    hDoc.write("<input type=\\"button\\" value=\\"Save\\" onclick=\\"javascript:updateChoice(1)\\">  ");
-    hDoc.write("<input type=\\"button\\" value=\\"Cancel\\" onclick=\\"self.close()\\"><br /><br />");
+    hDoc.write("<input type=\\"button\\" value=\\"$lt{'save'}\\" onclick=\\"javascript:updateChoice(1)\\">  ");
+    hDoc.write("<input type=\\"button\\" value=\\"$lt{'canc'}\\" onclick=\\"self.close()\\"><br /><br />");
     hDoc.write("<\\/form>");
     hDoc.write('$end_page_highlight_central');
     hDoc.close();
@@ -1749,7 +1763,7 @@
     my ($symb,$uname,$udom,$counter,$partid,$record,$res_error_pointer) = @_;
     my ($partlist,$handgrade,$responseType) = &response_type($symb,$res_error_pointer);
     my (@respids);
-     my @part_response_id = &flatten_responseType($responseType);
+    my @part_response_id = &flatten_responseType($responseType);
     foreach my $part_response_id (@part_response_id) {
     	my ($part,$resp) = @{ $part_response_id };
         if ($part eq $partid) {
@@ -2001,15 +2015,21 @@
 
 #	if ($env{'form.handgrade'} eq 'yes') {
         if (1) {
+
+            my %lt = &Apache::lonlocal::texthash(
+                          keyw => 'Keyword Options',
+                          past => 'Paste Selection to List',
+                          high => 'Hightlight Attribute',
+                     );    
 #
 # Print out the keyword options line
 #
 	    $request->print(<<KEYWORDS);
- <b>Keyword Options:</b> 
+<br /><b>$lt{'keyw'}:</b> 
 <a href="javascript:keywords(document.SCORE);" target="_self">List</a>   
 <a href="#" onmousedown="javascript:getSel(); return false"
- CLASS="page">Paste Selection to List</a>   
-<a href="javascript:kwhighlight();" target="_self">Highlight Attribute</a><br /><br />
+ CLASS="page">$lt{'past'}</a>   
+<a href="javascript:kwhighlight();" target="_self">$lt{'high'}</a><br /><br />
 KEYWORDS
 #
 # Load the other essays for similarity check
@@ -2531,7 +2551,7 @@
                                                      undef,undef,$showsymb,
                                                      $restitle);
 		$request->print('<br />'.&mt('Sending message to [_1]',$uname.':'.$udom).': '.
-				$msgstatus);
+				$msgstatus.'<br />');
 	    }
 	    if ($env{'form.collaborator'.$ctr}) {
 		my @collabstrs=&Apache::loncommon::get_env_multiple("form.collaborator$ctr");
@@ -2900,8 +2920,7 @@
 			$file_msg.= "\n".'<br /><span class="LC_filename"><a href="/uploaded/'."$domain/$stuname/".$save_file_name.'">'.$save_file_name."</a></span><br />";
 
                     }
-                    $request->print("<br />".$fname." will be the uploaded file name");
-                    $request->print(" ".$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter});
+                    $request->print('<br />'.&mt('[_1] will be the uploaded file name [_2]','<span class="LC_info">'.$fname.'</span>','<span class="LC_filename">'.$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter}.'</span>'));
                     $file_counter++;
                 }
 		my $subject = "File Handed Back by Instructor ";


More information about the LON-CAPA-cvs mailing list