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

raeburn raeburn at source.lon-capa.org
Tue Aug 13 23:33:55 EDT 2013


raeburn		Wed Aug 14 03:33:55 2013 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/homework	grades.pm 
  Log:
  - For 2.11
    - Backport 1.694, 1.695, 1.696, 1.697, 1.698.
  
  
-------------- next part --------------
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.596.2.12.2.17 loncom/homework/grades.pm:1.596.2.12.2.18
--- loncom/homework/grades.pm:1.596.2.12.2.17	Sat Jun 29 16:27:39 2013
+++ loncom/homework/grades.pm	Wed Aug 14 03:33:54 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.596.2.12.2.17 2013/06/29 16:27:39 raeburn Exp $
+# $Id: grades.pm,v 1.596.2.12.2.18 2013/08/14 03:33:54 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1793,7 +1793,7 @@
     $wgt       = ($wgt > 0 ? $wgt : '1');
     my $score  = ($$record{'resource.'.$partid.'.awarded'} eq '' ?
 		  '' : &compute_points($$record{'resource.'.$partid.'.awarded'},$wgt));
-    my $result='<input type="hidden" name="WGT'.$counter.'_'.$partid.'" value="'.$wgt.'" />'."\n";
+    my $data_WGT='<input type="hidden" name="WGT'.$counter.'_'.$partid.'" value="'.$wgt.'" />'."\n";
     my $display_part= &get_display_part($partid,$symb);
     my %last_resets = &get_last_resets($symb,$env{'request.course.id'},
 				       [$partid]);
@@ -1801,7 +1801,7 @@
     if ($last_resets{$partid}) {
         $aggtries = &get_num_tries($record,$last_resets{$partid},$partid);
     }
-    $result.=&Apache::loncommon::start_data_table_row();
+    my $result=&Apache::loncommon::start_data_table_row();
     my $ctr = 0;
     my $thisweight = 0;
     my $increment = &get_increment();
@@ -1838,8 +1838,8 @@
 
 
     $result .= 
-	    '<td>'.$display_part.'</td><td>'.$radio.'</td><td>'.&mt('or').'</td><td>'.$line.'</td>';
-    $result.=&Apache::loncommon::end_data_table_row();
+	    '<td>'.$data_WGT.$display_part.'</td><td>'.$radio.'</td><td>'.&mt('or').'</td><td>'.$line.'</td>';
+    $result.=&Apache::loncommon::end_data_table_row().'<td colspan="6">';
     $result.='<input type="hidden" name="stores'.$counter.'_'.$partid.'" value="" />'."\n".
 	'<input type="hidden" name="oldpts'.$counter.'_'.$partid.'" value="'.$score.'" />'."\n".
 	'<input type="hidden" name="solved'.$counter.'_'.$partid.'" value="'.
@@ -1850,6 +1850,7 @@
         $aggtries.'" />'."\n";
     my $res_error;
     $result.=&handback_box($symb,$uname,$udom,$counter,$partid,$record,\$res_error);
+    $result.='</td>'.&Apache::loncommon::end_data_table_row();
     if ($res_error) {
         return &navmap_errormsg();
     }
@@ -2138,7 +2139,7 @@
  <b>$lt{'keyw'}:</b> 
 <a href="javascript:keywords(document.SCORE);" target="_self">$lt{'list'}</a>   
 <a href="#" onmousedown="javascript:getSel(); return false"
- CLASS="page">$lt{'past'}</a>   
+ class="page">$lt{'past'}</a>   
 <a href="javascript:kwhighlight();" target="_self">$lt{'high'}</a><br /><br />
 KEYWORDS
 #
@@ -2252,13 +2253,14 @@
 		if ($env{"form.$uname:$udom:$partid:submitted_by"}) {
 		    if (exists($seenparts{$partid})) { next; }
 		    $seenparts{$partid}=1;
-		    my $submitby='<b>Part:</b> '.$display_part.
-			' <b>Collaborative submission by:</b> '.
-			'<a href="javascript:viewSubmitter(\''.
-			$env{"form.$uname:$udom:$partid:submitted_by"}.
-			'\');" target="_self">'.
-			$$fullname{$env{"form.$uname:$udom:$partid:submitted_by"}}.'</a><br />';
-		    $request->print($submitby);
+                    $request->print(
+                        '<b>'.&mt('Part: [_1]',$display_part).'</b>'.
+                        ' <b>'.&mt('Collaborative submission by: [_1]',
+                                   '<a href="javascript:viewSubmitter(\''.
+                                   $env{"form.$uname:$udom:$partid:submitted_by"}.
+                                   '\');" target="_self">'.
+                                   $$fullname{$env{"form.$uname:$udom:$partid:submitted_by"}}.'</a>').
+                        '<br />');
 		    next;
 		}
 		my $responsetype = $responseType->{$partid}->{$respid};
