--- loncom/homework/grades.pm 2007/06/11 21:36:18 1.401
+++ loncom/homework/grades.pm 2007/06/14 21:36:12 1.404
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.401 2007/06/11 21:36:18 albertel Exp $
+# $Id: grades.pm,v 1.404 2007/06/14 21:36:12 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1959,8 +1959,8 @@ KEYWORDS
($env{'form.lastSub'} eq 'hdgrade' &&
$$handgrade{$$part[0].'_'.$$part[1]} eq 'yes')) {
my $display_part=&get_display_part($partid,$symb);
- $lastsubonly.='
Debug -'.'Part: '.
- $display_part.' ( hhhh ID '.$respid.
+ $lastsubonly.='Part: '.
+ $display_part.' ( ID '.$respid.
' ) ';
my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record);
if (@$files) {
@@ -6078,10 +6078,9 @@ GRADINGMENUJS
''.
' '.&mt('scores from file').' | '."\n";
-# $result.=''.
-# ''.
-# ' '.&mt('clicker file').' | '."\n";
-
+ $result.=''.
+ ''.
+ ' '.&mt('clicker file').' | '."\n";
$result.=''.
' 'iClicker'));
$result.=<
+function sanitycheck() {
+// Accept only integer percentages
+ document.forms.gradesupload.pcorrect.value=Math.round(document.forms.gradesupload.pcorrect.value);
+ document.forms.gradesupload.pincorrect.value=Math.round(document.forms.gradesupload.pincorrect.value);
+// Find out grading choice
+ for (i=0; i
ENDUPFORM
@@ -6196,12 +6268,43 @@ sub process_clicker_file {
my ($symb)=&get_symb($r);
if (!$symb) {return '';}
my ($result) = &showResourceInfo($symb,$env{'form.probTitle'});
- $result.=&show_grading_menu_form($symb);
+ if (($env{'form.gradingmechanism'} eq 'specific') && ($env{'form.specificid'}!~/\w/)) {
+ $result.=''.&mt('You need to specify a clicker ID for the correct answer').'';
+ return $result.&show_grading_menu_form($symb);
+ }
my %clickerids=&gather_clicker_ids();
- foreach my $key (keys %clickerids) {
- $result.=' '.$key.' - '.$clickerids{$key};
+ my %correctids=();
+ if ($env{'form.gradingmechanism'} eq 'personnel') {
+ %correctids=&gather_adv_clicker_ids();
+ }
+ if ($env{'form.gradingmechanism'} eq 'specific') {
+ my $correctid=$env{'form.specificid'};
+ $correctid=~tr/a-z/A-Z/;
+ $correctid=~s/\s//gs;
+ $correctids{$correctid}='specified';
}
- return $result;
+ if ($env{'form.gradingmechanism'} eq 'attendance') {
+ $result.=&mt('Score based on attendance only');
+ } else {
+ my $number=0;
+ $result.=''.&mt('Correctness determined by the following IDs').'';
+ foreach my $id (sort(keys(%correctids))) {
+ $result.=''.$id.' - ';
+ if ($correctids{$id} eq 'specified') {
+ $result.=&mt('specified');
+ } else {
+ my ($uname,$udom)=split(/\:/,$correctids{$id});
+ $result.=&Apache::loncommon::plainname($uname,$udom);
+ }
+ $result.=' ';
+ $number++;
+ }
+ if ($number==0) {
+ $result.=''.&mt('No IDs found to determine correct answer').'';
+ return $result.&show_grading_menu_form($symb);
+ }
+ }
+ return $result.&show_grading_menu_form($symb);
}
sub handler {
| |