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: Sam H. v. a. <we...@ma...> - 2008-03-13 22:35:53
|
Log Message: ----------- Add $feedback_by_section option: # If this value is true, feedback will only be sent to users with the same # section as the user initiating the feedback. $feedback_by_section = 0; Modified Files: -------------- webwork2/conf: global.conf.dist webwork2/lib/WeBWorK/ContentGenerator: Feedback.pm Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.204 retrieving revision 1.205 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.204 -r1.205 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -163,6 +163,10 @@ # Use this to customize the text of the feedback button. $feedback_button_name = "Email instructor"; +# If this value is true, feedback will only be sent to users with the same +# section as the user initiating the feedback. +$feedback_by_section = 0; + ################################################################################ # Theme ################################################################################ Index: Feedback.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Feedback.pm,v retrieving revision 1.44 retrieving revision 1.45 diff -Llib/WeBWorK/ContentGenerator/Feedback.pm -Llib/WeBWorK/ContentGenerator/Feedback.pm -u -r1.44 -r1.45 --- lib/WeBWorK/ContentGenerator/Feedback.pm +++ lib/WeBWorK/ContentGenerator/Feedback.pm @@ -148,7 +148,7 @@ } # determine the recipients of the email - my @recipients = $self->getFeedbackRecipients(); + my @recipients = $self->getFeedbackRecipients($user); unless (@recipients) { $self->noRecipientsAvailable($returnURL); @@ -359,7 +359,7 @@ } sub getFeedbackRecipients { - my ($self) = @_; + my ($self, $user) = @_; my $ce = $self->r->ce; my $db = $self->r->db; my $authz = $self->r->authz; @@ -371,6 +371,9 @@ foreach my $rcptName ($db->listUsers()) { if ($authz->hasPermissions($rcptName, "receive_feedback")) { my $rcpt = $db->getUser($rcptName); # checked + next if $ce->{feedback_by_section} and defined $user + and defined $rcpt->section and defined $user->section + and $rcpt->section ne $user->section; if ($rcpt and $rcpt->email_address) { push @recipients, $rcpt->rfc822_mailbox; } |
From: Sam H. v. a. <we...@ma...> - 2008-03-13 18:06:59
|
Log Message: ----------- backport (sh002i): Fixed the name of the transaction log. Tags: ---- rel-2-4-dev 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.6 retrieving revision 1.189.2.7 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.189.2.6 -r1.189.2.7 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -493,7 +493,7 @@ # The transaction log contains data from each recorded answer submission. This # is useful if the database becomes corrupted. -$webworkFiles{logs}{transaction} = "$webworkDirs{logs}/$coursename_transaction.log"; +$webworkFiles{logs}{transaction} = "$webworkDirs{logs}/${courseName}_transaction.log"; # The answer log stores a history of all users' submitted answers. $courseFiles{logs}{answer_log} = "$courseDirs{logs}/answer_log"; |
From: Sam H. v. a. <we...@ma...> - 2008-03-13 18:06:43
|
Log Message: ----------- Fixed the name of the transaction log 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.203 retrieving revision 1.204 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.203 -r1.204 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -500,7 +500,7 @@ # The transaction log contains data from each recorded answer submission. This # is useful if the database becomes corrupted. -$webworkFiles{logs}{transaction} = "$webworkDirs{logs}/$coursename_transaction.log"; +$webworkFiles{logs}{transaction} = "$webworkDirs{logs}/${courseName}_transaction.log"; # The answer log stores a history of all users' submitted answers. $courseFiles{logs}{answer_log} = "$courseDirs{logs}/answer_log"; |
From: Sam H. v. a. <we...@ma...> - 2008-03-04 15:56:56
|
Log Message: ----------- Bring back the green bar, which some students appear to worship. Modified Files: -------------- webwork2/htdocs/css: math.css Revision Data ------------- Index: math.css =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/css/math.css,v retrieving revision 1.11 retrieving revision 1.12 diff -Lhtdocs/css/math.css -Lhtdocs/css/math.css -u -r1.11 -r1.12 --- htdocs/css/math.css +++ htdocs/css/math.css @@ -393,7 +393,14 @@ /* the info escape emits a DIV with this id. (not that the same DIV has class * "info-box" which is given above in the "template styles" section. Regardless, * it is emitted by WW code! */ -#InfoPanel { font-size: smaller; float: right; width: 40%; overflow: auto; } +#InfoPanel { + font-size: smaller; + float: right; + width: 40%; + overflow: auto; + margin-right: -1px; + background-color: #fff; +} /* tables used for laying out form fields shouldn't have a border */ table.FormLayout { border: 0; } @@ -411,7 +418,7 @@ /*ul.LinksMenu ul { list-style: none; margin-left: 0.5em; padding-left: 0; }*/ /* background styles for success and failure messages */ -div.ResultsWithoutError { color: #096; background-color: inherit; } /* green */ +div.ResultsWithoutError { color: inherit; background-color: #8F8; } /* green */ div.ResultsWithError { color: #C33; background-color: inherit; } /* red */ div.ResultsAlert { color: #F60; background-color: inherit; } /* orange */ |
From: Sam H. v. a. <we...@ma...> - 2008-03-04 15:56:56
|
Log Message: ----------- backport (sh002i): Bring back the green bar, which some students appear to worship. Tags: ---- rel-2-4-dev Modified Files: -------------- webwork2/htdocs/css: math.css Revision Data ------------- Index: math.css =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/css/math.css,v retrieving revision 1.9.4.2 retrieving revision 1.9.4.3 diff -Lhtdocs/css/math.css -Lhtdocs/css/math.css -u -r1.9.4.2 -r1.9.4.3 --- htdocs/css/math.css +++ htdocs/css/math.css @@ -393,7 +393,14 @@ /* the info escape emits a DIV with this id. (not that the same DIV has class * "info-box" which is given above in the "template styles" section. Regardless, * it is emitted by WW code! */ -#InfoPanel { font-size: smaller; float: right; width: 40%; overflow: auto; } +#InfoPanel { + font-size: smaller; + float: right; + width: 40%; + overflow: auto; + margin-right: -1px; + background-color: #fff; +} /* tables used for laying out form fields shouldn't have a border */ table.FormLayout { border: 0; } @@ -411,7 +418,7 @@ /*ul.LinksMenu ul { list-style: none; margin-left: 0.5em; padding-left: 0; }*/ /* background styles for success and failure messages */ -div.ResultsWithoutError { color: #096; background-color: inherit; } /* green */ +div.ResultsWithoutError { color: inherit; background-color: #8F8; } /* green */ div.ResultsWithError { color: #C33; background-color: inherit; } /* red */ div.ResultsAlert { color: #F60; background-color: inherit; } /* orange */ |
From: Sam H. v. a. <we...@ma...> - 2008-02-04 23:25:17
|
Log Message: ----------- check for Exception::Class (which is used by NewSQL) Tags: ---- rel-2-4-dev Modified Files: -------------- webwork2/bin: check_modules.pl Revision Data ------------- Index: check_modules.pl =================================================================== RCS file: /webwork/cvs/system/webwork2/bin/check_modules.pl,v retrieving revision 1.12.2.3 retrieving revision 1.12.2.4 diff -Lbin/check_modules.pl -Lbin/check_modules.pl -u -r1.12.2.3 -r1.12.2.4 --- bin/check_modules.pl +++ bin/check_modules.pl @@ -49,6 +49,7 @@ Digest::MD5 Email::Address Errno + Exception::Class File::Copy File::Find File::Path |
From: Sam H. v. a. <we...@ma...> - 2008-02-04 23:10:12
|
Log Message: ----------- (1) require --dest-lib, don't accept "files ... dest-lib" (2) add --check-names to warn if a file name will be changed (3) added --help option, improve usage output Modified Files: -------------- webwork2/bin: pg-pull Revision Data ------------- Index: pg-pull =================================================================== RCS file: /webwork/cvs/system/webwork2/bin/pg-pull,v retrieving revision 1.3 retrieving revision 1.4 diff -Lbin/pg-pull -Lbin/pg-pull -u -r1.3 -r1.4 --- bin/pg-pull +++ bin/pg-pull @@ -54,8 +54,14 @@ my (@files) = @_; my $oldfh = select(STDERR); $|=1; select(STDOUT); $|=1; select($oldfh); + if (defined $o{help}) { + print usage(); + exit; + } + my $dest_lib = $o{'dest-lib'}; - $dest_lib = pop @files unless defined $dest_lib; + # using the last argument as dest-lib is too confusing + #$dest_lib = pop @files unless defined $dest_lib; die "dest-lib not specified.\n" . usage() unless defined $dest_lib; die "no files specified (perhaps you meant to use --stdin?)\n" . usage() @@ -125,7 +131,11 @@ $target_dir_rel = File::Spec->abs2rel($dir, $o{'src-lib'}); $target_name = $name; } else { - ($target_dir_rel, $target_name) = tags_to_path(\%tags, '.pg'); + ($target_dir_rel, $target_name) = tags_to_path(\%tags, '.pg', $file); + } + + if ($o{'check-names'} and $name ne $target_name) { + warn "$file: name will be changed to $target_name\n"; } my $target_dir = File::Spec->catdir($o{'dest-lib'}, $target_dir_rel); @@ -145,12 +155,12 @@ } sub tags_to_path { - my ($tags, $ext) = @_; + my ($tags, $ext, $file) = @_; # FIXME here is where we'd put in textbook matching my $text = $tags->{textbooks}[0]; unless (defined $text) { - warn "no textbook tags\n"; + warn "$file: no textbook tags\n"; return; } my %text = %$text; @@ -162,7 +172,7 @@ or not defined $text{section} or not defined $text{problem} or @{$text{problem}} == 0) { - warn "incomplete textbook tags\n"; + warn "$file: incomplete textbook tags\n"; return; } @@ -177,16 +187,16 @@ if (defined $text_names{$text{chapter}}) { $chapter_name .= sissy_filename(" $text_names{$text{chapter}}") } else { - warn "no chapter name for $text{chapter}"; + warn "$file: no chapter name for $text{chapter}"; } if (defined $text_names{"$text{chapter}.$text{section}"}) { $chapsec_name .= sissy_filename(" $text_names{qq|$text{chapter}.$text{section}|}"); } else { - warn "no section name for $text{chapter}.$text{section}"; + warn "$file: no section name for $text{chapter}.$text{section}"; } } else { - warn "can't find text $text{author}/$text{title}/$text{edition} in Textbooks file -- directories will be unnamed\n"; + warn "$file: can't find text $text{author}/$text{title}/$text{edition} in Textbooks file -- directories will be unnamed\n"; } } @@ -249,10 +259,14 @@ sub usage { return "USAGE:\n" - . "$0 --textbooks=PATH --suffix=STRING files... dest-lib\n" - . "$0 --textbooks=PATH --suffix=STRING --dest-lib=PATH files...\n" - . "$0 --orig-paths -src-lib=PATH files... dest-lib\n" - . "$0 --orig-paths -src-lib=PATH --dest-lib=PATH files...\n"; + . "$0 [OPTIONS] --dest-lib=PATH [--textbooks=PATH] [--suffix=STRING] files...\n" + . "$0 [OPTIONS] --dest-lib=PATH --orig-paths --src-lib=PATH files...\n" + . "Options:\n" + . "\t--stdin\n" + . "\t--pretend\n" + . "\t--verbose\n" + . "\t--check-names\n" + ; } GetOptions(\%o, @@ -263,6 +277,8 @@ 'stdin', 'suffix=s', 'pretend', - 'verbose' + 'verbose', + 'check-names', + 'help', ); main(@ARGV); |
From: Sam H. v. a. <we...@ma...> - 2008-02-04 23:08:23
|
Log Message: ----------- improve error reporting for list parsing Modified Files: -------------- webwork2/lib/WeBWorK: NPL.pm Revision Data ------------- Index: NPL.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/NPL.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -Llib/WeBWorK/NPL.pm -Llib/WeBWorK/NPL.pm -u -r1.1 -r1.2 --- lib/WeBWorK/NPL.pm +++ lib/WeBWorK/NPL.pm @@ -274,8 +274,8 @@ my $field = $1; my $value = $2; my ($parsed_value, $parse_errors) = parse_normal_list($field, $value); - if ($parse_errors) { - warn "error while parsing value \"$value\" in field $field:\n" + if (@$parse_errors) { + warn "error while parsing list value \"$value\" in field $field:\n" . join('', @$parse_errors) . "value may be incomplete. use with caution.\n" . "(line $. of file $file)\n"; |
From: Sam H. v. a. <we...@ma...> - 2008-02-04 23:07:24
|
Log Message: ----------- added $mail{smtp_timeout} setting Modified Files: -------------- webwork2/lib/WeBWorK/PG: Local.pm Revision Data ------------- Index: Local.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/PG/Local.pm,v retrieving revision 1.25 retrieving revision 1.26 diff -Llib/WeBWorK/PG/Local.pm -Llib/WeBWorK/PG/Local.pm -u -r1.25 -r1.26 --- lib/WeBWorK/PG/Local.pm +++ lib/WeBWorK/PG/Local.pm @@ -197,6 +197,7 @@ my $mailer = new WeBWorK::Utils::DelayedMailer( smtp_server => $ce->{mail}{smtpServer}, smtp_sender => $ce->{mail}{smtpSender}, + smtp_timeout => $ce->{mail}{smtpTimeout}, # FIXME I'd like to have an X-Remote-Host header, but before I do that I have to # factor out the remote host/remote port code from Feedback.pm and Authen.pm and # put it in Utils! (or maybe in WW::Request?) |
From: Sam H. v. a. <we...@ma...> - 2008-02-04 23:07:05
|
Log Message: ----------- added $mail{smtp_timeout} setting Modified Files: -------------- webwork2/lib/WeBWorK/Utils: DelayedMailer.pm webwork2/conf: global.conf.dist Revision Data ------------- Index: DelayedMailer.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils/DelayedMailer.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -Llib/WeBWorK/Utils/DelayedMailer.pm -Llib/WeBWorK/Utils/DelayedMailer.pm -u -r1.2 -r1.3 --- lib/WeBWorK/Utils/DelayedMailer.pm +++ lib/WeBWorK/Utils/DelayedMailer.pm @@ -33,6 +33,7 @@ # SMTP settings $$self{smtp_server} = $options{smtp_server}; $$self{smtp_sender} = $options{smtp_sender}; + $$self{smtp_timeout} = $options{smtp_timeout}; # extra headers $$self{headers} = $options{headers}; @@ -88,7 +89,7 @@ return unless @{$$self{msgs}}; - my $smtp = new Net::SMTP($$self{smtp_server}, Timeout=>10) + my $smtp = new Net::SMTP($$self{smtp_server}, Timeout=>$$self{smtp_timeout}) or die "failed to create Net::SMTP object"; my @results; Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.202 retrieving revision 1.203 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.202 -r1.203 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -98,6 +98,9 @@ # a valid mail domain, or at least be well-formed. $mail{smtpSender} = 'we...@yo...'; +# Seconds to wait before timing out when connecting to the SMTP server. +$mail{smtpTimeout} = 30; + # AllowedRecipients defines addresses that the PG system is allowed to send mail # to. this prevents subtle PG exploits. This should be set in course.conf to the # addresses of professors of each course. Sending mail from the PG system (i.e. |
From: dpvc v. a. <we...@ma...> - 2008-02-04 21:53:01
|
Log Message: ----------- Fixed problem with variable patterns for variable names that are more than one character long. Modified Files: -------------- pg/macros: PGfunctionevaluators.pl Revision Data ------------- Index: PGfunctionevaluators.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGfunctionevaluators.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -Lmacros/PGfunctionevaluators.pl -Lmacros/PGfunctionevaluators.pl -u -r1.2 -r1.3 --- macros/PGfunctionevaluators.pl +++ macros/PGfunctionevaluators.pl @@ -726,14 +726,7 @@ # Add the variables and parameters to the context # my %variables; my $x; - foreach $x (@{$func_params{'var'}}) { - if (length($x) > 1) { - $context->{_variables}->{pattern} = $context->{_variables}->{namePattern} = - $x . '|' . $context->{_variables}->{pattern}; - $context->update; - } - $variables{$x} = 'Real'; - } + foreach $x (@{$func_params{'var'}}) {$variables{$x} = 'Real'} foreach $x (@{$func_params{'params'}}) {$variables{$x} = 'Parameter'} $context->variables->are(%variables); |
From: dpvc v. a. <we...@ma...> - 2008-01-31 14:38:37
|
Log Message: ----------- Fixed differentiation of log() function (it used to give an error about undefined function D_ln). Modified Files: -------------- pg/lib/Parser: Differentiation.pm Revision Data ------------- Index: Differentiation.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Differentiation.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -Llib/Parser/Differentiation.pm -Llib/Parser/Differentiation.pm -u -r1.14 -r1.15 --- lib/Parser/Differentiation.pm +++ lib/Parser/Differentiation.pm @@ -536,9 +536,9 @@ } sub Parser::Function::numeric::D_log { - my $self = $_[0]; + my $self = shift; my $base10 = $self->{equation}{context}{flags}{useBaseTenLog}; - if ($base10) {return D_log10(@_)} else {return D_ln(@_)} + if ($base10) {return $self->D_log10(@_)} else {return $self->D_ln(@_)} } sub Parser::Function::numeric::D_log10 { |
From: dpvc v. a. <we...@ma...> - 2008-01-26 01:52:11
|
Log Message: ----------- Added trimTrailingZeros flag to allow values to print as $50 rather than $50.00 Modified Files: -------------- pg/macros: contextCurrency.pl Revision Data ------------- Index: contextCurrency.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextCurrency.pl,v retrieving revision 1.14 retrieving revision 1.15 diff -Lmacros/contextCurrency.pl -Lmacros/contextCurrency.pl -u -r1.14 -r1.15 --- macros/contextCurrency.pl +++ macros/contextCurrency.pl @@ -133,6 +133,19 @@ If forceDecimals is set to 1 at the same time, then they must have 2 or more decimals, otherwise any number is OK. +By default, currency values are always formatted to display using +two decimal places, but you can request that if the decimals would be +.00 then they should not be displayed. This is controlled via the +trimTrailingZeros context flag: + + Context()->flags->set(trimTrailingZeros=>1); + +It can also be set on an individual currency value: + + $m = Compute("$50")->with(trimtrailingZeros=>1); + +so that this $m will print as $50 rather than $50.00. + =cut loadMacros("MathObjects.pl"); @@ -227,6 +240,7 @@ forceCommas => 0, forceDecimals => 0, noExtraDecimals => 1, + trimTrailingZeros => 0, ); $context->{_initialized} = 1; $context->update; @@ -475,8 +489,9 @@ $symbol = $self->context->operators->get($symbol)->{$type} || $symbol; $comma = "{$comma}" if $type eq 'TeX'; my $s = main::prfmt($self->value,"%.2f"); + $s =~ s/\.00// if $self->getFlag('trimTrailingZeros'); $s =~ s/\./$decimal/; - while ($s =~ s/(\d)(\d\d\d\D)/$1$comma$2/) {} + while ($s =~ s/(\d)(\d\d\d(:\D|$))/$1$comma$2/) {} $s = ($currency->{associativity} eq "right" ? $s.$symbol : $symbol.$s); $s =~ s/^\s+|\s+$//g; return $s; |
From: dpvc v. a. <we...@ma...> - 2008-01-25 23:46:02
|
Log Message: ----------- Add "disabled" previous and next buttons so that a student who clicks on the next button on the first problem and then clicks again (expecting another next) doesn't get "up" by accident. Modified Files: -------------- webwork2/lib/WeBWorK: ContentGenerator.pm webwork2/lib/WeBWorK/ContentGenerator: Problem.pm Revision Data ------------- Index: ContentGenerator.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator.pm,v retrieving revision 1.192 retrieving revision 1.193 diff -Llib/WeBWorK/ContentGenerator.pm -Llib/WeBWorK/ContentGenerator.pm -u -r1.192 -r1.193 --- lib/WeBWorK/ContentGenerator.pm +++ lib/WeBWorK/ContentGenerator.pm @@ -549,7 +549,7 @@ # grab some interesting data from the request my $courseID = $urlpath->arg("courseID"); my $userID = $r->param('user'); - my $eUserID = $r->param("effectiveUser"); + my $eUserID = $r->param("effectiveUser"); my $setID = $urlpath->arg("setID"); my $problemID = $urlpath->arg("problemID"); @@ -1297,29 +1297,29 @@ my $r = $self->r; my $ce = $r->ce; my %args = %$args; - + my $auth = $self->url_authen_args; my $prefix = $ce->{webworkURLs}->{htdocs}."/images"; - + my @result; while (@links) { my $name = shift @links; my $url = shift @links; my $img = shift @links; my $html = - ($img && $args{style} eq "images") + ($img && $args{style} eq "images") ? CGI::img( - {src=>($prefix."/".$img.$args{imagesuffix}), + {src=>($prefix."/".$img.$args{imagesuffix}), border=>"", alt=>"$name"}) : $name; - unless($img && !$url) { +# unless($img && !$url) { ## these are now "disabled" versions in grey -- DPVC push @result, $url ? CGI::a({-href=>"$url?$auth$tail"}, $html) : $html; - } +# } } - + return join($args{separator}, @result) . "\n"; } @@ -1519,7 +1519,7 @@ sub hidden_authen_fields { my ($self) = @_; - return $self->hidden_fields("user", "effectiveUser", "key"); + return $self->hidden_fields("user", "effectiveUser", "key", "theme"); } =item hidden_proctor_authen_fields() @@ -1590,7 +1590,7 @@ sub url_authen_args { my ($self) = @_; - return $self->url_args("user", "effectiveUser", "key"); + return $self->url_args("user", "effectiveUser", "key", "theme"); } =item url_state_args() @@ -1728,6 +1728,7 @@ $params{user} = undef unless exists $params{user}; $params{effectiveUser} = undef unless exists $params{effectiveUser}; $params{key} = undef unless exists $params{key}; + $params{theme} = undef unless exists $params{theme}; } my $url; Index: Problem.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm,v retrieving revision 1.210 retrieving revision 1.211 diff -Llib/WeBWorK/ContentGenerator/Problem.pm -Llib/WeBWorK/ContentGenerator/Problem.pm -u -r1.210 -r1.211 --- lib/WeBWorK/ContentGenerator/Problem.pm +++ lib/WeBWorK/ContentGenerator/Problem.pm @@ -737,7 +737,7 @@ courseID => $courseID, setID => $setID, problemID => $prevID); push @links, "Previous Problem", $r->location . $prevPage->path, "navPrev"; } else { - push @links, "Previous Problem", "", "navPrev"; + push @links, "Previous Problem", "", "navPrevGrey"; } push @links, "Problem List", $r->location . $urlpath->parent->path, "navProbList"; @@ -747,7 +747,7 @@ courseID => $courseID, setID => $setID, problemID => $nextID); push @links, "Next Problem", $r->location . $nextPage->path, "navNext"; } else { - push @links, "Next Problem", "", "navNext"; + push @links, "Next Problem", "", "navNextGrey"; } my $tail = ""; |
From: dpvc v. a. <we...@ma...> - 2008-01-25 23:44:50
|
Log Message: ----------- New images needed for disabled buttons. Added Files: ----------- webwork2/htdocs/images: navNextGrey.gif navPrevGrey.gif Revision Data ------------- |
From: Sam H. v. a. <we...@ma...> - 2008-01-24 15:56:22
|
Log Message: ----------- use monobook-like look and feel fix some problems with indexing "module_version--subdir" dirs Modified Files: -------------- admintools: ww-make-docs ww-make-docs-from-cvs Revision Data ------------- Index: ww-make-docs =================================================================== RCS file: /webwork/cvs/system/admintools/ww-make-docs,v retrieving revision 1.6 retrieving revision 1.7 diff -Lww-make-docs -Lww-make-docs -u -r1.6 -r1.7 --- ww-make-docs +++ ww-make-docs @@ -15,6 +15,7 @@ use Data::Dumper; our @sections = ( + '/' => "(root)", bin => "Scripts", conf => "Config Files", doc => "Documentation", @@ -117,7 +118,17 @@ my $html_path = "$html_dir/$filename"; my $html_rel_path = defined $subdir ? "$subdir/$filename" : $filename; - #print "$pod_path - $pod_name\n"; + # deal with potential + if (not defined $subdir) { + my $source_root_last = $source_root; + $source_root_last =~ s|^.*/||; + if ($source_root_last =~ /^(.+)_(.+?)(?:--(.*))?$/) { + my ($module, $version, $extra) = ($1, $2, $3); + $subdir = $extra; # the subdir is appended to the dir name + } else { + $subdir = '/'; # fake subdir for "things in the root" + } + } $self->update_index($subdir, $html_rel_path, $pod_name); #my $podpp_path = do_podpp($pod_path); do_mkdir($html_dir); @@ -130,6 +141,45 @@ html_path => $html_path, ); #unlink $podpp_path; + # postprocess HTML to add SSI tags for header and footer + $self->postprocess_pod($html_path); +} + +sub postprocess_pod { + my ($self, $file) = @_; + my $fh = new IO::File($file, 'r+') + or die "Failed to open file '$file' for reading/writing: $!\n"; + my $title; + my $text = ""; + my $in_body = 0; + while (my $line = <$fh>) { + if ($in_body) { + if ($line =~ /^\s*<\/body>\s*$/) { + $in_body = 0; + next; + } + if ($line =~ /^\s*<hr \/>\s*$/) { + next; + } + $text .= $line; + } else { + if ($line =~ /^\s*<body.*>\s*$/) { + $in_body = 1; + next; + } + if ($line =~ /\s*<title>(.*)<\/title>.*$/) { + $title = $1; + } + } + } + seek $fh, 0, 0; + truncate $fh, 0; + print $fh "<!--#set var=\"title\" value=\"$title\" -->", "\n" if defined $title; + print $fh '<!--#include virtual="/doc/cvs/header.html" -->' . "\n"; + print $fh $text; + print $fh '<!--#include virtual="/doc/cvs/footer.html" -->' . "\n"; + my $mode = (stat $fh)[2] & 0777 | 0111; + chmod $mode, $fh; } sub update_index { @@ -151,11 +201,16 @@ my $section_order = $self->{section_order}; my $source_root = $self->{source_root}; $source_root =~ s|^.*/||; + my $dest_url = $self->{dest_url}; #print Dumper($idx); - my $header = "<html><head><title>Index $source_root</title></head><body>\n"; - my $content_start = "<h1>Index for $source_root</h1><ul>\n"; + #my $header = "<html><head><title>Index $source_root</title></head><body>\n"; + #my $content_start = "<h1>Index for $source_root</h1><ul>\n"; + + my $header = qq|<!--#set var="title" value="Index for $source_root" -->| . "\n" + . '<!--#include virtual="/doc/cvs/header.html" -->' . "\n"; + my $content_start = "<ul>"; my $content = ""; foreach my $section (@$section_order) { @@ -163,21 +218,27 @@ my $section_name = $sections->{$section}; $content_start .= "<li><a href=\"#$section\">$section_name</a></li>\n"; my @files = sort @{$idx->{$section}}; - $content .= "<h2><a name=\"$section\">$section_name</a></h2><ul>\n"; + $content .= "<a name=\"$section\"></a>\n"; + $content .= "<h2>$section_name</h2><ul>\n"; foreach my $file (sort { $a->[1] cmp $b->[1] } @files) { my ($path, $name) = @$file; $content .= "<li><a href=\"$path\">$name</a></li>\n"; } - $content .= "</ul><hr/>\n"; + #$content .= "</ul><hr/>\n"; + $content .= "</ul>\n"; } - $content_start .= "</ul><hr/>\n"; + $content_start .= "</ul>\n"; my $date = strftime "%a %b %e %H:%M:%S %Z %Y", localtime; - my $content_end = "<p>Generated $date</p>\n"; - my $footer = "</body></html>\n"; + #my $content_end = "<p>Generated $date</p>\n"; + #my $footer = "</body></html>\n"; + my $content_end = ""; + my $footer = '<!--#include virtual="/doc/cvs/footer.html" -->' . "\n"; my $fh = new IO::File($out_path, 'w') or die "Failed to open index '$out_path' for writing: $!\n"; print $fh $header, $content_start, $content, $content_end, $footer; + my $mode = (stat $fh)[2] & 0777 | 0111; + chmod $mode, $fh; } sub do_podpp { @@ -213,7 +274,7 @@ "--infile=$o{pod_path}", "--outfile=$o{html_path}", '--recurse', - '--header', + '--noheader', ); #print join(" ", 'pod2html', @args), "\n"; pod2html(@args); Index: ww-make-docs-from-cvs =================================================================== RCS file: /webwork/cvs/system/admintools/ww-make-docs-from-cvs,v retrieving revision 1.5 retrieving revision 1.6 diff -Lww-make-docs-from-cvs -Lww-make-docs-from-cvs -u -r1.5 -r1.6 --- ww-make-docs-from-cvs +++ ww-make-docs-from-cvs @@ -39,6 +39,8 @@ our $WW_MAKE_DOCS = '/home/sh002i/work/admintools/ww-make-docs'; #our $WW_MAKE_DOCS = '/home/sam/work/admintools/ww-make-docs'; +our $BASE_URL = 'http://webwork.maa.org/doc/cvs'; + our $v; # for verbose switch my @dirs; @@ -62,9 +64,27 @@ } } -my $fh = new IO::File("$DOC_DIR/index.html", 'w') - or die "failed to open '$DOC_DIR/index.html' for writing: $!\n"; -write_index($fh); +{ + my $fh = new IO::File("$DOC_DIR/index.html", 'w') + or die "failed to open '$DOC_DIR/index.html' for writing: $!\n"; + write_index_new($fh); + my $mode = (stat $fh)[2] & 0777 | 0111; + chmod $mode, $fh; +} +{ + my $fh = new IO::File("$DOC_DIR/header.html", 'w') + or die "failed to open '$DOC_DIR/header.html' for writing: $!\n"; + write_header($fh); + my $mode = (stat $fh)[2] & 0777 | 0111; + chmod $mode, $fh; +} +{ + my $fh = new IO::File("$DOC_DIR/footer.html", 'w') + or die "failed to open '$DOC_DIR/footer.html' for writing: $!\n"; + write_footer($fh); + my $mode = (stat $fh)[2] & 0777 | 0111; + chmod $mode, $fh; +} sub update_cvs { my ($dir) = @_; @@ -86,7 +106,7 @@ die "/bin/mkdir -p $dest_dir failed (exit=$exit signal=$signal core=$core)\n"; } - system $WW_MAKE_DOCS, $source_dir, $dest_dir; + system $WW_MAKE_DOCS, $source_dir, $dest_dir;#, $BASE_URL; if ($?) { my $exit = $? >> 8; my $signal = $? & 127; @@ -124,7 +144,7 @@ $index{$module}{$version} = $dir; } } else { - warn "unfamiliary dir format '$dir' -- not adding to index.\n"; + warn "unfamiliar dir format '$dir' -- not adding to index.\n"; } } @@ -154,3 +174,109 @@ print $fh "</body></html>\n"; } } + +sub write_index_new { + my $fh = shift; + print $fh <<'EOF'; +<!--#set var="title" value="Main Menu" --> +<!--#include virtual="/doc/cvs/header.html" --> +<p>Chose a product and version from the menu to the left.</p> +<!--#include virtual="/doc/cvs/footer.html" --> +EOF +} + +sub write_header { + my $fh = shift; + print $fh <<'EOF'; +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> + <head> + <!-- <base href="http://webwork.maa.org/" /> --> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <link rel="shortcut icon" href="/favicon.ico" /> + <!--#if expr="$title" --> + <title><!--#echo var="title" --> - WeBWorKDocs</title> + <!--#else --> + <title>WeBWorKDocs</title> + <!--#endif --> + <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "/wiki/skins/monobook/main.css?42b"; /*]]>*/</style> + <link rel="stylesheet" type="text/css" media="print" href="/wiki/skins/common/commonPrint.css?42b" /> + <link rel="stylesheet" type="text/css" media="handheld" href="/wiki/skins/monobook/handheld.css?42b" /> + <!--[if lt IE 5.5000]><style type="text/css">@import "/wiki/skins/monobook/IE50Fixes.css?42b";</style><![endif]--> + <!--[if IE 5.5000]><style type="text/css">@import "/wiki/skins/monobook/IE55Fixes.css?42b";</style><![endif]--> + <!--[if IE 6]><style type="text/css">@import "/wiki/skins/monobook/IE60Fixes.css?42b";</style><![endif]--> + <!--[if IE 7]><style type="text/css">@import "/wiki/skins/monobook/IE70Fixes.css?42b";</style><![endif]--> + <!--[if lt IE 7]><script type="text/javascript" src="/wiki/skins/common/IEFixes.js?42b"></script> + <meta http-equiv="imagetoolbar" content="no" /><![endif]--> + </head> + <body class="mediawiki ns-0 ltr page-Main_Page"> + <div id="globalWrapper"> + <div id="column-content"> + <div id="content"> + <a name="top" id="top"></a> + <!--#if expr="$title" --> + <h1 class="firstHeading"><!--#echo var="title" --></h1> + <!--#endif --> + <div id="bodyContent"> + <h3 id="siteSub">From WeBWorK</h3> + <div id="contentSub"></div> + <div id="jump-to-nav">Jump to: <a href="#column-one">navigation</a></div> + <!-- <base href="http://devel.webwork.rochester.edu/doc/cvs/" /> --> + <!-- start content --> +EOF +} + +sub write_footer { + my $fh = shift; + print $fh <<'EOF'; + <!-- end content --> + <!-- <base href="http://webwork.maa.org/" /> --> + <div class="visualClear"></div> + </div> + </div> + </div> + <div id="column-one"> + <div class="portlet" id="p-logo"> + <a style="background-image: url(/webwork2_files/images/webwork_square.png);" href="/wiki/Main_Page" title="Main Page"></a> + </div> + <script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script> + <div class='portlet' id='p-navigation-$module'> + <h5>Navigation</h5> + <div class='pBody'> + <ul> + <li><a href="/doc/cvs/">CVS Docs Home</a></li> + <li><a href="/wiki/Main_Page">WeBWorK Wiki</a></li> + <li><a href="/">WeBWorK Home</a></li> + </ul> + </div> + </div> +EOF + for my $module (sort keys %index) { + print $fh "<div class='portlet' id='p-navigation-$module'>\n"; + print $fh "<h5>$module</h5>\n"; + print $fh "<div class='pBody'>\n"; + print $fh "<ul>\n"; + for my $version (reverse sort keys %{$index{$module}}) { + if (ref $index{$module}{$version}) { + print $fh "<li>$version<ul>\n"; + for my $extra (sort keys %{$index{$module}{$version}}) { + print $fh "<li><a href=\"$BASE_URL/$index{$module}{$version}{$extra}\">$extra</a></li>\n"; + } + print $fh "</ul></li>\n"; + } else { + print $fh "<li><a href=\"$BASE_URL/$index{$module}{$version}\">$version</a></li>\n"; + } + } + print $fh "</ul>\n"; + print $fh "</div></div>\n"; + } + print $fh <<'EOF'; + </div><!-- end of the left (by default at least) column --> + <div class="visualClear"></div> + <script type="text/javascript">if (window.runOnloadHook) runOnloadHook();</script> + </div> + </body> +</html> + +EOF +} |
From: Mike G. v. a. <we...@ma...> - 2008-01-24 04:03:45
|
Log Message: ----------- Fixed posting of events to calendar. For now only due date is posted -- that is probably all that is needed Calendar is not updated until something triggers wwassign's update subroutine The cron job will trigger this if nothing else does. Currently webwork cannot trigger the update directly. Modified Files: -------------- wwmoodle/wwassignment3/moodle/mod/wwassignment: lib.php locallib.php Revision Data ------------- Index: lib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment3/moodle/mod/wwassignment/lib.php,v retrieving revision 1.2 retrieving revision 1.3 diff -Lwwassignment3/moodle/mod/wwassignment/lib.php -Lwwassignment3/moodle/mod/wwassignment/lib.php -u -r1.2 -r1.3 --- wwassignment3/moodle/mod/wwassignment/lib.php +++ wwassignment3/moodle/mod/wwassignment/lib.php @@ -1,5 +1,7 @@ <?php +require_once("locallib.php"); + //////////////////////////////////////////////////////////////// //Functions that are called by the Moodle System //////////////////////////////////////////////////////////////// @@ -28,7 +30,7 @@ $returnid = insert_record('wwassignment',$wwassignment); //Creating events - _wwassignment_create_events($wwsetname,$wwassignment->id,$wwsetdata['open_date'],$wwsetdata['due_date']); + _wwassignment_create_events($wwsetname,$wwassignment,$wwsetdata['open_date'],$wwsetdata['due_date']); return $returnid; } @@ -39,11 +41,10 @@ * @return integer The result of the update_record function. */ function wwassignment_update_instance($wwassignment) { - global $COURSE; - + //error_log("updating instance".$wwassignment->id); //checking mappings $wwclient = new wwassignment_client(); - $wwcoursename = _wwassignment_mapped_course($COURSE->id,false); + $wwcoursename = _wwassignment_mapped_course($wwassignment->course,false); $wwsetname = $wwassignment->webwork_set; //get data from WeBWorK @@ -52,8 +53,8 @@ $returnid = update_record('wwassignment',$wwassignment); - _wwassignment_delete_events($wwassignment->id); - _wwassignment_create_events($wwsetname,$wwassignment->id,$wwsetdata['open_date'],$wwsetdata['due_date']); + _wwassignment_delete_events($wwassignment); + _wwassignment_create_events($wwsetname,$wwassignment,$wwsetdata['open_date'],$wwsetdata['due_date']); return $returnid; } @@ -177,10 +178,46 @@ * @desc Function that is run by the cron job. This makes sure that all data is pushed to webwork. */ function wwassignment_cron() { + // refresh wwassignment events in all courses. + wwassignment_refresh_events(); + //error_log("cron: update instance has been called"); //FIXME: Add a call that updates all events with dates (in case people forgot to push) return true; } +/** + * Make sure up-to-date events are created for all assignment instances + * + * This standard function will check all instances of this module + * and make sure there are up-to-date events created for each of them. + * If courseid = 0, then every assignment event in the site is checked, else + * only assignment events belonging to the course specified are checked. + * This function is used, in its new format, by restore_refresh_events() + * + * @param $courseid int optional If zero then all assignments for all courses are covered + * @return boolean Always returns true + */ + +function wwassignment_refresh_events($courseid = 0) { + + if ($courseid == 0) { + if (! $wwassignments = get_records("wwassignment")) { + return true; + } + } else { + if (! $wwassignments = get_records("wwassignment", "course", $courseid)) { + return true; + } + } + $moduleid = get_field('modules', 'id', 'name', 'wwassignment'); + //error_log("assignments ". count($wwassignments)); + foreach($wwassignments as $key => $wwassignment) { + //error_log("updating events for ".$wwassignment->id); + wwassignment_update_instance($wwassignment); + + } + return true; +} /** @@ -188,17 +225,14 @@ * @param string $wwassignmentid The Moodle wwassignment ID. * @return array An array of course users (IDs). */ -/*function wwassignment_get_participants($wwassignmentid) { +/* +function wwassignment_get_participants($wwassignmentid) { $wwassignment = get_record('wwassignment', 'id', $wwassignmentid); if(!isset($wwassignment)) { return array(); } return get_course_users($wwassignment->course); } - -function wwassignment_refresh_events($courseid = 0) { - error_log('wwassignment_refresh_events called'); - return true; -}*/ +*/ ?> \ No newline at end of file Index: locallib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment3/moodle/mod/wwassignment/locallib.php,v retrieving revision 1.4 retrieving revision 1.5 diff -Lwwassignment3/moodle/mod/wwassignment/locallib.php -Lwwassignment3/moodle/mod/wwassignment/locallib.php -u -r1.4 -r1.5 --- wwassignment3/moodle/mod/wwassignment/locallib.php +++ wwassignment3/moodle/mod/wwassignment/locallib.php @@ -2,7 +2,7 @@ require_once("$CFG->libdir/soap/nusoap.php"); -define(WWASSIGNMENT_DEBUG,0); +DEFINE('WWASSIGNMENT_DEBUG',0); ////////////////////////////////////////////////////////////////// //EVENT CREATION AND DELETION @@ -16,37 +16,39 @@ * @param $duedate integer The UNIX timestamp of the due date. * @return integer 0 on success. -1 on error. */ -function _wwassignment_create_events($wwsetname,$wwassignmentid,$opendate,$duedate) { +function _wwassignment_create_events($wwsetname,$wwassignment,$opendate,$duedate) { global $COURSE; unset($event); $event->name = $wwsetname; $event->description = 'WeBWorK Set Event'; - $event->courseid = $COURSE->id; + $event->courseid = $wwassignment->course; $event->groupid = 0; $event->userid = 0; $event->format = 1; $event->modulename = 'wwassignment'; - $event->instance = $wwassignmentid; + $event->instance = $wwassignment->id; $event->visible = 1; - $openevent = $event; + // FIXME -- this doesn't create a new object we'll just handle the due date for now + // what you want is $openevent = clone $event this makes a shallow copy of the object + //$openevent = $event; + // FIXME -- it's likely that only the due date needs to be posted. once that is sure, clean this up. $dueevent = $event; - $openevent->name .= ' is Open.'; - $openevent->eventtype = 'open'; - $openevent->timestart = $opendate; - $openevent->timeduration = $duedate - $opendate; + //$openevent->name .= ' is Open.'; + //$openevent->eventtype = 'open'; + //$openevent->timestart = $opendate; + //$openevent->timeduration = $duedate - $opendate; $dueevent->name .= ' is Due.'; $dueevent->eventtype = 'due'; $dueevent->timestart = $duedate; $dueevent->timeduration = 1; - - + // error_log("adding a due event"); $result = 0; - if(!add_event($openevent)) { - $result = -1; - } + //if(!add_event($openevent)) { + // $result = -1; + //} if(!add_event($dueevent)) { $result = -1; } @@ -59,9 +61,11 @@ * @param $wwassignmentid integer The wwassignment ID. * @return integer 0 on success */ -function _wwassignment_delete_events($wwassignmentid) { +function _wwassignment_delete_events($wwassignment) { + $wwassignmentid = $wwassignment->id; if ($events = get_records_select('event', "modulename = 'wwassignment' and instance = '$wwassignmentid'")) { foreach($events as $event) { + // error_log("deleting event ".$event->id); delete_event($event->id); } } @@ -492,7 +496,41 @@ 'password' => $userdata->password))); return 1; } - + /** 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. + */ + function update_user($webworkcourse,&$userdata,$permission='0') { + $studentid = $userid; + # FIXME: find permission for this user and set permissions appropriately in webwork + # FIXME: find the group(s) that this person is a member of + # FIXME: I have used the following scheme: gage_SEC use groups ending like this to determine sections in webwork + # FIXME: use ordinary groups taName to correspond to recitation sections in WeBWorK + # + # FIXME: make it so an update_user function is called whenever the user data in moodle is changed + # FIXME: so if a student switches groups this is reflected in WeBWorK + # do get_user first to get current status then update this?? + $this->handler('put_user',array('courseName' => $webworkcourse, 'record' => array( + //'user_id' => $userdata->username, // can't update this + 'first_name' => $userdata->firstname, + 'last_name' => $userdata->lastname, + 'email_address' => $userdata->email, + 'student_id' => $studentid, + //'status' => 'C', //can you update this from moodle? + 'section' => '', + 'recitation' => '', + 'comment' => 'moodle updated user'))); + $this->handler('add_permission',array('courseName' => $webworkcourse,'record' => array( + 'user_id' => $userdata->username, + 'permission' => $permission))); + $this->handler('add_password',array('courseName' => $webworkcourse,'record' => array( + 'user_id' => $userdata->username, + 'password' => $userdata->password))); + return 1; + } /** * @desc Creates a user set in WeBWorK * @param string $webworkcourse The webwork course name. |
From: dpvc v. a. <we...@ma...> - 2008-01-16 23:07:41
|
Log Message: ----------- Make sure Currency() actually returns a Currency object (it used to return a Real if one was passed to it). Modified Files: -------------- pg/macros: contextCurrency.pl Revision Data ------------- Index: contextCurrency.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextCurrency.pl,v retrieving revision 1.13 retrieving revision 1.14 diff -Lmacros/contextCurrency.pl -Lmacros/contextCurrency.pl -u -r1.13 -r1.14 --- macros/contextCurrency.pl +++ macros/contextCurrency.pl @@ -444,19 +444,19 @@ # produce an error message. # sub new { - my $self = shift; + my $self = shift; my $class = ref($self) || $self; my $context = (Value::isContext($_[0]) ? shift : $self->context); my $x = shift; Value::Error("Can't convert %s to a monitary value",lc(Value::showClass($x))) if !$self->getFlag("promoteReals",1) && Value::isRealNumber($x) && !Value::classMatch($x,"Currency"); - $self = $self->SUPER::new($context,$x,@_); + $self = bless $self->SUPER::new($context,$x,@_), $class; $self->{isReal} = $self->{isValue} = $self->{isCurrency} = 1; return $self; } sub make { - my $self = shift; - $self = $self->SUPER::make(@_); + my $self = shift; my $class = ref($self) || $self; + $self = bless $self->SUPER::make(@_), $class; $self->{isReal} = $self->{isValue} = $self->{isCurrency} = 1; return $self; } |
From: dpvc v. a. <we...@ma...> - 2008-01-16 23:03:12
|
Log Message: ----------- Make sure that real and complex values have their contexts changed if one is specified in the call to new(). Modified Files: -------------- pg/lib/Value: Complex.pm Real.pm Revision Data ------------- Index: Real.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Real.pm,v retrieving revision 1.40 retrieving revision 1.41 diff -Llib/Value/Real.pm -Llib/Value/Real.pm -u -r1.40 -r1.41 --- lib/Value/Real.pm +++ lib/Value/Real.pm @@ -17,7 +17,7 @@ my $self = shift; my $class = ref($self) || $self; my $context = (Value::isContext($_[0]) ? shift : $self->context); my $x = shift; $x = [$x,@_] if scalar(@_) > 0; - return $x if Value::isReal($x); + return $x->inContext($context) if Value::isReal($x); $x = [$x] unless ref($x) eq 'ARRAY'; Value::Error("Can't convert ARRAY of length %d to %s",scalar(@{$x}),Value::showClass($self)) unless (scalar(@{$x}) == 1); Index: Complex.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Complex.pm,v retrieving revision 1.35 retrieving revision 1.36 diff -Llib/Value/Complex.pm -Llib/Value/Complex.pm -u -r1.35 -r1.36 --- lib/Value/Complex.pm +++ lib/Value/Complex.pm @@ -19,7 +19,7 @@ my $self = shift; my $class = ref($self) || $self; my $context = (Value::isContext($_[0]) ? shift : $self->context); my $x = shift; $x = [$x,@_] if scalar(@_) > 0; - return $x if Value::isComplex($x) || (Value::isFormula($x) && $x->{tree}->isComplex); + return $x->inContext($context) if Value::isComplex($x) || (Value::isFormula($x) && $x->{tree}->isComplex); $x = $x->data if Value::isReal($x); $x = [$x] unless ref($x) eq 'ARRAY'; $x->[1] = 0 unless defined($x->[1]); Value::Error("Can't convert ARRAY of length %d to a Complex Number",scalar(@{$x})) |
From: Gavin L. v. a. <we...@ma...> - 2008-01-14 18:20:53
|
Log Message: ----------- Fix dropped last value in problem definition lines when importing from a set definition file. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: ProblemSetList.pm Revision Data ------------- Index: ProblemSetList.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm,v retrieving revision 1.105 retrieving revision 1.106 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm -u -r1.105 -r1.106 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm @@ -1733,8 +1733,10 @@ $curr .= $c; } } - ($name, $value, $attemptLimit, $continueFlag) = @line; + ## anything left? + push(@line, $curr) if ( $curr ); + ($name, $value, $attemptLimit, $continueFlag) = @line; ##################### # clean up problem values ########################### |
From: Mike G. v. a. <we...@ma...> - 2008-01-08 14:55:05
|
Log Message: ----------- fixed spelling of received :-) 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.55 retrieving revision 1.56 diff -Llib/WeBWorK/Constants.pm -Llib/WeBWorK/Constants.pm -u -r1.55 -r1.56 --- lib/WeBWorK/Constants.pm +++ lib/WeBWorK/Constants.pm @@ -283,7 +283,7 @@ type => 'number' }, { var => 'mail{allowedRecipients}', - doc => 'E-mail addresses which can recieve e-mail from a pg problem', + doc => 'E-mail addresses which can receive e-mail from a pg problem', doc2 => 'List of e-mail addresses to which e-mail can be sent by a problem. Professors need to be added to this list if questionaires are used, or other WeBWorK problems which send e-mail as part of their answer mechanism.', type => 'list'}, { var => 'permissionLevels{receive_feedback}', |
From: Mike G. v. a. <we...@ma...> - 2008-01-03 15:28:33
|
Log Message: ----------- Fixed bug. Pass variables in $foo = FlashApplet(...) to the actual applet creator Modified Files: -------------- pg/macros: AppletObjects.pl Revision Data ------------- Index: AppletObjects.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/AppletObjects.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -Lmacros/AppletObjects.pl -Lmacros/AppletObjects.pl -u -r1.2 -r1.3 --- macros/AppletObjects.pl +++ macros/AppletObjects.pl @@ -42,7 +42,7 @@ =cut sub FlashApplet { - return new FlashApplet(); + return new FlashApplet(@_); } |
From: Mike G. v. a. <we...@ma...> - 2007-12-24 01:42:20
|
Log Message: ----------- added check for Exception::Class Modified Files: -------------- webwork-modperl/bin: check_modules.pl Revision Data ------------- Index: check_modules.pl =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/bin/check_modules.pl,v retrieving revision 1.15 retrieving revision 1.16 diff -Lbin/check_modules.pl -Lbin/check_modules.pl -u -r1.15 -r1.16 --- bin/check_modules.pl +++ bin/check_modules.pl @@ -49,6 +49,7 @@ Digest::MD5 Email::Address Errno + Exception::Class File::Copy File::Find File::Path |
From: Mike G. v. a. <we...@ma...> - 2007-12-20 00:18:32
|
Log Message: ----------- remove \ensuremath from around the output. I don't think it will work properly (although it might have worked with LatexToHTML) Modified Files: -------------- pg/lib: Fraction.pm Revision Data ------------- Index: Fraction.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Fraction.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -Llib/Fraction.pm -Llib/Fraction.pm -u -r1.2 -r1.3 --- lib/Fraction.pm +++ lib/Fraction.pm @@ -313,13 +313,13 @@ } # positive fraction: print out in plain math mode elsif ($self->scalar > 0) { - $out = "\\ensuremath{ \\frac{$self->{numerator}}{$self->{denominator}} }"; + $out = " \\frac{$self->{numerator}}{$self->{denominator}} "; } # negative fraction: print out negative sign and then absolute value in # fraction form, avoiding parenthesis around the negative portion. else { my $foo = -$self->{numerator}; - $out = "\\ensuremath{ -\\frac{$foo}{$self->{denominator}} }"; + $out = " -\\frac{$foo}{$self->{denominator}} "; } $out; @@ -341,8 +341,8 @@ my $coeff = int($tempNum/$tempDenom); $tempNum = $tempNum % $tempDenom; - $out = "\\ensuremath{ -$coeff \\frac{abs($tempNum)}{abs($tempDenom)} }" if ($self->scalar < 0); - $out = "\\ensuremath{ $coeff \\frac{$tempNum}{$tempDenom} }" if ($self->scalar > 0); + $out = " -$coeff \\frac{abs($tempNum)}{abs($tempDenom)} " if ($self->scalar < 0); + $out = " $coeff \\frac{$tempNum}{$tempDenom} " if ($self->scalar > 0); $out = $coeff if ($tempNum == 0); } |
From: Mike G. v. a. <we...@ma...> - 2007-12-20 00:15:02
|
Log Message: ----------- Updated documentation. Fixed a hard coded reference in the DEFAULT_OBJECT_TEXT. Added getQE(name) for referencing HTML elements in PG questions. Added listQuestionElements() for discovering the names/ids of input HTML elements in PG questions. Modified Files: -------------- pg/lib: Applet.pm Revision Data ------------- Index: Applet.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Applet.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -Llib/Applet.pm -Llib/Applet.pm -u -r1.3 -r1.4 --- lib/Applet.pm +++ lib/Applet.pm @@ -24,7 +24,8 @@ # Create link to applet ################################### my $appletName = "LineThruPointsWW"; - $applet = new FlashApplet( + $applet = new FlashApplet( + # can be replaced by $applet =FlashApplet() when using AppletObjects.pl codebase => findAppletCodebase("$appletName.swf"), appletName => $appletName, appletId => $appletName, @@ -94,6 +95,38 @@ use MIME::Base64 qw( encode_base64 decode_base64); + +=head2 Default javaScript functions placed in header + +These functions are automatically defined for use for +any javaScript placed in the text of a PG question. + + getFlashMovie(appletName) -- finds the applet path in the DOM + + submitAction() -- calls the submit action of the applet + -- the submitAction is defined + + initialize() -- calls the initialize action of the applet + + getQE(name) -- gets an HTML element of the question by name + or by id. Be sure to keep all names and ids + unique within a given PG question. + + getQuestionElement(name) -- long form of getQE(name) + + listQuestionElements() -- for discovering the names of inputs in the + PG question. An alert dialog will list all + of the elements. + Usage: Place this at the END of the question, + just before END_DOCUMENT(): + + TEXT(qq!<script> listQuestionElements() </script>!); + ENDDOCUMENT(); + + +=cut + + use constant DEFAULT_HEADER_TEXT =><<'END_HEADER_SCRIPT'; <script language="javascript">AC_FL_RunContent = 0;</script> <script src="http://hosted2.webwork.rochester.edu/webwork2_files/applets/AC_RunActiveContent.js" language="javascript"> @@ -103,19 +136,53 @@ <script language="JavaScript"> var flash; - function getFlashMovie(movieName) { + function getFlashMovie(appletName) { var isIE = navigator.appName.indexOf("Microsoft") != -1; - return (isIE) ? window[movieName] : window.document[movieName]; - //return window.document[movieName]; + var obj = (isIE) ? window[appletName] : window.document[appletName]; + //return window.document[appletName]; + if (obj.name = appletName) { + return( obj ); + } else { + alert ("can't find applet " + appletName); + } } - + function submitAction() { + getQE("$returnFieldName").value = getFlashMovie("$appletId").$submitAction(); + } function initialize() { getFlashMovie("$appletId").$initializeAction("$base64_xmlString"); } - function submitAction() { - document.problemMainForm.$returnFieldName.value = getFlashMovie("$appletId").$submitAction(); - } + function getQE(name1) { // get Question Element in problemMainForm by name + var isIE = navigator.appName.indexOf("Microsoft") != -1; + var obj = (isIE) ? document.getElementById(name1) + :document.problemMainForm[name1]; + // needed for IE -- searches id and name space so it can be unreliable if names are not unique + if (obj.name = name1 ) { + return( obj ); + } else { + alert("Can't find " + name1); + listQuestionElements(); + } + + } + function getQuestionElement(name1) { + return getQE(name1); + } + + function listQuestionElements() { // list all HTML elements in main problem form + var isIE = navigator.appName.indexOf("Microsoft") != -1; + var mainForm = (isIE) ? document.getElementsByTagName("input") : document.getElementsByTagName("input"); + var str=mainForm.length +" Question Elements\n type | name = value < id > \n"; + for( var i=0; i< mainForm.length; i++) { + str = str + " "+i+" " + mainForm[i].type + + " | " + mainForm[i].name + + "= " + mainForm[i].value + + " <" + mainForm[i].id + ">\n"; + } + alert(str +"\n Place listQuestionElements() at end of document in order to get all form elements!"); + } + </script> @@ -151,12 +218,31 @@ http://devel.teratechnologies.net/swfformfix/swfobject_swfformfix_source.js http://www.teratechnologies.net/stevekamerman/index.php?m=01&y=07&entry=entry070101-033933 + use constant DEFAULT_OBJECT_TEXT =><<'END_OBJECT_TEXT'; + <form></form> + <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + id="$appletName" width="500" height="375" + codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> + <param name="movie" value="$codebase/$appletName.swf" /> + <param name="quality" value="high" /> + <param name="bgcolor" value="#869ca7" /> + <param name="allowScriptAccess" value="sameDomain" /> + <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#869ca7" + width="550" height="400" name="$appletName" align="middle" id="$appletID" + play="true" loop="false" quality="high" allowScriptAccess="sameDomain" + type="application/x-shockwave-flash" + pluginspage="http://www.macromedia.com/go/getflashplayer"> + </embed> + + </object> + END_OBJECT_TEXT + =cut use constant DEFAULT_OBJECT_TEXT =><<'END_OBJECT_TEXT'; <form></form> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" - id="ExternalInterface" width="500" height="375" + id="$appletName" width="500" height="375" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> <param name="movie" value="$codebase/$appletName.swf" /> <param name="quality" value="high" /> |