--- loncom/homework/grades.pm 2003/09/25 02:46:19 1.130.2.1.2.2
+++ loncom/homework/grades.pm 2003/08/21 18:21:39 1.135
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.130.2.1.2.2 2003/09/25 02:46:19 albertel Exp $
+# $Id: grades.pm,v 1.135 2003/08/21 18:21:39 bowersj2 Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -517,8 +517,8 @@ LISTJAVASCRIPT
my $saveStatus = $ENV{'form.Status'} eq '' ? 'Active' : $ENV{'form.Status'};
$ENV{'form.Status'} = $saveStatus;
- $gradeTable.=' last sub only'."\n".
- ' last sub & parts info'."\n".
+ $gradeTable.=' last submission only'."\n".
+ ' last submission & parts info'."\n".
' by dates and submissions'."\n".
' all details'."\n".
''."\n".
@@ -544,7 +544,7 @@ LISTJAVASCRIPT
$gradeTable.='" />'."\n";
-
+ $gradeTable.='Check For Plagiarism';
my (undef, undef, $fullname) = &getclasslist($getsec,'1');
$gradeTable.='
'.
'
';
@@ -1461,13 +1461,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 +1487,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$/));
@@ -2798,9 +2805,7 @@ LISTJAVASCRIPT
sub getSymbMap {
my ($request) = @_;
- my $navmap = Apache::lonnavmaps::navmap-> new($ENV{'request.course.fn'}.'.db',
- $ENV{'request.course.fn'}.'_parms.db');
-# $navmap->init();
+ my $navmap = Apache::lonnavmaps::navmap->new();
my %symbx = ();
my @titles = ();
@@ -2845,8 +2850,7 @@ sub displayPage {
&sub_page_js($request);
$request->print($result);
- 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 ($mapUrl, $id, $resUrl) = split(/___/, $ENV{'form.page'});
my $map = $navmap->getResourceByUrl($resUrl); # add to navmaps
@@ -3008,8 +3012,7 @@ sub updateGradeByPage {
$request->print($result);
- 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 ($mapUrl, $id, $resUrl) = split(/___/, $ENV{'form.page'});
my $map = $navmap->getResourceByUrl($resUrl); # add to navmaps
@@ -3146,8 +3149,6 @@ sub getSequenceDropDown {
}
sub scantron_uploads {
- #FIXME need to support scantron files put in another location,
- # maybe the course directory? a scantron dir in the course directory?
if (!-e $Apache::lonnet::perlvar{'lonScansDir'}) { return ''};
my $result= '