[LON-CAPA-cvs] cvs: modules /gerd/educause correl.pl

www lon-capa-cvs@mail.lon-capa.org
Mon, 22 Mar 2004 20:27:42 -0000


www		Mon Mar 22 15:27:42 2004 EDT

  Modified files:              
    /modules/gerd/educause	correl.pl 
  Log:
  On evaluative questions, also count greater or smaller than 3
  
  
Index: modules/gerd/educause/correl.pl
diff -u modules/gerd/educause/correl.pl:1.2 modules/gerd/educause/correl.pl:1.3
--- modules/gerd/educause/correl.pl:1.2	Mon Mar 22 10:01:53 2004
+++ modules/gerd/educause/correl.pl	Mon Mar 22 15:27:42 2004
@@ -13,12 +13,43 @@
 	unless ($entries[$first]) { next; }
 	$key=$first.':'.$entries[$first];
 	$tot{$key}++;
+	my $numkey=0;
+	my $firstnum=int($entries[$first]);
+	if ($firstnum) {
+	    if ($firstnum<3) { $numkey=$first.':lt3'; }
+	    if ($firstnum>3) { $numkey=$first.':gt3'; }
+	}
+	if ($numkey) {
+	    $tot{$numkey}++;
+	}
 	for ($second=1;$second<=$#entries;$second++) {
 	    if ($first==$second) { next; }
 	    unless ($entries[$second]) { next; }
 	    $thiskey=$key.'_'.$second.':'.$entries[$second];
 	    $res{$thiskey}++;
 	    $root{$thiskey}=$key;
+	    my $secnum=int($entries[$second]);
+	    my $secnumkey=0;
+	    if ($secnum) {
+		if ($secnum<3) { $secnumkey=$second.':lt3'; }
+		if ($secnum>3) { $secnumkey=$second.':gt3'; }
+	    }
+	    if ($secnumkey) {
+		$thiskey=$key.'_'.$secnumkey;
+		$res{$thiskey}++;
+		$root{$thiskey}=$key;
+	    }
+	    if ($numkey) {
+		$thiskey=$numkey.'_'.$second.':'.$entries[$second];
+		$res{$thiskey}++;
+		$root{$thiskey}=$numkey;
+		if ($secnumkey) {
+		    $thiskey=$numkey.'_'.$secnumkey;
+		    $res{$thiskey}++;
+		    $root{$thiskey}=$numkey;
+		}
+	    }
+
 	}
     }
 }