]> hydra-www.ietfng.org Git - grade/commitdiff
Add ! dings
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Mon, 16 Feb 2015 00:16:14 +0000 (19:16 -0500)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Wed, 18 Feb 2015 00:53:35 +0000 (19:53 -0500)
README.rst
grade.pl

index 4ebd89f1168c5e056a1dda4fe239086950a6cf69..5c1f34608f1cef3a3a921eefe602571b9c02cd21 100644 (file)
@@ -164,10 +164,17 @@ Within sections, each flag definition takes the form ::
    .
 
 ``flag-name`` is the name of the flag used in the grading data files.
-``score-modifier`` is a number (as understood by Perl) and is almost always
-negative (i.e., beginning with a ``-``), but positive numbers are understood
-for some form of extra credit.  (Note that the script will refuse to set a
-score higher than the section maximum.)
+``score-modifier`` is either 
+
+* a number (as understood by Perl), which adjusts the score of this section
+  appropriately.  As such, this number is almost always negative (i.e.,
+  beginning with a ``-``), but positive numbers are understood for some form
+  of extra credit.  (Note that the script will refuse to set a score higher
+  than the section maximum.)
+
+* a ``!`` followed by a number, again, as understood by Perl, usually ``0``.
+  Engaging a flag so defined will cause the grading script to act as if a
+  ``!pointsset`` directive was encountered.
 
 Text between the line beginning with ``:`` and the dot on a line by itself
 will be copied into student grade reports whenever the flag is given in a
index db8c7a374faeee89a66c8f9c7f11b2d60a456e43..c5c92d1474e488509badf24b78f4bcb66382c2a1 100644 (file)
--- a/grade.pl
+++ b/grade.pl
@@ -83,8 +83,14 @@ sub doDing($) { # {{{
   seek DEFINES, $sectionoffset, 0;
   while(my $line = <DEFINES>) {
     last if ($line =~ /^@/);
+    chomp $line;
     if ($line =~ /^:$ding\s+(.*)$/) {
-      $dingsum += $1;
+      my $dingmod = $1;
+      if ($dingmod =~ /^!(.*)$/) {
+        $pointsset = $1;
+      } else {
+        $dingsum += $1;
+      }
       push @$dingtext, "($1)";
       untilDefinesDot(sub ($) { push @$dingtext, @_; });
       push @$dingtext, "";