@@ -2325,18 +2327,26 @@
                             if ($hide eq 'anon') {
                                 $lastsubonly.='<br />'.&mt('[quant,_1,file] uploaded to this anonymous survey',scalar(@{$files}));
                             } else {
-                                $lastsubonly.='<br /><span class="LC_warning">'.&mt('Like all files provided by users, this file may contain viruses').'</span><br />';
+                                $lastsubonly.='<br /><br />'.'<b>'.&mt('Submitted Files:').'</b>'
+                                            .'<br /><span class="LC_warning">';
+                                if(@$files == 1) {
+                                    $lastsubonly .= &mt('Like all files provided by users, this file may contain viruses!');
+                                } else {
+                                    $lastsubonly .= &mt('Like all files provided by users, these files may contain viruses!');
+                                }
+                                $lastsubonly .= '</span>';
+
                                 foreach my $file (@$files) {
                                     &Apache::lonnet::allowuploaded('/adm/grades',$file);
-                                    $lastsubonly.='<br /><a href="'.$file.'?rawmode=1" target="lonGRDs"><img src="'.&Apache::loncommon::icon($file).'" border="0" /> '.$file.'</a>';
+                                    $lastsubonly.='<br /><a href="'.$file.'?rawmode=1" target="lonGRDs"><img src="'.&Apache::loncommon::icon($file).'" border="0" alt="" /> '.$file.'</a>';
                                 }
                             }
 			    $lastsubonly.='<br />';
 			}
                         if ($hide eq 'anon') {
-                            $lastsubonly.='<b>'.&mt('Anonymous Survey').'</b>'; 
+                            $lastsubonly.='<br /><b>'.&mt('Anonymous Survey').'</b>'; 
                         } else {
-			    $lastsubonly.='<b>'.&mt('Submitted Answer:').' </b>'.
+			    $lastsubonly.='<br /><b>'.&mt('Submitted Answer:').' </b>'.
 			        &cleanRecord($subval,$responsetype,$symb,$partid,
 					     $respid,\%record,$order,undef,$uname,$udom,$type,$trial,$rndseed);
                         }
@@ -2393,9 +2403,9 @@
 	    '<input type="hidden" name="newmsg'.$counter.'" value="" />'."\n";
 	$result.=' <a href="javascript:msgCenter(document.SCORE,'.$counter.
 	    ',\''.$msgfor.'\');" target="_self">'.
-	    &mt('Compose message to student').(scalar(@$col_fullnames) >= 1 ? 's' : '').'</a><label> ('.
+	    &mt('Compose message to student'.(scalar(@$col_fullnames) >= 1 ? 's' : '')).'</a><label> ('.
 	    &mt('incl. grades').' <input type="checkbox" name="withgrades'.$counter.'" /></label>)'.
-	    '<img src="'.$request->dir_config('lonIconsURL').
+	    ' <img src="'.$request->dir_config('lonIconsURL').
 	    '/mailbkgrd.gif" width="14" height="10" name="mailicon'.$counter.'" />'."\n".
 	    '<br /> ('.
 	    &mt('Message will be sent when you click on Save & Next below.').")\n";
@@ -3743,8 +3753,8 @@
 	my $display_part=&get_display_part($partid,$symb);
 	if ($display =~ /^Partial Credit Factor/) {
 	    $result.='<th>'.
-		&mt('Score Part: [_1]<br /> (weight = [_2])',
-		    $display_part,$weight{$partid}).'</th>'."\n";
+                &mt('Score Part: [_1][_2](weight = [_3])',
+                    $display_part,'<br />',$weight{$partid}).'</th>'."\n";
 	    next;
 	    
 	} else {
@@ -5681,7 +5691,7 @@
 
     &Apache::lonpickcode::code_list($r,2);
 
-    $r->print('<br /><form method="post" name="checkscantron">'.
+    $r->print('<br /><form method="post" name="checkscantron" action="">'.
              $default_form_data."\n".
              &Apache::loncommon::start_data_table('LC_scantron_action')."\n".
              &Apache::loncommon::start_data_table_header_row()."\n".
@@ -10032,7 +10042,7 @@
              &mt('Found [_1] registered and [_2] unregistered clickers.',$student_count,$unknown_count);
     if (($env{'form.gradingmechanism'} ne 'attendance') && ($env{'form.gradingmechanism'} ne 'given')) {
        if ($correct_count==0) {
-          $errormsg.="Found no correct answers answers for grading!";
+          $errormsg.="Found no correct answers for grading!";
        } elsif ($correct_count>1) {
           $result.='<br /><span class="LC_warning">'.&mt("Found [_1] entries for grading!",$correct_count).'</span>';
        }
@@ -10207,7 +10217,7 @@
        if ($user) {
           if ($users{$user}) {
              $result.='<br /><span class="LC_warning">'.
-                      &mt("More than one entry found for <tt>[_1]</tt>!",$user).
+                      &mt('More than one entry found for [_1]!','<tt>'.$user.'</tt>').
                       '</span><br />';
           }
           $users{$user}=1;


More information about the LON-CAPA-cvs mailing list