You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(53) |
Feb
(56) |
Mar
|
Apr
|
May
(30) |
Jun
(78) |
Jul
(121) |
Aug
(155) |
Sep
(77) |
Oct
(61) |
Nov
(45) |
Dec
(94) |
2006 |
Jan
(116) |
Feb
(33) |
Mar
(11) |
Apr
(23) |
May
(60) |
Jun
(89) |
Jul
(130) |
Aug
(109) |
Sep
(124) |
Oct
(63) |
Nov
(82) |
Dec
(45) |
2007 |
Jan
(31) |
Feb
(35) |
Mar
(123) |
Apr
(36) |
May
(18) |
Jun
(134) |
Jul
(133) |
Aug
(241) |
Sep
(126) |
Oct
(31) |
Nov
(15) |
Dec
(5) |
2008 |
Jan
(11) |
Feb
(6) |
Mar
(16) |
Apr
(29) |
May
(43) |
Jun
(149) |
Jul
(27) |
Aug
(29) |
Sep
(37) |
Oct
(20) |
Nov
(4) |
Dec
(6) |
2009 |
Jan
(34) |
Feb
(30) |
Mar
(16) |
Apr
(6) |
May
(1) |
Jun
(32) |
Jul
(22) |
Aug
(7) |
Sep
(18) |
Oct
(50) |
Nov
(22) |
Dec
(8) |
2010 |
Jan
(17) |
Feb
(15) |
Mar
(10) |
Apr
(9) |
May
(67) |
Jun
(30) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
|
From: Arnie P. v. a. <we...@ma...> - 2008-07-23 15:47:05
|
Log Message: ----------- removed ====== Tags: ---- rel-2-4-dev Modified Files: -------------- pg/lib/Value: Union.pm Revision Data ------------- Index: Union.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Union.pm,v retrieving revision 1.24.6.2 retrieving revision 1.24.6.3 diff -Llib/Value/Union.pm -Llib/Value/Union.pm -u -r1.24.6.2 -r1.24.6.3 --- lib/Value/Union.pm +++ lib/Value/Union.pm @@ -4,7 +4,7 @@ my $pkg = 'Value::Union'; qw(Value); -======= + use strict; no strict "refs"; our @ISA = qw(Value); |
From: Mike G. v. a. <we...@ma...> - 2008-07-23 03:40:49
|
Log Message: ----------- replace die by warn when dumping tables for archives. This allows us to dump old courses that haven't been updated. Modified Files: -------------- webwork2/lib/WeBWorK/DB/Schema/NewSQL: Std.pm Revision Data ------------- Index: Std.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -Llib/WeBWorK/DB/Schema/NewSQL/Std.pm -Llib/WeBWorK/DB/Schema/NewSQL/Std.pm -u -r1.16 -r1.17 --- lib/WeBWorK/DB/Schema/NewSQL/Std.pm +++ lib/WeBWorK/DB/Schema/NewSQL/Std.pm @@ -228,7 +228,7 @@ my $exit = $? >> 8; my $signal = $? & 127; my $core = $? & 128; - die "Failed to dump table '".$self->sql_table_name."' with command '$dump_cmd' (exit=$exit signal=$signal core=$core): $dump_out\n"; + warn "Failed to dump table '".$self->sql_table_name."' with command '$dump_cmd' (exit=$exit signal=$signal core=$core): $dump_out\n"; } return 1; |
From: Mike G. v. a. <we...@ma...> - 2008-07-14 22:00:01
|
Log Message: ----------- Added a link to a collection of TimeZone files so that you can determine the names for timezones outside the continental US (or more complicated time zones inside the US) Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK: Constants.pm Revision Data ------------- Index: Constants.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Constants.pm,v retrieving revision 1.52.4.3.2.1 retrieving revision 1.52.4.3.2.2 diff -Llib/WeBWorK/Constants.pm -Llib/WeBWorK/Constants.pm -u -r1.52.4.3.2.1 -r1.52.4.3.2.2 --- lib/WeBWorK/Constants.pm +++ lib/WeBWorK/Constants.pm @@ -144,7 +144,7 @@ type => 'number'}, { var => 'siteDefaults{timezone}', doc => 'Timezone for the course', - doc2 => 'Some servers handle courses taking place in different timezones. If this course is not showing the correct timezone, enter the correct value here. The format consists of unix times, such as "America/Chicago", "America/Phoenix", "America/Los_Angeles", "America/New_York", or "America/Denver".', + doc2 => 'Some servers handle courses taking place in different timezones. If this course is not showing the correct timezone, enter the correct value here. The format consists of unix times, such as "America/New_York","America/Chicago", "America/Denver", "America/Phoenix" or "America/Los_Angeles". Complete list: <a href="http://cpan.uwinnipeg.ca/dist/DateTime-TimeZone">TimeZoneFiles</a>', type => 'text'},], ['Permissions', { var => 'permissionLevels{login}', |
From: dpvc v. a. <we...@ma...> - 2008-07-14 16:01:09
|
Log Message: ----------- Fixed documentation typos. Modified Files: -------------- pg/macros: contextCurrency.pl Revision Data ------------- Index: contextCurrency.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextCurrency.pl,v retrieving revision 1.15 retrieving revision 1.16 diff -Lmacros/contextCurrency.pl -Lmacros/contextCurrency.pl -u -r1.15 -r1.16 --- macros/contextCurrency.pl +++ macros/contextCurrency.pl @@ -125,7 +125,7 @@ ANS(Compute('$10.95')->cmp(forceDecimals=>1)); By default, if the monitary value includes decimals digits, it -must have exactly two. You can weaken this requirement to all +must have exactly two. You can weaken this requirement to allow any number of decimals by using noExtraDecimals=>0. ANS(Compute('$10.23372')->cmp(noExtraDecimals=>0); @@ -142,7 +142,7 @@ It can also be set on an individual currency value: - $m = Compute("$50")->with(trimtrailingZeros=>1); + $m = Compute('$50')->with(trimtrailingZeros=>1); so that this $m will print as $50 rather than $50.00. |
From: Gavin L. v. a. <we...@ma...> - 2008-07-10 15:18:23
|
Log Message: ----------- ProblemSetDetail: correct typo in grouping set message, don't show problem seeds for usersets of gateway assignments (because the seeds there aren't used for anything; only the version's seeds matter). Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: ProblemSetDetail.pm Revision Data ------------- Index: ProblemSetDetail.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm,v retrieving revision 1.73 retrieving revision 1.74 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -u -r1.73 -r1.74 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm @@ -373,6 +373,10 @@ (! $forUsers && ( $globalRecord->restrict_ip eq '' || $globalRecord->restrict_ip eq 'No' ) ) ) ); + # skip the problem seed if we're editing a gateway set for users, + # but aren't editing a set version + next if ( $field eq 'problem_seed' && + ( $isGWset && $forUsers && ! $setVersion ) ); unless ($properties{type} eq "hidden") { $output .= CGI::Tr({}, CGI::td({}, [$self->FieldHTML($userID, $setID, $problemID, $globalRecord, $userRecord, $field)])) . "\n"; @@ -1557,7 +1561,7 @@ my $ce = $r->ce; return "No source file specified" unless $file; - return "Problem source is drawn from grouping set" if $file =~ /^group/; + return "Problem source is drawn from a grouping set" if $file =~ /^group/; $file = $ce->{courseDirs}->{templates} . '/' . $file unless $file =~ m|^/|; my $text = "This source file "; |
From: Dan A. v. a. <we...@ma...> - 2008-07-08 20:13:34
|
Log Message: ----------- Modified the data types isn these files to encapsulate the data in a SOAP string type. Modified Files: -------------- webwork2/lib: WebworkSOAP.pm webwork2/lib/WebworkSOAP/Classes: GlobalProblem.pm GlobalSet.pm Key.pm Password.pm Permission.pm User.pm UserProblem.pm UserSet.pm Revision Data ------------- Index: WebworkSOAP.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WebworkSOAP.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -Llib/WebworkSOAP.pm -Llib/WebworkSOAP.pm -u -r1.12 -r1.13 --- lib/WebworkSOAP.pm +++ lib/WebworkSOAP.pm @@ -57,6 +57,12 @@ return $self; } +sub array_to_soap_string { + my @array = @_; + @array = map { SOAP::Data->type( 'string', $_ ) } @array; + return \@array; +} + sub soap_fault_authen { die SOAP::Fault->faultcode(SOAPERROR_AUTHEN_FAILED) ->faultstring("SOAP Webservice Authentication Failed!"); @@ -103,7 +109,7 @@ } $@ and soap_fault_major("Course Environment cannot be constructed."); my @test = listCourses($ce); - return \@test; + return array_to_soap_string( @test ); } =pod @@ -127,7 +133,7 @@ eval { $soapEnv->{db}->deleteKey($userID) }; eval { $soapEnv->{db}->addKey($Key) }; $@ and soap_fault(SOAPERROR_USER_NOT_FOUND,"User not found."); - return $newKey; + return SOAP::Data->type( 'string', $newKey ); } =pod @@ -171,7 +177,7 @@ initializeUserProblem($UserProblem, $seed); eval { $db->addUserProblem($UserProblem) }; } - return @results; + return array_to_soap_string( @results ); #FIXME WSDL says $string, not @string? } =pod @@ -196,7 +202,7 @@ } push(@grades,$grade); } - return \@grades; + return array_to_soap_string( @grades ); } =pod @@ -204,7 +210,7 @@ _IN authenKey $string _IN courseName $string _IN setID $string -_RETURN @string +_RETURN $WebworkSOAP::Classes::GlobalSet =end WSDL =cut sub get_set_data { @@ -216,8 +222,6 @@ } my $set = new WebworkSOAP::Classes::GlobalSet($setData); return $set; - - } #################################################################### @@ -240,7 +244,7 @@ my $soapEnv = new WebworkSOAP($authenKey,$courseName); my $newPassword = $soapEnv->{db}->newPassword; %$newPassword = %$record; - return $soapEnv->{db}->addPassword($newPassword); + return SOAP::Data->type( 'string', $soapEnv->{db}->addPassword($newPassword) ); } =pod @@ -254,7 +258,7 @@ sub put_password { my ($self,$authenKey,$courseName,$record) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); - return $soapEnv->{db}->putPassword($record); + return SOAP::Data->type( 'string', $soapEnv->{db}->putPassword($record) ); } =pod @@ -268,7 +272,7 @@ my ($self,$authenKey,$courseName) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); my @tempArray = $soapEnv->{db}->listPasswords; - return \@tempArray; + return array_to_soap_string( @tempArray ); } =pod @@ -326,7 +330,7 @@ my $soapEnv = new WebworkSOAP($authenKey,$courseName); my $newPermissionLevel = $soapEnv->{db}->newPermissionLevel; %$newPermissionLevel = %$record; - return $soapEnv->{db}->addPermissionLevel($newPermissionLevel); + return SOAP::Data->type( 'string', $soapEnv->{db}->addPermissionLevel($newPermissionLevel) ); } =pod @@ -340,7 +344,7 @@ sub put_permission { my ($self,$authenKey,$courseName,$record) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); - return $soapEnv->{db}->putPermissionLevel($record); + return SOAP::Data->type( 'string', $soapEnv->{db}->putPermissionLevel($record) ); } =pod @@ -354,7 +358,7 @@ my ($self,$authenKey,$courseName) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); my @tempArray = $soapEnv->{db}->listPermissionLevels; - return \@tempArray; + return array_to_soap_string( @tempArray ); } =pod @@ -412,7 +416,7 @@ my $soapEnv = new WebworkSOAP($authenKey,$courseName); my $newKey = $soapEnv->{db}->newKey; %$newKey = %$record; - return $soapEnv->{db}->addKey($newKey); + return SOAP::Data->type( 'string', $soapEnv->{db}->addKey($newKey) ); } =pod @@ -426,7 +430,7 @@ sub put_key { my ($self,$authenKey,$courseName,$record) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); - return $soapEnv->{db}->putKey($record); + return SOAP::Data->type( 'string', $soapEnv->{db}->putKey($record) ); } =pod @@ -440,7 +444,7 @@ my ($self,$authenKey,$courseName) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); my @tempArray = $soapEnv->{db}->listKeys; - return \@tempArray; + return array_to_soap_string( @tempArray ); } =pod @@ -498,7 +502,7 @@ my $soapEnv = new WebworkSOAP($authenKey,$courseName); my $newUser = $soapEnv->{db}->newUser; %$newUser = %$record; - return $soapEnv->{db}->addUser($newUser); + return SOAP::Data->type( 'string', $soapEnv->{db}->addUser($newUser) ); } =pod @@ -512,7 +516,7 @@ sub put_user { my ($self,$authenKey,$courseName,$record) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); - return $soapEnv->{db}->putUser($record); + return SOAP::Data->type( 'string', $soapEnv->{db}->putUser($record) ); } =pod @@ -526,7 +530,7 @@ my ($self,$authenKey,$courseName) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); my @tempArray = $soapEnv->{db}->listUsers; - return \@tempArray; + return array_to_soap_string( @tempArray ); } =pod @@ -578,7 +582,7 @@ sub delete_user { my ($self,$authenKey,$courseName,$userID) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); - return $soapEnv->{db}->deleteUser($userID); + return SOAP::Data->type( 'string', $soapEnv->{db}->deleteUser($userID) ); } ################################################## @@ -598,7 +602,7 @@ my $soapEnv = new WebworkSOAP($authenKey,$courseName); my $newGlobalSet = $soapEnv->{db}->newGlobalSet; %$newGlobalSet = %$record; - return $soapEnv->{db}->addGlobalSet($newGlobalSet); + return SOAP::Data->type( 'string', $soapEnv->{db}->addGlobalSet($newGlobalSet) ); } =pod @@ -612,7 +616,7 @@ sub put_global_set { my ($self,$authenKey,$courseName,$record) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); - return $soapEnv->{db}->putGlobalSet($record); + return SOAP::Data->type( 'string', $soapEnv->{db}->putGlobalSet($record) ); } =pod @@ -626,10 +630,9 @@ my ($self,$authenKey,$courseName) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); my @tempArray = $soapEnv->{db}->listGlobalSets; - return \@tempArray; + return array_to_soap_string( @tempArray ); } - =pod =begin WSDL _IN authenKey $string @@ -698,7 +701,7 @@ sub delete_global_set { my ($self,$authenKey,$courseName,$setID) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); - return $soapEnv->{db}->deleteGlobalSet($setID); + return SOAP::Data->type( 'string', $soapEnv->{db}->deleteGlobalSet($setID) ); } ################################################## @@ -718,7 +721,7 @@ my $soapEnv = new WebworkSOAP($authenKey,$courseName); my $newGlobalProblem = $soapEnv->{db}->newGlobalProblem; %$newGlobalProblem = %$record; - return $soapEnv->{db}->addGlobalProblem($newGlobalProblem); + return SOAP::Data->type( 'string', $soapEnv->{db}->addGlobalProblem($newGlobalProblem) ); } =pod @@ -732,7 +735,7 @@ sub put_global_problem { my ($self,$authenKey,$courseName,$record) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); - return $soapEnv->{db}->putGlobalProblem($record); + return SOAP::Data->type( 'string', $soapEnv->{db}->putGlobalProblem($record) ); } =pod @@ -747,7 +750,7 @@ my ($self,$authenKey,$courseName,$setID) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); my @tempArray = $soapEnv->{db}->listGlobalProblems($setID); - return \@tempArray; + return array_to_soap_string( @tempArray ); } =pod @@ -773,7 +776,7 @@ =begin _IN authenKey $string _IN courseName $string -_IN problemIDs @string +_IN problemIDs @string An array reference: [userID setID problemID] _RETURN @WebworkSOAP::Classes::GlobalProblem Array of user objects =end WSDL =cut @@ -783,7 +786,7 @@ my @problemData = $soapEnv->{db}->getGlobalProblems(@$problemIDs); my @problems; for(my $i=0;$i<@problemData;$i++) { - push(@problems,new WebworkSOAP::Classes::GlobalProblem(@problemData[$i])); + push(@problems,new WebworkSOAP::Classes::GlobalProblem(@problemData[$i])); #FIXME $problemData[$i]? } return \@problems; } @@ -820,7 +823,7 @@ sub delete_global_problem { my ($self,$authenKey,$courseName,$setID,$problemID) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); - return $soapEnv->{db}->deleteGlobalProblem($setID,$problemID); + return SOAP::Data->type( 'string', $soapEnv->{db}->deleteGlobalProblem($setID,$problemID) ); } ################################################## @@ -840,7 +843,7 @@ my $soapEnv = new WebworkSOAP($authenKey,$courseName); my $newUserProblem = $soapEnv->{db}->newUserProblem; %$newUserProblem = %$record; - return $soapEnv->{db}->addUserProblem($newUserProblem); + return SOAP::Data->type( 'string', $soapEnv->{db}->addUserProblem($newUserProblem) ); } =pod @@ -854,7 +857,7 @@ sub put_user_problem { my ($self,$authenKey,$courseName,$record) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); - return $soapEnv->{db}->putUserProblem($record); + return SOAP::Data->type( 'string', $soapEnv->{db}->putUserProblem($record) ); } =pod @@ -862,14 +865,15 @@ _IN authenKey $string _IN courseName $string _IN userID $string +_IN setID $string _RETURN @string of names objects. =end WSDL =cut sub list_user_problems { - my ($self,$authenKey,$courseName,$userID) = @_; + my ($self,$authenKey,$courseName,$userID,$setID) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); - my @tempArray = $soapEnv->{db}->listUserProblems($userID); - return \@tempArray; + my @tempArray = $soapEnv->{db}->listUserProblems($userID,$setID); + return array_to_soap_string( @tempArray ); } =pod @@ -896,7 +900,7 @@ =begin WSDL _IN authenKey $string _IN courseName $string -_IN userProblemIDs @string +_IN userProblemIDs @string A 3 element array: { user_ID, setID, problemID } _RETURN @WebworkSOAP::Classes::UserProblem of names objects. =end WSDL =cut @@ -945,7 +949,7 @@ sub delete_user_problem { my ($self,$authenKey,$courseName,$userID,$setID,$problemID) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); - return $soapEnv->{db}->deleteUserProblem($userID,$setID,$problemID); + return SOAP::Data->type( 'string', $soapEnv->{db}->deleteUserProblem($userID,$setID,$problemID) ); } ################################################## @@ -965,7 +969,7 @@ my $soapEnv = new WebworkSOAP($authenKey,$courseName); my $newUserSet = $soapEnv->{db}->newUserSet; %$newUserSet = %$record; - return $soapEnv->{db}->addUserSet($newUserSet); + return SOAP::Data->type( 'string', $soapEnv->{db}->addUserSet($newUserSet) ); } =pod @@ -979,7 +983,7 @@ sub put_user_set { my ($self,$authenKey,$courseName,$record) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); - return $soapEnv->{db}->addUserSet($record); + return SOAP::Data->type( 'string', $soapEnv->{db}->addUserSet($record) ); } =pod @@ -994,7 +998,7 @@ my ($self,$authenKey,$courseName,$userID) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); my @tempArray = $soapEnv->{db}->listUserSets($userID); - return \@tempArray; + return array_to_soap_string( @tempArray ); } =pod @@ -1066,7 +1070,7 @@ sub delete_user_set { my ($self,$authenKey,$courseName,$userID,$setID) = @_; my $soapEnv = new WebworkSOAP($authenKey,$courseName); - return $soapEnv->{db}->deleteUserSet($userID,$setID); + return SOAP::Data->type( 'string', $soapEnv->{db}->deleteUserSet($userID,$setID) ); } Index: Permission.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WebworkSOAP/Classes/Permission.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -Llib/WebworkSOAP/Classes/Permission.pm -Llib/WebworkSOAP/Classes/Permission.pm -u -r1.3 -r1.4 --- lib/WebworkSOAP/Classes/Permission.pm +++ lib/WebworkSOAP/Classes/Permission.pm @@ -10,8 +10,8 @@ my $self = shift; my $data = shift; $self = {}; - $self->{user_id} = $data->user_id; - $self->{permission} = $data->permission; + $self->{user_id} = SOAP::Data->type( 'string', $data->user_id ); + $self->{permission} = SOAP::Data->type( 'string', $data->permission ); bless $self; return $self; } Index: User.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WebworkSOAP/Classes/User.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -Llib/WebworkSOAP/Classes/User.pm -Llib/WebworkSOAP/Classes/User.pm -u -r1.2 -r1.3 --- lib/WebworkSOAP/Classes/User.pm +++ lib/WebworkSOAP/Classes/User.pm @@ -17,15 +17,15 @@ my $self = shift; my $data = shift; $self = {}; - $self->{user_id} = $data->user_id; - $self->{first_name} = $data->first_name; - $self->{last_name} = $data->last_name; - $self->{email_address} = $data->email_address; - $self->{student_id} = $data->student_id; - $self->{status} = $data->status; - $self->{section} = $data->section; - $self->{recitation} = $data->recitation; - $self->{comment} = $data->comment; + $self->{user_id} = SOAP::Data->type( 'string', $data->user_id ); + $self->{first_name} = SOAP::Data->type( 'string', $data->first_name ); + $self->{last_name} = SOAP::Data->type( 'string', $data->last_name ); + $self->{email_address} = SOAP::Data->type( 'string', $data->email_address ); + $self->{student_id} = SOAP::Data->type( 'string', $data->student_id ); + $self->{status} = SOAP::Data->type( 'string', $data->status ); + $self->{section} = SOAP::Data->type( 'string', $data->section ); + $self->{recitation} = SOAP::Data->type( 'string', $data->recitation ); + $self->{comment} = SOAP::Data->type( 'string', $data->comment ); bless $self; return $self; } Index: Key.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WebworkSOAP/Classes/Key.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -Llib/WebworkSOAP/Classes/Key.pm -Llib/WebworkSOAP/Classes/Key.pm -u -r1.2 -r1.3 --- lib/WebworkSOAP/Classes/Key.pm +++ lib/WebworkSOAP/Classes/Key.pm @@ -11,9 +11,9 @@ my $self = shift; my $data = shift; $self = {}; - $self->{user_id} = $data->user_id; - $self->{key_not_a_keyboard} = $data->key_not_a_keyboard; - $self->{timestamp} = $data->timestamp; + $self->{user_id} = SOAP::Data->type( 'string', $data->user_id ); + $self->{key_not_a_keyboard} = SOAP::Data->type( 'string', $data->key_not_a_keyboard ); + $self->{timestamp} = SOAP::Data->type( 'string', $data->timestamp ); bless $self; return $self; } Index: GlobalProblem.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WebworkSOAP/Classes/GlobalProblem.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -Llib/WebworkSOAP/Classes/GlobalProblem.pm -Llib/WebworkSOAP/Classes/GlobalProblem.pm -u -r1.2 -r1.3 --- lib/WebworkSOAP/Classes/GlobalProblem.pm +++ lib/WebworkSOAP/Classes/GlobalProblem.pm @@ -11,11 +11,11 @@ my $self = shift; my $data = shift; $self = {}; - $self->{set_id} = $data->set_id; - $self->{problem_id} = $data->problem_id; - $self->{source_file} = $data->source_file; - $self->{value} = $data->value; - $self->{max_attempts} = $data->max_attempts; + $self->{set_id} = SOAP::Data->type( 'string', $data->set_id ); + $self->{problem_id} = SOAP::Data->type( 'string', $data->problem_id ); + $self->{source_file} = SOAP::Data->type( 'string', $data->source_file ); + $self->{value} = SOAP::Data->type( 'string', $data->value ); + $self->{max_attempts} = SOAP::Data->type( 'string', $data->max_attempts ); bless $self; return $self; } Index: GlobalSet.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WebworkSOAP/Classes/GlobalSet.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -Llib/WebworkSOAP/Classes/GlobalSet.pm -Llib/WebworkSOAP/Classes/GlobalSet.pm -u -r1.2 -r1.3 --- lib/WebworkSOAP/Classes/GlobalSet.pm +++ lib/WebworkSOAP/Classes/GlobalSet.pm @@ -22,22 +22,22 @@ my $self = shift; my $data = shift; $self = {}; - $self->{set_id} = $data->set_id; - $self->{set_header} = $data->set_header; - $self->{hardcopy_header} = $data->hardcopy_header; - $self->{open_date} = $data->open_date; - $self->{due_date} = $data->due_date; - $self->{answer_date} = $data->answer_date; - $self->{published} = $data->published; - $self->{assignment_type} = $data->assignment_type; - $self->{attempts_per_version} = $data->attempts_per_version; - $self->{time_interval} = $data->time_interval; - $self->{versions_per_interval} = $data->versions_per_interval; - $self->{version_time_limit} = $data->version_time_limit; - $self->{version_creation_time} = $data->version_creation_time; - $self->{problem_randorder} = $data->problem_randorder; - $self->{version_last_attempt_time} = $data->version_last_attempt_time; - $self->{problems_per_page} = $data->problems_per_page; + $self->{set_id} = SOAP::Data->type( 'string', $data->set_id ); + $self->{set_header} = SOAP::Data->type( 'string', $data->set_header ); + $self->{hardcopy_header} = SOAP::Data->type( 'string', $data->hardcopy_header ); + $self->{open_date} = SOAP::Data->type( 'string', $data->open_date ); + $self->{due_date} = SOAP::Data->type( 'string', $data->due_date ); + $self->{answer_date} = SOAP::Data->type( 'string', $data->answer_date ); + $self->{published} = SOAP::Data->type( 'string', $data->published ); + $self->{assignment_type} = SOAP::Data->type( 'string', $data->assignment_type ); + $self->{attempts_per_version} = SOAP::Data->type( 'string', $data->attempts_per_version ); + $self->{time_interval} = SOAP::Data->type( 'string', $data->time_interval ); + $self->{versions_per_interval} = SOAP::Data->type( 'string', $data->versions_per_interval ); + $self->{version_time_limit} = SOAP::Data->type( 'string', $data->version_time_limit ); + $self->{version_creation_time} = SOAP::Data->type( 'string', $data->version_creation_time ); + $self->{problem_randorder} = SOAP::Data->type( 'string', $data->problem_randorder ); + $self->{version_last_attempt_time} = SOAP::Data->type( 'string', $data->version_last_attempt_time ); + $self->{problems_per_page} = SOAP::Data->type( 'string', $data->problems_per_page ); bless $self; return $self; } Index: Password.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WebworkSOAP/Classes/Password.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -Llib/WebworkSOAP/Classes/Password.pm -Llib/WebworkSOAP/Classes/Password.pm -u -r1.2 -r1.3 --- lib/WebworkSOAP/Classes/Password.pm +++ lib/WebworkSOAP/Classes/Password.pm @@ -10,8 +10,8 @@ my $self = shift; my $data = shift; $self = {}; - $self->{user_id} = $data->user_id; - $self->{password} = $data->password; + $self->{user_id} = SOAP::Data->type( 'string', $data->user_id ); + $self->{password} = SOAP::Data->type( 'string', $data->password ); bless $self; return $self; } Index: UserSet.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WebworkSOAP/Classes/UserSet.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -Llib/WebworkSOAP/Classes/UserSet.pm -Llib/WebworkSOAP/Classes/UserSet.pm -u -r1.2 -r1.3 --- lib/WebworkSOAP/Classes/UserSet.pm +++ lib/WebworkSOAP/Classes/UserSet.pm @@ -25,24 +25,24 @@ my $self = shift; my $data = shift; $self = {}; - $self->{user_id} = $data->user_id; - $self->{set_id} = $data->set_id; - $self->{psvn} = $data->psvn; - $self->{set_header} = $data->set_header; - $self->{hardcopy_header} = $data->hardcopy_header; - $self->{open_date} = $data->open_date; - $self->{due_date} = $data->due_date; - $self->{answer_date} = $data->answer_date; - $self->{published} = $data->published; - $self->{assignment_type} = $data->assignment_type; - $self->{attempts_per_version} = $data->attempts_per_version; - $self->{time_interval} = $data->time_interval; - $self->{versions_per_interval} = $data->versions_per_interval; - $self->{version_time_limit} = $data->version_time_limit; - $self->{version_creation_time} = $data->version_creation_time; - $self->{problem_randorder} = $data->problem_randorder; - $self->{version_last_attempt_time} = $data->version_last_attempt_time; - $self->{problems_per_page} = $data->problems_per_page; + $self->{user_id} = SOAP::Data->type( 'string', $data->user_id ); + $self->{set_id} = SOAP::Data->type( 'string', $data->set_id ); + $self->{psvn} = SOAP::Data->type( 'string', $data->psvn ); + $self->{set_header} = SOAP::Data->type( 'string', $data->set_header ); + $self->{hardcopy_header} = SOAP::Data->type( 'string', $data->hardcopy_header ); + $self->{open_date} = SOAP::Data->type( 'string', $data->open_date ); + $self->{due_date} = SOAP::Data->type( 'string', $data->due_date ); + $self->{answer_date} = SOAP::Data->type( 'string', $data->answer_date ); + $self->{published} = SOAP::Data->type( 'string', $data->published ); + $self->{assignment_type} = SOAP::Data->type( 'string', $data->assignment_type ); + $self->{attempts_per_version} = SOAP::Data->type( 'string', $data->attempts_per_version ); + $self->{time_interval} = SOAP::Data->type( 'string', $data->time_interval ); + $self->{versions_per_interval} = SOAP::Data->type( 'string', $data->versions_per_interval ); + $self->{version_time_limit} = SOAP::Data->type( 'string', $data->version_time_limit ); + $self->{version_creation_time} = SOAP::Data->type( 'string', $data->version_creation_time ); + $self->{problem_randorder} = SOAP::Data->type( 'string', $data->problem_randorder ); + $self->{version_last_attempt_time} = SOAP::Data->type( 'string', $data->version_last_attempt_time ); + $self->{problems_per_page} = SOAP::Data->type( 'string', $data->problems_per_page ); bless $self; return $self; } Index: UserProblem.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WebworkSOAP/Classes/UserProblem.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -Llib/WebworkSOAP/Classes/UserProblem.pm -Llib/WebworkSOAP/Classes/UserProblem.pm -u -r1.2 -r1.3 --- lib/WebworkSOAP/Classes/UserProblem.pm +++ lib/WebworkSOAP/Classes/UserProblem.pm @@ -19,18 +19,18 @@ my $self = shift; my $data = shift; $self = {}; - $self->{user_id} = $data->user_id; - $self->{set_id} = $data->set_id; - $self->{problem_id} = $data->problem_id; - $self->{source_file} = $data->source_file; - $self->{value} = $data->value; - $self->{max_attempts} = $data->max_attempts; - $self->{problem_seed} = $data->problem_seed; - $self->{status} = $data->status; - $self->{attempted} = $data->attempted; - $self->{last_answer} = $data->last_answer; - $self->{num_correct} = $data->num_correct; - $self->{num_incorrect} = $data->num_incorrect; + $self->{user_id} = SOAP::Data->type( 'string', $data->user_id ); + $self->{set_id} = SOAP::Data->type( 'string', $data->set_id ); + $self->{problem_id} = SOAP::Data->type( 'string', $data->problem_id ); + $self->{source_file} = SOAP::Data->type( 'string', $data->source_file ); + $self->{value} = SOAP::Data->type( 'string', $data->value ); + $self->{max_attempts} = SOAP::Data->type( 'string', $data->max_attempts ); + $self->{problem_seed} = SOAP::Data->type( 'string', $data->problem_seed ); + $self->{status} = SOAP::Data->type( 'string', $data->status ); + $self->{attempted} = SOAP::Data->type( 'string', $data->attempted ); + $self->{last_answer} = SOAP::Data->type( 'string', $data->last_answer ); + $self->{num_correct} = SOAP::Data->type( 'string', $data->num_correct ); + $self->{num_incorrect} = SOAP::Data->type( 'string', $data->num_incorrect ); bless $self; return $self; } |
From: Mike G. v. a. <we...@ma...> - 2008-07-08 15:31:04
|
Log Message: ----------- forward port of bug fix in rel-2-4-5 Modified Files: -------------- pg/macros: contextIntegerFunctions.pl Revision Data ------------- Index: contextIntegerFunctions.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextIntegerFunctions.pl,v retrieving revision 1.11 retrieving revision 1.12 diff -Lmacros/contextIntegerFunctions.pl -Lmacros/contextIntegerFunctions.pl -u -r1.11 -r1.12 --- macros/contextIntegerFunctions.pl +++ macros/contextIntegerFunctions.pl @@ -46,7 +46,7 @@ sub _contextIntegerFunctions_init {context::IntegerFunctions2::Init()}; # don't reload this file -package context::IntegerFunction2; +package context::IntegerFunctions2; our @ISA = qw(Parser::Function::numeric2); # checks for 2 numeric inputs sub C { @@ -69,8 +69,8 @@ $context->{name} = "IntegerFunctions"; $context->functions->add( - C => {class => 'context::IntegerFunction2'}, - P => {class => 'context::IntegerFunction2'}, + C => {class => 'context::IntegerFunctions2'}, + P => {class => 'context::IntegerFunctions2'}, ); main::Context("IntegerFunctions"); |
From: Mike G. v. a. <we...@ma...> - 2008-07-08 15:27:00
|
Log Message: ----------- fixed typo by changing all references to IntegerFunction or IntegerFunctions to the plural The typo gave an immediate error when IntegerFunctions2::Init was called instead of IntegerFunction2::Init while the internal name of the package was integerFunction2. The external name of the context was IntegerFunctions and everything has been changed to match that. The fact that this bug has existed so long leads me to believe that this context is not much used. Is there an alternative or better way to include C(n,k) and P(n,k) as functions in the context? I'd also suggest changing the name to something like contextCombinatorics since I think this is more likely to show up when someone searches for C(n,k) or P(N,k) functionality using a keyword search. This would be feasible if the current contextIntegerFunctions has not be used very much. -- Mike Gage and Noah Bennett Tags: ---- rel-2-4-patches Modified Files: -------------- pg/macros: contextIntegerFunctions.pl Revision Data ------------- Index: contextIntegerFunctions.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextIntegerFunctions.pl,v retrieving revision 1.1.6.2.2.1 retrieving revision 1.1.6.2.2.2 diff -Lmacros/contextIntegerFunctions.pl -Lmacros/contextIntegerFunctions.pl -u -r1.1.6.2.2.1 -r1.1.6.2.2.2 --- macros/contextIntegerFunctions.pl +++ macros/contextIntegerFunctions.pl @@ -46,7 +46,7 @@ sub _contextIntegerFunctions_init {context::IntegerFunctions2::Init()}; # don't reload this file -package context::IntegerFunction2; +package context::IntegerFunctions2; our @ISA = qw(Parser::Function::numeric2); # checks for 2 numeric inputs sub C { @@ -69,8 +69,8 @@ $context->{name} = "IntegerFunctions"; $context->functions->add( - C => {class => 'context::IntegerFunction2'}, - P => {class => 'context::IntegerFunction2'}, + C => {class => 'context::IntegerFunctions2'}, + P => {class => 'context::IntegerFunctions2'}, ); main::Context("IntegerFunctions"); |
From: Mike G. v. a. <we...@ma...> - 2008-07-03 14:27:48
|
Log Message: ----------- forward port correction in reporting AUTOLOAD error from rel-2-4-5 Take care, Mike VS: ---------------------------------------------------------------------- Modified Files: -------------- webwork2/lib/WeBWorK/DB/Schema: NewSQL.pm Revision Data ------------- Index: NewSQL.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Schema/NewSQL.pm,v retrieving revision 1.25 retrieving revision 1.26 diff -Llib/WeBWorK/DB/Schema/NewSQL.pm -Llib/WeBWorK/DB/Schema/NewSQL.pm -u -r1.25 -r1.26 --- lib/WeBWorK/DB/Schema/NewSQL.pm +++ lib/WeBWorK/DB/Schema/NewSQL.pm @@ -334,8 +334,7 @@ if (exists $API{$2}) { croak sprintf("%s does not implement &%s", $1, $2); } else { - warn caller(); - croak sprintf("Undefined subroutine &%s called ", $AUTOLOAD); + croak sprintf("Undefined subroutine &%s called ", $AUTOLOAD," stack trace: ", caller()); } } |
From: Mike G. v. a. <we...@ma...> - 2008-07-02 17:33:46
|
Log Message: ----------- forward port of typo correction in url Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: CourseAdmin.pm Revision Data ------------- Index: CourseAdmin.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v retrieving revision 1.76 retrieving revision 1.77 diff -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -u -r1.76 -r1.77 --- lib/WeBWorK/ContentGenerator/CourseAdmin.pm +++ lib/WeBWorK/ContentGenerator/CourseAdmin.pm @@ -2445,8 +2445,8 @@ CGI::p("If you are using your WeBWorK server for courses please help us out by registering your server."), CGI::p("We are often asked how many institutions are using WeBWorK and how many students are using WeBWorK Since WeBWorK is open source and can be freely downloaded from ". - CGI::a({href=>'http://www.openwebwork.org'},'http://www.openwebwork.org' ). " and ". - CGI::a({href=> 'http://webwork.maa.org'},'http://www.openwebwork.org'). ", it is frequently difficult for us to give a reasonable answer to this + CGI::a({href=>'http://webwork.maa.org'},'http://webwork.maa.org' ). " and ". + CGI::a({href=> 'http://www.openwebwork.org'},'http://www.openwebwork.org'). ", it is frequently difficult for us to give a reasonable answer to this question."), CGI::p("You can help by registering your current version of WeBWorK -- click the button, answer a few questions (the ones you can answer easily) and send the email. It takes less than two minutes. Thank you!. -- The WeBWorK Team"), |
From: Mike G. v. a. <we...@ma...> - 2008-07-02 17:32:58
|
Log Message: ----------- Corrected typo in url for webwork.maa.org (the openwebwork url was used twice) Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: CourseAdmin.pm Revision Data ------------- Index: CourseAdmin.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v retrieving revision 1.64.2.2.2.2 retrieving revision 1.64.2.2.2.3 diff -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -u -r1.64.2.2.2.2 -r1.64.2.2.2.3 --- lib/WeBWorK/ContentGenerator/CourseAdmin.pm +++ lib/WeBWorK/ContentGenerator/CourseAdmin.pm @@ -2445,8 +2445,8 @@ CGI::p("If you are using your WeBWorK server for courses please help us out by registering your server."), CGI::p("We are often asked how many institutions are using WeBWorK and how many students are using WeBWorK Since WeBWorK is open source and can be freely downloaded from ". - CGI::a({href=>'http://www.openwebwork.org'},'http://www.openwebwork.org' ). " and ". - CGI::a({href=> 'http://webwork.maa.org'},'http://www.openwebwork.org'). ", it is frequently difficult for us to give a reasonable answer to this + CGI::a({href=>'http://webwork.maa.org'},'http://webwork.maa.org' ). " and ". + CGI::a({href=> 'http://www.openwebwork.org'},'http://www.openwebwork.org'). ", it is frequently difficult for us to give a reasonable answer to this question."), CGI::p("You can help by registering your current version of WeBWorK -- click the button, answer a few questions (the ones you can answer easily) and send the email. It takes less than two minutes. Thank you!. -- The WeBWorK Team"), |
From: Arnie P. v. a. <we...@ma...> - 2008-07-02 17:14:16
|
Log Message: ----------- Edited: # URL of WeBWorK handler. If WeBWorK is to be on the web server root, use "". Note # that using "" may not work so we suggest sticking with "/webwork2". Modified Files: -------------- webwork2/conf: global.conf.dist Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.209 retrieving revision 1.210 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.209 -r1.210 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -30,7 +30,8 @@ # Set these variables to correspond to your configuration and preferences. You # will need to restart the webserver to reset the variables in this section. -# URL of WeBWorK handler. If WeBWorK is to be on the web server root, use "/". +# URL of WeBWorK handler. If WeBWorK is to be on the web server root, use "". Note +# that using "" may not work so we suggest sticking with "/webwork2". $webwork_url = "/webwork2"; # Root directory of PG. |
From: Arnie P. v. a. <we...@ma...> - 2008-07-02 17:12:02
|
Log Message: ----------- Edited: # URL of WeBWorK handler. If WeBWorK is to be on the web server root, use "". Note # that using "" may not work so we suggest sticking with "/webwork2". Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/conf: global.conf.dist Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.189.2.7.2.7 retrieving revision 1.189.2.7.2.8 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.189.2.7.2.7 -r1.189.2.7.2.8 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -30,7 +30,8 @@ # Set these variables to correspond to your configuration and preferences. You # will need to restart the webserver to reset the variables in this section. -# URL of WeBWorK handler. If WeBWorK is to be on the web server root, use "/". +# URL of WeBWorK handler. If WeBWorK is to be on the web server root, use "". Note +# that using "" may not work so we suggest sticking with "/webwork2". $webwork_url = "/webwork2"; # Root directory of PG. |
From: Arnie P. v. a. <we...@ma...> - 2008-07-01 14:27:40
|
Log Message: ----------- Added a "NPL Directory" button to the Library Browser giving access to all the directories in the NPL Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/conf: global.conf.dist Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.189.2.7.2.6 retrieving revision 1.189.2.7.2.7 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.189.2.7.2.6 -r1.189.2.7.2.7 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -386,9 +386,12 @@ # # would add two buttons, one for the Rochester library and one for the ASU # library, provided templates/rochester and templates/asu exists either as -# subdirectories or links to other directories. +# subdirectories or links to other directories. The "NPL Directory" button +# activated below gives access to all the directories in the National +# Problem Library. # $courseFiles{problibs} = { + Library => "NPL Directory", # rochesterLibrary => "Rochester", # asuLibrary => "Arizona State", # dcdsLibrary => "Detroit CDS", |
From: Arnie P. v. a. <we...@ma...> - 2008-07-01 14:24:02
|
Log Message: ----------- Added a "NPL Directory" button to the Library Browser giving access to all the directories in the NPL Modified Files: -------------- webwork2/conf: global.conf.dist Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.208 retrieving revision 1.209 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.208 -r1.209 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -386,9 +386,12 @@ # # would add two buttons, one for the Rochester library and one for the ASU # library, provided templates/rochester and templates/asu exists either as -# subdirectories or links to other directories. +# subdirectories or links to other directories. The "NPL Directory" button +# activated below gives access to all the directories in the National +# Problem Library. # $courseFiles{problibs} = { + Library => "NPL Directory", # rochesterLibrary => "Rochester", # asuLibrary => "Arizona State", # dcdsLibrary => "Detroit CDS", |
From: Gavin L. v. a. <we...@ma...> - 2008-07-01 13:36:23
|
Log Message: ----------- SetMaker: update to make problems that are "tried" display according to the assignment type of the selected set. We may want to back this change out at some point: because the set type is determined when the page is built, changing the selected set doesn't change how viewed problems are displayed until the page is reloaded. I think the behavior introduced by this patch is better than showing all problems as homework problems, but it may be otherwise. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: SetMaker.pm Revision Data ------------- Index: SetMaker.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm,v retrieving revision 1.84 retrieving revision 1.85 diff -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -u -r1.84 -r1.85 --- lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm +++ lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm @@ -843,6 +843,19 @@ $sourceFileName =~ s|^./||; # clean up top ugliness my $urlpath = $self->r->urlpath; + my $db = $self->r->db; + + ## to set up edit and try links elegantly we want to know if + ## any target set is a gateway assignment or not + my $localSet = $self->r->param('local_sets'); + my $setRecord; + if ( defined($localSet) && $localSet ne SELECT_SET_STRING && + $localSet ne NO_LOCAL_SET_STRING ) { + $setRecord = $db->getGlobalSet( $localSet ); + } + my $isGatewaySet = ( defined($setRecord) && + $setRecord->assignment_type =~ /gateway/ ); + my $problem_output = $pg->{flags}->{error_flag} ? CGI::div({class=>"ResultsWithError"}, CGI::em("This problem produced an error")) : CGI::div({class=>"RenderSolo"}, $pg->{body_text}); @@ -862,19 +875,22 @@ my $displayMode = $self->r->param("mydisplayMode"); $displayMode = $self->r->ce->{pg}->{options}->{displayMode} if not defined $displayMode or $displayMode eq "None"; + my $module = ( $isGatewaySet ) ? "GatewayQuiz" : "Problem"; + my %pathArgs = ( courseID =>$urlpath->arg("courseID"), + setID=>"Undefined_Set" ); + $pathArgs{problemID} = "1" if ( ! $isGatewaySet ); + my $try_link = CGI::a({href=>$self->systemLink( - $urlpath->newFromModule("WeBWorK::ContentGenerator::Problem", - courseID =>$urlpath->arg("courseID"), - setID=>"Undefined_Set", - problemID=>"1"), - params =>{ - effectiveUser => scalar($self->r->param('user')), - editMode => "SetMaker", - problemSeed=> $problem_seed, - sourceFilePath => "$sourceFileName", - displayMode => $displayMode, - } - ), target=>"WW_View"}, "Try it"); + $urlpath->newFromModule("WeBWorK::ContentGenerator::$module", + %pathArgs ), + params =>{ + effectiveUser => scalar($self->r->param('user')), + editMode => "SetMaker", + problemSeed=> $problem_seed, + sourceFilePath => "$sourceFileName", + displayMode => $displayMode, + } + ), target=>"WW_View"}, "Try it"); my %add_box_data = ( -name=>"trial$cnt",-value=>1,-label=>"Add this problem to the target set on the next update"); if($mark & SUCCESS) { |
From: Gavin L. v. a. <we...@ma...> - 2008-07-01 13:30:58
|
Log Message: ----------- ProblemSetDetail: fix sourcefile handling for gateway assignments Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: ProblemSetDetail.pm Revision Data ------------- Index: ProblemSetDetail.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm,v retrieving revision 1.72 retrieving revision 1.73 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -u -r1.72 -r1.73 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm @@ -2017,7 +2017,8 @@ problemID => "1" } ); my $seed = $problemToShow ? $problemToShow->problem_seed : ""; - my $file = $problemToShow ? $problemToShow->source_file : ""; + my $file = $problemToShow ? $problemToShow->source_file : + $GlobalProblems{$problemID}->source_file; $viewProblemLink = $self->systemLink( $viewProblemPage, |
From: Gavin L. v. a. <we...@ma...> - 2008-07-01 13:30:29
|
Log Message: ----------- GatewayQuiz: improve handling of unlikely circumstances. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: GatewayQuiz.pm Revision Data ------------- Index: GatewayQuiz.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm,v retrieving revision 1.53 retrieving revision 1.54 diff -Llib/WeBWorK/ContentGenerator/GatewayQuiz.pm -Llib/WeBWorK/ContentGenerator/GatewayQuiz.pm -u -r1.53 -r1.54 --- lib/WeBWorK/ContentGenerator/GatewayQuiz.pm +++ lib/WeBWorK/ContentGenerator/GatewayQuiz.pm @@ -1018,8 +1018,11 @@ #################################### # bail without doing anything if the set isn't yet open for this user - return unless $self->{isOpen} || - $authz->hasPermissions($userName,"view_unopened_sets"); + if ( ! ( $self->{isOpen} || + $authz->hasPermissions($userName,"view_unopened_sets") ) ) { + $self->{invalidSet} = "This set is not yet open."; + return; + } # what does the user want to do? my %want = @@ -1283,7 +1286,7 @@ # if $self->{invalidSet} is set, then we have an error and should # just bail with the appropriate error message - if ($self->{invalidSet}) { + if ($self->{invalidSet} || $self->{invalidProblem}) { # delete any proctor keys that are floating around if ( $self->{'assignment_type'} eq 'proctored_gateway' ) { my $proctorID = $r->param('proctor_user'); |
From: dpvc v. a. <we...@ma...> - 2008-06-30 21:36:53
|
Log Message: ----------- Fixed typo Modified Files: -------------- pg/macros: parserMultiPart.pl Revision Data ------------- Index: parserMultiPart.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/parserMultiPart.pl,v retrieving revision 1.12 retrieving revision 1.13 diff -Lmacros/parserMultiPart.pl -Lmacros/parserMultiPart.pl -u -r1.12 -r1.13 --- macros/parserMultiPart.pl +++ macros/parserMultiPart.pl @@ -30,7 +30,7 @@ loadMacros("parserMultiAnswer.pl"); sub MultiPart { - warn "The MultiPart object has been depricated.${BR}You should use MultiAnswer object instead"; + warn "The MultiPart object has been deprecated.${BR}You should use MultiAnswer object instead"; MultiAnswer->new(@_); } |
From: Mike G. v. a. <we...@ma...> - 2008-06-29 18:20:38
|
Log Message: ----------- Comment on why the "stylesheet" variable will not work properly if one attempts to modify it in course.conf .CVS: ---------------------------------------------------------------------- Modified Files: -------------- webwork2/lib/WeBWorK: ContentGenerator.pm Revision Data ------------- Index: ContentGenerator.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator.pm,v retrieving revision 1.194 retrieving revision 1.195 diff -Llib/WeBWorK/ContentGenerator.pm -Llib/WeBWorK/ContentGenerator.pm -u -r1.194 -r1.195 --- lib/WeBWorK/ContentGenerator.pm +++ lib/WeBWorK/ContentGenerator.pm @@ -480,6 +480,10 @@ my $themesDir = $ce->{webworkDirs}{templates}; my $theme = $r->param("theme") || $ce->{defaultTheme}; $theme = $ce->{defaultTheme} if $theme =~ m!(?:^|/)\.\.(?:/|$)!; + #$ce->{webworkURLs}->{stylesheet} = ($ce->{webworkURLs}->{htdocs})."/css/$theme.css"; # reset the style sheet + # the line above is clever -- but I think it is better to link directly to the style sheet from the system.template + # then the link between template and css is made in .template file instead of hard coded as above + # this means that the {stylesheet} option in global.conf is never used my $template = $self->can("templateName") ? $self->templateName : $ce->{defaultThemeTemplate}; my $templateFile = "$themesDir/$theme/$template.template"; |
From: Mike G. v. a. <we...@ma...> - 2008-06-29 18:15:06
|
Log Message: ----------- Improve error reporting when AUTOLOAD method not found. Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK/DB/Schema: NewSQL.pm Revision Data ------------- Index: NewSQL.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Schema/NewSQL.pm,v retrieving revision 1.21.2.1.2.1 retrieving revision 1.21.2.1.2.2 diff -Llib/WeBWorK/DB/Schema/NewSQL.pm -Llib/WeBWorK/DB/Schema/NewSQL.pm -u -r1.21.2.1.2.1 -r1.21.2.1.2.2 --- lib/WeBWorK/DB/Schema/NewSQL.pm +++ lib/WeBWorK/DB/Schema/NewSQL.pm @@ -334,8 +334,7 @@ if (exists $API{$2}) { croak sprintf("%s does not implement &%s", $1, $2); } else { - warn caller(); - croak sprintf("Undefined subroutine &%s called ", $AUTOLOAD); + croak sprintf("Undefined subroutine &%s called ", $AUTOLOAD," stack trace: ", caller()); } } |
From: Mike G. v. a. <we...@ma...> - 2008-06-29 17:49:41
|
Log Message: ----------- Restored a few of the database functions from HEAD in order to make archive/unarchive work. Those two functions are still delicate. Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK/DB/Record: Locations.pm webwork2/lib/WeBWorK/DB/Schema/NewSQL: Std.pm Revision Data ------------- Index: Locations.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Record/Locations.pm,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.1.2.1 diff -Llib/WeBWorK/DB/Record/Locations.pm -Llib/WeBWorK/DB/Record/Locations.pm -u -r1.1.2.1 -r1.1.2.1.2.1 --- lib/WeBWorK/DB/Record/Locations.pm +++ lib/WeBWorK/DB/Record/Locations.pm @@ -1,4 +1,5 @@ -################################################################################# WeBWorK Online Homework Delivery System +################################################################################ +# WeBWorK Online Homework Delivery System # Copyright � 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/ # $CVSHeader$ # Index: Std.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm,v retrieving revision 1.10.2.2.2.1 retrieving revision 1.10.2.2.2.2 diff -Llib/WeBWorK/DB/Schema/NewSQL/Std.pm -Llib/WeBWorK/DB/Schema/NewSQL/Std.pm -u -r1.10.2.2.2.1 -r1.10.2.2.2.2 --- lib/WeBWorK/DB/Schema/NewSQL/Std.pm +++ lib/WeBWorK/DB/Schema/NewSQL/Std.pm @@ -228,7 +228,8 @@ my $exit = $? >> 8; my $signal = $? & 127; my $core = $? & 128; - die "Failed to dump table '".$self->sql_table_name."' with command '$dump_cmd' (exit=$exit signal=$signal core=$core): $dump_out\n"; + warn "Warning: Failed to dump table '".$self->sql_table_name."' with command '$dump_cmd' (exit=$exit signal=$signal core=$core): $dump_out\n"; + warn "This can be expected if the course was created with an earlier version of WeBWorK."; } return 1; |
From: Mike G. v. a. <we...@ma...> - 2008-06-29 14:38:22
|
Log Message: ----------- Added some of the database functions -- in particular dump_tables from head back to rel-2-4-5 Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK: DB.pm webwork2/lib/WeBWorK/ContentGenerator/Instructor: PGProblemEditor.pm webwork2/lib/WeBWorK/DB/Record: LocationAddresses.pm webwork2/lib/WeBWorK/DB/Schema: NewSQL.pm webwork2/lib/WeBWorK/DB/Schema/NewSQL: Std.pm Revision Data ------------- Index: DB.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB.pm,v retrieving revision 1.104.2.2 retrieving revision 1.104.2.2.2.1 diff -Llib/WeBWorK/DB.pm -Llib/WeBWorK/DB.pm -u -r1.104.2.2 -r1.104.2.2.2.1 --- lib/WeBWorK/DB.pm +++ lib/WeBWorK/DB.pm @@ -97,12 +97,62 @@ use warnings; use Carp; use Data::Dumper; +use Scalar::Util qw/blessed/; use WeBWorK::DB::Schema; use WeBWorK::DB::Utils qw/make_vsetID grok_vsetID grok_setID_from_vsetID_sql grok_versionID_from_vsetID_sql/; use WeBWorK::Debug; use WeBWorK::Utils qw(runtime_use); +=for comment + +These exceptions will replace the ones in WeBWorK::DB::Schema and will be +allowed to propagate out to calling code. The following callers will have to be +changed to catch these exceptions instead of doing string matching: + +lib/WebworkSOAP.pm: if ($@ =~ m/user set exists/) { +lib/WeBWorK/ContentGenerator/Instructor.pm: if ($@ =~ m/user set exists/) { +lib/WeBWorK/ContentGenerator/Instructor.pm: if ( $@ =~ m/user set exists/ ) { +lib/WeBWorK/ContentGenerator/Instructor.pm: if ($@ =~ m/user problem exists/) { +lib/WeBWorK/ContentGenerator/Instructor.pm: if ($@ =~ m/user problem exists/) { +lib/WeBWorK/ContentGenerator/Instructor.pm: next if $@ =~ m/user set exists/; +lib/WeBWorK/Utils/DBImportExport.pm: if ($@ =~ m/exists/) { +lib/WeBWorK/DB.pm: if ($@ and $@ !~ m/password exists/) { +lib/WeBWorK/DB.pm: if ($@ and $@ !~ m/permission level exists/) { + +How these exceptions should be used: + +* RecordExists is thrown by the DBI error handler (handle_error in +Schema::NewSQL::Std) when in INSERT fails because a record exists. Thus it can +be thrown via addUser, addPassword, etc. + +* RecordNotFound should be thrown when we try to UPDATE and zero rows were +affected. Problem: Frank Wolfs (UofR PAS) may have a MySQL server that returns 0 +when updating even when a record was modified. What's up with that? There's some +question as to where we should throw this: in this file's put* methods? In +Std.pm's put method? Or in update_fields and update_fields_i? + +* DependencyNotFound should be throws when we check for a record that is needed +to insert another record (e.g. password depends on user). These checks are done +in this file, so we'll throw this exception from there. + +=cut + +use Exception::Class ( + 'WeBWorK::DB::Ex' => {}, + 'WeBWorK::DB::Ex::RecordExists' => { + isa => 'WeBWorK::DB::Ex', + fields => ['type', 'key'], + }, + 'WeBWorK::DB::Ex::RecordNotFound' => { + isa => 'WeBWorK::DB::Ex', + fields => ['type', 'key'], + }, + 'WeBWorK::DB::Ex::DependencyNotFound' => { + isa => 'WeBWorK::DB::Ex::RecordNotFound', + }, +); + ################################################################################ # constructor ################################################################################ @@ -271,8 +321,40 @@ }; } +sub gen_insert_records { + my $table = shift; + return sub { + my ($self, @records) = @_; + if (@records == 1 and blessed $records[0] and $records[0]->isa("Iterator")) { + return $self->{$table}->insert_records_i($records[0]); + } else { + return $self->{$table}->insert_records(@records); + } + }; +} + +sub gen_update_records { + my $table = shift; + return sub { + my ($self, @records) = @_; + if (@records == 1 and blessed $records[0] and $records[0]->isa("Iterator")) { + return $self->{$table}->update_records_i($records[0]); + } else { + return $self->{$table}->update_records(@records); + } + }; +} + +sub gen_delete_where { + my $table = shift; + return sub { + my ($self, $where) = @_; + return $self->{$table}->delete_where($where); + }; +} + ################################################################################ -# create/rename/delete tables +# create/rename/delete/dump/restore tables ################################################################################ sub create_tables { @@ -334,6 +416,42 @@ return 1; } +sub dump_tables { + my ($self, $dump_dir) = @_; + + foreach my $table (keys %$self) { + next if $table =~ /^_/; # skip non-table self fields (none yet) + next if $self->{$table}{params}{non_native}; # skip non-native tables + my $schema_obj = $self->{$table}; + if ($schema_obj->can("dump_table")) { + my $dump_file = "$dump_dir/$table.sql"; + $schema_obj->dump_table($dump_file); + } else { + warn "skipping dump of '$table' table: no dump_table method\n"; + } + } + + return 1; +} + +sub restore_tables { + my ($self, $dump_dir) = @_; + + foreach my $table (keys %$self) { + next if $table =~ /^_/; # skip non-table self fields (none yet) + next if $self->{$table}{params}{non_native}; # skip non-native tables + my $schema_obj = $self->{$table}; + if ($schema_obj->can("restore_table")) { + my $dump_file = "$dump_dir/$table.sql"; + $schema_obj->restore_table($dump_file); + } else { + warn "skipping restore of '$table' table: no restore_table method\n"; + } + } + + return 1; +} + ################################################################################ # user functions ################################################################################ @@ -693,6 +811,55 @@ } ################################################################################ +# setting functions +################################################################################ + +BEGIN { + *Setting = gen_schema_accessor("setting"); + *newSetting = gen_new("setting"); + *countSettingsWhere = gen_count_where("setting"); + *existsSettingWhere = gen_exists_where("setting"); + *listSettingsWhere = gen_list_where("setting"); + *getSettingsWhere = gen_get_records_where("setting"); + *addSettings = gen_insert_records("setting"); + *putSettings = gen_update_records("setting"); + *deleteSettingsWhere = gen_delete_where("setting"); +} + +# minimal set of routines for basic setting operation +# we don't need a full set, since the usage of settings is somewhat limited +# we also don't want to bother with records, since a setting is just a pair + +sub settingExists { + my ($self, $name) = @_; + return $self->{setting}->exists_where([name_eq=>$name]); +} + +sub getSettingValue { + my ($self, $name) = @_; + return map { @$_ } $self->{setting}->get_fields_where(['value'], [name_eq=>$name]); +} + +# we totally don't care if a setting already exists (and in fact i find that +# whole distinction somewhat annoying lately) so we hide the fact that we're +# either calling insert or update. at some point we could stand to add a +# method to Std.pm that used REPLACE INTO and then we'd be able to not care +# at all whether a setting was already there +sub setSettingValue { + my ($self, $name, $value) = @_; + if ($self->settingExists($name)) { + return $self->{setting}->update_where({value=>$value}, [name_eq=>$name]); + } else { + return $self->{setting}->insert_fields(['name','value'], [[$name,$value]]); + } +} + +sub deleteSetting { + my ($self, $name) = shift->checkArgs(\@_, qw/name/); + return $self->{setting}->delete_where([name_eq=>$name]); +} + +################################################################################ # locations functions ################################################################################ # this database table is for ip restrictions by assignment @@ -941,6 +1108,7 @@ my ($self, $setID) = shift->checkArgs(\@_, "set_id$U"); $self->deleteUserSet(undef, $setID); $self->deleteGlobalProblem($setID, undef); + $self->deleteGlobalSetLocation($setID, undef); return $self->{set}->delete($setID); } Index: PGProblemEditor.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm,v retrieving revision 1.90.4.1 retrieving revision 1.90.4.1.2.1 diff -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -u -r1.90.4.1 -r1.90.4.1.2.1 --- lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm +++ lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm @@ -76,11 +76,11 @@ # But it is used instead of set_header when producing a hardcopy of the problem set in the TeX format, instead of producing HTML # formatted version for use on the computer screen. # -# file_type eq 'course_info +# file_type eq 'course_info' # This allows editing of the course_info.txt file which gives general information about the course. It is called from the # ProblemSets.pm module. # -# file_type eq 'options_info +# file_type eq 'options_info' # This allows editing of the options_info.txt file which gives general information about the course. It is called from the # Options.pm module. # @@ -1540,14 +1540,6 @@ } - - - - - - - - sub make_local_copy_handler { my ($self, $genericParams, $actionParams, $tableParams) = @_; foreach my $key (qw(target_file file_type saveMode source_file)) { Index: LocationAddresses.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Record/LocationAddresses.pm,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.1.2.1 diff -Llib/WeBWorK/DB/Record/LocationAddresses.pm -Llib/WeBWorK/DB/Record/LocationAddresses.pm -u -r1.1.2.1 -r1.1.2.1.2.1 --- lib/WeBWorK/DB/Record/LocationAddresses.pm +++ lib/WeBWorK/DB/Record/LocationAddresses.pm @@ -1,4 +1,5 @@ -################################################################################# WeBWorK Online Homework Delivery System +################################################################################ +# WeBWorK Online Homework Delivery System # Copyright � 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/ # $CVSHeader$ # Index: NewSQL.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Schema/NewSQL.pm,v retrieving revision 1.21.2.1 retrieving revision 1.21.2.1.2.1 diff -Llib/WeBWorK/DB/Schema/NewSQL.pm -Llib/WeBWorK/DB/Schema/NewSQL.pm -u -r1.21.2.1 -r1.21.2.1.2.1 --- lib/WeBWorK/DB/Schema/NewSQL.pm +++ lib/WeBWorK/DB/Schema/NewSQL.pm @@ -149,6 +149,11 @@ return {ip_mask=>$ip_mask}; } +sub where_name_eq { + my ($self, $flags, $name) = @_; + return {name=>$name}; +} # gotta get rid of this stupid way of specifying where clauses... + ################################################################################ # utility methods ################################################################################ @@ -177,6 +182,15 @@ return shift->{record}->FIELD_DATA; } +sub initial_records { + my ($self) = @_; + if ($self->{record}->can("INITIAL_RECORDS")) { + return $self->{record}->INITIAL_RECORDS; + } else { + return (); + } +} + sub box { my ($self, $values) = @_; # promote undef values to empty strings. eventually we'd like to stop doing this (FIXME) @@ -320,7 +334,8 @@ if (exists $API{$2}) { croak sprintf("%s does not implement &%s", $1, $2); } else { - croak sprintf("Undefined subroutine &%s called", $AUTOLOAD); + warn caller(); + croak sprintf("Undefined subroutine &%s called ", $AUTOLOAD); } } Index: Std.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm,v retrieving revision 1.10.2.2 retrieving revision 1.10.2.2.2.1 diff -Llib/WeBWorK/DB/Schema/NewSQL/Std.pm -Llib/WeBWorK/DB/Schema/NewSQL/Std.pm -u -r1.10.2.2 -r1.10.2.2.2.1 --- lib/WeBWorK/DB/Schema/NewSQL/Std.pm +++ lib/WeBWorK/DB/Schema/NewSQL/Std.pm @@ -28,6 +28,8 @@ use Carp qw(croak); use Iterator; use Iterator::Util; +use File::Temp; +use String::ShellQuote; use WeBWorK::DB::Utils::SQLAbstractIdentTrans; use WeBWorK::Debug; @@ -111,7 +113,10 @@ my ($self) = @_; my $stmt = $self->_create_table_stmt; - return $self->dbh->do($stmt); + $self->dbh->do($stmt); + my @fields = $self->fields; + my @rows = map { [ @$_{@fields} ] } $self->initial_records; + return $self->insert_fields(\@fields, \@rows); } # this is mostly ripped off from wwdb_check, which is pretty much a per-table @@ -192,7 +197,90 @@ my ($self) = @_; my $sql_table_name = $self->sql_table_name; - return "DROP TABLE `$sql_table_name`"; + return "DROP TABLE IF EXISTS `$sql_table_name`"; +} + +################################################################################ +# table dumping and restoring +################################################################################ + +# These are limited to mysql, since they use the mysql monitor and mysqldump. +# An exception will be thrown if the table in question doesn't use mysql. +# It also requires some additions to the params: +# mysqldump_path - path to mysqldump(1) +# mysql_path - path to mysql(1) + +sub dump_table { + my ($self, $dumpfile_path) = @_; + + my ($my_cnf, $database) = $self->_get_db_info; + my $mysqldump = $self->{params}{mysqldump_path}; + + # 2>&1 is specified first, which apparently makes stderr go to stdout + # and stdout (not including stderr) go to the dumpfile. see bash(1). + my $dump_cmd = "2>&1 " . shell_quote($mysqldump) + . " --defaults-extra-file=" . shell_quote($my_cnf->filename) + . " " . shell_quote($database) + . " " . shell_quote($self->sql_table_name) + . " > " . shell_quote($dumpfile_path); + my $dump_out = readpipe $dump_cmd; + if ($?) { + my $exit = $? >> 8; + my $signal = $? & 127; + my $core = $? & 128; + die "Failed to dump table '".$self->sql_table_name."' with command '$dump_cmd' (exit=$exit signal=$signal core=$core): $dump_out\n"; + } + + return 1; +} + +sub restore_table { + my ($self, $dumpfile_path) = @_; + + my ($my_cnf, $database) = $self->_get_db_info; + my $mysql = $self->{params}{mysql_path}; + + my $restore_cmd = "2>&1 " . shell_quote($mysql) + . " --defaults-extra-file=" . shell_quote($my_cnf->filename) + . " " . shell_quote($database) + . " < " . shell_quote($dumpfile_path); + my $restore_out = readpipe $restore_cmd; + if ($?) { + my $exit = $? >> 8; + my $signal = $? & 127; + my $core = $? & 128; + die "Failed to restore table '".$self->sql_table_name."' with command '$restore_cmd' (exit=$exit signal=$signal core=$core): $restore_out\n"; + } + + return 1; +} + +sub _get_db_info { + my ($self) = @_; + my $dsn = $self->{driver}{source}; + my $username = $self->{params}{username}; + my $password = $self->{params}{password}; + + die "Can't call dump_table or restore_table on a table with a non-MySQL source" + unless $dsn =~ s/^dbi:mysql://i; + + # this is an internal function which we probably shouldn't be using here + # but it's quick and gets us what we want (FIXME what about sockets, etc?) + my %dsn; + DBD::mysql->_OdbcParse($dsn, \%dsn, ['database', 'host', 'port']); + die "no database specified in DSN!" unless defined $dsn{database}; + + # doing this securely is kind of a hassle... + my $my_cnf = new File::Temp; + $my_cnf->unlink_on_destroy(1); + chmod 0600, $my_cnf or die "failed to chmod 0600 $my_cnf: $!"; # File::Temp objects stringify with ->filename + print $my_cnf "[client]\n"; + print $my_cnf "user=$username\n" if defined $username and length($username) > 0; + print $my_cnf "password=$password\n" if defined $password and length($password) > 0; + print $my_cnf "host=$dsn{host}\n" if defined $dsn{host} and length($dsn{host}) > 0; + print $my_cnf "port=$dsn{port}\n" if defined $dsn{port} and length($dsn{port}) > 0; + + return ($my_cnf, $dsn{database}); } ################################################################################ |
From: Mike G. v. a. <we...@ma...> - 2008-06-28 20:46:40
|
Log Message: ----------- format spaces Modified Files: -------------- pg/lib/Value: AnswerChecker.pm Revision Data ------------- Index: AnswerChecker.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/AnswerChecker.pm,v retrieving revision 1.118 retrieving revision 1.119 diff -Llib/Value/AnswerChecker.pm -Llib/Value/AnswerChecker.pm -u -r1.118 -r1.119 --- lib/Value/AnswerChecker.pm +++ lib/Value/AnswerChecker.pm @@ -30,8 +30,8 @@ # Internal use. # Set default flags for the answer checker in this object -# showTypeWarnings => 1 -# showEqualErrors => 1 +# showTypeWarnings => 1 +# showEqualErrors => 1 # ignoreStrings => 1 # studentsMustReduceUnions => 1 # showUnionReduceWarnings => 1 |
From: Mike G. v. a. <we...@ma...> - 2008-06-28 20:46:09
|
Log Message: ----------- Backport from HEAD Tags: ---- rel-2-4-patches Modified Files: -------------- pg/lib/Value: AnswerChecker.pm Revision Data ------------- Index: AnswerChecker.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/AnswerChecker.pm,v retrieving revision 1.91.2.2.2.1 retrieving revision 1.91.2.2.2.2 diff -Llib/Value/AnswerChecker.pm -Llib/Value/AnswerChecker.pm -u -r1.91.2.2.2.1 -r1.91.2.2.2.2 --- lib/Value/AnswerChecker.pm +++ lib/Value/AnswerChecker.pm @@ -3,7 +3,7 @@ ############################################################# # - # Implements the ->cmp method for Value objects. + # Implements the ->cmp method for Value objects. # Otherwise known as MathObjects. This produces # an answer checker appropriate for the type of object. # Additional options can be passed to the cmp method to @@ -34,8 +34,8 @@ # showEqualErrors => 1 # ignoreStrings => 1 # studentsMustReduceUnions => 1 -# show UnionReduceWarnings => 1 -# +# showUnionReduceWarnings => 1 +# =cut @@ -1172,9 +1172,10 @@ # partial credit. Set the various types for error # messages. # +my $typeMatchInterval = Value::Interval->make(0,1); sub cmp_defaults {( Value::List::cmp_defaults(@_), - typeMatch => 'Value::Interval', + typeMatch => $typeMatchInterval, list_type => 'an interval, set or union', short_type => 'a union', entry_type => 'an interval or set', @@ -1431,7 +1432,7 @@ $entry = $self->Package("Formula")->new($entry) if !Value::isValue($entry); # - # Some words differ if ther eis only one entry in the student's list + # Some words differ if there is only one entry in the student's list # my $nth = ''; my $answer = 'answer'; my $class = $ans->{list_type} || $ans->{cmp_class}; |