'.
'';
@@ -1461,13 +1462,20 @@ KEYWORDS
my ($ressub,$subval) = split(/:/,$_,2);
# Similarity check
my $similar='';
- my ($oname,$odom,$ocrsid,$oessay,$osim)=&most_similar($uname,$udom,$subval);
- if ($osim) {
- $osim=int($osim*100.0);
- $similar='
Essay is '.$osim.
- '% similar to an essay by '.&Apache::loncommon::plainname($oname,$odom).
- ''.
- &keywords_highlight($oessay).' ';
+ my $oname;
+ my $odom;
+ my $ocrsid;
+ my $oessay;
+ my $osim;
+ if($ENV{'form.checkPlag'}){
+ ($oname,$odom,$ocrsid,$oessay,$osim)=&most_similar($uname,$udom,$subval);
+ if ($osim) {
+ $osim=int($osim*100.0);
+ $similar='
Essay is '.$osim.
+ '% similar to an essay by '.&Apache::loncommon::plainname($oname,$odom).
+ ''.
+ &keywords_highlight($oessay).' ';
+ }
}
$lastsubonly.=' Part '.
$partid.' ( ID '.$respid.
@@ -1480,7 +1488,7 @@ KEYWORDS
'this file may contain virusses ':'').
'Submitted Answer: '.
&cleanRecord($subval,$responsetype,$symb).
- '
'.$similar."\n"
+ '
'.$similar."\n"
if ($ENV{'form.lastSub'} eq 'lastonly' ||
($ENV{'form.lastSub'} eq 'hdgrade' &&
$$handgrade{$part} =~ /:yes$/));
@@ -2327,18 +2335,17 @@ sub editgrades {
$newrecord{'resource.'.$_.'.awarded'} = 0;
$newrecord{'resource.'.$_.'.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}";
$updateflag = 1;
+ } elsif (!($old_part eq $partial && $old_score eq $score)) {
+ $updateflag = 1;
+ $newrecord{'resource.'.$_.'.awarded'} = $partial if $partial ne '';
+ $newrecord{'resource.'.$_.'.solved'} = $score;
+ $rec_update++;
}
$line .= ' | '.$old_aw.' | '.
''.$awarded.
($score eq 'excused' ? $score : '').' | ';
- if (!($old_part eq $partial && $old_score eq $score)) {
- $updateflag = 1;
- $newrecord{'resource.'.$_.'.awarded'} = $partial if $partial ne '';
- $newrecord{'resource.'.$_.'.solved'} = $score;
- $rec_update++;
- }
my $partid=$_;
foreach my $stores (@parts) {
@@ -2726,7 +2733,9 @@ LISTJAVASCRIPT
$result.='
$grading_menu_button
SCANTRONFORM
@@ -3332,14 +3337,9 @@ sub scantron_filter {
#and then get the instructor to fix all of these errors, then grade
#the corrected one, I'll still need to catch error conditions, but
#maybe most will taken care even before we start
-
-sub scantron_validate_file {
- my ($r) = @_;
-}
-
sub scantron_process_students {
my ($r) = @_;
- my (undef,undef,$sequence)=split(/___/,$ENV{'form.selectpage'});
+ my (undef,undef,$sequence)=&Apache::lonnet::decode_symb($ENV{'form.selectpage'});
my ($symb,$url)=&get_symb_and_url($r);
if (!$symb) {return '';}
my $default_form_data=&defaultFormData($symb,$url);
@@ -3349,7 +3349,7 @@ sub scantron_process_students {
my @scanlines=<$scanlines>;
my $classlist=&Apache::loncoursedata::get_classlist();
my %idmap=&username_to_idmap($classlist);
- my $navmap=Apache::lonnavmaps::navmap->new($ENV{'request.course.fn'}.'.db',$ENV{'request.course.fn'}.'_parms.db',1, 1);
+ my $navmap=Apache::lonnavmaps::navmap->new();
my $map=$navmap->getResourceByUrl($sequence);
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0);
# $r->print("geto ".scalar(@resources)." ");
@@ -3636,7 +3636,7 @@ sub handler {
my $command=$ENV{'form.command'};
if (!$url) {
my ($temp1,$temp2);
- ($temp1,$temp2,$ENV{'form.url'})=split(/___/,$symb);
+ ($temp1,$temp2,$ENV{'form.url'})=&Apache::lonnet::decode_symb($symb);
$url = $ENV{'form.url'};
}
&send_header($request);
@@ -3649,7 +3649,7 @@ sub handler {
my ($tsymb,$tuname,$tudom,$tcrsid)=
&Apache::lonnet::checkin($token);
if ($tsymb) {
- my ($map,$id,$url)=split(/\_\_\_/,$tsymb);
+ my ($map,$id,$url)=&Apache::lonnet::decode_symb($tsymb);
if (&Apache::lonnet::allowed('mgr',$tcrsid)) {
$request->print(&Apache::lonnet::ssi_body('/res/'.$url,
('grade_username' => $tuname,
@@ -3721,8 +3721,6 @@ sub handler {
}
} elsif ($command eq 'scantron_selectphase' && $perm{'mgr'}) {
$request->print(&scantron_selectphase($request));
- } elsif ($command eq 'scantron_validate' && $perm{'mgr'}) {
- $request->print(&scantron_validate_file($request));
} elsif ($command eq 'scantron_process' && $perm{'mgr'}) {
$request->print(&scantron_process_students($request));
} elsif ($command) {
|