[LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 28 Apr 2006 21:14:09 -0000
albertel Fri Apr 28 17:14:09 2006 EDT
Modified files:
/loncom/interface loncoursedata.pm
Log:
- adding a response_specific_2 column to the response data table for supporting tasks
- adding the response specific data to the result of the &get_response_data_by_student()
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.158 loncom/interface/loncoursedata.pm:1.159
--- loncom/interface/loncoursedata.pm:1.158 Sat Apr 8 02:51:47 2006
+++ loncom/interface/loncoursedata.pm Fri Apr 28 17:14:03 2006
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: loncoursedata.pm,v 1.158 2006/04/08 06:51:47 albertel Exp $
+# $Id: loncoursedata.pm,v 1.159 2006/04/28 21:14:03 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -204,9 +204,10 @@
associated with a particular response id which is stored when a student
attempts a problem. The following are the columns of the table, in order:
'symb_id','part_id','response_id','student_id','transaction','tries',
-'awarddetail', 'response_specific' (data particular to the response
-type), 'response_specific_value', and 'submission (the text of the students
-submission). The primary key is based on the first five columns listed above.
+'awarddetail', 'response_specific', 'response_specific_value',
+'response_specific_2', 'response_specific_value_2', and 'submission
+(the text of the students submission). The primary key is based on the
+first five columns listed above.
=item $fulldump_part_table
@@ -466,6 +467,10 @@
type => 'TINYTEXT' },
{ name => 'response_specific_value',
type => 'TINYTEXT' },
+ { name => 'response_specific_2',
+ type => 'TINYTEXT' },
+ { name => 'response_specific_value_2',
+ type => 'TINYTEXT' },
{ name => 'submission',
type => 'TEXT'},
],
@@ -1086,7 +1091,9 @@
$transaction,
$data->{'awarddetail'},
$data->{'response_specific'},
- $data->{'response_specific_value'}).
+ $data->{'response_specific_value'}),
+ $data->{'response_specific_2'},
+ $data->{'response_specific_value_2'}).
"',".$submission."),";
$store_rows++;
}
@@ -2322,13 +2329,14 @@
}
}
-sub RD_student_id { return 0; }
-sub RD_awarddetail { return 1; }
-sub RD_response_eval { return 2; }
-sub RD_submission { return 3; }
-sub RD_timestamp { return 4; }
-sub RD_tries { return 5; }
-sub RD_sname { return 6; }
+sub RD_student_id { return 0; }
+sub RD_awarddetail { return 1; }
+sub RD_response_eval { return 2; }
+sub RD_response_eval_2 { return 3; }
+sub RD_submission { return 4; }
+sub RD_timestamp { return 5; }
+sub RD_tries { return 6; }
+sub RD_sname { return 7; }
sub get_response_data {
my ($Sections,$enrollment,$symb,$response,$courseid) = @_;
@@ -2355,7 +2363,8 @@
&limit_by_section_and_status($Sections,$enrollment,'d');
my $request = 'SELECT '.
'a.student_id, a.awarddetail, a.response_specific_value, '.
- 'a.submission, b.timestamp, c.tries, d.student '.
+ 'a.response_specific_value_2, a.submission, b.timestamp, '.
+ 'c.tries, d.student '.
'FROM '.$fulldump_response_table.' AS a '.
'LEFT JOIN '.$fulldump_timestamp_table.' AS b '.
'ON a.symb_id=b.symb_id AND a.student_id=b.student_id AND '.
@@ -2397,11 +2406,13 @@
}
-sub RDs_awarddetail { return 3; }
-sub RDs_submission { return 2; }
-sub RDs_timestamp { return 1; }
-sub RDs_tries { return 0; }
-sub RDs_awarded { return 4; }
+sub RDs_awarddetail { return 3; }
+sub RDs_submission { return 2; }
+sub RDs_timestamp { return 1; }
+sub RDs_tries { return 0; }
+sub RDs_awarded { return 4; }
+sub RDs_response_eval { return 5; }
+sub RDs_response_eval_2 { return 6; }
sub get_response_data_by_student {
my ($student,$symb,$response,$courseid) = @_;
@@ -2419,7 +2430,8 @@
my $dbh = &Apache::lonmysql::get_dbh();
return undef if (! defined($dbh));
my $request = 'SELECT '.
- 'c.tries, b.timestamp, a.submission, a.awarddetail, e.awarded '.
+ 'c.tries, b.timestamp, a.submission, a.awarddetail, c.awarded, '.
+ 'a.response_specific_value, a.response_specific_value_2, '.
'FROM '.$fulldump_response_table.' AS a '.
'LEFT JOIN '.$fulldump_timestamp_table.' AS b '.
'ON a.symb_id=b.symb_id AND a.student_id=b.student_id AND '.