From: P. G. L. <gl...@um...> - 2006-09-28 23:12:27
|
Hi Sam, This may be a silly question, but: should problem_user.status be INT? For example, in a problem with three parts on which I get 1/3 correct: the status on that problem would then be .33? Just curious, Gavin -- P Gavin LaRose, PhD | gl...@um... | 734.764.6454 | ...you have Program Manager, Instructional Technology | to respect someone who can Mathematics Dept, University of Michigan | spell Tuesday, even if they http://www.math.lsa.umich.edu/~glarose/ | can't spell it right. -Milne On Thu, 28 Sep 2006, Sam Hathaway via activitymail wrote: > Log Message: > ----------- > change key.timestamp type to BIGINT and problem_user.status type to INT. > > Modified Files: > -------------- > webwork2/bin: > wwdb_upgrade > webwork2/lib/WeBWorK/DB/Record: > Key.pm > UserProblem.pm > > Revision Data > ------------- > Index: wwdb_upgrade > =================================================================== > RCS file: /webwork/cvs/system/webwork2/bin/wwdb_upgrade,v > retrieving revision 1.3 > retrieving revision 1.4 > diff -Lbin/wwdb_upgrade -Lbin/wwdb_upgrade -u -r1.3 -r1.4 > --- bin/wwdb_upgrade > +++ bin/wwdb_upgrade > @@ -59,7 +59,7 @@ > > ################################################################################ > > -our $THIS_DB_VERSION = 3; > +our $THIS_DB_VERSION = 5; > > our @DB_VERSIONS; > > @@ -83,6 +83,19 @@ > $dbh->do("CREATE TABLE depths (md5 CHAR(33) NOT NULL, depth SMALLINT, PRIMARY KEY (md5))"); > }; > > +$DB_VERSIONS[4]{desc} = "changes type of key timestamp field to BIGINT"; > +$DB_VERSIONS[4]{course_code} = sub { > + my $course = shift; > + $dbh->do("ALTER TABLE `${course}_key` CHANGE COLUMN `timestamp` `timestamp` BIGINT"); > +}; > + > +$DB_VERSIONS[5]{desc} = "changes type of problem_user status field to INT"; > +$DB_VERSIONS[5]{course_code} = sub { > + my $course = shift; > + $dbh->do("UPDATE `${course}_problem_user` SET `status`=NULL WHERE `status`=''"); > + $dbh->do("ALTER TABLE `${course}_problem_user` CHANGE COLUMN `status` `status` INT"); > +}; > + > ################################################################################ > > { > Index: Key.pm > =================================================================== > RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Record/Key.pm,v > retrieving revision 1.8 > retrieving revision 1.9 > diff -Llib/WeBWorK/DB/Record/Key.pm -Llib/WeBWorK/DB/Record/Key.pm -u -r1.8 -r1.9 > --- lib/WeBWorK/DB/Record/Key.pm > +++ lib/WeBWorK/DB/Record/Key.pm > @@ -30,7 +30,7 @@ > __PACKAGE__->_fields( > user_id => { type=>"BLOB", key=>1 }, > key => { type=>"TEXT" }, > - timestamp => { type=>"TEXT" }, > + timestamp => { type=>"BIGINT" }, > ); > } > > Index: UserProblem.pm > =================================================================== > RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Record/UserProblem.pm,v > retrieving revision 1.7 > retrieving revision 1.8 > diff -Llib/WeBWorK/DB/Record/UserProblem.pm -Llib/WeBWorK/DB/Record/UserProblem.pm -u -r1.7 -r1.8 > --- lib/WeBWorK/DB/Record/UserProblem.pm > +++ lib/WeBWorK/DB/Record/UserProblem.pm > @@ -37,7 +37,7 @@ > value => { type=>"INT" }, > max_attempts => { type=>"INT" }, > problem_seed => { type=>"INT" }, > - status => { type=>"TEXT" }, > + status => { type=>"INT" }, > attempted => { type=>"INT" }, > last_answer => { type=>"TEXT" }, > num_correct => { type=>"INT" }, > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > OpenWeBWorK-CVS mailing list > Ope...@li... > https://lists.sf.net/lists/listinfo/openwebwork-cvs > > > |