--- loncom/homework/grades.pm 2010/04/20 20:23:55 1.626
+++ loncom/homework/grades.pm 2010/12/04 15:02:26 1.639
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.626 2010/04/20 20:23:55 www Exp $
+# $Id: grades.pm,v 1.639 2010/12/04 15:02:26 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -44,6 +44,7 @@ use Apache::Constants qw(:common);
use Apache::lonlocal;
use Apache::lonenc;
use Apache::lonstathelpers;
+use Apache::lonquickgrades;
use String::Similarity;
use LONCAPA;
@@ -820,9 +821,7 @@ sub listStudents {
$submitonly= $env{'form.submitonly'} eq '' ? 'all' : $env{'form.submitonly'};
}
- my $result='
'
- .&mt("View/Grade/Regrade Submissions for a Student or a Group of Students")
- .'
';
+ my $result='';
my $res_error;
my ($partlist,$handgrade,$responseType) = &response_type($symb,\$res_error);
@@ -891,7 +890,7 @@ LISTJAVASCRIPT
''."\n".
''.
- ''."\n".
''.
' '.
@@ -1269,12 +1268,6 @@ sub sub_page_js {
}
}
- if (val == "Grade Student") {
- if (formname.Status.value == "") {
- formname.Status.value = "Active";
- }
- formname.studentNo.value = total;
- }
formname.submit();
}
@@ -1323,7 +1316,8 @@ sub sub_page_kw_js {
my $iconpath = $request->dir_config('lonIconsURL');
&commonJSfunctions($request);
- my $inner_js_msg_central= &Apache::lonhtmlcommon::scripttag(<
function checkInput() {
opener.document.SCORE.msgsub.value = opener.checkEntities(document.msgcenter.msgsub.value);
var nmsg = opener.document.SCORE.savemsgN.value;
@@ -1360,9 +1354,11 @@ sub sub_page_kw_js {
self.close()
}
+
INNERJS
- my $inner_js_highlight_central= &Apache::lonhtmlcommon::scripttag(<
function updateChoice(flag) {
opener.document.SCORE.kwclr.value = opener.radioSelection(document.hlCenter.kwdclr);
opener.document.SCORE.kwsize.value = opener.radioSelection(document.hlCenter.kwdsize);
@@ -1373,6 +1369,7 @@ INNERJS
}
self.close()
}
+
INNERJS
my $start_page_msg_central =
@@ -1909,7 +1906,6 @@ sub submission {
if ($counter == 0) {
&sub_page_js($request);
&sub_page_kw_js($request);
- $request->print('
'.&mt('Submission Record').'
');
# option to display problem, only once else it cause problems
# with the form later since the problem has a form.
@@ -2213,13 +2209,8 @@ KEYWORDS
$request->print(''."\n");
# return if view submission with no grading option
-# FIXME: the logic seems off here. Why show the grade button if you cannot grade?
if (!&canmodify($usec)) {
- my $toGrade.=' '."\n" if (&canmodify($usec));
- $toGrade.=''."\n";
- $request->print($toGrade);
+ $request->print('
'.&mt('No grading privileges').'
');
return;
} else {
$request->print(''."\n");
@@ -2337,10 +2328,10 @@ sub check_collaborators {
next if ($record->{'resource.'.$part.'.collaborators'} eq '');
my (@good_collaborators, @bad_collaborators);
foreach my $possible_collaborator
- (split(/,?\s+/,$record->{'resource.'.$part.'.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
@@ -2353,13 +2344,13 @@ sub check_collaborators {
}
}
if (scalar(@good_collaborators) != 0) {
- $result.=' '.&mt('Collaborators: ');
+ $result.=' '.&mt('Collaborators:').'';
foreach my $name (@good_collaborators) {
my ($lastname,$givenn) = split(/,/,$$fullname{$name});
push(@col_fullnames, $givenn.' '.$lastname);
- $result.=$fullname->{$name}.' ';
+ $result.='
'.$fullname->{$name}.'
';
}
- $result.=' '."\n";
+ $result.=' '."\n";
my ($part)=split(/\./,$part);
$result.=''.
@@ -2592,16 +2583,6 @@ sub processHandGrade {
return '';
}
-# Go directly to grade student - from submission or link from chart page
-# FIXME: looks like reading off the button label!
- if ($button eq 'Grade Student') {
- my $processUser = $env{'form.unamedom'.$env{'form.studentNo'}};
- ($env{'form.student'},$env{'form.userdom'}) = split(/:/,$processUser);
- $env{'form.fullname'} = $$fullname{$processUser};
- &submission($request,0,0,$symb);
- return '';
- }
-
# Get the next/previous one or group of students
my $firststu = $env{'form.unamedom0'};
my $laststu = $env{'form.unamedom'.($ngrade-1)};
@@ -2689,9 +2670,7 @@ sub processHandGrade {
$ctr++;
}
if ($total < 0) {
- my $the_end = '
'.&mt('LON-CAPA User Message').'
'."\n";
- $the_end.=&mt('Message: No more students for this section or class.').'
'."\n";
- $the_end.=&mt('Click on the button below to return to the grading menu.').'
'."\n";
+ my $the_end.=&mt('Message: No more students for this section or class.').'
'."\n";
$request->print($the_end);
}
return '';
@@ -3371,6 +3350,9 @@ sub viewgrades {
if (!$display) { $display = &Apache::lonnet::metadata($url,$part.'.name'); }
my ($partid) = &split_part_type($part);
push(@partids,$partid);
+#
+# FIXME: Looks like $display looks at English text
+#
my $display_part=&get_display_part($partid,$symb);
if ($display =~ /^Partial Credit Factor/) {
$result.='
'.
@@ -3817,18 +3799,14 @@ sub csvuploadmap_header {
$javascript=&csvupload_javascript_forward_associate();
}
- my $result='';
$symb = &Apache::lonenc::check_encrypt($symb);
+ $request->print('