[LON-CAPA-cvs] cvs: loncom /homework grades.pm

www lon-capa-cvs-allow@mail.lon-capa.org
Sat, 16 Jun 2007 02:35:23 -0000


www		Fri Jun 15 22:35:23 2007 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  Collect info about unregistered clickers
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.410 loncom/homework/grades.pm:1.411
--- loncom/homework/grades.pm:1.410	Fri Jun 15 21:37:44 2007
+++ loncom/homework/grades.pm	Fri Jun 15 22:35:22 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.410 2007/06/16 01:37:44 www Exp $
+# $Id: grades.pm,v 1.411 2007/06/16 02:35:22 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6289,18 +6289,18 @@
 	$result.=&mt('Score based on attendance only');
     } else {
 	my $number=0;
-	$result.='<h3>'.&mt('Correctness determined by the following IDs').'</h3>';
+	$result.='<p><b>'.&mt('Correctness determined by the following IDs').'</b>';
 	foreach my $id (sort(keys(%correct_ids))) {
-	    $result.='<tt>'.$id.'</tt> - ';
+	    $result.='<br /><tt>'.$id.'</tt> - ';
 	    if ($correct_ids{$id} eq 'specified') {
 		$result.=&mt('specified');
 	    } else {
 		my ($uname,$udom)=split(/\:/,$correct_ids{$id});
 		$result.=&Apache::loncommon::plainname($uname,$udom);
 	    }
-	    $result.='<br />';
 	    $number++;
 	}
+        $result.="</p>\n";
 	if ($number==0) {
 	    $result.='<span class="LC_error">'.&mt('No IDs found to determine correct answer').'</span>';
 	    return $result.&show_grading_menu_form($symb);
@@ -6316,6 +6316,7 @@
 
 # Were able to get all the info needed, now analyze the file
 
+    $result.=&Apache::loncommon::studentbrowser_javascript();
     my $heading=&mt('Scanning clicker file');
     $result.=(<<ENDHEADER);
 <br /><table width="100%" border="0"><tr><td bgcolor="#777777">
@@ -6326,6 +6327,9 @@
 <input type="hidden" name="command" value="assignclickergrades" />
 <input type="hidden" name="probTitle" value="$env{'form.probTitle'}" />
 <input type="hidden" name="saveState"  value="$env{'form.saveState'}" />
+<input type="hidden" name="gradingmechanism" value="$env{'form.gradingmechanism'}" />
+<input type="hidden" name="pcorrect" value="$env{'form.pcorrect'}" />
+<input type="hidden" name="pincorrect" value="$env{'form.pincorrect'}" />
 ENDHEADER
     my %responses;
     my @questiontitles;
@@ -6334,19 +6338,32 @@
     if ($env{'form.upfiletype'} eq 'iclicker') {
 	($errormsg,$number)=&iclicker_eval(\@questiontitles,\%responses);
     }
-    $result.='<br />'.&mt('Found [_1] question(s)',$number).'<br />';
-    my $found_correct_flag=0;
+    $result.='<br />'.&mt('Found [_1] question(s)',$number).'<br />'.
+             '<input type="hidden" name="number" value="'.$number.'" />'.
+             &mt('Awarding [_1] percent for correct and [_2] percent for incorrect responses',
+                 $env{'form.pcorrect'},$env{'form.pincorrect'}).
+             '<br />';
+    my $correct_count=0;
+    my $student_count=0;
+    my $unknown_count=0;
     foreach my $id (keys(%responses)) {
        if ($correct_ids{$id}) {
           $result.="\n".'<input type="hidden" name="correct:'.$correct_ids{$id}.'" value="'.$responses{$id}.'" />';
-          $found_correct_flag++;
+          $correct_count++;
        } elsif ($clicker_ids{$id}) {
           $result.="\n".'<input type="hidden" name="student:'.$clicker_ids{$id}.'" value="'.$responses{$id}.'" />';
+          $student_count++;
        } else {
-          $result.="\n<br />Unknown: ".$id." - ".$responses{$id};
+          $result.="\n<hr />".&mt('Unregistered Clicker')." <tt>".$id."</tt><br />";
+          $result.="\n".'<input type="hidden" name="unknown:'.$id.'" value="'.$responses{$id}.'" />'.
+                   "\n".&mt("Username").": <input type='text' name='uname".$id."' />&nbsp;".
+                   "\n".&mt("Domain").": ".
+                   &Apache::loncommon::select_dom_form($env{'course.'.$env{'request.course.id'}.'.domain'},'udom'.$id).'&nbsp;'.
+                   &Apache::loncommon::selectstudent_link('clickeranalysis','uname'.$id,'udom'.$id);
+          $unknown_count++;
        }
     }
-    $result.='</form>';
+    $result.='<hr /><p>&nbsp;</p><input type="submit" name="finalize" value="'.&mt('Finalize Grading').'" /></form>';
     $result.='</td></tr></table>'."\n".
              '</td></tr></table><br /><br />'."\n";
     return $result.&show_grading_menu_form($symb);