[LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 28 Apr 2006 21:22:12 -0000
albertel Fri Apr 28 17:22:12 2006 EDT
Modified files:
/loncom/interface loncoursedata.pm
Log:
- need to make sure awrded ends up in the awarded column and solved ends up in the solved column
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.160 loncom/interface/loncoursedata.pm:1.161
--- loncom/interface/loncoursedata.pm:1.160 Fri Apr 28 17:18:15 2006
+++ loncom/interface/loncoursedata.pm Fri Apr 28 17:22:10 2006
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: loncoursedata.pm,v 1.160 2006/04/28 21:18:15 albertel Exp $
+# $Id: loncoursedata.pm,v 1.161 2006/04/28 21:22:10 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1272,16 +1272,23 @@
my %stored;
while (my ($parameter,$value) = each(%$param_hash)) {
next if ($parameter !~ /^resource\.(.*)\.(solved|awarded)$/);
- my $part = $1;
+ my $part = $1;
+ my $which = $2;
next if ($part =~ /\./);
next if (exists($stored{$part}));
$stored{$part}++;
#
my $part_id = &get_part_id($part);
next if (!defined($part_id));
- my $solved = $value;
- my $tries = $param_hash->{'resource.'.$part.'.tries'};
- my $awarded = $param_hash->{'resource.'.$part.'.awarded'};
+
+ my ($solved,$awarded);
+ if ($which eq 'solved') {
+ $solved = $value;
+ $awarded = $param_hash->{'resource.'.$part.'.awarded'};
+ } else {
+ $solved = $param_hash->{'resource.'.$part.'.solved'};
+ $awarded = $value;
+ }
my $award = $param_hash->{'resource.'.$part.'.award'};
my $awarddetail = $param_hash->{'resource.'.$part.'.awarddetail'};
my $timestamp = $param_hash->{'timestamp'};