[LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm
matthew
lon-capa-cvs@mail.lon-capa.org
Fri, 26 Sep 2003 19:23:14 -0000
matthew Fri Sep 26 15:23:14 2003 EDT
Modified files:
/loncom/interface loncoursedata.pm
Log:
In full updates we need to pick up and store the response specific parameters
'submissiongrading' and 'molecule'.
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.89 loncom/interface/loncoursedata.pm:1.90
--- loncom/interface/loncoursedata.pm:1.89 Fri Sep 26 14:31:31 2003
+++ loncom/interface/loncoursedata.pm Fri Sep 26 15:23:14 2003
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: loncoursedata.pm,v 1.89 2003/09/26 18:31:31 matthew Exp $
+# $Id: loncoursedata.pm,v 1.90 2003/09/26 19:23:14 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1157,7 +1157,15 @@
next;
} elsif ($parameter eq 'version') {
next;
- } elsif ($parameter =~ /^resource\.(.*)\.(tries|award|awarded|previous|solved|awarddetail|submission)\s*$/){
+ } elsif ($parameter =~ /^resource\.(.*)\.(tries|
+ award|
+ awarded|
+ previous|
+ solved|
+ awarddetail|
+ submission|
+ submissiongrading|
+ molecule)\s*$/x){
# we do not have enough information to store an
# entire row, so we save it up until later.
my ($part_and_resp_id,$field) = ($1,$2);
@@ -1169,11 +1177,18 @@
} else {
$part_id = &get_part_id($part_and_resp_id);
}
+ # Deal with part specific data
if ($field =~ /^(tries|award|awarded|previous)$/) {
$partdata->{$symb_id}->{$part_id}->{$transaction}->{$field}=$value;
}
+ # deal with response specific data
if (defined($resp_id) &&
- $field =~ /^(tries|awarddetail|awarded|submission)$/) {
+ $field =~ /^(tries|
+ awarddetail|
+ awarded|
+ submission|
+ submissiongrading|
+ molecule)$/x) {
if ($field eq 'submission') {
# We have to be careful with user supplied input.
# most of the time we are okay because it is escaped.
@@ -1185,7 +1200,13 @@
$value =~ s/\\$/\\\\/;
}
}
- $respdata->{$symb_id}->{$part_id}->{$resp_id}->{$transaction}->{$field}=$value;
+ if ($field eq 'submissiongrading' ||
+ $field eq 'molecule') {
+ $respdata->{$symb_id}->{$part_id}->{$resp_id}->{$transaction}->{'response_specific'}=$field;
+ $respdata->{$symb_id}->{$part_id}->{$resp_id}->{$transaction}->{'response_specific_value'}=$value;
+ } else {
+ $respdata->{$symb_id}->{$part_id}->{$resp_id}->{$transaction}->{$field}=$value;
+ }
}
}
}
@@ -1232,7 +1253,8 @@
$data->{'tries'},
$data->{'awarddetail'},
$data->{'awarded'},
- '','',
+ $data->{'response_specific'},
+ $data->{'response_specific_value'},
$data->{'submission'})."'),";
$store_rows++;
}