--- loncom/homework/grades.pm	2011/10/10 22:45:20	1.596.2.7
+++ loncom/homework/grades.pm	2011/12/01 00:36:59	1.596.2.12
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.596.2.7 2011/10/10 22:45:20 raeburn Exp $
+# $Id: grades.pm,v 1.596.2.12 2011/12/01 00:36:59 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -416,7 +416,7 @@ sub cleanRecord {
 	    '<tr valign="top"><td>'.$grayFont.&mt('Item ID').'</span></td>'.
 	    $middlerow.'</tr>'.
 	    '<tr valign="top"><td>'.$grayFont.&mt('Option ID').'</span></td>'.
-	    $bottomrow.'</tr>'.'</table></blockquote>';
+	    $bottomrow.'</tr></table></blockquote>';
     } elsif ($response eq 'radiobutton') {
 	my %answer=&Apache::lonnet::str2hash($answer);
 	my ($toprow,$bottomrow);
@@ -2106,7 +2106,7 @@ sub submission {
                           keyw => 'Keyword Options',
                           list => 'List',
                           past => 'Paste Selection to List',
-                          high => 'Hightlight Attribute',
+                          high => 'Highlight Attribute',
                      );
 #
 # Print out the keyword options line
@@ -2468,7 +2468,7 @@ sub check_collaborators {
 	    (split(/[,;\s]+/,$record->{'resource.'.$part.'.collaborators'})) { 
 	    $possible_collaborator =~ s/[\$\^\(\)]//g;
 	    next if ($possible_collaborator eq '');
-	    my ($co_name,$co_dom) = split(/\@|:/,$possible_collaborator);
+	    my ($co_name,$co_dom) = split(/:/,$possible_collaborator);
 	    $co_dom = $udom if (! defined($co_dom) || $co_dom =~ /^domain$/i);
 	    next if ($co_name eq $uname && $co_dom eq $udom);
 	    # Doing this grep allows 'fuzzy' specification
@@ -2481,7 +2481,7 @@ sub check_collaborators {
 	    }
 	}
 	if (scalar(@good_collaborators) != 0) {
-	    $result.='<br />'.&mt('Collaborators: ').'<ol>';
+	    $result.='<br />'.&mt('Collaborators:').'<ol>';
 	    foreach my $name (@good_collaborators) {
 		my ($lastname,$givenn) = split(/,/,$$fullname{$name});
 		push(@col_fullnames, $givenn.' '.$lastname);
@@ -7051,7 +7051,7 @@ sub scantron_get_correction {
        .&mt('The ID on the form is [_1]',
             "<tt>$$scan_record{'scantron.ID'}</tt>")
        .'<br />'
-       .&mt('The name on the paper is [_2], [_3]',
+       .&mt('The name on the paper is [_1], [_2]',
             $$scan_record{'scantron.LastName'},
             $$scan_record{'scantron.FirstName'})
        .'</p>';
@@ -7176,7 +7176,7 @@ ENDSCRIPT
 	}
         $r->print(&verify_bubbles_checked(@lines_to_correct));
     } elsif ($error eq 'missingbubble') {
-	$r->print('<p class="LC_warning">.&mt("There have been [_1]no[_2] bubbles scanned for some question(s)",'<b>','</b>')."</p>\n");
+	$r->print('<p class="LC_warning">'.&mt("There have been [_1]no[_2] bubbles scanned for some question(s)",'<b>','</b>')."</p>\n");
 	$r->print($message);
 	$r->print("<p>".&mt("Please indicate which bubble should be used for grading.")."</p>");
 	$r->print(&mt("Some questions have no scanned bubbles.")."\n");
@@ -8464,7 +8464,7 @@ sub checkscantron_results {
         }
     }
     $r->print('<p>'.
-              &mt('Comparison of bubblesheet data (including corrections) with corresponding submission records (most recent submission) for [_1][quant,_2,student][_3]  ([quant,_4,bubblesheet line] per student).',
+              &mt('Comparison of bubblesheet data (including corrections) with corresponding submission records (most recent submission) for [_1][quant,_2,student][_3] ([quant,_4,bubblesheet line] per student).',
                   '<b>',
                   $numstudents,
                   '</b>',
@@ -9382,9 +9382,10 @@ sub assign_clicker_grades {
 # FIXME: This should probably look for the first handgradeable part
     my $part=$$partlist[0];
 # Start screen output
-    my ($result) = &showResourceInfo($symb,$env{'form.probTitle'}).'<br />';
+    my ($result) = &showResourceInfo($symb,$env{'form.probTitle'});
 
-    $result .= &Apache::loncommon::start_data_table().
+    $result .= '<br />'.
+               &Apache::loncommon::start_data_table().
                &Apache::loncommon::start_data_table_header_row().
                '<th>'.&mt('Assigning grades based on clicker file').'</th>'.
                &Apache::loncommon::end_data_table_header_row().
@@ -9572,9 +9573,12 @@ sub handler {
     } else {
         &init_perm();
         if (!$env{'request.course.id'}) {
-            # Not in a course.
-            $env{'user.error.msg'}="/adm/grades::vgr:0:0:Cannot display grades page outside course context";
-            return HTTP_NOT_ACCEPTABLE;
+            unless ((&Apache::lonnet::allowed('usc',$env{'request.role.domain'})) &&
+                    ($command =~ /^scantronupload/)) {
+                # Not in a course.
+                $env{'user.error.msg'}="/adm/grades::vgr:0:0:Cannot display grades page outside course context";
+                return HTTP_NOT_ACCEPTABLE;
+            }
         } elsif (!%perm) {
             $request->internal_redirect('/adm/quickgrades');
         }