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: Mike G. v. a. <we...@ma...> - 2009-10-01 21:34:27
|
Log Message: ----------- log the cmid with along with everything else Modified Files: -------------- wwmoodle/wwassignment4/moodle/mod/wwassignment: view.php Revision Data ------------- Index: view.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/view.php,v retrieving revision 1.2 retrieving revision 1.3 diff -Lwwassignment4/moodle/mod/wwassignment/view.php -Lwwassignment4/moodle/mod/wwassignment/view.php -u -r1.2 -r1.3 --- wwassignment4/moodle/mod/wwassignment/view.php +++ wwassignment4/moodle/mod/wwassignment/view.php @@ -55,7 +55,7 @@ $wwkey = _wwassignment_login_user($wwcoursename,$wwusername); $wwsetlink = _wwassignment_link_to_set_auto_login($wwcoursename,$wwsetname,$wwusername,$wwkey); -add_to_log($course->id, "wwassignment", "view", "view.php?id=$cm->id", "$wwassignment->id"); +add_to_log($course->id, "wwassignment", "view", "view.php?id=$cm->id", "$wwassignmentid",_wwassignment_cmid()); /// Print the page header |
From: dpvc v. a. <we...@ma...> - 2009-10-01 15:01:26
|
Log Message: ----------- During substitution, remove cached values that could change Modified Files: -------------- pg/lib: Parser.pm Revision Data ------------- Index: Parser.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser.pm,v retrieving revision 1.54 retrieving revision 1.55 diff -Llib/Parser.pm -Llib/Parser.pm -u -r1.54 -r1.55 --- lib/Parser.pm +++ lib/Parser.pm @@ -662,7 +662,8 @@ foreach my $x (keys %{$self->{values}}) {delete $self->{variables}{$x}} $self->{tree} = $self->{tree}->substitute; $self->unsetValues; - delete $self->{f}; + foreach my $id ("test_values","test_adapt","string","f", + "stack","ref","tokens","space","domainMismatch") {delete $self->{$id}} return $self; } |
From: dpvc v. a. <we...@ma...> - 2009-10-01 14:58:07
|
Log Message: ----------- Add LimitedProperFraction context, and some cosmetic fixes Modified Files: -------------- pg/macros: contextFraction.pl Revision Data ------------- Index: contextFraction.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextFraction.pl,v retrieving revision 1.7 retrieving revision 1.8 diff -Lmacros/contextFraction.pl -Lmacros/contextFraction.pl -u -r1.7 -r1.8 --- macros/contextFraction.pl +++ macros/contextFraction.pl @@ -17,11 +17,12 @@ loadMacros("contextFraction.pl"); -and then select the appropriate context -- one of the following three: +and then select the appropriate context -- one of the following: Context("Fraction"); Context("Fraction-NoDecimals"); Context("LimitedFraction"); + Context("LimitedProperFraction"); The first is the most general, and allows fractions to be intermixed with real numbers, so 1/2 + .5 would be allowed. Also, 1/2.5 is @@ -45,6 +46,9 @@ permissible to enter a whole number WITH a fraction, as in 2 1/2 for "two and one half", or 5/2. +The fourth is the same as LimiteFraction, but students must enter proper +fractions, and results are shown as proper fractions. + You can use the Compute() function to generate fraction objects, or the Fraction() constructor to make one explicitly. For example: @@ -155,6 +159,7 @@ This determines whether fractions MUST be entered as proper fractions. It is 0 by default, meaning improper fractions are allowed. When set, you will not be able to enter 5/2 as a fraction, but must use "2 1/2". +This flag is allowed only when strictFractions is in effect. Set it to 1 only when you also set allowProperFractions, or you will not be able to specify fractions bigger than one. It is off by default in all three contexts. @@ -254,6 +259,9 @@ ); $context->{cmpDefaults}{Fraction} = {studentsMustReduceFractions => 1}; + $context = $main::context{LimitedProperFraction} = $context->copy; + $context->flags->set(requireProperFractions => 1); + main::PG_restricted_eval('sub Fraction {Value->Package("Fraction()")->new(@_)};'); } @@ -331,7 +339,7 @@ $self->Error("The denominator of a fraction must be a (non-negative) integer") unless $self->{rop}->class eq 'INTEGER'; $self->Error("The numerator must be less than the denominator in a proper fraction") - if $self->context->flag("requireProperFractions") && CORE::abs($self->{lop}->eval) >= CORE::abs($self->{rop}->eval); + if $self->context->flag("requireProperFractions") && CORE::abs($self->{lop}->eval) >= CORE::abs($self->{rop}->eval); } # @@ -692,7 +700,7 @@ if ($y < 0 && $d % 2 == 1) {$y = -(-$y)**(1/$d)} else {$y = $y**(1/$d)}; } return $self->inherit($other)->make($x,$y) unless $x eq 'nan' || $y eq 'nan'; - Value::Error("Can't raise a negative number to a power") if $a*$b < 0; + Value::Error("Can't raise a negative number to a non-integer power") if $a*$b < 0; Value::Error("Result of exponention is not a number"); } |
From: dpvc v. a. <we...@ma...> - 2009-10-01 14:57:42
|
Log Message: ----------- Fix error message for powers of negatives Modified Files: -------------- pg/lib/Value: Real.pm pg/lib/Parser/BOP: power.pm Revision Data ------------- Index: Real.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Real.pm,v retrieving revision 1.42 retrieving revision 1.43 diff -Llib/Value/Real.pm -Llib/Value/Real.pm -u -r1.42 -r1.43 --- lib/Value/Real.pm +++ lib/Value/Real.pm @@ -96,7 +96,7 @@ my ($self,$l,$r,$other) = Value::checkOpOrderWithPromote(@_); my $x = $l->{data}[0] ** $r->{data}[0]; return $self->inherit($other)->make($x) unless $x eq 'nan'; - Value::Error("Can't raise a negative number to a power") if ($l->{data}[0] < 0); + Value::Error("Can't raise a negative number to a non-integer power") if ($l->{data}[0] < 0); Value::Error("Result of exponention is not a number"); } Index: power.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/BOP/power.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -Llib/Parser/BOP/power.pm -Llib/Parser/BOP/power.pm -u -r1.17 -r1.18 --- lib/Parser/BOP/power.pm +++ lib/Parser/BOP/power.pm @@ -32,7 +32,7 @@ my $self = $_[0]; my $x = $_[1] ** $_[2]; return $x unless $x eq 'nan'; - $self->Error("Can't raise a negative number to a power") + $self->Error("Can't raise a negative number to a non-integer power") if Value::isNumber($_[1]) && Value::makeValue($_[1],context=>$self->context)->value < 0; $self->Error("Result of exponentiation is not a number"); } |
From: dpvc v. a. <we...@ma...> - 2009-10-01 14:57:18
|
Log Message: ----------- Fix problem with processing lists where a constant answer produces a computation error 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.125 retrieving revision 1.126 diff -Llib/Value/AnswerChecker.pm -Llib/Value/AnswerChecker.pm -u -r1.125 -r1.126 --- lib/Value/AnswerChecker.pm +++ lib/Value/AnswerChecker.pm @@ -1330,9 +1330,9 @@ $sOpen = $student->{open}; $sClose = $student->{close}; } } + return if $ans->{split_error}; foreach my $x (@correct) {$x->{equation} = $self}; foreach my $x (@student) {$x->{equation} = $self}; - return if $ans->{split_error}; # # Check for parenthesis match # @@ -1510,13 +1510,9 @@ foreach my $entry (@entries) { my $v = Parser::Formula($entry); $v = Parser::Evaluate($v) if (defined($v) && $v->isConstant); + if (!defined($v)) {$ans->{split_error} = 1; $self->cmp_error($ans); return} $v->{equation} = $self; push(@formula,$v); - # - # There shouldn't be an error evaluating the formula, - # but you never know... - # - if (!defined($v)) {$ans->{split_error} = 1; $self->cmp_error; return} } return @formula; } @@ -1525,7 +1521,7 @@ # Return the value if it is defined, otherwise use a default # sub getOption { - my $ans = shift; my $name = shift; + my $ans = shift; my $name = shift; my $value = $ans->{$name}; return $value if defined($value); return $ans->{showPartialCorrectAnswers}; |
From: Mike G. v. a. <we...@ma...> - 2009-09-30 14:39:41
|
Log Message: ----------- Corrects bug (uncovered by newer versions of CGI.pm after version 3.29 and before 3.42) which defaultedstudents to "guests" in the permission popup menu used for editing the student record. It showed uponly for student because there default value was 0 -- which can be treated ambiguously -- as opposed to2 or 10 which is not. Adding the override switch forces the default value generated in the perl code to override other default values for the popupmenu and provides the expected behavior. This should fix the bug where students were mysteriously reassigned as guests and lost their "submit answer" buttons. sites with older versions of CGI.pm will not have observed this problem. Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: UserList.pm Revision Data ------------- Index: UserList.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm,v retrieving revision 1.91.2.1 retrieving revision 1.91.2.1.2.1 diff -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -u -r1.91.2.1 -r1.91.2.1.2.1 --- lib/WeBWorK/ContentGenerator/Instructor/UserList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/UserList.pm @@ -1495,6 +1495,7 @@ values => \@values, default => $default, labels => \%labels, + override => 1, # force default to be selected. }); } } |
From: Mike G. v. a. <we...@ma...> - 2009-09-30 14:38:36
|
Log Message: ----------- Corrects bug (uncovered by newer versions of CGI.pm after version 3.29 and before 3.42) which defaulted students to "guests" in the permission popup menu used for editing the student record. It showed up only for student because there default value was 0 -- which can be treated ambiguously -- as opposed to 2 or 10 which is not. Adding the override switch forces the default value generated in the perl code to override other default values for the popupmenu and provides the expected behavior. This should fix the bug where students were mysteriously reassigned as guests and lost their "submit answer" buttons. sites with older versions of CGI.pm will not have observed this problem. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: UserList.pm Revision Data ------------- Index: UserList.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm,v retrieving revision 1.93 retrieving revision 1.94 diff -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -u -r1.93 -r1.94 --- lib/WeBWorK/ContentGenerator/Instructor/UserList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/UserList.pm @@ -823,8 +823,6 @@ return "Users sorted by $names{$primary}, then by $names{$secondary}, then by $names{$ternary}."; } - - sub edit_form { my ($self, $onChange, %actionParams) = @_; @@ -1515,6 +1513,7 @@ values => \@values, default => $default, labels => \%labels, + override => 1, # force default to be selected. (corrects bug on newer CGI }); } } |
From: Mike G. v. a. <we...@ma...> - 2009-09-25 00:56:06
|
Log Message: ----------- Hide from students most of the errors created when the hardcopy version can't be TeX'd or created for some other reason. The professor still gets the errors. A value in global.conf download_hardcopy_view_errors =>"professor", adjusts who sees the hardcopy errors. global.conf.dist has been changed to include this entry. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Hardcopy.pm Revision Data ------------- Index: Hardcopy.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Hardcopy.pm,v retrieving revision 1.101 retrieving revision 1.102 diff -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -u -r1.101 -r1.102 --- lib/WeBWorK/ContentGenerator/Hardcopy.pm +++ lib/WeBWorK/ContentGenerator/Hardcopy.pm @@ -173,6 +173,7 @@ # is the user allowed to request multiple sets/users at a time? my $perm_multiset = $authz->hasPermissions($userID, "download_hardcopy_multiset"); my $perm_multiuser = $authz->hasPermissions($userID, "download_hardcopy_multiuser"); + my $perm_viewhidden = $authz->hasPermissions($userID, "view_hidden_work"); my $perm_viewfromip = $authz->hasPermissions($userID, "view_ip_restricted_sets"); @@ -263,42 +264,57 @@ sub body { my ($self) = @_; - + my $userID = $self->r->param("user"); + my $perm_view_errors = $self->r->authz->hasPermissions($userID, "download_hardcopy_view_errors"); + $perm_view_errors = (defined($perm_view_errors) ) ? $perm_view_errors : 0; if (my $num = $self->get_errors) { my $final_file_url = $self->{final_file_url}; my %temp_file_map = %{$self->{temp_file_map}}; - - my $errors_str = $num > 1 ? "errors" : "error"; - print CGI::p("$num $errors_str occured while generating hardcopy:"); - - print CGI::ul(CGI::li($self->get_errors_ref)); + if($perm_view_errors) { + my $errors_str = $num > 1 ? "errors" : "error"; + print CGI::p("$num $errors_str occured while generating hardcopy:"); + + print CGI::ul(CGI::li($self->get_errors_ref)); + } if ($final_file_url) { print CGI::p( - "A hardcopy file was generated, but it may not be complete or correct: ", - CGI::a({href=>$final_file_url}, "Download Hardcopy") + "A hardcopy file was generated, but it may not be complete or correct.", + "Please check that no problems are missing and that they are all legible." , + "If not, please inform your instructor.<br />", + CGI::a({href=>$final_file_url}, "Download Hardcopy"), ); - } + } else { + print CGI::p( + "WeBWorK was unable to generate a paper copy of this homework set. Please inform your instructor. " + ); - if (%temp_file_map) { - print CGI::start_p(); - print "You can also examine the following temporary files: "; - my $first = 1; - while (my ($temp_file_name, $temp_file_url) = each %temp_file_map) { - if ($first) { - $first = 0; - } else { - print ", "; + } + if($perm_view_errors) { + if (%temp_file_map) { + print CGI::start_p(); + print "You can also examine the following temporary files: "; + my $first = 1; + while (my ($temp_file_name, $temp_file_url) = each %temp_file_map) { + if ($first) { + $first = 0; + } else { + print ", "; + } + print CGI::a({href=>$temp_file_url}, " $temp_file_name"); } - print CGI::a({href=>$temp_file_url}, " $temp_file_name"); + print CGI::end_p(); } - print CGI::end_p(); } print CGI::hr(); } - - $self->display_form(); + + # don't display the retry form if there are errors and the user doesn't have permission to view the errors. + unless ($self->get_errors and not $perm_view_errors) { + $self->display_form(); + } + ''; # return a blank } sub display_form { |
From: Mike G. v. a. <we...@ma...> - 2009-09-25 00:55:19
|
Log Message: ----------- removed sql_moodle as a choice on the add course page since that database structure is no longer supported. Added switch to global.conf for determining what level of permissions is needed to see hardcopy errors. download_hardcopy_view_errors =>"professor", Modified Files: -------------- webwork2/conf: database.conf.dist global.conf.dist Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.214 retrieving revision 1.215 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.214 -r1.215 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -49,7 +49,7 @@ # Paths to external programs ################################################################################ -# system utilties +# system utilities $externalPrograms{mv} = "/bin/mv"; $externalPrograms{cp} = "/bin/cp"; $externalPrograms{rm} = "/bin/rm"; @@ -161,6 +161,10 @@ $mail{editor_window_rows} = 15; $mail{editor_window_columns} = 100; +################################################### +# Customizing the action of the "Email your instructor" button +################################################### + # Use this to customize the text of the feedback button. $feedback_button_name = "Email instructor"; @@ -168,6 +172,21 @@ # section as the user initiating the feedback. $feedback_by_section = 0; +# If the variable below is set to a non-empty value (i.e. in course.conf), WeBWorK's usual +# email feedback mechanism will be replaced with a link to the given URL. +# See also $feedback_button_name, above. + +$courseURLs{feedbackURL} = ""; + +# If the variable below is set to a non-empty value (i.e. in course.conf), +# WeBWorK's usual email feedback mechanism will be replaced with a link to the given URL and +# a POST request with information about the problem including the HTML rendering +# of the problem will be sent to that URL. +# See also $feedback_button_name, above. + +#$courseURLs{feedbackFormURL} = "http://www.mathnerds.com/MathNerds/mmn/SDS/askQuestion.aspx"; #"http://www.tipjar.com/cgi-bin/test"; +$courseURLs{feedbackFormURL} = ""; + ################################################################################ # Theme ################################################################################ @@ -299,10 +318,6 @@ # Location of temporary editing files. $courseDirs{tmpEditFileDir} = "$courseDirs{templates}/tmpEdit"; -# If this is set to a non-empty value (i.e. in course.conf), WeBWorK's usual -# email feedback mechanism will be replaced with a link to the given URL. -# See also $feedback_button_name, above. -$courseURLs{feedbackURL} = ""; # mail merge status directory $courseDirs{mailmerge} = "$courseDirs{DATA}/mailmerge"; @@ -709,6 +724,7 @@ download_hardcopy_multiuser => "ta", download_hardcopy_multiset => "ta", + download_hardcopy_view_errors =>"professor", download_hardcopy_format_pdf => "guest", download_hardcopy_format_tex => "ta", ); Index: database.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/database.conf.dist,v retrieving revision 1.38 retrieving revision 1.39 diff -Lconf/database.conf.dist -Lconf/database.conf.dist -u -r1.38 -r1.39 --- conf/database.conf.dist +++ conf/database.conf.dist @@ -276,61 +276,61 @@ =cut # params used by moodle-backed tables -my %moodleParams = ( - non_native => 1, - username => $moodle_username, - password => $moodle_password, - debug => $database_debug, - tablePrefix => $moodle_table_prefix, - courseName => $courseName, - moodle17 => $moodle17, -); - -$dbLayouts{sql_moodle} = { - # start with sql_single table definitions - %{$dbLayouts{sql_single}}, - - # then override user, password, and permission tables - # use the same record classes as sql_single - user => { - record => "WeBWorK::DB::Record::User", - schema => "WeBWorK::DB::Schema::NewSQL::Moodle::User", - driver => "WeBWorK::DB::Driver::SQL", - source => $moodle_dsn, - params => { %moodleParams, - statusDeletedAbbrevs => $statuses{Drop}{abbrevs}, - statusDeletedDefault => $statuses{Drop}{abbrevs}[0], - statusNotDeletedAbbrevs => $statuses{Enrolled}{abbrevs}, - statusNotDeletedDefault => $statuses{Enrolled}{abbrevs}[0], - #sectionPrefix => "SEC_", # not implemented - #recitationPrefix => "", # not implemented - }, - }, - password => { - record => "WeBWorK::DB::Record::Password", - schema => "WeBWorK::DB::Schema::NewSQL::Moodle::PasswordPermission", - driver => "WeBWorK::DB::Driver::SQL", - source => $moodle_dsn, - params => { %moodleParams, - guestsPermissionLevel => -5, - studentsPermissionLevel => 0, - teachersPermissionLevel => 10, - adminsPermissionLevel => 10, - }, - }, - permission => { - record => "WeBWorK::DB::Record::PermissionLevel", - schema => "WeBWorK::DB::Schema::NewSQL::Moodle::PasswordPermission", - driver => "WeBWorK::DB::Driver::SQL", - source => $moodle_dsn, - params => { %moodleParams, - guestsPermissionLevel => -5, - studentsPermissionLevel => 0, - teachersPermissionLevel => 10, - adminsPermissionLevel => 10, - }, - }, -}; +#my %moodleParams = ( +# non_native => 1, +# username => $moodle_username, +# password => $moodle_password, +# debug => $database_debug, +# tablePrefix => $moodle_table_prefix, +# courseName => $courseName, +# moodle17 => $moodle17, +#); +# +#$dbLayouts{sql_moodle} = { +# # start with sql_single table definitions +# %{$dbLayouts{sql_single}}, +# +# # then override user, password, and permission tables +# # use the same record classes as sql_single +# user => { +# record => "WeBWorK::DB::Record::User", +# schema => "WeBWorK::DB::Schema::NewSQL::Moodle::User", +# driver => "WeBWorK::DB::Driver::SQL", +# source => $moodle_dsn, +# params => { %moodleParams, +# statusDeletedAbbrevs => $statuses{Drop}{abbrevs}, +# statusDeletedDefault => $statuses{Drop}{abbrevs}[0], +# statusNotDeletedAbbrevs => $statuses{Enrolled}{abbrevs}, +# statusNotDeletedDefault => $statuses{Enrolled}{abbrevs}[0], +# #sectionPrefix => "SEC_", # not implemented +# #recitationPrefix => "", # not implemented +# }, +# }, +# password => { +# record => "WeBWorK::DB::Record::Password", +# schema => "WeBWorK::DB::Schema::NewSQL::Moodle::PasswordPermission", +# driver => "WeBWorK::DB::Driver::SQL", +# source => $moodle_dsn, +# params => { %moodleParams, +# guestsPermissionLevel => -5, +# studentsPermissionLevel => 0, +# teachersPermissionLevel => 10, +# adminsPermissionLevel => 10, +# }, +# }, +# permission => { +# record => "WeBWorK::DB::Record::PermissionLevel", +# schema => "WeBWorK::DB::Schema::NewSQL::Moodle::PasswordPermission", +# driver => "WeBWorK::DB::Driver::SQL", +# source => $moodle_dsn, +# params => { %moodleParams, +# guestsPermissionLevel => -5, +# studentsPermissionLevel => 0, +# teachersPermissionLevel => 10, +# adminsPermissionLevel => 10, +# }, +# }, +#}; =head1 DATABASE LAYOUT METADATA @@ -354,7 +354,7 @@ %dbLayout_descr = ( sql_single => "Uses a single SQL database to record WeBWorK data for all courses using this layout. This is the recommended layout for new courses.", - sql_moodle => "Simiar to sql_single, but uses a Moodle database for user, password, and permission information. This layout should be used for courses used with wwmoodle.", +# sql_moodle => "Simiar to sql_single, but uses a Moodle database for user, password, and permission information. This layout should be used for courses used with wwmoodle.", ); =back |
From: Mike G. v. a. <we...@ma...> - 2009-09-25 00:52:47
|
Log Message: ----------- added the download_hardcopy_view_errors =>"professor", switch to determine what level of permission is needed to see errors from producing hardcopy. 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.12 retrieving revision 1.189.2.7.2.13 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.189.2.7.2.12 -r1.189.2.7.2.13 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -49,7 +49,7 @@ # Paths to external programs ################################################################################ -# system utilties +# system utilities $externalPrograms{mv} = "/bin/mv"; $externalPrograms{cp} = "/bin/cp"; $externalPrograms{rm} = "/bin/rm"; @@ -161,6 +161,10 @@ $mail{editor_window_rows} = 15; $mail{editor_window_columns} = 100; +################################################### +# Customizing the action of the "Email your instructor" button +################################################### + # Use this to customize the text of the feedback button. $feedback_button_name = "Email instructor"; @@ -168,6 +172,21 @@ # section as the user initiating the feedback. $feedback_by_section = 0; +# If the variable below is set to a non-empty value (i.e. in course.conf), WeBWorK's usual +# email feedback mechanism will be replaced with a link to the given URL. +# See also $feedback_button_name, above. + +$courseURLs{feedbackURL} = ""; + +# If the variable below is set to a non-empty value (i.e. in course.conf), +# WeBWorK's usual email feedback mechanism will be replaced with a link to the given URL and +# a POST request with information about the problem including the HTML rendering +# of the problem will be sent to that URL. +# See also $feedback_button_name, above. + +#$courseURLs{feedbackFormURL} = "http://www.mathnerds.com/MathNerds/mmn/SDS/askQuestion.aspx"; #"http://www.tipjar.com/cgi-bin/test"; +$courseURLs{feedbackFormURL} = ""; + ################################################################################ # Theme ################################################################################ @@ -299,10 +318,6 @@ # Location of temporary editing files. $courseDirs{tmpEditFileDir} = "$courseDirs{templates}/tmpEdit"; -# If this is set to a non-empty value (i.e. in course.conf), WeBWorK's usual -# email feedback mechanism will be replaced with a link to the given URL. -# See also $feedback_button_name, above. -$courseURLs{feedbackURL} = ""; # mail merge status directory $courseDirs{mailmerge} = "$courseDirs{DATA}/mailmerge"; @@ -709,6 +724,7 @@ download_hardcopy_multiuser => "ta", download_hardcopy_multiset => "ta", + download_hardcopy_view_errors =>"professor", download_hardcopy_format_pdf => "guest", download_hardcopy_format_tex => "ta", ); @@ -936,6 +952,19 @@ [qw(Applet FlashApplet JavaApplet)], ]; +##### Problem creation defaults + +# The default weight (also called value) of a problem to use when using the +# Library Browser, Problem Editor or Hmwk Sets Editor to add problems to a set +# or when this value is left blank in an imported set definition file. +$problemDefaults{value} = 1; + +# The default max_attempts for a problem to use when using the +# Library Browser, Problem Editor or Hmwk Sets Editor to add problems to a set +# or when this value is left blank in an imported set definition file. Note that +# setting this to -1 gives students unlimited attempts. +$problemDefaults{max_attempts} = -1; + ##### Answer evaluatior defaults $pg{ansEvalDefaults} = { |
From: Mike G. v. a. <we...@ma...> - 2009-09-25 00:50:01
|
Log Message: ----------- Hide from students most of the errors created when the hardcopy version can't be TeX'd or created for some other reason. The professor still gets the errors. A value in global.conf download_hardcopy_view_errors =>"professor", adjusts who sees the hardcopy errors. global.conf.dist has been changed to include this entry. Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Hardcopy.pm webwork2/lib/WeBWorK/ContentGenerator/Instructor: PGProblemEditor.pm Revision Data ------------- Index: Hardcopy.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Hardcopy.pm,v retrieving revision 1.94.2.2.2.3 retrieving revision 1.94.2.2.2.4 diff -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -u -r1.94.2.2.2.3 -r1.94.2.2.2.4 --- lib/WeBWorK/ContentGenerator/Hardcopy.pm +++ lib/WeBWorK/ContentGenerator/Hardcopy.pm @@ -168,6 +168,7 @@ # is the user allowed to request multiple sets/users at a time? my $perm_multiset = $authz->hasPermissions($userID, "download_hardcopy_multiset"); my $perm_multiuser = $authz->hasPermissions($userID, "download_hardcopy_multiuser"); + my $perm_viewhidden = $authz->hasPermissions($userID, "view_hidden_work"); my $perm_viewfromip = $authz->hasPermissions($userID, "view_ip_restricted_sets"); @@ -258,42 +259,57 @@ sub body { my ($self) = @_; - + my $userID = $self->r->param("user"); + my $perm_view_errors = $self->r->authz->hasPermissions($userID, "download_hardcopy_view_errors"); + $perm_view_errors = (defined($perm_view_errors) ) ? $perm_view_errors : 0; if (my $num = $self->get_errors) { my $final_file_url = $self->{final_file_url}; my %temp_file_map = %{$self->{temp_file_map}}; - - my $errors_str = $num > 1 ? "errors" : "error"; - print CGI::p("$num $errors_str occured while generating hardcopy:"); - - print CGI::ul(CGI::li($self->get_errors_ref)); + if($perm_view_errors) { + my $errors_str = $num > 1 ? "errors" : "error"; + print CGI::p("$num $errors_str occured while generating hardcopy:"); + + print CGI::ul(CGI::li($self->get_errors_ref)); + } if ($final_file_url) { print CGI::p( - "A hardcopy file was generated, but it may not be complete or correct: ", - CGI::a({href=>$final_file_url}, "Download Hardcopy") + "A hardcopy file was generated, but it may not be complete or correct.", + "Please check that no problems are missing and that they are all legible." , + "If not, please inform your instructor.<br />", + CGI::a({href=>$final_file_url}, "Download Hardcopy"), ); - } + } else { + print CGI::p( + "WeBWorK was unable to generate a paper copy of this homework set. Please inform your instructor. " + ); - if (%temp_file_map) { - print CGI::start_p(); - print "You can also examine the following temporary files: "; - my $first = 1; - while (my ($temp_file_name, $temp_file_url) = each %temp_file_map) { - if ($first) { - $first = 0; - } else { - print ", "; + } + if($perm_view_errors) { + if (%temp_file_map) { + print CGI::start_p(); + print "You can also examine the following temporary files: "; + my $first = 1; + while (my ($temp_file_name, $temp_file_url) = each %temp_file_map) { + if ($first) { + $first = 0; + } else { + print ", "; + } + print CGI::a({href=>$temp_file_url}, " $temp_file_name"); } - print CGI::a({href=>$temp_file_url}, " $temp_file_name"); + print CGI::end_p(); } - print CGI::end_p(); } print CGI::hr(); } - - $self->display_form(); + + # don't display the retry form if there are errors and the user doesn't have permission to view the errors. + unless ($self->get_errors and not $perm_view_errors) { + $self->display_form(); + } + ''; # return a blank } sub display_form { Index: PGProblemEditor.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm,v retrieving revision 1.90.4.1.2.6 retrieving revision 1.90.4.1.2.7 diff -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -u -r1.90.4.1.2.6 -r1.90.4.1.2.7 --- lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm +++ lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm @@ -1628,16 +1628,18 @@ my $shortFilePath = $editFilePath; $shortFilePath =~ s|^$templatesDir/||; $shortFilePath =~ s|^.*/|| if $shortFilePath =~ m|^/|; # if it is still an absolute path don't suggest that you save to it. - -### --- old menu-based apparoach --- -# my $allowedActions = (defined($setID) && $setID =~/\S/ && $setID ne 'Undefined_Set') ? ['save_a_copy','rename' ] : ['save_a_copy']; - -# return CGI::popup_menu( -# -name=>'action.save_as.saveMode', -values=>$allowedActions, -# -default=>'rename',-labels=>{save_a_copy=>'Create a copy of file at ', rename=>'Rename file path to'}, -# -onmousedown=>$onChange -# ). " [TMPL]/". -### + if ( not (-w $editFilePath) ) { # if the file is not writable create a local file path so that the file can be saved." + $shortFilePath = $self->determineLocalFilePath($shortFilePath); + } + ####################################################################################### + # cases where the file might not be writable + # $self->{file_type} eq 'problem' # need problem structure to make local copy in most cases + # $self->{file_type} eq 'set_header' # special case to make copy of blankProblem + # $self->{file_type} eq 'set_header' # special case to make copy of screen header + # $self->{file_type} eq 'hardcopy_header' # special case to make copy of hardcopy header + # + ####################################################################################### + my $probNum = ($self->{file_type} eq 'problem')? "/problem $self->{problemID}" : ""; my $andRelink = ''; @@ -1667,6 +1669,7 @@ $self->{status_message} = ''; ## DPVC -- remove bogus old messages my $courseName = $self->{courseID}; my $setName = $self->{setID}; + my $fullSetName = $self->{fullSetID}; my $problemNumber = $self->{problemID}; my $displayMode = $self->{displayMode}; |
From: Arnie P. v. a. <we...@ma...> - 2009-09-24 17:50:42
|
Log Message: ----------- Syning with head Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK/Utils: CourseIntegrityCheck.pm Revision Data ------------- Index: CourseIntegrityCheck.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils/CourseIntegrityCheck.pm,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -Llib/WeBWorK/Utils/CourseIntegrityCheck.pm -Llib/WeBWorK/Utils/CourseIntegrityCheck.pm -u -r1.5.2.1 -r1.5.2.2 --- lib/WeBWorK/Utils/CourseIntegrityCheck.pm +++ lib/WeBWorK/Utils/CourseIntegrityCheck.pm @@ -104,6 +104,7 @@ # for corresponding tables. ########################################################## my $db = $self->db; + my $ce = $self->{ce}; $self->lock_database; foreach my $table (sort keys %$db) { next if $db->{$table}{params}{non_native}; # skip non-native tables @@ -131,8 +132,26 @@ my $stmt = "show tables like '${courseName}%'"; # mysql request my $result = $dbh->selectall_arrayref($stmt) ; my @tableNames = map {@$_} @$result; # drill down in the result to the table name level + +# Table names are of the form courseID_table (with an underscore). So if we have two courses mth101 and mth101_fall09 +# when we check the tables for mth101 we will inadvertantly pick up the tables for mth101_fall09. Thus we find all +# courseID's and exclude the extraneous tables. + + my @courseIDs = listCourses($ce); + my @similarIDs =(); + foreach my $courseID (@courseIDs) { + next unless $courseID =~/^${courseName}\_(.*)/; + push(@similarIDs, $courseID); + } + + OUTER_LOOP: foreach my $table (sort @tableNames) { - next unless $table =~/^${courseName}\_(.*)/; #double check that we only have our course tables + next unless $table =~/^${courseName}\_(.*)/; #double check that we only have our course tables and similar ones + + foreach my $courseID (@similarIDs) { #exclude tables with similar but wrong names + next OUTER_LOOP if $table =~/^${courseID}\_(.*)/; + } + my $schema_name = $1; my $exists = exists($db->{$schema_name}); $tables_ok = 0 unless exists($db->{$schema_name}); @@ -436,4 +455,4 @@ -1; \ No newline at end of file +1; |
From: Arnie P. v. a. <we...@ma...> - 2009-09-24 17:47:31
|
Log Message: ----------- Fixed a bug that occurs when you have courses with similar names with a underscore such as math101 and math101_fall09. Before checking tables for math101 would find tables for math101_fall09 and bring up false warnings. See http://webwork.maa.org/moodle/mod/forum/discuss.php?d=6248 Modified Files: -------------- webwork2/lib/WeBWorK/Utils: CourseIntegrityCheck.pm Revision Data ------------- Index: CourseIntegrityCheck.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils/CourseIntegrityCheck.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -Llib/WeBWorK/Utils/CourseIntegrityCheck.pm -Llib/WeBWorK/Utils/CourseIntegrityCheck.pm -u -r1.5 -r1.6 --- lib/WeBWorK/Utils/CourseIntegrityCheck.pm +++ lib/WeBWorK/Utils/CourseIntegrityCheck.pm @@ -104,6 +104,7 @@ # for corresponding tables. ########################################################## my $db = $self->db; + my $ce = $self->{ce}; $self->lock_database; foreach my $table (sort keys %$db) { next if $db->{$table}{params}{non_native}; # skip non-native tables @@ -131,8 +132,26 @@ my $stmt = "show tables like '${courseName}%'"; # mysql request my $result = $dbh->selectall_arrayref($stmt) ; my @tableNames = map {@$_} @$result; # drill down in the result to the table name level + +# Table names are of the form courseID_table (with an underscore). So if we have two courses mth101 and mth101_fall09 +# when we check the tables for mth101 we will inadvertantly pick up the tables for mth101_fall09. Thus we find all +# courseID's and exclude the extraneous tables. + + my @courseIDs = listCourses($ce); + my @similarIDs =(); + foreach my $courseID (@courseIDs) { + next unless $courseID =~/^${courseName}\_(.*)/; + push(@similarIDs, $courseID); + } + + OUTER_LOOP: foreach my $table (sort @tableNames) { - next unless $table =~/^${courseName}\_(.*)/; #double check that we only have our course tables + next unless $table =~/^${courseName}\_(.*)/; #double check that we only have our course tables and similar ones + + foreach my $courseID (@similarIDs) { #exclude tables with similar but wrong names + next OUTER_LOOP if $table =~/^${courseID}\_(.*)/; + } + my $schema_name = $1; my $exists = exists($db->{$schema_name}); $tables_ok = 0 unless exists($db->{$schema_name}); @@ -436,4 +455,4 @@ -1; \ No newline at end of file +1; |
From: Mike G. v. a. <we...@ma...> - 2009-09-20 22:43:11
|
Log Message: ----------- fixed a left over conflict indicator Modified Files: -------------- wwmoodle/wwassignment4/moodle/blocks/wwlink: block_wwlink.php Revision Data ------------- Index: block_wwlink.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/blocks/wwlink/block_wwlink.php,v retrieving revision 1.6 retrieving revision 1.7 diff -Lwwassignment4/moodle/blocks/wwlink/block_wwlink.php -Lwwassignment4/moodle/blocks/wwlink/block_wwlink.php -u -r1.6 -r1.7 --- wwassignment4/moodle/blocks/wwlink/block_wwlink.php +++ wwassignment4/moodle/blocks/wwlink/block_wwlink.php @@ -28,7 +28,7 @@ return array('all' => false, 'course-view' => true); } -<<<<<<< block_wwlink.php + function user_can_edit() { require_capability('moode/site:doanything',get_context_instance(CONTEXT_SYSTEM)); return parent::user_can_edit(); |
From: Mike G. v. a. <we...@ma...> - 2009-09-20 22:42:23
|
Log Message: ----------- Added code which prevents anyone but an administrator from editing a wwlink Block. (security feature -- inspired by Zig Fiedorwicz) Modified Files: -------------- wwmoodle/wwassignment4/moodle/blocks/wwlink: block_wwlink.php Revision Data ------------- Index: block_wwlink.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/blocks/wwlink/block_wwlink.php,v retrieving revision 1.5 retrieving revision 1.6 diff -Lwwassignment4/moodle/blocks/wwlink/block_wwlink.php -Lwwassignment4/moodle/blocks/wwlink/block_wwlink.php -u -r1.5 -r1.6 --- wwassignment4/moodle/blocks/wwlink/block_wwlink.php +++ wwassignment4/moodle/blocks/wwlink/block_wwlink.php @@ -19,31 +19,7 @@ return true; } - /** - * @desc Saves the form data from configuration into the wwassignment_bridge table. - */ -// function instance_config_save($data) { - -// $webworkcourse = $data->webwork_link_id; -// $moodlecourse = $data->courseid; -// -// $wwassignmentbridge = new stdClass; -// $wwassignmentbridge->course = $moodlecourse; -// $wwassignmentbridge->webwork_course = $webworkcourse; -// -// //has this mapping been defined -// $record = get_record('wwassignment_bridge','course',$moodlecourse); -// if(!$record) { -// //new one -// insert_record('wwassignment_bridge',$wwassignmentbridge); -// } else { -// //update -// $wwassignmentbridge->id = $record->id; -// update_record('wwassignment_bridge',$wwassignmentbridge); -// } - -// return parent::instance_config_save($data); -// } + /** * @desc Makes sure that the only place this block can be added is on course-view page. This insures one block per course. @@ -52,35 +28,15 @@ return array('all' => false, 'course-view' => true); } - /** - * @desc Prints the content of the block. Whether or not the course is connected to a moodle course. - */ -// function get_content() { -// global $COURSE; -// print_r($this->config ); -// $courseid = $COURSE->id; -// $record = get_record('wwassignment_bridge','course',$courseid); -// print_r($record); -// if(!$record) { -// $wwlinkdata = $this->config; -// if (!$wwlinkdata) { -// $this->content->text = get_string('not_connected','block_wwlink'); -// } else { -// $this->content->text = "connecting to ". $this->config->webwork_link_id; -// $wwassignmentbridge->course = $courseid; -// $wwassignmentbridge->webwork_course = $wwlinkdata->webwork_link_id; -// insert_record('wwassignment_bridge',$wwassignmentbridge); -// } -// -// } else { -// $this->content->text = get_string('connected','block_wwlink') . ' ' . $record->webwork_course; -// } -// $this->content->footer = ''; -// return $this->content; -// } +<<<<<<< block_wwlink.php +function user_can_edit() { + require_capability('moode/site:doanything',get_context_instance(CONTEXT_SYSTEM)); + return parent::user_can_edit(); +} // new method for storing state: // we can store it in the configuration data for the block! we don't need the wwassignment_bridge table to store state. + function get_content() { global $COURSE; //print_r($this->config ); |
From: Mike G. v. a. <we...@ma...> - 2009-09-20 22:18:19
|
Log Message: ----------- Major changes are in index.php which adds a column with the total number of points for the homework set. locallib.php which correctly calculates the points (using the actual weight assigned to the problem) rather than just counting the number of problems. the rest are minor changes and updates Modified Files: -------------- wwmoodle/wwassignment4/moodle/mod/wwassignment: index.php lib.php locallib.php view.php wwmoodle/wwassignment4/moodle/mod/wwassignment/db: upgrade.php wwmoodle/wwassignment4/moodle/mod/wwassignment/lang/en_utf8: wwassignment.php Revision Data ------------- Index: upgrade.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/db/upgrade.php,v retrieving revision 1.6 retrieving revision 1.7 diff -Lwwassignment4/moodle/mod/wwassignment/db/upgrade.php -Lwwassignment4/moodle/mod/wwassignment/db/upgrade.php -u -r1.6 -r1.7 --- wwassignment4/moodle/mod/wwassignment/db/upgrade.php +++ wwassignment4/moodle/mod/wwassignment/db/upgrade.php @@ -15,7 +15,7 @@ // will tell you what you need to do. // // The commands in here will all be database-neutral, -// using the functions defined in lib/ddllib.php +// using the functions defined in lib/ddllib.ph function xmldb_wwassignment_upgrade($oldversion=0) { @@ -33,7 +33,6 @@ /// } //===== 1.9.0 upgrade line ======// - notify("running 1.9 upgrade"); if ($result && $oldversion < 2008092818) { @@ -42,8 +41,6 @@ $table = new XMLDBTable('wwassignment'); $field = new XMLDBField('grade'); $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'webwork_set'); - // can't do this until you are connected to webwork -- which you won't be on initial upgrades - // add this either to wwlink block or to configuration /// Launch add field grade Index: index.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/index.php,v retrieving revision 1.1 retrieving revision 1.2 diff -Lwwassignment4/moodle/mod/wwassignment/index.php -Lwwassignment4/moodle/mod/wwassignment/index.php -u -r1.1 -r1.2 --- wwassignment4/moodle/mod/wwassignment/index.php +++ wwassignment4/moodle/mod/wwassignment/index.php @@ -42,9 +42,12 @@ $strdescription = get_string('description'); $stropendate = get_string("open_date", "wwassignment"); $strduedate = get_string("due_date", "wwassignment"); +$strtotalpoints = get_string("total_points","wwassignment"); + + if ($course->format == "weeks") { - $table->head = array ($strweek, $strname,$strdescription, $stropendate, $strduedate); + $table->head = array ($strweek, $strname,$strdescription, $stropendate, $strduedate, $strtotalpoints); $table->align = array ("center", "left", "left", "left", "left"); } else if ($course->format == "topics") { $table->head = array ($strtopic, $strname,$strdescription, $stropendate, $strduedate); @@ -71,7 +74,8 @@ $link = "<a href=\"view.php?id=$wwassignment->coursemodule\">$wwassignment->name</a>"; } if ($course->format == "weeks" or $course->format == "topics") { - $table->data[] = array ($wwassignment->section, $link, $wwassignment->description, strftime("%c", $wwsetinfo['open_date']), strftime("%c", $wwsetinfo['due_date'])); + $totalpoints = $wwclient->get_max_grade($wwcoursename, $wwsetname,false); + $table->data[] = array ($wwassignment->section, $link, $wwassignment->description, strftime("%c", $wwsetinfo['open_date']), strftime("%c", $wwsetinfo['due_date']), $totalpoints); } else { $table->data[] = array ($link, $wwassignment->description, strftime("%c", $wwsetinfo['open_date']), strftime("%c", $wwsetinfo['due_date'])); } Index: view.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/view.php,v retrieving revision 1.1 retrieving revision 1.2 diff -Lwwassignment4/moodle/mod/wwassignment/view.php -Lwwassignment4/moodle/mod/wwassignment/view.php -u -r1.1 -r1.2 --- wwassignment4/moodle/mod/wwassignment/view.php +++ wwassignment4/moodle/mod/wwassignment/view.php @@ -35,8 +35,9 @@ //catch the guests global $USER; -if($USER->username == 'guest') { - print_error('Guests cannot view WeBWorK Problem Sets'); +if($USER->username == 'guest') { # this allows guests to view webwork (signed in as user guest) + #FIXME -- replace this with a method that uses the automatic guest sign in on webwork. + // print_error('Guests cannot view WeBWorK Problem Sets'); } //force login @@ -50,6 +51,7 @@ $wwsetname = $wwassignment->webwork_set; _wwassignment_mapcreate_user($wwcoursename,$wwusername); _wwassignment_mapcreate_user_set($wwcoursename,$wwusername,$wwsetname); + $wwkey = _wwassignment_login_user($wwcoursename,$wwusername); $wwsetlink = _wwassignment_link_to_set_auto_login($wwcoursename,$wwsetname,$wwusername,$wwkey); Index: lib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/lib.php,v retrieving revision 1.6 retrieving revision 1.7 diff -Lwwassignment4/moodle/mod/wwassignment/lib.php -Lwwassignment4/moodle/mod/wwassignment/lib.php -u -r1.6 -r1.7 --- wwassignment4/moodle/mod/wwassignment/lib.php +++ wwassignment4/moodle/mod/wwassignment/lib.php @@ -55,7 +55,7 @@ debugLog("Begin wwassignment_add_instance"); debugLog("input wwassignment "); - //debugLot( print_r($wwassignment, true) ); + //debugLog( print_r($wwassignment, true) ); //Get data about the set from WebWorK $wwclient = new wwassignment_client(); @@ -66,8 +66,8 @@ //Attaching Moodle Set to WeBWorK Set - //debugLog("saving wwassignment "); - //debugLog( print_r($wwassignment,true)); + debugLog("saving wwassignment "); + debugLog( print_r($wwassignment,true)); $wwassignment->timemodified = time(); if ($returnid = insert_record("wwassignment", $wwassignment)) { @@ -75,7 +75,7 @@ //Creating events _wwassignment_create_events($wwsetname,$wwassignment->id,$wwsetdata['open_date'],$wwsetdata['due_date']); - + debugLog("notify gradebook"); //notify gradebook wwassignment_grade_item_update($wwassignment); } Index: locallib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/locallib.php,v retrieving revision 1.10 retrieving revision 1.11 diff -Lwwassignment4/moodle/mod/wwassignment/locallib.php -Lwwassignment4/moodle/mod/wwassignment/locallib.php -u -r1.10 -r1.11 --- wwassignment4/moodle/mod/wwassignment/locallib.php +++ wwassignment4/moodle/mod/wwassignment/locallib.php @@ -469,10 +469,27 @@ * @return integer The max grade on success or -1 on failure. */ //FIXME -- this assumes each problem gets 1 point which is false +// function get_max_grade($webworkcourse,$webworkset,$silent = true) { +// $record = $this->handler('list_global_problems',array('courseName' => $webworkcourse,'setID' => $webworkset)); +// if(isset($record)) { +// return count($record); +// } +// if(!$silent) { +// print_error('webwork_set_map_failure','wwassignment'); +// } +// return -1; +// +// } + function get_max_grade($webworkcourse,$webworkset,$silent = true) { - $record = $this->handler('list_global_problems',array('courseName' => $webworkcourse,'setID' => $webworkset)); + $record = $this->handler('get_all_global_problems',array('courseName' => $webworkcourse,'setID' => $webworkset)); + $totalpoints =0; if(isset($record)) { - return count($record); + foreach ($record as $set) { + $totalpoints = $totalpoints + $set[value]; + + } + return $totalpoints; } if(!$silent) { print_error('webwork_set_map_failure','wwassignment'); Index: wwassignment.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/lang/en_utf8/wwassignment.php,v retrieving revision 1.1 retrieving revision 1.2 diff -Lwwassignment4/moodle/mod/wwassignment/lang/en_utf8/wwassignment.php -Lwwassignment4/moodle/mod/wwassignment/lang/en_utf8/wwassignment.php -u -r1.1 -r1.2 --- wwassignment4/moodle/mod/wwassignment/lang/en_utf8/wwassignment.php +++ wwassignment4/moodle/mod/wwassignment/lang/en_utf8/wwassignment.php @@ -10,6 +10,7 @@ //index list $string['open_date'] = "Opened"; $string['due_date'] = "Due"; +$string['total_points'] = "Total points"; //viewing page $string['go_to_webwork'] = "Administer the WeBWorK portion of this course."; |
From: dpvc v. a. <we...@ma...> - 2009-09-18 18:03:17
|
Log Message: ----------- Fixed problem with domain errors Modified Files: -------------- pg/macros: answerComposition.pl Revision Data ------------- Index: answerComposition.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/answerComposition.pl,v retrieving revision 1.8 retrieving revision 1.9 diff -Lmacros/answerComposition.pl -Lmacros/answerComposition.pl -u -r1.8 -r1.9 --- macros/answerComposition.pl +++ macros/answerComposition.pl @@ -191,7 +191,7 @@ "Your formula my not be the composition itself"; $error = 1; next; } - if ($student{$i} == $x{$i}) { + if (Parser::Formula($x{$i}) == $student{$i}) { $ans{$i}->{rh_ans}{ans_message} = "The identity function is not allowed" unless $isPreview; $error = 1; next; |
From: dpvc v. a. <we...@ma...> - 2009-09-16 11:15:38
|
Log Message: ----------- Fix context() method to SET the context when one is passed Modified Files: -------------- pg/lib: Parser.pm Revision Data ------------- Index: Parser.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser.pm,v retrieving revision 1.53 retrieving revision 1.54 diff -Llib/Parser.pm -Llib/Parser.pm -u -r1.53 -r1.54 --- lib/Parser.pm +++ lib/Parser.pm @@ -56,8 +56,14 @@ # Get the object's context, or the default one # sub context { - my $self = shift; - return $self->{context} if Value::isHash($self) && $self->{context}; + my $self = shift; my $context = shift; + if (Value::isHash($self)) { + if ($context && $self->{context} != $context) { + $self->{context} = $context; + $self->{tree} = $self->{tree}->copy($self) if $self->{tree}; + } + return $self->{context} if $self->{context}; + } Parser::Context->current; } |
From: Mike G. v. a. <we...@ma...> - 2009-09-09 21:36:32
|
Log Message: ----------- LiveGraphics3D.pl is being maintained in the NPL/macros/Union directory Tags: ---- rel-2-4-patches Removed Files: ------------- pg/macros: LiveGraphics3D.pl Revision Data ------------- --- macros/LiveGraphics3D.pl +++ /dev/null @@ -1,191 +0,0 @@ -sub _LiveGraphics3D_init {}; # don't reload this file - -########################################################################### -# -# Macros for handling interactive 3D graphics via the LiveGraphics3D -# Java applet. The applet needs to be in the course html directory. -# (If it is in the system html area, you will need to change the -# default below or supply the jar option explicitly). -# -# The LiveGraphics3D applet displays a mathematica Graphics3D object -# that is stored in a .m file (or a compressed one). Use Mathematica -# to create one. (In the future, I plan to write a perl class that -# will create these for you on the fly. -- DPVC) -# -# The main routines are -# -# Live3Dfile load a data file -# Live3Ddata load raw Graphics3D data -# LiveGraphics3D access to all parameters -# - -# -# LiveGraphics3D(options) -# -# Options are from: -# -# file => name name of .m file to load -# -# archive => name name of a .zip file to load -# -# input => 3Ddata string containing Graphics3D data to -# be displayed by the applet -# -# size => [w,h] width and height of applet -# -# vars => [vars] hash of variables to pass as independent -# variables to the applet, togther with -# their initial values -# e.g., vars => [a=>1,b=>1] -# -# depend => [list] list of dependent variables to pass to -# the applet with their replacement strings -# (see LiveGraphics3D documentation) -# -# jar => URL where to find the live.jar file -# -# background=>"#RRGGBB" the background color to use (default is white) -# -# scale => n scaling factor for applet (default is 1.) -# -# image => file a file containing an image to use in TeX mode -# or when Java is disabled -# -# tex_size => ratio a scaling factor for the TeX image (as a portion -# of the line width). -# 1000 is 100%, 500 is 50%, etc. -# -# tex_center => 0 or 1 center the image in TeX mode or not -# -# Live3D => [params] hash of additional parameters to pass to -# the Live3D applet. -# e.g. Live3D => [VISIBLE_FACES => "FRONT"] -# - -sub LiveGraphics3D { - my %options = ( - size => [250,250], - jar => "live.jar", # "${htmlURL}live.jar", - codebase => findAppletCodebase("live.jar"), - background => "#FFFFFF", - scale => 1., - tex_size => 500, - tex_cener => 0, - @_ - ); - my $out = ""; my $p; my %pval; - my $ratio = $options{tex_size} * (.001); - - if ($main::displayMode eq "TeX") { - # - # In TeX mode, include the image, if there is one, or - # else give the user a message about using it on line - # - if ($options{image}) { - $out = "\\includegraphics[width=$ratio\\linewidth]{$options{image}}"; - $out = "\\centerline{$out}" if $options{tex_center}; - $out .= "\n"; - } else { - $out = "\\vbox{ - \\hbox{[ This image is created by} - \\hbox{\\quad an interactive applet;} - \\hbox{you must view it on line ]} - }"; - } - } else { - my ($w,$h) = @{$options{size}}; - $out .= $bHTML if ($main::displayMode eq "Latex2HTML"); - # - # Put the applet in a table - # - $out .= qq{\n<TABLE BORDER="1" CELLSPACING="2" CELLPADDING="0">\n<TR>}; - $out .= qq{<TD WIDTH="$w" HEIGHT="$h" ALIGN="CENTER">}; - # - # start the applet - # - $out .= qq{ - <APPLET CODEBASE="$options{codebase}" ARCHIVE="$options{jar}" CODE="Live.class" WIDTH="$w" HEIGHT="$h"> - <PARAM NAME="BGCOLOR" VALUE="$options{background}"> - <PARAM NAME="MAGNIFICATION" VALUE="$options{scale}"> - }; - # - # include the file or data - # - $out .= qq{<PARAM NAME="INPUT_ARCHIVE" VALUE="$options{archive}">\n} - if ($options{archive}); - $out .= qq{<PARAM NAME="INPUT_FILE" VALUE="$options{file}">\n} - if ($options{file}); - $out .= qq{<PARAM NAME="INPUT" VALUE="$options{input}">\n} - if ($options{input}); - # - # include any independent variables - # - if ($options{vars}) { - my @vars = (); %pval = @{$options{vars}}; - foreach $p (lex_sort(keys(%pval))) {push(@vars,"${p}->$pval{$p}");} - $out .= - '<PARAM NAME="INDEPENDENT_VARIABLES" VALUE="{'.join(',',@vars).'}">'; - $out .= "\n"; - } - # - # include dependent variables - # - if ($options{depend}) { - my @depend = (); $pval = @{$options{depend}}; - foreach $p (lex_sort(keys(%pval))) {push(@depend,"${p}->$pval{$p}");} - $out .= - '<PARAM NAME="DEPENDENT_VARIABLES" VALUE="{'.join(',',@depend).'}">'; - $out .= "\n"; - } - # - # include any extra Live3D parameters - # - if ($options{Live3D}) { - my %pval = @{$options{Live3D}}; - foreach $p (lex_sort(keys(%pval))) { - $out .= qq{<PARAM NAME="$p" VALUE="$pval{$p}">\n}; - } - } - # - # End the applet and table - # - $out .= qq{<IMG SRC="$options{image}" BORDER="0">} if ($options{image}); - $out .= "<SMALL>[Enable Java to make this image interactive]</SMALL><BR>"; - $out .= "</APPLET>"; - $out .= "</TD></TD>\n</TABLE>\n"; - $out .= $eHTML if ($main::displayMode eq "Latex2HTML"); - } - - return $out; -} - -# -# Syntactic sugar to make it easier to pass files and data to -# LiveGraphics3D. -# -sub Live3Dfile { - my $file = shift; - LiveGraphics3D(file => $file, @_); -} - -# -# Syntactic sugar to make it easier to pass raw Graohics3D data -# to LiveGraphics3D. -# -sub Live3Ddata { - my $data = shift; - LiveGraphics3D(input => $data, @_); -} - - -# -# A message you can use for a caption under a graph -# -$LIVEMESSAGE = MODES( - TeX => '', - Latex2HTML => - $BCENTER.$BSMALL."Drag the surface to rotate it".$ESMALL.$ECENTER, - HTML => $BCENTER.$BSMALL."Drag the surface to rotate it".$ESMALL.$ECENTER -); - -1; |
From: Mike G. v. a. <we...@ma...> - 2009-09-09 21:30:06
|
Log Message: ----------- backporting changes in HEAD to rel-2-4-patches Tags: ---- rel-2-4-patches Modified Files: -------------- pg/macros: LiveGraphics3D.pl Revision Data ------------- Index: LiveGraphics3D.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/Attic/LiveGraphics3D.pl,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -Lmacros/LiveGraphics3D.pl -Lmacros/LiveGraphics3D.pl -u -r1.1.2.1 -r1.1.2.2 --- macros/LiveGraphics3D.pl +++ macros/LiveGraphics3D.pl @@ -65,7 +65,8 @@ sub LiveGraphics3D { my %options = ( size => [250,250], - jar => findAppletCodebase("live.jar")."/live.jar", + jar => "live.jar", # "${htmlURL}live.jar", + codebase => findAppletCodebase("live.jar"), background => "#FFFFFF", scale => 1., tex_size => 500, @@ -103,18 +104,18 @@ # start the applet # $out .= qq{ - <APPLET ARCHIVE="$options{jar}" CODE="Live.class" WIDTH="$w" HEIGHT="$h"> + <APPLET CODEBASE="$options{codebase}" ARCHIVE="$options{jar}" CODE="Live.class" WIDTH="$w" HEIGHT="$h"> <PARAM NAME="BGCOLOR" VALUE="$options{background}"> <PARAM NAME="MAGNIFICATION" VALUE="$options{scale}"> }; # # include the file or data # - $out .= qq{<PARAM NAME="INPUT_ARCHIVE" VALUE="$options{archive}">\n} + $out .= qq{<PARAM NAME="INPUT_ARCHIVE" VALUE="$options{archive}">\n} if ($options{archive}); - $out .= qq{<PARAM NAME="INPUT_FILE" VALUE="$options{file}">\n} + $out .= qq{<PARAM NAME="INPUT_FILE" VALUE="$options{file}">\n} if ($options{file}); - $out .= qq{<PARAM NAME="INPUT" VALUE="$options{input}">\n} + $out .= qq{<PARAM NAME="INPUT" VALUE="$options{input}">\n} if ($options{input}); # # include any independent variables |
From: Mike G. v. a. <we...@ma...> - 2009-09-06 01:24:25
|
Log Message: ----------- correct return behavior of wwclient->create_user to conform to its use. The routine no returns the username that is created. With luck this will fix a bug in which the first time one attempts to create a webwork assignment one received a communication error message -- the second time (because the user had already been created) it would succeed. Now it always appears to succeed the first time. -- Mike Modified Files: -------------- wwmoodle/wwassignment4/moodle/mod/wwassignment: locallib.php Revision Data ------------- Index: locallib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/locallib.php,v retrieving revision 1.9 retrieving revision 1.10 diff -Lwwassignment4/moodle/mod/wwassignment/locallib.php -Lwwassignment4/moodle/mod/wwassignment/locallib.php -u -r1.9 -r1.10 --- wwassignment4/moodle/mod/wwassignment/locallib.php +++ wwassignment4/moodle/mod/wwassignment/locallib.php @@ -547,7 +547,8 @@ * @param string $webworkcourse The webwork course name. * @param array $userdata The user data to use in creation. * @param string $permission The permissions of the new user, defaults to 0. - * @return Returns 1 on success. + * @return Returns username on success. + */ function create_user($webworkcourse,&$userdata,$permission='0') { $studentid = $userid; @@ -574,14 +575,14 @@ $this->handler('add_password',array('courseName' => $webworkcourse,'record' => array( 'user_id' => $userdata->username, 'password' => $userdata->password))); - return 1; + return $userdata->username; } /** NOT yet ready!!!!!!!!! * @desc Updates data for a user in the WeBWorK course. * @param string $webworkcourse The webwork course name. * @param array $userdata The user data to use in creation. * @param string $permission The permissions of the new user, defaults to 0. - * @return Returns 1 on success. + * @return Returns username on success. */ function update_user($webworkcourse,&$userdata,$permission='0') { error_log("update_user called -- not yet ready"); @@ -610,7 +611,7 @@ $this->handler('add_password',array('courseName' => $webworkcourse,'record' => array( 'user_id' => $userdata->username, 'password' => $userdata->password))); - return 1; + return $userdata->username; } /** * @desc Creates a user set in WeBWorK |
From: Mike G. v. a. <we...@ma...> - 2009-09-01 23:59:40
|
Log Message: ----------- Added check so that warnings are not created when editing the course_info.txt file (which has no problem or version ID attached. Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: PGProblemEditor.pm Revision Data ------------- Index: PGProblemEditor.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm,v retrieving revision 1.90.4.1.2.5 retrieving revision 1.90.4.1.2.6 diff -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -u -r1.90.4.1.2.5 -r1.90.4.1.2.6 --- lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm +++ lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm @@ -146,12 +146,16 @@ $self->{problemID} = $r->urlpath->arg("problemID"); # parse setID, which may come in with version data + my $fullSetID = $self->{setID}; - if ( $fullSetID =~ /,v(\d+)$/ ) { - $self->{versionID} = $1; - $self->{setID} =~ s/,v\d+$//; + if (defined($fullSetID) ) { + + if ( $fullSetID =~ /,v(\d+)$/ ) { + $self->{versionID} = $1; + $self->{setID} =~ s/,v\d+$//; + } + $self->{fullSetID} = $fullSetID; } - $self->{fullSetID} = $fullSetID; my $submit_button = $r->param('submit'); # obtain submit command from form my $actionID = $r->param('action'); |
From: Mike G. v. a. <we...@ma...> - 2009-09-01 19:03:09
|
Log Message: ----------- Fixes a cosmetic bug reported in the forum. http://webwork.maa.org/moodle/mod/forum/discuss.php?d=6266#p8224 Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: PGProblemEditor.pm Revision Data ------------- Index: PGProblemEditor.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm,v retrieving revision 1.96 retrieving revision 1.97 diff -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -u -r1.96 -r1.97 --- lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm +++ lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm @@ -148,13 +148,16 @@ $self->{problemID} = $r->urlpath->arg("problemID"); # parse setID, which may come in with version data + my $fullSetID = $self->{setID}; - if ( $fullSetID =~ /,v(\d+)$/ ) { - $self->{versionID} = $1; - $self->{setID} =~ s/,v\d+$//; + if (defined($fullSetID) ) { + + if ( $fullSetID =~ /,v(\d+)$/ ) { + $self->{versionID} = $1; + $self->{setID} =~ s/,v\d+$//; + } + $self->{fullSetID} = $fullSetID; } - $self->{fullSetID} = $fullSetID; - my $submit_button = $r->param('submit'); # obtain submit command from form my $actionID = $r->param('action'); my $file_type = $r->param("file_type") || ''; |
From: Arnie P. v. a. <we...@ma...> - 2009-08-29 16:35:01
|
Log Message: ----------- correct typo nessages in comment Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Hardcopy.pm Revision Data ------------- Index: Hardcopy.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Hardcopy.pm,v retrieving revision 1.100 retrieving revision 1.101 diff -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -u -r1.100 -r1.101 --- lib/WeBWorK/ContentGenerator/Hardcopy.pm +++ lib/WeBWorK/ContentGenerator/Hardcopy.pm @@ -164,7 +164,7 @@ # when students don't select any sets the size of @setIDs is 1 with a null character in $setIDs[0]. # when professors don't select any sets the size of @setIDs is 0. # the following test "unless ((@setIDs) and ($setIDs[0] =~ /\S+/))" catches both cases and prevents -# warning nessages in the case of a professor's empty array. +# warning messages in the case of a professor's empty array. unless ((@setIDs) and ($setIDs[0] =~ /\S+/)) { $self->addbadmessage("Please select at least one set and try again."); $validation_failed = 1; |
From: Arnie P. v. a. <we...@ma...> - 2009-08-29 16:28:31
|
Log Message: ----------- This fixes the bug reported Blake Thornton Hardcopy Error by Blake Thornton - Thursday, 27 August 2009, 09:47 PM # when students don't select any sets the size of @setIDs is 1 with a null character in $setIDs[0]. # when professors don't select any sets the size of @setIDs is 0. # the following test "unless ((@setIDs) and ($setIDs[0] =~ /\S+/))" catches both cases and prevents # warning nessages in the case of a professor's empty array. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Hardcopy.pm Revision Data ------------- Index: Hardcopy.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Hardcopy.pm,v retrieving revision 1.99 retrieving revision 1.100 diff -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -u -r1.99 -r1.100 --- lib/WeBWorK/ContentGenerator/Hardcopy.pm +++ lib/WeBWorK/ContentGenerator/Hardcopy.pm @@ -159,10 +159,15 @@ unless (@userIDs) { $self->addbadmessage("Please select at least one user and try again."); $validation_failed = 1; - } - unless (@setIDs) { + } + +# when students don't select any sets the size of @setIDs is 1 with a null character in $setIDs[0]. +# when professors don't select any sets the size of @setIDs is 0. +# the following test "unless ((@setIDs) and ($setIDs[0] =~ /\S+/))" catches both cases and prevents +# warning nessages in the case of a professor's empty array. + unless ((@setIDs) and ($setIDs[0] =~ /\S+/)) { $self->addbadmessage("Please select at least one set and try again."); - $validation_failed = 1; + $validation_failed = 1; } # is the user allowed to request multiple sets/users at a time? |