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: dpvc v. a. <we...@ma...> - 2005-09-17 13:21:58
|
Log Message: ----------- Improved layout and labeling of error messages. Modified Files: -------------- pg/macros: parserMultiPart.pl Revision Data ------------- Index: parserMultiPart.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/parserMultiPart.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -Lmacros/parserMultiPart.pl -Lmacros/parserMultiPart.pl -u -r1.2 -r1.3 --- macros/parserMultiPart.pl +++ macros/parserMultiPart.pl @@ -218,11 +218,19 @@ push(@text,check_string($result->{preview_text_string},'__')); push(@student,check_string($result->{student_ans},'__')); if ($result->{ans_message}) { - push(@errors,"Answer $i: ".$result->{ans_message}); + push(@errors,'<TR VALIGN="TOP"><TD STYLE="text-align:right; border:0px" NOWRAP>' . + "<I>In answer $i</I>: </TD>". + '<TD STYLE="text-align:left; border:0px">'.$result->{ans_message}.'</TD></TR>'); } else {$score += $result->{score}} } $ans->score($score/$self->length); - $ans->{ans_message} = $ans->{error_message} = join("<BR>",@errors); + $ans->{ans_message} = $ans->{error_message} = ""; + if (scalar(@errors)) { + $ans->{ans_message} = $ans->{error_message} = + '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" CLASS="ArrayLayout">' . + join('<TR><TD HEIGHT="4"></TD></TR>',@errors). + '</TABLE>'; + } if ($nonblank) { $ans->{preview_latex_string} = '{'.join('}'.$self->{tex_separator}.'{',@latex).'}'; $ans->{preview_text_string} = join($self->{separator},@text); |
From: dpvc v. a. <we...@ma...> - 2005-09-17 13:02:06
|
Log Message: ----------- The Parser answer checkers used to give the student answer as the parsed but unevaluated answer. This has been changed so that the student answer is now the computed result, no the parsed answer. The answer preview still shows the parsed equation. This is more consistent with the traditional answer checkers, and probably is more valuable to the students. 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.63 retrieving revision 1.64 diff -Llib/Value/AnswerChecker.pm -Llib/Value/AnswerChecker.pm -u -r1.63 -r1.64 --- lib/Value/AnswerChecker.pm +++ lib/Value/AnswerChecker.pm @@ -105,7 +105,7 @@ unless Value::isValue($ans->{student_value}); $ans->{preview_latex_string} = $ans->{student_formula}->TeX; $ans->{preview_text_string} = protectHTML($ans->{student_formula}->string); - $ans->{student_ans} = $ans->{preview_text_string}; + $ans->{student_ans} = protectHTML($ans->{student_value}->string); if ($self->cmp_collect($ans)) { $self->cmp_equal($ans); $self->cmp_postprocess($ans) if !$ans->{error_message}; @@ -366,7 +366,7 @@ else {$sep = '</TD><TD WIDTH="8px"></TD><TD>'} foreach my $i (0..$rows-1) { $HTML .= '<TR><TD HEIGHT="6px"></TD></TR>' if $i; - $HTML .= '<TR ALIGN="MIDDLE"><TD>'.join($sep,@{$array->[$i]}).'</TD></TR>'."\n"; + $HTML .= '<TR ALIGN="MIDDLE"><TD>'.join($sep,EVALUATE(@{$array->[$i]})).'</TD></TR>'."\n"; } $open = $self->format_delimiter($open,$rows,$options{tth_delims}); $close = $self->format_delimiter($close,$rows,$options{tth_delims}); @@ -387,6 +387,8 @@ . '</TABLE>'; } +sub EVALUATE {map {(Value::isFormula($_) && $_->isConstant? $_->eval: $_)} @_} + sub VERBATIM { my $string = shift; my $displayMode = Value->getPG('$displayMode'); |
From: dpvc v. a. <we...@ma...> - 2005-09-17 12:38:48
|
Log Message: ----------- Better error messages for unreduced unions. 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.62 retrieving revision 1.63 diff -Llib/Value/AnswerChecker.pm -Llib/Value/AnswerChecker.pm -u -r1.62 -r1.63 --- lib/Value/AnswerChecker.pm +++ lib/Value/AnswerChecker.pm @@ -260,12 +260,12 @@ !$ans->{isPreview} && !Value::isFormula($student); if ($student->type eq 'Union' && $student->length >= 2) { my $reduced = $student->reduce; - return "Your$nth union can be written in a simpler form" + return "Your$nth union can be written without overlaps" unless $reduced->type eq 'Union' && $reduced->length == $student->length; my @R = $reduced->sort->value; my @S = $student->sort->value; foreach my $i (0..$#R) { - return "Your$nth union can be written in a simpler form" + return "Your$nth union can be written without overlaps" unless $R[$i] == $S[$i] && $R[$i]->length == $S[$i]->length; } } elsif ($student->type eq 'Set' && $student->length >= 2) { |
From: dpvc v. a. <we...@ma...> - 2005-09-17 12:25:18
|
Log Message: ----------- Improved error message layout and labeling for when ans_array is used. 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.61 retrieving revision 1.62 diff -Llib/Value/AnswerChecker.pm -Llib/Value/AnswerChecker.pm -u -r1.61 -r1.62 --- lib/Value/AnswerChecker.pm +++ lib/Value/AnswerChecker.pm @@ -20,9 +20,8 @@ # -# Create an answer checker for the given type of object +# Default flags for the answer checkers # - sub cmp_defaults {( showTypeWarnings => 1, showEqualErrors => 1, @@ -31,6 +30,9 @@ showUnionReduceWarnings => 1, )} +# +# Create an answer checker for the given type of object +# sub cmp { my $self = shift; my $ans = new AnswerEvaluator; @@ -109,8 +111,8 @@ $self->cmp_postprocess($ans) if !$ans->{error_message}; } } else { + $self->cmp_collect($ans); $self->cmp_error($ans); - $self->cmp_collect($ans); ## FIXME: why is this here a second time? } contextSet($context,%{$flags}); # restore context values Parser::Context->current(undef,$current); # put back the old context @@ -137,7 +139,7 @@ $type = "Value::".$self->{tree}->type if $self->class eq 'Formula'; $ans->{student_formula} = eval {$type->new($array)->with(ColumnVector=>$self->{ColumnVector})}; if (!defined($ans->{student_formula}) || $$Value::context->{error}{flag}) - {Parser::reportEvalError($@); return 0} + {Parser::reportEvalError($@); $self->cmp_error($ans); return 0} $ans->{student_value} = $ans->{student_formula}; $ans->{preview_text_string} = $ans->{student_ans}; $ans->{preview_latex_string} = $ans->{student_formula}->TeX; @@ -454,7 +456,7 @@ # based on these, and keep track of error messages. # -my @ans_defaults = (showCoodinateHints => 0, checker => sub {0}); +my @ans_cmp_defaults = (showCoodinateHints => 0, checker => sub {0}); sub ans_collect { my $self = shift; my $ans = shift; @@ -465,34 +467,42 @@ if ($self->{ColumnVector}) {foreach my $x (@{$data}) {$x = [$x]}} $data = [$data] unless ref($data->[0]) eq 'ARRAY'; foreach my $i (0..$rows-1) { - my @row = (); + my @row = (); my $entry; foreach my $j (0..$cols-1) { if ($i || $j) { - my $entry = $inputs->{ANS_NAME($self->{ans_name},$i,$j)}; - my $result = $data->[$i][$j]->cmp(@ans_cmp_defaults)->evaluate($entry); - $OK &= entryCheck($result,$blank); - push(@row,$result->{student_formula}); - entryMessage($result->{ans_message},$errors,$i,$j,$rows); + $entry = $inputs->{ANS_NAME($self->{ans_name},$i,$j)}; } else { - $ans->{student_formula} = $ans->{student_value} = undef unless $ans->{student_ans} =~ m/\S/; - $OK &= entryCheck($ans,$blank); - push(@row,$ans->{student_formula}); - entryMessage($ans->{ans_message},$errors,$i,$j,$rows); + $entry = $ans->{original_student_ans}; + $ans->{student_formula} = $ans->{student_value} = undef unless $entry =~ m/\S/; } + my $result = $data->[$i][$j]->cmp(@ans_cmp_defaults)->evaluate($entry); + $OK &= entryCheck($result,$blank); + push(@row,$result->{student_formula}); + entryMessage($result->{ans_message},$errors,$i,$j,$rows,$cols); } push(@array,[@row]); } $ans->{student_formula} = [@array]; - $ans->{ans_message} = $ans->{error_message} = join("<BR>",@{$errors}); - return $OK && scalar(@{$errors}) == 0; + $ans->{ans_message} = $ans->{error_message} = ""; + if (scalar(@{$errors})) { + $ans->{ans_message} = $ans->{error_message} = + '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" CLASS="ArrayLayout">'. + join('<TR><TD HEIGHT="4"></TD></TR>',@{$errors}). + '</TABLE>'; + $OK = 0; + } + return $OK; } sub entryMessage { my $message = shift; return unless $message; - my ($errors,$i,$j,$rows) = @_; $i++; $j++; - if ($rows == 1) {$message = "Coordinate $j: $message"} - else {$message = "Entry ($i,$j): $message"} - push(@{$errors},$message); + my ($errors,$i,$j,$rows,$cols) = @_; $i++; $j++; + my $title; + if ($rows == 1) {$title = "In entry $j"} + elsif ($cols == 1) {$title = "In entry $i"} + else {$title = "In entry ($i,$j)"} + push(@{$errors},"<TR VALIGN=\"TOP\"><TD STYLE=\"text-align:right; border:0px\"><I>$title</I>: </TD>". + "<TD STYLE=\"text-align:left; border:0px\">$message</TD></TR>"); } sub entryCheck { |
From: dpvc v. a. <we...@ma...> - 2005-09-17 12:22:08
|
Log Message: ----------- Improved error messages for formulas returning infinity Modified Files: -------------- pg/lib: Value.pm Revision Data ------------- Index: Value.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value.pm,v retrieving revision 1.46 retrieving revision 1.47 diff -Llib/Value.pm -Llib/Value.pm -u -r1.46 -r1.47 --- lib/Value.pm +++ lib/Value.pm @@ -220,6 +220,7 @@ $type .= ' of '.$ltype.'s'; } } + return 'an Infinity' if $type eq 'String' && $value->{isInfinite}; return 'a Word' if $type eq 'String'; return 'a Complex Number' if $value->isComplex; return 'an '.$type if $type =~ m/^[aeio]/i; |
From: Sam H. v. a. <we...@ma...> - 2005-09-16 19:08:22
|
Log Message: ----------- feedback is now sent to users with receive_feedback permission regardless of the contents of the feedbackRecipients list in global.conf. Comments in global.conf now read: By default, feeback is sent to all users who have permission to receive_feedback. If this list is non-empty, feedback is also sent to the addresses specified here. * If you want to disable feedback altogether, leave this empty and set submit_feeback => $nobody in %permissionLevels below. This will cause the feedback button to go away as well. * If you want to send email ONLY to addresses in this list, set receive_feedback => $nodoy in %permissionLevels below. It's often useful to set this in the course.conf to change the behavior of feedback for a specific course. 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.137 retrieving revision 1.138 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.137 -r1.138 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -103,16 +103,26 @@ #'pr...@yo...', #'pr...@yo...', ]; - -# If defined, feedbackRecipients overrides the list of recipients for feedback -# email. It's appropriate to set this in the course.conf for specific courses, -# but probably not in global.conf. if not defined, mail is sent to all -# professors and TAs for a given course -#$mail{feedbackRecipients} = [ -# 'pr...@yo...', -# 'pr...@yo...', -#]; - + +# By default, feeback is sent to all users who have permission to +# receive_feedback. If this list is non-empty, feedback is also sent to the +# addresses specified here. +# +# * If you want to disable feedback altogether, leave this empty and set +# submit_feeback => $nobody in %permissionLevels below. This will cause the +# feedback button to go away as well. +# +# * If you want to send email ONLY to addresses in this list, set +# receive_feedback => $nodoy in %permissionLevels below. +# +# It's often useful to set this in the course.conf to change the behavior of +# feedback for a specific course. +# +$mail{feedbackRecipients} = [ + #'pr...@yo...', + #'pr...@yo...', +]; + # feedbackVerbosity: # 0: send only the feedback comment and context link # 1: as in 0, plus user, set, problem, and PG data Index: Feedback.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Feedback.pm,v retrieving revision 1.27 retrieving revision 1.28 diff -Llib/WeBWorK/ContentGenerator/Feedback.pm -Llib/WeBWorK/ContentGenerator/Feedback.pm -u -r1.27 -r1.28 --- lib/WeBWorK/ContentGenerator/Feedback.pm +++ lib/WeBWorK/ContentGenerator/Feedback.pm @@ -318,20 +318,21 @@ my $authz = $self->r->authz; my @recipients; - if (defined $ce->{mail}->{feedbackRecipients}) { - @recipients = @{$ce->{mail}->{feedbackRecipients}}; - } else { - # send to all users with permission to receive_feedback and an email address - foreach my $rcptName ($db->listUsers()) { - if ($authz->hasPermissions($rcptName, "receive_feedback")) { - my $rcpt = $db->getUser($rcptName); # checked - if ($rcpt and $rcpt->email_address) { - push @recipients, $rcpt->email_address; - } + + # send to all users with permission to receive_feedback and an email address + foreach my $rcptName ($db->listUsers()) { + if ($authz->hasPermissions($rcptName, "receive_feedback")) { + my $rcpt = $db->getUser($rcptName); # checked + if ($rcpt and $rcpt->email_address) { + push @recipients, $rcpt->email_address; } } } + if (defined $ce->{mail}->{feedbackRecipients}) { + push @recipients, @{$ce->{mail}->{feedbackRecipients}}; + } + return @recipients; } |
From: Sam H. v. a. <we...@ma...> - 2005-09-16 18:50:33
|
Log Message: ----------- use new feedbackMacro(), put "edit this problem" inside the problem DIV. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Problem.pm Revision Data ------------- Index: Problem.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm,v retrieving revision 1.184 retrieving revision 1.185 diff -Llib/WeBWorK/ContentGenerator/Problem.pm -Llib/WeBWorK/ContentGenerator/Problem.pm -u -r1.184 -r1.185 --- lib/WeBWorK/ContentGenerator/Problem.pm +++ lib/WeBWorK/ContentGenerator/Problem.pm @@ -827,7 +827,7 @@ my $editorPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::Instructor::PGProblemEditor", courseID => $courseName, setID => $set->set_id, problemID => $problem->problem_id); my $editorURL = $self->systemLink($editorPage, params=>$forced_field); - $editorLink = CGI::a({href=>$editorURL}, "Edit this problem"); + $editorLink = CGI::p(CGI::a({href=>$editorURL}, "Edit this problem")); } ##### translation errors? ##### @@ -994,6 +994,7 @@ print CGI::start_div({class=>"problem"}); print CGI::p($pg->{body_text}); print CGI::p(CGI::b("Note: "), CGI::i($pg->{result}->{msg})) if $pg->{result}->{msg}; + print $editorLink; # this is empty unless it is appropriate to have an editor link. print CGI::end_div(); print CGI::start_p(); @@ -1151,30 +1152,38 @@ CGI::endform(); } - # feedback form url - my $feedbackPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::Feedback", - courseID => $courseName); - my $feedbackURL = $self->systemLink($feedbackPage, authen => 0); # no authen info for form action - - #print feedback form - print - CGI::start_form(-method=>"POST", -action=>$feedbackURL),"\n", - $self->hidden_authen_fields,"\n", - CGI::hidden("module", __PACKAGE__),"\n", - CGI::hidden("set", $set->set_id),"\n", - CGI::hidden("problem", $problem->problem_id),"\n", - CGI::hidden("displayMode", $self->{displayMode}),"\n", - CGI::hidden("showOldAnswers", $will{showOldAnswers}),"\n", - CGI::hidden("showCorrectAnswers", $will{showCorrectAnswers}),"\n", - CGI::hidden("showHints", $will{showHints}),"\n", - CGI::hidden("showSolutions", $will{showSolutions}),"\n", - CGI::p({-align=>"left"}, - CGI::submit(-name=>"feedbackForm", -label=>"Email instructor") - ), - CGI::endform(),"\n"; - - # FIXME print editor link - print $editorLink; #empty unless it is appropriate to have an editor link. + ## feedback form url + #my $feedbackPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::Feedback", + # courseID => $courseName); + #my $feedbackURL = $self->systemLink($feedbackPage, authen => 0); # no authen info for form action + # + ##print feedback form + #print + # CGI::start_form(-method=>"POST", -action=>$feedbackURL),"\n", + # $self->hidden_authen_fields,"\n", + # CGI::hidden("module", __PACKAGE__),"\n", + # CGI::hidden("set", $set->set_id),"\n", + # CGI::hidden("problem", $problem->problem_id),"\n", + # CGI::hidden("displayMode", $self->{displayMode}),"\n", + # CGI::hidden("showOldAnswers", $will{showOldAnswers}),"\n", + # CGI::hidden("showCorrectAnswers", $will{showCorrectAnswers}),"\n", + # CGI::hidden("showHints", $will{showHints}),"\n", + # CGI::hidden("showSolutions", $will{showSolutions}),"\n", + # CGI::p({-align=>"left"}, + # CGI::submit(-name=>"feedbackForm", -label=>"Email instructor") + # ), + # CGI::endform(),"\n"; + + print $self->feedbackMacro( + module => __PACKAGE__, + set => $self->{set}->set_id, + problem => $problem->problem_id, + displayMode => $self->{displayMode}, + showOldAnswers => $will{showOldAnswers}, + showCorrectAnswers => $will{showCorrectAnswers}, + showHints => $will{showHints}, + showSolutions => $will{showSolutions}, + ); print CGI::end_div(); |
From: Sam H. v. a. <we...@ma...> - 2005-09-16 18:49:57
|
Log Message: ----------- use new feedbackMacro() Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: ProblemSet.pm ProblemSets.pm Revision Data ------------- Index: ProblemSets.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/ProblemSets.pm,v retrieving revision 1.62 retrieving revision 1.63 diff -Llib/WeBWorK/ContentGenerator/ProblemSets.pm -Llib/WeBWorK/ContentGenerator/ProblemSets.pm -u -r1.62 -r1.63 --- lib/WeBWorK/ContentGenerator/ProblemSets.pm +++ lib/WeBWorK/ContentGenerator/ProblemSets.pm @@ -221,26 +221,37 @@ print CGI::p(CGI::submit("hardcopy", "Download Hardcopy for Selected Set$pl")); print CGI::endform(); - # feedback form url - my $feedbackPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::Feedback", courseID => $courseName); - my $feedbackURL = $self->systemLink($feedbackPage, authen => 0); # no authen info for form action - - #print feedback form - print - CGI::start_form(-method=>"POST", -action=>$feedbackURL),"\n", - $self->hidden_authen_fields,"\n", - CGI::hidden("module", __PACKAGE__),"\n", - CGI::hidden("set", ''),"\n", - CGI::hidden("problem", ''),"\n", - CGI::hidden("displayMode", ''),"\n", - CGI::hidden("showOldAnswers", ''),"\n", - CGI::hidden("showCorrectAnswers", ''),"\n", - CGI::hidden("showHints", ''),"\n", - CGI::hidden("showSolutions", ''),"\n", - CGI::p({-align=>"left"}, - CGI::submit(-name=>"feedbackForm", -label=>"Email instructor") - ), - CGI::endform(),"\n"; + ## feedback form url + #my $feedbackPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::Feedback", courseID => $courseName); + #my $feedbackURL = $self->systemLink($feedbackPage, authen => 0); # no authen info for form action + # + ##print feedback form + #print + # CGI::start_form(-method=>"POST", -action=>$feedbackURL),"\n", + # $self->hidden_authen_fields,"\n", + # CGI::hidden("module", __PACKAGE__),"\n", + # CGI::hidden("set", ''),"\n", + # CGI::hidden("problem", ''),"\n", + # CGI::hidden("displayMode", ''),"\n", + # CGI::hidden("showOldAnswers", ''),"\n", + # CGI::hidden("showCorrectAnswers", ''),"\n", + # CGI::hidden("showHints", ''),"\n", + # CGI::hidden("showSolutions", ''),"\n", + # CGI::p({-align=>"left"}, + # CGI::submit(-name=>"feedbackForm", -label=>"Email instructor") + # ), + # CGI::endform(),"\n"; + + print $self->feedbackMacro( + module => __PACKAGE__, + set => "", + problem => "", + displayMode => "", + showOldAnswers => "", + showCorrectAnswers => "", + showHints => "", + showSolutions => "", + ); return ""; } Index: ProblemSet.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/ProblemSet.pm,v retrieving revision 1.66 retrieving revision 1.67 diff -Llib/WeBWorK/ContentGenerator/ProblemSet.pm -Llib/WeBWorK/ContentGenerator/ProblemSet.pm -u -r1.66 -r1.67 --- lib/WeBWorK/ContentGenerator/ProblemSet.pm +++ lib/WeBWorK/ContentGenerator/ProblemSet.pm @@ -318,17 +318,18 @@ print CGI::p("This homework set contains no problems."); } - ## feedback form - #my $ce = $self->{ce}; - #my $root = $ce->{webworkURLs}->{root}; - #my $courseName = $ce->{courseName}; - #my $feedbackURL = "$root/$courseName/feedback/"; + ## feedback form url + #my $feedbackPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::Feedback", + # courseID => $courseID); + #my $feedbackURL = $self->systemLink($feedbackPage, authen => 0); # no authen info for form action + # + ##print feedback form #print # CGI::start_form(-method=>"POST", -action=>$feedbackURL),"\n", # $self->hidden_authen_fields,"\n", # CGI::hidden("module", __PACKAGE__),"\n", # CGI::hidden("set", $self->{set}->set_id),"\n", - # CGI::hidden("problem", ""),"\n", + # CGI::hidden("problem", ''),"\n", # CGI::hidden("displayMode", $self->{displayMode}),"\n", # CGI::hidden("showOldAnswers", ''),"\n", # CGI::hidden("showCorrectAnswers", ''),"\n", @@ -339,27 +340,16 @@ # ), # CGI::endform(),"\n"; - # feedback form url - my $feedbackPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::Feedback", - courseID => $courseID); - my $feedbackURL = $self->systemLink($feedbackPage, authen => 0); # no authen info for form action - - #print feedback form - print - CGI::start_form(-method=>"POST", -action=>$feedbackURL),"\n", - $self->hidden_authen_fields,"\n", - CGI::hidden("module", __PACKAGE__),"\n", - CGI::hidden("set", $self->{set}->set_id),"\n", - CGI::hidden("problem", ''),"\n", - CGI::hidden("displayMode", $self->{displayMode}),"\n", - CGI::hidden("showOldAnswers", ''),"\n", - CGI::hidden("showCorrectAnswers", ''),"\n", - CGI::hidden("showHints", ''),"\n", - CGI::hidden("showSolutions", ''),"\n", - CGI::p({-align=>"left"}, - CGI::submit(-name=>"feedbackForm", -label=>"Email instructor") - ), - CGI::endform(),"\n"; + print $self->feedbackMacro( + module => __PACKAGE__, + set => $self->{set}->set_id, + problem => "", + displayMode => $self->{displayMode}, + showOldAnswers => "", + showCorrectAnswers => "", + showHints => "", + showSolutions => "", + ); return ""; } |
From: Sam H. v. a. <we...@ma...> - 2005-09-16 18:48:47
|
Log Message: ----------- added feedbackHelper to consolidate generation of feedback form. Modified Files: -------------- webwork2/lib/WeBWorK: ContentGenerator.pm Revision Data ------------- Index: ContentGenerator.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator.pm,v retrieving revision 1.148 retrieving revision 1.149 diff -Llib/WeBWorK/ContentGenerator.pm -Llib/WeBWorK/ContentGenerator.pm -u -r1.148 -r1.149 --- lib/WeBWorK/ContentGenerator.pm +++ lib/WeBWorK/ContentGenerator.pm @@ -1381,6 +1381,42 @@ return $result; } +=item feedbackMacro(%params) + +Helper macro for displaying the feedback form. Returns a button named "Email +Instructor". %params contains the request parameters accepted by the Feedback +module and their values. + +=cut + +sub feedbackMacro { + my ($self, %params) = @_; + my $r = $self->r; + my $userID = $r->param("user"); + my $authz = $r->authz; + my $urlpath = $r->urlpath; + my $courseID = $urlpath->arg("courseID"); + + # don't do anything unless the user has permission to + return "" unless $authz->hasPermissions($userID, "submit_feedback"); + + # feedback form url + my $feedbackPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::Feedback", courseID => $courseID); + my $feedbackURL = $self->systemLink($feedbackPage, authen => 0); # no authen info for form action + + my $result = CGI::start_form(-method=>"POST", -action=>$feedbackURL) . "\n"; + $result .= $self->hidden_authen_fields . "\n"; + + while (my ($key, $value) = each %params) { + $result .= CGI::hidden($key, $value) . "\n"; + } + + $result .= CGI::p({-align=>"left"}, CGI::submit(-name=>"feedbackForm", -label=>"Email instructor")); + $result .= CGI::endform() . "\n"; + + return $result; +} + =back =cut |
From: Sam H. v. a. <we...@ma...> - 2005-09-16 18:47:29
|
Log Message: ----------- allow printing of error message upfront when there are no recipients. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Feedback.pm Revision Data ------------- Index: Feedback.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Feedback.pm,v retrieving revision 1.26 retrieving revision 1.27 diff -Llib/WeBWorK/ContentGenerator/Feedback.pm -Llib/WeBWorK/ContentGenerator/Feedback.pm -u -r1.26 -r1.27 --- lib/WeBWorK/ContentGenerator/Feedback.pm +++ lib/WeBWorK/ContentGenerator/Feedback.pm @@ -78,7 +78,6 @@ my $feedback = $r->param("feedback"); my $courseID = $r->urlpath->arg("courseID"); - my ($user, $set, $problem); $user = $db->getUser($userName) # checked if defined $userName and $userName ne ""; @@ -151,6 +150,14 @@ return ""; } + # determine the recipients of the email + my @recipients = $self->getFeedbackRecipients(); + + unless (@recipients) { + $self->noRecipientsAvailable($returnURL); + return ""; + } + if (defined $r->param("sendFeedback")) { # get verbosity level my $verbosity = $ce->{mail}->{feedbackVerbosity}; @@ -160,33 +167,12 @@ ? $user->email_address : $from); - # determine the recipients of the email - my @recipients; - if (defined $ce->{mail}->{feedbackRecipients}) { - @recipients = @{$ce->{mail}->{feedbackRecipients}}; - } else { - # send to all professors and TAs - foreach my $rcptName ($db->listUsers()) { - if ($authz->hasPermissions($rcptName, "receive_feedback")) { - my $rcpt = $db->getUser($rcptName); # checked - if ($rcpt and $rcpt->email_address) { - push @recipients, $rcpt->email_address; - } - } - } - } - # sanity checks unless ($sender) { $self->feedbackForm($user, $returnURL, "No Sender specified."); return ""; } - unless (@recipients) { - $self->feedbackForm($user, $returnURL, - "No recipients specified."); - return ""; - } unless ($feedback) { $self->feedbackForm($user, $returnURL, "Message was blank."); @@ -288,6 +274,13 @@ print CGI::p(CGI::a({-href=>$returnURL}, "Cancel Feedback")) if $returnURL; } +sub noRecipientsAvailable { + my ($self, $returnURL) = @_; + + print CGI::p("No feedback recipients are listed for this course."); + print CGI::p(CGI::a({-href=>$returnURL}, "Cancel Feedback")) if $returnURL; +} + sub feedbackForm { my ($self, $user, $returnURL, $message) = @_; my $r = $self->r; @@ -318,4 +311,28 @@ print CGI::p(CGI::a({-href=>$returnURL}, "Cancel Feedback")) if $returnURL; } +sub getFeedbackRecipients { + my ($self) = @_; + my $ce = $self->r->ce; + my $db = $self->r->db; + my $authz = $self->r->authz; + + my @recipients; + if (defined $ce->{mail}->{feedbackRecipients}) { + @recipients = @{$ce->{mail}->{feedbackRecipients}}; + } else { + # send to all users with permission to receive_feedback and an email address + foreach my $rcptName ($db->listUsers()) { + if ($authz->hasPermissions($rcptName, "receive_feedback")) { + my $rcpt = $db->getUser($rcptName); # checked + if ($rcpt and $rcpt->email_address) { + push @recipients, $rcpt->email_address; + } + } + } + } + + return @recipients; +} + 1; |
From: Sam H. v. a. <we...@ma...> - 2005-09-16 17:58:33
|
Log Message: ----------- cosmetic changes (blank lines, comments, ordering) 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.136 retrieving revision 1.137 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.136 -r1.137 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -48,22 +48,20 @@ # Paths to external programs ################################################################################ +# system utilties $externalPrograms{mkdir} = "/bin/mkdir"; $externalPrograms{mv} = "/bin/mv"; $externalPrograms{mysql} = "/usr/bin/mysql"; +$externalPrograms{tar} = "/usr/bin/tar"; +# equation rendering/hardcopy utiltiies $externalPrograms{latex} = "/usr/bin/latex"; -$externalPrograms{pdflatex} = "/usr/bin/pdflatex --shell-escape"; # allows pdflatex to handle .eps files +$externalPrograms{pdflatex} = "/usr/bin/pdflatex --shell-escape"; # --shell-escape allows pdflatex to handle .eps files $externalPrograms{dvipng} = "/usr/bin/dvipng"; $externalPrograms{tth} = "/usr/bin/tth"; -$externalPrograms{tar} = "/usr/bin/tar"; - -# Basic image manipulation utilities - -#################################################### -# Most sites only need to configure the first line -#################################################### +# NetPBM - basic image manipulation utilities +# most sites only need to configure $netpbm_prefix. my $netpbm_prefix = "/usr/bin"; $externalPrograms{giftopnm} = "$netpbm_prefix/giftopnm"; $externalPrograms{ppmtopgm} = "$netpbm_prefix/ppmtopgm"; @@ -71,22 +69,17 @@ $externalPrograms{pnmtopng} = "$netpbm_prefix/pnmtopng"; $externalPrograms{pngtopnm} = "$netpbm_prefix/pngtopnm"; -# The following lines are the external scripts gif2eps, etc. -# The source file is input with cat, and the output is redirected to -# the desired file. - -$externalPrograms{gif2eps} = "$externalPrograms{giftopnm} | $externalPrograms{ppmtopgm}| $externalPrograms{pnmtops} -noturn 2>/dev/null"; +# image conversions utiltiies +# the source file is given on stdin, and the output expected on stdout. +# +# Note on conversions pipelines: +# we used to use `pnmdepth 1' instead of ppmtopgm as it creates a +# monochrome image (1 bit) rather than a greyscale image (8 bits). +# However, this was causing improper display of some sort in PDFs. +$externalPrograms{gif2eps} = "$externalPrograms{giftopnm} | $externalPrograms{ppmtopgm} | $externalPrograms{pnmtops} -noturn 2>/dev/null"; $externalPrograms{png2eps} = "$externalPrograms{pngtopnm} | $externalPrograms{ppmtopgm} | $externalPrograms{pnmtops} -noturn 2>/dev/null"; $externalPrograms{gif2png} = "$externalPrograms{giftopnm} | $externalPrograms{pnmtopng}"; -# Note on these conversions: -# we used to use `pnmdepth 1' instead of ppmtopgm as it creates a -# monochrome image (1 bit) rather than a greyscale image (8 bits). -# However, this was causing improper display of some sort in PDFs. - - - - ################################################################################ # Mail settings ################################################################################ |
From: dpvc v. a. <we...@ma...> - 2005-09-15 14:26:16
|
Log Message: ----------- Bring jsMath up to version 2.1d, which fixes a number of small bugs, including: o There was a problem with image fonts where the cached data about the size of the images was not being checked properly, so was recomputed every time a character was displayed. The cache is now properly handled, so that should speed up image mode. o Fixed a bug where loading extra fonts while in image mode would cause the data about previously loaded image fonts to be lost. o Fixed a bug with "Hi-Res Fonts for Printing" where the fonts where incorrectly scaled so that they appear far too small. (This worked in an early beta version of jsMath v2, but apparently hasn't worked properly in any production version.) o Fixed a long-standing bug where horizontal lines are only displayed in black, not in the color specified by \color (or by a style from the surrounding text). o Fixed a similar bug with \rule so that it now produces a box with the color of the surrounding text. o Dimensions can now be enclosed in braces (for example, \rule can be \rule{10pt}{5pt}{3pt} as well as \rule 10pt 5pt 3pt). o Fixed a bug where extra space was inserted in some equations for browsers that don't allow absolute positioning within an in-line element (e.g., Opera). Modified Files: -------------- webwork-modperl/htdocs/jsMath: jsMath.js Revision Data ------------- Index: jsMath.js =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/htdocs/jsMath/jsMath.js,v retrieving revision 1.16 retrieving revision 1.17 diff -Lhtdocs/jsMath/jsMath.js -Lhtdocs/jsMath/jsMath.js -u -r1.16 -r1.17 --- htdocs/jsMath/jsMath.js +++ htdocs/jsMath/jsMath.js @@ -66,13 +66,12 @@ var jsMath = { - version: "2.1a", // change this if you edit the file + version: "2.1d", // change this if you edit the file // // Name of image files // blank: "blank.gif", - black: "black.gif", defaultH: 0, // default height for characters with none specified @@ -185,7 +184,7 @@ jsMath.Browser.hiddenSpace).w/5; } var h = this.BBoxFor('x').h; // Line height and depth to baseline - var d = this.BBoxFor('x<IMG SRC="'+jsMath.black+'" HEIGHT="'+(h*jsMath.Browser.imgScale)+'" WIDTH="1">').h - h; + var d = this.BBoxFor('x<IMG SRC="'+jsMath.blank+'" HEIGHT="'+(h*jsMath.Browser.imgScale)+'" WIDTH="1">').h - h; this.h = (h-d)/this.em; this.d = d/this.em; this.hd = this.h + this.d; this.ph = h-d; this.pd = d; @@ -316,7 +315,6 @@ jsMath.root = src.replace(/jsMath.js$/,''); jsMath.Img.root = jsMath.root + "fonts/"; jsMath.blank = jsMath.root + jsMath.blank; - jsMath.black = jsMath.root + jsMath.black; this.Domain(); return; } @@ -374,7 +372,7 @@ var WH = jsMath.EmBoxFor('<SPAN CLASS="'+name+'">'+font[65].c+'</SPAN>'); font.hd = WH.h; font.d = jsMath.EmBoxFor('<SPAN CLASS="'+name+'">'+ font[65].c + - '<IMG SRC="'+jsMath.black+'" STYLE="height:'+(font.hd*jsMath.Browser.imgScale)+'em; width:1"></SPAN>').h + '<IMG SRC="'+jsMath.blank+'" STYLE="height:'+(font.hd*jsMath.Browser.imgScale)+'em; width:1"></SPAN>').h - font.hd; font.h = font.hd - font.d; font.dh = .05; @@ -1942,6 +1940,15 @@ this.update[font] = this.update[font].concat(change[font]); } }, + + /* + * Called by the exta-font definition files to add an image font + * into the mix + */ + AddFont: function (size,def) { + if (!jsMath.Img[size]) {jsMath.Img[size] = {}}; + jsMath.Add(jsMath.Img[size],def); + }, /* * Update font(s) to use image data rather than native fonts @@ -1983,7 +1990,7 @@ Scale: function () { if (!this.loaded) return; this.best = this.BestSize(); - this.em = jsMath.Img.w[this.fonts[this.best]] + this.em = jsMath.Img.w[this.fonts[this.best]]; this.scale = (jsMath.em/this.em); if (Math.abs(this.scale - 1) < .12) {this.scale = 1} }, @@ -2064,11 +2071,11 @@ + 'vertical-align: '+this.Em(y)+'; left: '+this.Em(x)+'; ' + 'width:' +this.Em(w*jsMath.Browser.imgScale)+'; ' + 'height:'+this.Em(h*jsMath.Browser.imgScale)+'; ' - + 'border-color: '+c+'; border-style: solid; border-width: 1px;">'; + + 'border: 1px solid '+c+';">'; }, /* - * Create a black rule line for fractions, etc. + * Create a rule line for fractions, etc. * Height is converted to pixels (with a minimum of 1), so that * the line will not disappear at small font sizes. This means that * the thickness will not change if you change the font size, or @@ -2078,13 +2085,14 @@ if (h == null) {h = jsMath.TeX.default_rule_thickness} if (w == 0 || h == 0) return; // should make an invisible box? w *= jsMath.Browser.imgScale; - h = Math.round(h*jsMath.em)*jsMath.Browser.imgScale; + h = Math.round(h*jsMath.em*jsMath.Browser.imgScale+.25); if (h < 1) {h = 1}; - return '<IMG SRC="'+jsMath.black+'" HSPACE="0" VSPACE="0" ' - + 'STYLE="width:'+this.Em(w)+'; height:'+h+'px; ' - + 'background-color: black">'; + return '<IMG SRC="'+jsMath.blank+'" HSPACE="0" VSPACE="0" ' + + 'STYLE="width:'+this.Em(w)+'; height:1px; ' + + 'vertical-align:-1px; ' + + 'border:0px none; border-top:'+h+'px solid">'; }, - + /* * Add a <SPAN> tag to activate a specific CSS class */ @@ -2250,13 +2258,14 @@ TeXIMG: function (font,C,size) { var c = jsMath.TeX[font][C]; if (c.img.size != null && c.img.size == size && - c.img.scale != null && c.img.best == jsMath.Img.best) return; - var mustScale = (jsMath.Img.scale != 1 || jsMath.Img.forceScale); + c.img.best != null && c.img.best == jsMath.Img.best) return; + var mustScale = (jsMath.Img.scale != 1 || jsMath.Img.forceScale); var id = jsMath.Img.best + size - 4; if (id < 0) {id = 0; mustScale = 1} else if (id >= jsMath.Img.fonts.length) {id = jsMath.Img.fonts.length-1; mustScale = 1} - var imgFont = jsMath.Img[jsMath.Img.fonts[id]]; var img = imgFont[font][C]; - var scale = jsMath.Img.scale/jsMath.Img.w[jsMath.Img.fonts[id]]; + var imgFont = jsMath.Img[jsMath.Img.fonts[id]]; + var img = imgFont[font][C]; + var scale = 1/jsMath.Img.w[jsMath.Img.fonts[id]]; if (id != jsMath.Img.best + size - 4) { if (c.w != null) {scale = c.w/img[0]} else { scale *= jsMath.Img.fonts[size]/jsMath.Img.fonts[4] @@ -4228,7 +4237,7 @@ doteq: ['Macro','\\buildrel\\textstyle.\\over='], ldots: ['Macro','\\mathinner{\\ldotp\\ldotp\\ldotp}'], cdots: ['Macro','\\mathinner{\\cdotp\\cdotp\\cdotp}'], - vdots: ['Macro','\\mathinner{\\rlap{\\raise8pt{\\rule 0pt 6pt 0pt .}}\\rlap{\\raise4pt{.}}.}'], + vdots: ['Macro','\\mathinner{\\rlap{\\raise8pt{.\\rule 0pt 6pt 0pt}}\\rlap{\\raise4pt{.}}.}'], ddots: ['Macro','\\mathinner{\\kern1mu\\raise7pt{\\rule 0pt 7pt 0pt .}\\kern2mu\\raise4pt{.}\\kern2mu\\raise1pt{.}\\kern1mu}'], joinrel: ['Macro','\\mathrel{\\kern-4mu}'], relbar: ['Macro','\\mathrel{\\smash-}'], // \smash, because - has the same height as + @@ -4270,7 +4279,7 @@ hskip: 'Hskip', kern: 'Hskip', - rule: ['Rule','black'], + rule: ['Rule','colored'], space: ['Rule','blank'], big: ['MakeBig','ord',0.85], @@ -4500,11 +4509,20 @@ * converted when typeset. */ GetDimen: function (name,nomu) { - var rest = this.string.slice(this.i); + var rest; var advance = 0; + if (this.nextIsSpace()) {this.i++} + if (this.string.charAt(this.i) == '{') { + rest = this.GetArgument(name); + } else { + rest = this.string.slice(this.i); + advance = 1; + } var match = rest.match(/^\s*([-+]?(\.\d+|\d+(\.\d*)?))(pt|em|ex|mu|px)/); if (!match) {this.Error("Missing dimension or its units for "+name); return} - this.i += match[0].length; - if (this.nextIsSpace()) {this.i++} + if (advance) { + this.i += match[0].length; + if (this.nextIsSpace()) {this.i++} + } var d = match[1]-0; if (match[4] == 'px') {d /= jsMath.em} else if (match[4] == 'pt') {d /= 10} @@ -4924,16 +4942,27 @@ * This replaces \hrule and \vrule * @@@ not a standard TeX command, and all three parameters must be given @@@ */ - Rule: function (name,gif) { + Rule: function (name,style) { var w = this.GetDimen(this.cmd+name,1); if (this.error) return; var h = this.GetDimen(this.cmd+name,1); if (this.error) return; var d = this.GetDimen(this.cmd+name,1); if (this.error) return; - h += d; + h += d; var html; if (h != 0) {h = Math.max(1.05/jsMath.em,h)} - if (h == 0 || w == 0) {gif = "blank"} - var html = '<IMG SRC="'+jsMath[gif]+'" STYLE="' + if (h == 0 || w == 0) {style = "blank"} + if (w == 0) { + html = '<IMG SRC="'+jsMath.blank+'" STYLE="' + + 'border:0px none; width:1px; margin-right:-1px; ' + + 'height:'+jsMath.HTML.Em(h*jsMath.Browser.imgScale)+'">'; + } else if (style == "blank") { + html = '<IMG SRC="'+jsMath.blank+'" STYLE="border:0px none; ' + 'height:'+jsMath.HTML.Em(h*jsMath.Browser.imgScale)+'; ' + 'width:' +jsMath.HTML.Em(w*jsMath.Browser.imgScale)+'">'; + } else { + html = '<IMG SRC="'+jsMath.blank+'" STYLE="' + + 'position: relative; top:1px; height:1px; border:0px none; ' + + 'border-top:'+jsMath.HTML.Em(h*jsMath.Browser.imgScale)+' solid; ' + + 'width:' +jsMath.HTML.Em(w*jsMath.Browser.imgScale)+'">'; + } if (d) { html = '<SPAN STYLE="vertical-align:'+jsMath.HTML.Em(-d)+'">' + html + '</SPAN>'; @@ -5277,11 +5306,9 @@ if (box.format == 'null') {return ''}; box.Styled().Remeasured(); var isSmall = 0; var isBig = 0; - var h = box.bh; var d = box.bd; if (box.bh > box.h && box.bh > jsMath.h+.001) {isSmall = 1} if (box.bd > box.d && box.bd > jsMath.d+.001) {isSmall = 1} - if (box.h > jsMath.h) {isBig = 1; h = box.h} - if (box.d > jsMath.d) {isBig = 1; d = box.d} + if (box.h > jsMath.h || box.d > jsMath.d) {isBig = 1} var html = box.html; if (isSmall) {// hide the extra size @@ -5289,7 +5316,7 @@ var y = 0; if (jsMath.Browser.spanHeightVaries || box.bh > jsMath.h+.001) {y = (jsMath.h - box.bh)} html = jsMath.HTML.Absolute(html,box.w,jsMath.h,0,y,jsMath.h); - isBig = 1; h = box.h; d = box.d; + isBig = 1; } else if (!jsMath.Browser.valignBug) { // remove line height and try to hide the depth var dy = jsMath.HTML.Em(Math.max(0,box.bd-jsMath.hd)/3); @@ -5301,8 +5328,8 @@ if (isBig) {// add height and depth to the line (force a little // extra to separate lines if needed) html += '<IMG SRC="'+jsMath.blank+'" CLASS="mathHD" STYLE="' - + 'height:'+jsMath.HTML.Em((h+d+.2)*jsMath.Browser.imgScale)+'; ' - + 'vertical-align:'+jsMath.HTML.Em(-d-.1)+';">' + + 'height:'+jsMath.HTML.Em((box.h+box.d+.2)*jsMath.Browser.imgScale)+'; ' + + 'vertical-align:'+jsMath.HTML.Em(-box.d-.1)+';">' } return '<NOBR><SPAN CLASS="jsM_scale">'+html+'</SPAN><NOBR>'; } |
From: Mike G. v. a. <we...@ma...> - 2005-09-14 23:44:26
|
Log Message: ----------- Hide the "important message" text unless there is actually a message in site_info.txt Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator: Login.pm Revision Data ------------- Index: Login.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Login.pm,v retrieving revision 1.28 retrieving revision 1.29 diff -Llib/WeBWorK/ContentGenerator/Login.pm -Llib/WeBWorK/ContentGenerator/Login.pm -u -r1.28 -r1.29 --- lib/WeBWorK/ContentGenerator/Login.pm +++ lib/WeBWorK/ContentGenerator/Login.pm @@ -58,7 +58,7 @@ print CGI::div({class=>"ResultsWithError"}, CGI::p("$@"), ); - } else { + } elsif($text) { print CGI::p(CGI::b("Important Message")), $text,CGI::hr(); } } |
From: Arnie P. v. a. <we...@ma...> - 2005-09-13 17:59:45
|
Log Message: ----------- In hardcopy, a TeX file download has to have the extension .tex, not .pdf Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator: Hardcopy.pm Revision Data ------------- Index: Hardcopy.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Hardcopy.pm,v retrieving revision 1.60 retrieving revision 1.61 diff -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -u -r1.60 -r1.61 --- lib/WeBWorK/ContentGenerator/Hardcopy.pm +++ lib/WeBWorK/ContentGenerator/Hardcopy.pm @@ -478,7 +478,7 @@ mkdir ($ce->{courseDirs}->{html_temp}) or die "Unable to make directory: ".$ce->{courseDirs}->{html_temp} unless -e $ce->{courseDirs}->{html_temp}; my $hardcopyTempDirectory = $ce->{courseDirs}->{html_temp}."/hardcopy"; - my $hardcopyFilePath = surePathToFile($ce->{courseDirs}->{html_temp}, "$hardcopyTempDirectory/$fileName"); + my $hardcopyFilePath = surePathToFile($ce->{courseDirs}->{html_temp}, "$hardcopyTempDirectory/$TeXdownloadFileName"); my $hardcopyFileURL = $ce->{courseURLs}->{html_temp}."/hardcopy/$TeXdownloadFileName"; $self->{hardcopyFilePath} = $hardcopyFilePath; |
From: Arnie P. v. a. <we...@ma...> - 2005-09-13 17:08:22
|
Log Message: ----------- Change back to $mail{smtpServer} = 'mail.yourschool.edu'; Modified Files: -------------- webwork-modperl/conf: global.conf.dist Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/conf/global.conf.dist,v retrieving revision 1.135 retrieving revision 1.136 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.135 -r1.136 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -93,7 +93,7 @@ # Mail sent by the PG system and the mail merge and feedback modules will be # sent via this SMTP server. -$mail{smtpServer} = 'mail.rochester.edu'; +$mail{smtpServer} = 'mail.yourschool.edu'; # When connecting to the above server, WeBWorK will send this address in the # MAIL FROM command. This has nothing to do with the "From" address on the mail |
From: dpvc v. a. <we...@ma...> - 2005-09-13 16:23:54
|
Log Message: ----------- Fixed problem with recognizing MINF in NUM_CMP. Modified Files: -------------- pg/macros: PGanswermacros.pl Revision Data ------------- Index: PGanswermacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGanswermacros.pl,v retrieving revision 1.36 retrieving revision 1.37 diff -Lmacros/PGanswermacros.pl -Lmacros/PGanswermacros.pl -u -r1.36 -r1.37 --- macros/PGanswermacros.pl +++ macros/PGanswermacros.pl @@ -1078,7 +1078,8 @@ # if ($num_params{strings}) { foreach my $string (@{$num_params{strings}}) { - my %tex = ($string =~ m/(-?)inf(inity)?/i)? (TeX => "$1\\infty"): (); + my %tex = ($string =~ m/^(-?)inf(inity)?$/i)? (TeX => "$1\\infty"): (); + %tex = (TeX => "-\\infty") if uc($string) eq "MINF"; $context->strings->add(uc($string) => {%tex}); } } |
From: dpvc v. a. <we...@ma...> - 2005-09-13 14:07:03
|
Log Message: ----------- The ORIGINAL_NUM_CMP was calling str_cmp as a code reference rather than as the more modern AnswerEvaluator object. This causes error messages when string answers were used. It now uses the evaluate() method of the AnswerEvaluator. Modified Files: -------------- pg/macros: PGanswermacros.pl Revision Data ------------- Index: PGanswermacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGanswermacros.pl,v retrieving revision 1.35 retrieving revision 1.36 diff -Lmacros/PGanswermacros.pl -Lmacros/PGanswermacros.pl -u -r1.35 -r1.36 --- macros/PGanswermacros.pl +++ macros/PGanswermacros.pl @@ -4327,7 +4327,7 @@ my $sensibleAnswer = 0; $ans = str_filters( $ans, 'compress_whitespace' ); # remove trailing, leading, and double spaces. my ($ans_eval) = str_cmp($rh_ans->{correct_ans}); - my $temp_ans_hash = &$ans_eval($ans); + my $temp_ans_hash = $ans_eval->evaluate($ans); $rh_ans->{test} = $temp_ans_hash; if ($temp_ans_hash->{score} ==1 ) { # students answer matches the correct answer. |
From: Mike G. v. a. <we...@ma...> - 2005-09-13 01:24:05
|
Log Message: ----------- Add clarification to error message for surePathToFile Modified Files: -------------- webwork-modperl/lib/WeBWorK: Utils.pm Revision Data ------------- Index: Utils.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/Utils.pm,v retrieving revision 1.69 retrieving revision 1.70 diff -Llib/WeBWorK/Utils.pm -Llib/WeBWorK/Utils.pm -u -r1.69 -r1.70 --- lib/WeBWorK/Utils.pm +++ lib/WeBWorK/Utils.pm @@ -259,7 +259,7 @@ #FIXME this make directory command may not be fool proof. unless (-e $path) { mkdir($path, $perms) - or warn "Failed to create directory $path"; + or warn "Failed to create directory $path with start directory $start_directory "; } } |
From: dpvc v. a. <we...@ma...> - 2005-09-12 23:28:07
|
Log Message: ----------- Fixed an error where scalar() was used on a hash ref. Fixed a misfeature where operations on formulas could return Value objects of other classes; they should always return formulas, even when the formula is constant. Modified Files: -------------- pg/lib/Value: Formula.pm Revision Data ------------- Index: Formula.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Formula.pm,v retrieving revision 1.36 retrieving revision 1.37 diff -Llib/Value/Formula.pm -Llib/Value/Formula.pm -u -r1.36 -r1.37 --- lib/Value/Formula.pm +++ lib/Value/Formula.pm @@ -108,7 +108,7 @@ ($l->type =~ m/Interval|Set|Union/ || $r->type =~ m/Interval|Set|Union/); $formula->{tree} = $parser->{BOP}->new($formula,$bop,$l,$r); $formula->{variables} = $formula->{tree}->getVariables; - return $formula->eval if scalar(%{$formula->{variables}}) == 0; +# return $formula->eval if $formula->{isConstant}; return $formula; } @@ -148,7 +148,7 @@ $formula->{context} = $self->{context}; $formula->{variables} = $self->{variables}; $formula->{tree} = $formula->{context}{parser}{UOP}->new($formula,'u-',$self->{tree}->copy($formula)); - return $formula->eval if scalar(%{$formula->{variables}}) == 0; +# return $formula->eval if $formula->isConstant; return $formula; } @@ -481,7 +481,10 @@ # Check if the value of a formula is constant # (could use shift->{tree}{isConstant}, but I don't trust it) # -sub isConstant {scalar(%{shift->{variables}}) == 0} +sub isConstant { + my @vars = (%{shift->{variables}}); + return scalar(@vars) == 0; +} ############################################ # |
From: dpvc v. a. <we...@ma...> - 2005-09-12 20:25:39
|
Log Message: ----------- Avoid undefined value of $name. Modified Files: -------------- pg/lib: Parser.pm Revision Data ------------- Index: Parser.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser.pm,v retrieving revision 1.29 retrieving revision 1.30 diff -Llib/Parser.pm -Llib/Parser.pm -u -r1.29 -r1.30 --- lib/Parser.pm +++ lib/Parser.pm @@ -470,7 +470,7 @@ my $self = shift; my $context = $self->{context}; my $top = $self->pop->{value}; my $fn = $self->pop; my $constant = $top->{isConstant}; - if ($context->{parens}{$top->{open}}{function} && + if ($top->{open} && $context->{parens}{$top->{open}}{function} && $context->{parens}{$top->{open}}{close} eq $top->{close} && !$context->{functions}{$fn->{name}}{vectorInput}) {$top = $top->coords} else {$top = [$top]} @@ -641,7 +641,7 @@ # then the variables from the formula are used in sorted order.) # sub perlFunction { - my $self = shift; my $name = shift; my $vars = shift; + my $self = shift; my $name = shift || ''; my $vars = shift; $vars = [sort(keys %{$self->{variables}})] unless $vars; my $n = scalar(@{$vars}); my $vnames = ''; if ($n > 0) { |
From: Mike G. v. a. <we...@ma...> - 2005-09-10 18:21:11
|
Log Message: ----------- Restored changes that were accidentally clobbered when the gateway changes were checked in. Email now uses post processing to email students. Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor: SendMail.pm Revision Data ------------- Index: SendMail.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm,v retrieving revision 1.41 retrieving revision 1.42 diff -Llib/WeBWorK/ContentGenerator/Instructor/SendMail.pm -Llib/WeBWorK/ContentGenerator/Instructor/SendMail.pm -u -r1.41 -r1.42 --- lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm +++ lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm @@ -381,40 +381,48 @@ $self->addbadmessage(CGI::p("Can't read merge file $merge_file. No message sent")); return; } ; - - - foreach my $recipient (@recipients) { - #warn "FIXME sending email to $recipient"; - my $ur = $self->{db}->getUser($recipient); #checked - die "record for user $recipient not found" unless $ur; - unless ($ur->email_address) { - $self->addbadmessage(CGI::p("user $recipient does not have an email address -- skipping")); - next; - } - my ($msg, $preview_header); - eval{ ($msg,$preview_header) = $self->process_message($ur,$rh_merge_data); }; - $self->addbadmessage(CGI::p("There were errors in processing user $ur, merge file $merge_file. $@")) if $@; - my $mailer = Mail::Sender->new({ - from => $from, - to => $ur->email_address, - smtp => $ce->{mail}->{smtpServer}, - subject => $subject, - headers => "X-Remote-Host: ".$r->get_remote_host(), - }); - unless (ref $mailer) { - $self->addbadmessage(CGI::p("Failed to create a mailer for user $recipient: $Mail::Sender::Error")); - next; - } - unless (ref $mailer->Open()) { - $self->addbadmessage(CGI::p("Failed to open the mailer for user $recipient: $Mail::Sender::Error")); - next; - } - my $MAIL = $mailer->GetHandle() or $self->addbadmessage(CGI::p("Couldn't get handle")); - print $MAIL $msg || $self->addbadmessage(CGI::p("Couldn't print to $MAIL")); - close $MAIL || $self->addbadmessage(CGI::p("Couldn't close $MAIL")); - #warn "FIXME mailed to ", $ur->email_address, "from $from subject $subject"; - - } + if (@recipients) { + $self->{rh_merge_data} = $rh_merge_data; + $self->{smtpServer} = $ce->{mail}->{smtpServer}; + my $post_connection_action = sub { + my $r = shift; + my $result_message = $self->mail_message_to_recipients(); + $self->email_notification($result_message); + }; + $r->post_connection($post_connection_action) ; + } +# foreach my $recipient (@recipients) { +# #warn "FIXME sending email to $recipient"; +# my $ur = $self->{db}->getUser($recipient); #checked +# die "record for user $recipient not found" unless $ur; +# unless ($ur->email_address) { +# $self->addbadmessage(CGI::p("user $recipient does not have an email address -- skipping")); +# next; +# } +# my ($msg, $preview_header); +# eval{ ($msg,$preview_header) = $self->process_message($ur,$rh_merge_data); }; +# $self->addbadmessage(CGI::p("There were errors in processing user $ur, merge file $merge_file. $@")) if $@; +# my $mailer = Mail::Sender->new({ +# from => $from, +# to => $ur->email_address, +# smtp => $ce->{mail}->{smtpServer}, +# subject => $subject, +# headers => "X-Remote-Host: ".$r->get_remote_host(), +# }); +# unless (ref $mailer) { +# $self->addbadmessage(CGI::p("Failed to create a mailer for user $recipient: $Mail::Sender::Error")); +# next; +# } +# unless (ref $mailer->Open()) { +# $self->addbadmessage(CGI::p("Failed to open the mailer for user $recipient: $Mail::Sender::Error")); +# next; +# } +# my $MAIL = $mailer->GetHandle() or $self->addbadmessage(CGI::p("Couldn't get handle")); +# print $MAIL $msg || $self->addbadmessage(CGI::p("Couldn't print to $MAIL")); +# close $MAIL || $self->addbadmessage(CGI::p("Couldn't close $MAIL")); +# #warn "FIXME mailed to ", $ur->email_address, "from $from subject $subject"; +# +# } } else { $self->addbadmessage(CGI::p("Didn't recognize button $action")); @@ -447,8 +455,12 @@ if ($response eq 'preview') { $self->print_preview($setID); } elsif (($response eq 'send_email')){ - $self->addgoodmessage(CGI::p("Email sent to ". scalar(@{$self->{ra_send_to}})." students.")); - $self->{message} .= CGI::i("Email sent to ". scalar(@{$self->{ra_send_to}})." students."); + my $message = CGI::i("Email is being sent to ". scalar(@{$self->{ra_send_to}})." recipients. You will be notified" + ." when the task is completed. This may take several minutes if the class is large." + ); + $self->addgoodmessage($message); + $self->{message} .= $message; + $self->print_form($setID); } else { $self->print_form($setID); |
From: Mike G. v. a. <we...@ma...> - 2005-09-09 20:51:25
|
Log Message: ----------- Fixed some documentation comments. Modified Files: -------------- webwork-modperl/lib/WeBWorK: Utils.pm Revision Data ------------- Index: Utils.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/Utils.pm,v retrieving revision 1.68 retrieving revision 1.69 diff -Llib/WeBWorK/Utils.pm -Llib/WeBWorK/Utils.pm -u -r1.68 -r1.69 --- lib/WeBWorK/Utils.pm +++ lib/WeBWorK/Utils.pm @@ -231,11 +231,11 @@ # A very useful macro for making sure that all of the directories to a file have # been constructed. sub surePathToFile($$) { - # constructs intermediate + # constructs intermediate directories enroute to the file # the input path must be the path relative to this starting directory my $start_directory = shift; my $path = shift; - my $delim = "/"; #&getDirDelim(); + my $delim = "/"; unless ($start_directory and $path ) { warn "missing directory<br> surePathToFile start_directory path "; return ''; @@ -246,7 +246,6 @@ # if the path starts with $start_directory (which is permitted but optional) remove this initial segment $path =~ s|^$start_directory|| if $path =~ m|^$start_directory|; - #$path = convertPath($path); # find the nodes on the given path @@ -255,7 +254,7 @@ # create new path $path = $start_directory; #convertPath("$tmpDirectory"); - while (@nodes>1) { + while (@nodes>1) { # the last node is the file name $path = $path . shift (@nodes) . "/"; #convertPath($path . shift (@nodes) . "/"); #FIXME this make directory command may not be fool proof. unless (-e $path) { |
From: Mike G. v. a. <we...@ma...> - 2005-09-09 20:50:43
|
Log Message: ----------- Fixed a bug in which, if the Hardcopy call was the first one to need to create the directory at (e.g.) /ww/htdocs/tmp/myCourse then the creation of myCourse would fail. If /ww/htdocs/tmp/myCourse/gif already existed things would go fine. I think that more has to be done here. We need to look at how myCourse is created when storing a gif or html is the first action and handle these all the same. One of the difficulties is that the tmp directory might be located anywhere -- it is not guaranteed to be under /ww/webwork/webwork2/htdocs -- at least as we have defined it at the moment. Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator: Hardcopy.pm Revision Data ------------- Index: Hardcopy.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Hardcopy.pm,v retrieving revision 1.59 retrieving revision 1.60 diff -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -u -r1.59 -r1.60 --- lib/WeBWorK/ContentGenerator/Hardcopy.pm +++ lib/WeBWorK/ContentGenerator/Hardcopy.pm @@ -45,7 +45,7 @@ use WeBWorK::Form; use WeBWorK::Debug; use WeBWorK::PG; -use WeBWorK::Utils qw(readFile makeTempDirectory); +use WeBWorK::Utils qw(readFile makeTempDirectory surePathToFile); use Apache::Constants qw(:common REDIRECT); =head1 CONFIGURATION VARIABLES @@ -472,9 +472,14 @@ # Location for hardcopy file to be downloaded # FIXME this should use surePathToTmpFile - my $hardcopyTempDirectory = $ce->{courseDirs}->{html_temp}."/hardcopy"; - mkdir ($hardcopyTempDirectory) or die "Unable to make $hardcopyTempDirectory" unless -e $hardcopyTempDirectory; - my $hardcopyFilePath = "$hardcopyTempDirectory/$TeXdownloadFileName"; + # The html_temp directory might not have been created. + # But since the temp directory might be located anywhere we don't know what to use + # for the start file. + mkdir ($ce->{courseDirs}->{html_temp}) or die "Unable to make directory: ".$ce->{courseDirs}->{html_temp} + unless -e $ce->{courseDirs}->{html_temp}; + my $hardcopyTempDirectory = $ce->{courseDirs}->{html_temp}."/hardcopy"; + my $hardcopyFilePath = surePathToFile($ce->{courseDirs}->{html_temp}, "$hardcopyTempDirectory/$fileName"); + my $hardcopyFileURL = $ce->{courseURLs}->{html_temp}."/hardcopy/$TeXdownloadFileName"; $self->{hardcopyFilePath} = $hardcopyFilePath; $self->{hardcopyFileURL} = $hardcopyFileURL; @@ -517,13 +522,20 @@ my $r = $self->r; my $ce = $r->ce; + #FIXME is $tempDir used? #my $finalFile = "$tempDir/$fileName"; # Location for hardcopy file to be downloaded # FIXME this should use surePathToTmpFile - my $hardcopyTempDirectory = $ce->{courseDirs}->{html_temp}."/hardcopy"; - mkdir ($hardcopyTempDirectory) or die "Unable to make $hardcopyTempDirectory" unless -e $hardcopyTempDirectory; - my $hardcopyFilePath = "$hardcopyTempDirectory/$fileName"; + # The html_temp directory might not have been created. + # But since the temp directory might be located anywhere we don't know what to use + # for the start file. + mkdir ($ce->{courseDirs}->{html_temp}) or die "Unable to make directory: ".$ce->{courseDirs}->{html_temp} + unless -e $ce->{courseDirs}->{html_temp}; + my $hardcopyTempDirectory = $ce->{courseDirs}->{html_temp}."/hardcopy"; + my $hardcopyFilePath = surePathToFile($ce->{courseDirs}->{html_temp}, "$hardcopyTempDirectory/$fileName"); + + my $hardcopyFileURL = $ce->{courseURLs}->{html_temp}."/hardcopy/$fileName"; $self->{hardcopyFilePath} = $hardcopyFilePath; $self->{hardcopyFileURL} = $hardcopyFileURL; |
From: Mike G. v. a. <we...@ma...> - 2005-09-08 17:52:17
|
Log Message: ----------- Display the information in site_info.txt on the webwork2 homepage as well as on login pages. Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator: Home.pm Revision Data ------------- Index: Home.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Home.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -Llib/WeBWorK/ContentGenerator/Home.pm -Llib/WeBWorK/ContentGenerator/Home.pm -u -r1.8 -r1.9 --- lib/WeBWorK/ContentGenerator/Home.pm +++ lib/WeBWorK/ContentGenerator/Home.pm @@ -26,13 +26,44 @@ use strict; use warnings; use CGI::Pretty qw(); -use WeBWorK::Utils qw/readDirectory/; +use WeBWorK::Utils qw(readFile readDirectory); use WeBWorK::Utils::CourseManagement qw/listCourses/; sub loginstatus { "" } sub links { "" } sub options { "" }; +sub info { + my ($self) = @_; + my $r = $self->r; + my $ce = $r->ce; + my $site_info = $ce->{webworkFiles}->{site_info}; + + if (defined $site_info and $site_info) { + my $site_info_path = $site_info; + + # deal with previewing a temporary file + if (defined $r->param("editMode") and $r->param("editMode") eq "temporaryFile" + and defined $r->param("editFileSuffix")) { + $site_info_path .= $r->param("editFileSuffix"); + } + + if (-f $site_info_path) { + my $text = eval { readFile($site_info_path) }; + if ($@) { + print CGI::div({class=>"ResultsWithError"}, + CGI::p("$@"), + ); + } elsif ($text) { + print CGI::p(CGI::b("Important Message")), $text,CGI::hr(); + } + } + + + } + return ""; + +} sub body { my ($self) = @_; my $r = $self->r; |
From: dpvc v. a. <we...@ma...> - 2005-09-08 02:54:09
|
Log Message: ----------- Sam changed open(LOG,...) to open(my $log, ...), but didn't change the usages of LOG to $log, so the show answers page was always reporting no past answers available. Now the values are being shown. (I'm not sure why it is necessary to make a local variable for LOG, but at least it works now.) Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor: ShowAnswers.pm Revision Data ------------- Index: ShowAnswers.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/ShowAnswers.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -Llib/WeBWorK/ContentGenerator/Instructor/ShowAnswers.pm -Llib/WeBWorK/ContentGenerator/Instructor/ShowAnswers.pm -u -r1.15 -r1.16 --- lib/WeBWorK/ContentGenerator/Instructor/ShowAnswers.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ShowAnswers.pm @@ -106,7 +106,7 @@ $self->{lastID} = ''; $self->{lastn} = 0; - my @lines = grep(/$pattern/,<LOG>); close(LOG); + my @lines = grep(/$pattern/,<$log>); close($log); chomp(@lines); foreach $line (@lines) {$line = substr($line,27)}; # remove datestamp |