--- loncom/homework/grades.pm 2003/11/12 21:18:10 1.157
+++ loncom/homework/grades.pm 2003/12/04 23:23:16 1.166
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.157 2003/11/12 21:18:10 albertel Exp $
+# $Id: grades.pm,v 1.166 2003/12/04 23:23:16 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -290,7 +290,8 @@ sub cleanRecord {
$ENV{'form.kwstyle'} = $keyhash{$loginuser.'_kwstyle'} ne '' ? $keyhash{$loginuser.'_kwstyle'} : '';
$ENV{'form.'.$symb} = 1; # so that we don't have to read it from disk for multiple sub of the same prob.
}
- return '
'.&keywords_highlight($answer).'
';
+ $answer =~ s-\n- -g;
+ return '
'.&keywords_highlight($answer).'
';
}
return $answer;
}
@@ -678,10 +679,11 @@ LISTJAVASCRIPT
if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') {
(%status) =&student_gradeStatus($url,$symb,$udom,$uname,$partlist);
my $submitted = 0;
- my $graded = 1;
+ my $graded = 0;
foreach (keys(%status)) {
$submitted = 1 if ($status{$_} ne 'nothing');
- $graded = 0 if ($status{$_} =~ /^correct/);
+ $graded = 1 if ($status{$_} !~ /^correct/);
+
my ($foo,$partid,$foo1) = split(/\./,$_);
if ($status{'resource.'.$partid.'.submitted_by'} ne '') {
$submitted = 0;
@@ -1375,7 +1377,9 @@ sub submission {
return;
}
- $ENV{'form.lastSub'} = ($ENV{'form.lastSub'} eq '' ? 'datesub' : $ENV{'form.lastSub'});
+ if (!$ENV{'form.lastSub'}) { $ENV{'form.lastSub'} = 'datesub'; }
+ if (!$ENV{'form.vProb'}) { $ENV{'form.vProb'} = 'yes'; }
+ if (!$ENV{'form.vAns'}) { $ENV{'form.vAns'} = 'yes'; }
my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : '');
my $checkIcon = '';
@@ -1644,7 +1648,7 @@ KEYWORDS
$partid.' ( ID '.$respid.
' ) ';
if ($record{"resource.$partid.$respid.uploadedurl"}) {
- $lastsubonly.=' File uploaded by student Like all files provided by users, this file may contain virusses ';
+ $lastsubonly.=' File uploaded by student Like all files provided by users, this file may contain virusses ';
}
$lastsubonly.='Submitted Answer: '.
&cleanRecord($subval,$responsetype,$symb,$partid,
@@ -2840,7 +2844,9 @@ sub csvuploadassign {
foreach my $grade (@gradedata) {
my %entries=&Apache::loncommon::record_sep($grade);
my $username=$entries{$fields{'username'}};
+ $username=~s/\s//g;
my $domain=$entries{$fields{'domain'}};
+ $domain=~s/\s//g;
if (!exists($$classlist{"$username:$domain"})) {
push(@skipped,"$username:$domain");
next;
@@ -3371,24 +3377,13 @@ sub getSequenceDropDown {
return $result;
}
-#FIXME, I am in loncreatecourse, use that one instead
-sub propath {
- my ($udom,$uname)=@_;
- $udom=~s/\W//g;
- $uname=~s/\W//g;
- my $subdir=$uname.'__';
- $subdir =~ s/(.)(.)(.).*/$1\/$2\/$3/;
- my $proname="$Apache::lonnet::perlvar{'lonUsersDir'}/$udom/$subdir/$uname";
- return $proname;
-}
-
sub scantron_uploads {
if (!-e $Apache::lonnet::perlvar{'lonScansDir'}) { return ''};
my $result= '