--- loncom/homework/grades.pm 2003/07/17 22:08:25 1.118
+++ loncom/homework/grades.pm 2003/07/22 18:59:57 1.122
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.118 2003/07/17 22:08:25 ng Exp $
+# $Id: grades.pm,v 1.122 2003/07/22 18:59:57 ng Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -123,24 +123,25 @@ sub showResourceInfo {
my $result ='
'.
'
Current Resource: '.$probTitle.'
'."\n";
my ($partlist,$handgrade) = &response_type($url);
- my ($resptype,$hdgrade)=('','no');
+ my %resptype = (); #,$hdgrade)=('','no');
+ my $hdgrade='no';
for (sort keys(%$handgrade)) {
my ($responsetype,$handgrade)=split(/:/,$$handgrade{$_});
- $resptype = $responsetype;
+ my $partID = (split(/_/))[0];
+ $resptype{$partID} = $responsetype;
$hdgrade = $handgrade if ($handgrade eq 'yes');
- $result.='
Part '.(split(/_/))[0].'
'.
+ $result.='
Part '.$partID.'
'.
'
Type: '.$responsetype.'
';
# '
Handgrade: '.$handgrade.'
';
}
$result.='
'."\n";
- return $result,$resptype,$hdgrade,$partlist,$handgrade;
+ return $result,\%resptype,$hdgrade,$partlist,$handgrade;
}
#--- Clean response type for display
#--- Currently filters option response type only.
sub cleanRecord {
- my ($answer,$response) = @_;
- $answer =~ s|^ ||;
+ my ($answer,$response,$symb) = @_;
if ($response eq 'option') {
my (@IDs,@ans);
foreach (split(/\&/,&Apache::lonnet::unescape($answer))) {
@@ -156,6 +157,21 @@ sub cleanRecord {
(join '
'.$grayFont,@IDs).'
'.
'';
}
+ if ($response eq 'essay') {
+ if (! exists ($ENV{'form.'.$symb})) {
+ my (%keyhash) = &Apache::lonnet::dump('nohist_handgrade',
+ $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
+ $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
+
+ my $loginuser = $ENV{'user.name'}.':'.$ENV{'user.domain'};
+ $ENV{'form.keywords'} = $keyhash{$symb.'_keywords'} ne '' ? $keyhash{$symb.'_keywords'} : '';
+ $ENV{'form.kwclr'} = $keyhash{$loginuser.'_kwclr'} ne '' ? $keyhash{$loginuser.'_kwclr'} : 'red';
+ $ENV{'form.kwsize'} = $keyhash{$loginuser.'_kwsize'} ne '' ? $keyhash{$loginuser.'_kwsize'} : '0';
+ $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);
+ }
return $answer;
}
@@ -198,6 +214,7 @@ COMMONJSFUNCTIONS
#--- section, ids and fullnames for each user.
sub getclasslist {
my ($getsec,$filterlist) = @_;
+ $getsec = $getsec eq '' ? 'all' : $getsec;
my $classlist=&Apache::loncoursedata::get_classlist();
# Bail out if we were unable to get the classlist
return if (! defined($classlist));
@@ -431,7 +448,7 @@ sub listStudents {
my $result='
'.$viewgrade.
' Submissions for a Student or a Group of Students
';
@@ -2268,7 +2295,7 @@ sub editgrades {
my $awarded = $ENV{'form.GD_'.$user.'_'.$part.'_'.$type};
if ($awarded ne '' && $awarded ne $old_aw) {
$newrecord{'resource.'.$part.'.'.$type}= $awarded;
- $newrecord{'resource.'.$part.'regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}";
+ $newrecord{'resource.'.$part.'.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}";
$updateflag=1;
}
$line .= '
'.$old_aw.'
'.
@@ -2397,7 +2424,7 @@ sub csvuploadmap_header {
$javascript=&csvupload_javascript_forward_associate();
}
- my ($result,$resptype,$hdgrade,$partlist,$handgrade) = &showResourceInfo($url,$ENV{'form.probTitle'});
+ my ($result) = &showResourceInfo($url,$ENV{'form.probTitle'});
$request->print(<
@@ -2609,7 +2636,7 @@ sub csvuploadassign {
#
#-------------------------------------------------------------------
#
-#-------------- Next few routines handles grading by page/sequence
+#-------------- Next few routines handle grading by page/sequence
#
#--- Select a page/sequence and a student to grade
sub pickStudentPage {
@@ -2668,7 +2695,7 @@ LISTJAVASCRIPT
$result.=' Submission Details: '.
' none'."\n".
- ' dates and submissions'."\n".
+ ' by dates and submissions'."\n".
' all details'."\n";
$result.=''."\n".
@@ -2798,7 +2825,8 @@ sub displayPage {
if($curRes == $iterator->BEGIN_MAP) { $depth++; }
if($curRes == $iterator->END_MAP) { $depth--; }
- if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) {
+# if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) {
+ if (ref($curRes) && $curRes->is_problem()) {
my $parts = $curRes->parts();
my $title = $curRes->compTitle();
my $symbx = $curRes->symb();
@@ -2824,45 +2852,11 @@ sub displayPage {
if ($record{'version'} eq '') {
$studentTable.=' No recorded submission for this problem ';
} else {
- $studentTable.='
'.
- '
'.
- '
Date/Time
'.
- '
Submission
'.
- '
Status
';
my %responseType = ();
foreach my $partid (@{$parts}) {
$responseType{$partid} = $curRes->responseType($partid);
}
- my ($version);
- my %mark;
- $mark{'correct_by_student'} = $checkIcon;
- for ($version=1;$version<=$record{'version'};$version++) {
- my $timestamp = scalar(localtime($record{$version.':timestamp'}));
- $studentTable.='