--- loncom/build/lpml_html_posteval.pl 2001/12/06 23:14:33 1.2 +++ loncom/build/lpml_html_posteval.pl 2001/12/15 20:20:11 1.4 @@ -3,7 +3,7 @@ # The LearningOnline Network with CAPA # lpml_html_posteval.pl - runs posteval lpml statements in a lpml document. # -# $Id: lpml_html_posteval.pl,v 1.2 2001/12/06 23:14:33 harris41 Exp $ +# $Id: lpml_html_posteval.pl,v 1.4 2001/12/15 20:20:11 harris41 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -34,17 +34,33 @@ use strict; +my %chash; while(<>) { my $line=$_; my $arguments=''; - if ($line=~/\<\!\-\- POSTEVAL2 (.*?) \-\-\>/) { - $arguments=$1; + my $category=''; + if ($line=~/\<\!\-\- POSTEVAL \[(.+)\] (.*?) \-\-\>/) { + $category=$1; + $arguments=$2; } if ($arguments=~/^verify\.pl /) { my @values=`perl $arguments`; my $ret=join('',@values); - $ret='good' unless $ret; - $line=~s/<\!\-\- POSTEVAL2 .*? \-\-\>/$ret/; + unless ($ret) { + $ret='correct'; + } + else { + $chash{$category}++; + $ret="$ret"; + } + $line=~s/\<\!\-\- POSTEVAL .*? \-\-\>/$ret/; + } + elsif ($arguments=~/^byteandlinecount/) { + + } + if ($line=~/\<\!\-\- POSTEVALINLINE (.*?) \-\-\>/) { + my $count=$chash{$1}+0; + $line=~s/<\!\-\- POSTEVALINLINE .*? \-\-\>/$count/; } print $line; }