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...> - 2010-02-01 15:12:06
|
Log Message: ----------- Allow formula to be point-valued (if promotePoints is 1) Modified Files: -------------- pg/macros: parserParametricLine.pl Revision Data ------------- Index: parserParametricLine.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/parserParametricLine.pl,v retrieving revision 1.17 retrieving revision 1.18 diff -Lmacros/parserParametricLine.pl -Lmacros/parserParametricLine.pl -u -r1.17 -r1.18 --- macros/parserParametricLine.pl +++ macros/parserParametricLine.pl @@ -91,7 +91,7 @@ } else { $line = $context->Package("Formula")->new($context,shift); Value::Error("Your formula doesn't look like a parametric line") - unless $line->type eq 'Vector'; + unless $line->type eq 'Vector' || $line->type eq "Point"; $t = shift || (keys %{$line->{variables}})[0]; Value::Error("A line can't be just a constant vector") unless $t; $p = $context->Package("Point")->new($context,$line->eval($t=>0)); |
From: Arnie P. v. a. <we...@ma...> - 2010-02-01 02:53:12
|
Log Message: ----------- A few more changed to Reduced Credit documemtation 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.62 retrieving revision 1.63 diff -Llib/WeBWorK/Constants.pm -Llib/WeBWorK/Constants.pm -u -r1.62 -r1.63 --- lib/WeBWorK/Constants.pm +++ lib/WeBWorK/Constants.pm @@ -253,7 +253,7 @@ type => 'number'}, { var => 'pg{ansEvalDefaults}{reducedScoringPeriod}', doc => 'Length of Reduced Credit Period in minutes', - doc2 => 'The Reduced Credit Period is a period before the due date during which + doc2 => 'The Reduced Credit Period (formally called the Reduced Scoring Period) is a period before the due date during which all additional work done by the student counts at a reduced rate. Here is where you set the length of this period in minutes. If this value is greater than 0, a message like "This assignment has a Reduced Credit Period that begins 11/08/2009 @@ -267,7 +267,7 @@ type => 'number'}, { var => 'pg{ansEvalDefaults}{reducedScoringValue}', doc => 'Value of work done in Reduced Credit Period' , - doc2 => 'The Reduced Credit Period is a period before the due date during which + doc2 => 'The Reduced Credit Period (formally called the Reduced Scoring Period) is a period before the due date during which all additional work done by the student counts at a reduced rate. Here is where you set the reduced rate which must be a number in the interval [0,1]. 1 means no reduction. For example if this value is .5 and a student views a problem during the |
From: Arnie P. v. a. <we...@ma...> - 2010-02-01 02:43:03
|
Log Message: ----------- Replace "Reduced Scoring" by "Reduced Credit" Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: ProblemSetDetail.pm Revision Data ------------- Index: ProblemSetDetail.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm,v retrieving revision 1.78 retrieving revision 1.79 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -u -r1.78 -r1.79 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm @@ -139,7 +139,7 @@ }, }, enable_reduced_scoring => { - name => "Reduced Scoring Enabled", + name => "Reduced Credit Enabled", type => "choose", override => "all", choices => [qw( 0 1 )], |
From: Arnie P. v. a. <we...@ma...> - 2010-02-01 02:40:07
|
Log Message: ----------- Replace "Reduced Scoring" by "Reduced Credit" 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.110 retrieving revision 1.111 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm -u -r1.110 -r1.111 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm @@ -332,7 +332,7 @@ "Due Date", "Answer Date", "Visible", - "Reduced Scoring<br> Enabled" + "Reduced Credit<br> Enabled" ); ########## set initial values for state fields @@ -541,7 +541,7 @@ ########## first adjust heading if in editMode $prettyFieldNames{set_id} = "Edit All <br> Set Data" if $editMode; - $prettyFieldNames{enable_reduced_scoring} = 'Enable Reduced<br>Scoring' if $editMode; + $prettyFieldNames{enable_reduced_scoring} = 'Enable Reduced<br>Credit' if $editMode; print CGI::p({},"Showing ", scalar @visibleSetIDs, " out of ", scalar @allSetIDs, " sets."); @@ -921,13 +921,13 @@ $result = "No change made to any set."; } elsif ($scope eq "all") { @setIDs = @{ $self->{allSetIDs} }; - $result = "Reduced Scoring $verb for all sets."; + $result = "Reduced Credit $verb for all sets."; } elsif ($scope eq "visible") { @setIDs = @{ $self->{visibleSetIDs} }; - $result = "Reduced Scoring $verb for visable sets."; + $result = "Reduced Credit $verb for visable sets."; } elsif ($scope eq "selected") { @setIDs = @{ $genericParams->{selected_sets} }; - $result = "Reduced Scoring $verb for selected sets."; + $result = "Reduced Credit $verb for selected sets."; } # can we use UPDATE here, instead of fetch/change/store? @@ -2099,7 +2099,7 @@ my $setSelected = $options{setSelected}; my $publishedClass = $Set->published ? "Published" : "Unpublished"; - my $enable_reduced_scoringClass = $Set->enable_reduced_scoring ? 'Reduced Scoring Enabled' : 'Reduced Scoring Disabled'; + my $enable_reduced_scoringClass = $Set->enable_reduced_scoring ? 'Reduced Credit Enabled' : 'Reduced Credit Disabled'; my $users = $db->countSetUsers($Set->set_id); my $totalUsers = $self->{totalUsers}; |
From: Arnie P. v. a. <we...@ma...> - 2010-02-01 02:18:28
|
Log Message: ----------- Replace "Reduced Scoring" by "Reduced Credit" 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.61 retrieving revision 1.62 diff -Llib/WeBWorK/Constants.pm -Llib/WeBWorK/Constants.pm -u -r1.61 -r1.62 --- lib/WeBWorK/Constants.pm +++ lib/WeBWorK/Constants.pm @@ -252,28 +252,28 @@ A value such as 0.1 means 0.1 percent error is allowed.", type => 'number'}, { var => 'pg{ansEvalDefaults}{reducedScoringPeriod}', - doc => 'Length of Reduced Scoring Period in minutes', - doc2 => 'The Reduced Scoring Period is a period before the due date during which + doc => 'Length of Reduced Credit Period in minutes', + doc2 => 'The Reduced Credit Period is a period before the due date during which all additional work done by the student counts at a reduced rate. Here is where you set the length of this period in minutes. If this value is greater than 0, a - message like "This assignment has a Reduced Scoring Period that begins 11/08/2009 + message like "This assignment has a Reduced Credit Period that begins 11/08/2009 at 06:17pm EST and ends on the due date, 11/10/2009 at 06:17pm EST. During this period all additional work done counts 50% of the original." will be displayed.<p> - To use this, you also have to enable Reduced Scoring for individual assignments by + To use this, you also have to enable Reduced Credit for individual assignments by editing the set data using the Hmwk Sets Editor.<p> This works with the avg_problem_grader (which is the the default grader) and the std_problem_grader (the all or nothing grader). It will work with custom graders if they are written appropriately.' , type => 'number'}, { var => 'pg{ansEvalDefaults}{reducedScoringValue}', - doc => 'Value of work done in Reduced Scoring Period' , - doc2 => 'The Reduced Scoring Period is a period before the due date during which + doc => 'Value of work done in Reduced Credit Period' , + doc2 => 'The Reduced Credit Period is a period before the due date during which all additional work done by the student counts at a reduced rate. Here is where you set the reduced rate which must be a number in the interval [0,1]. 1 means no reduction. For example if this value is .5 and a student views a problem during the - Reduced Scoring Period, they will see the message "You are in the Reduced Scoring + Reduced Credit Period, they will see the message "You are in the Reduced Credit Period: All additional work done counts 50% of the original." <p> - To use this, you also have to enable Reduced Scoring for individual assignments by + To use this, you also have to enable Reduced Credit for individual assignments by editing the set data using the Hmwk Sets Editor.<p> This works with the avg_problem_grader (which is the the default grader) and the std_problem_grader (the all or nothing grader). It will work with custom graders |
From: Arnie P. v. a. <we...@ma...> - 2010-02-01 02:09:46
|
Log Message: ----------- Rename Reduced Scoring Period to Reduced Credit Period 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.220 retrieving revision 1.221 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.220 -r1.221 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -997,7 +997,7 @@ numZeroLevelTolDefault => 1E-12, useBaseTenLog => 0, defaultDisplayMatrixStyle => "[s]", - reducedScoringPeriod => 0, # Length of Reduced Scoring Period in minutes + reducedScoringPeriod => 0, # Length of Reduced Credit Period (formally Reduced Scoring Period) in minutes reducedScoringValue => 1, # A number in [0,1]. Students will be informed of the value as a percentage }; |
From: Arnie P. v. a. <we...@ma...> - 2010-02-01 02:03:49
|
Log Message: ----------- Replace "Reduced Scoring" by "Reduced Credit". Don't displat message after due date Modified Files: -------------- pg/macros: PGanswermacros.pl Revision Data ------------- Index: PGanswermacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGanswermacros.pl,v retrieving revision 1.71 retrieving revision 1.72 diff -Lmacros/PGanswermacros.pl -Lmacros/PGanswermacros.pl -u -r1.71 -r1.72 --- macros/PGanswermacros.pl +++ macros/PGanswermacros.pl @@ -1643,13 +1643,13 @@ # the sub_recored_score holds the recored_score before entering the reduced scoring period $problem_state{sub_recorded_score} = $problem_state{recorded_score}; } - else { # we are in the reduced scoring period. This doesn't get called after due date. + elsif (time() < $dueDate) { # we are in the reduced scoring period. # student gets credit for all work done before the reduced scoring period plus a portion of work done during period my $newScore = 0; $newScore = $problem_state{sub_recorded_score} + $reducedScoringValue*($problem_result{score} - $problem_state{sub_recorded_score}) if ($problem_result{score} > $problem_state{sub_recorded_score}); $problem_state{recorded_score} = $newScore if $newScore > $problem_state{recorded_score}; my $reducedScoringPerCent = int(100*$reducedScoringValue+.5); - $problem_result{msg} = $problem_result{msg}."<br />You are in the Reduced Scoring Period: All additional work done counts $reducedScoringPerCent\% of the original."; + $problem_result{msg} = $problem_result{msg}."<br />You are in the Reduced Credit Period: All additional work done counts $reducedScoringPerCent\% of the original."; } $problem_state{state_summary_msg} = ''; # an HTML formatted message printed at the bottom of the problem page @@ -1746,13 +1746,13 @@ # the sub_recored_score holds the recored_score before entering the reduced scoring period $problem_state{sub_recorded_score} = $problem_state{recorded_score}; } - else { # we are in the reduced scoring period. This doesn't get called after due date. + elsif (time() < $dueDate) { # we are in the reduced scoring period. # student gets credit for all work done before the reduced scoring period plus a portion of work done during period my $newScore = 0; $newScore = $problem_state{sub_recorded_score} + $reducedScoringValue*($problem_result{score} - $problem_state{sub_recorded_score}) if ($problem_result{score} > $problem_state{sub_recorded_score}); $problem_state{recorded_score} = $newScore if $newScore > $problem_state{recorded_score}; my $reducedScoringPerCent = int(100*$reducedScoringValue+.5); - $problem_result{msg} = $problem_result{msg}."<br />You are in the Reduced Scoring Period: All additional work done counts $reducedScoringPerCent\% of the original."; + $problem_result{msg} = $problem_result{msg}."<br />You are in the Reduced Credit Period: All additional work done counts $reducedScoringPerCent\% of the original."; } # record attempt only if there have been no syntax errors. @@ -1841,13 +1841,13 @@ # the sub_recored_score holds the recored_score before entering the reduced scoring period $problem_state{sub_recorded_score} = $problem_state{recorded_score}; } - else { # we are in the reduced scoring period. This doesn't get called after due date. +elsif (time() < $dueDate) { # we are in the reduced scoring period. # student gets credit for all work done before the reduced scoring period plus a portion of work done during period my $newScore = 0; $newScore = $problem_state{sub_recorded_score} + $reducedScoringValue*($problem_result{score} - $problem_state{sub_recorded_score}) if ($problem_result{score} > $problem_state{sub_recorded_score}); $problem_state{recorded_score} = $newScore if $newScore > $problem_state{recorded_score}; my $reducedScoringPerCent = int(100*$reducedScoringValue+.5); - $problem_result{msg} = $problem_result{msg}."<br />You are in the Reduced Scoring Period: All additional work done counts $reducedScoringPerCent\% of the original."; + $problem_result{msg} = $problem_result{msg}."<br />You are in the Reduced Credit Period: All additional work done counts $reducedScoringPerCent\% of the original."; } $problem_state{state_summary_msg} = ''; # an HTML formatted message printed at the bottom of the problem page |
From: Arnie P. v. a. <we...@ma...> - 2010-02-01 00:06:05
|
Log Message: ----------- Change "Reduced Scoring" to "Reduced Credit" and adjust message depending on whether it is before or after the due date Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: ProblemSet.pm Revision Data ------------- Index: ProblemSet.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/ProblemSet.pm,v retrieving revision 1.94 retrieving revision 1.95 diff -Llib/WeBWorK/ContentGenerator/ProblemSet.pm -Llib/WeBWorK/ContentGenerator/ProblemSet.pm -u -r1.94 -r1.95 --- lib/WeBWorK/ContentGenerator/ProblemSet.pm +++ lib/WeBWorK/ContentGenerator/ProblemSet.pm @@ -325,9 +325,15 @@ my $reducedScoringValue = $ce->{pg}->{ansEvalDefaults}->{reducedScoringValue}; my $reducedScoringPerCent = int(100*$reducedScoringValue+.5); my $beginReducedScoringPeriod = $self->formatDateTime($set->due_date() - $reducedScoringPeriodSec); - print CGI::div({class=>"ResultsAlert"},"This assignment has a Reduced Scoring Period that begins - $beginReducedScoringPeriod and ends on the due date, $dueDate. During this period all additional - work done counts $reducedScoringPerCent\% of the original."); + if (time < $set->due_date()) { + print CGI::div({class=>"ResultsAlert"},"This assignment has a Reduced Credit Period that begins + $beginReducedScoringPeriod and ends on the due date, $dueDate. During this period all additional + work done counts $reducedScoringPerCent\% of the original."); + } else { + print CGI::div({class=>"ResultsAlert"},"This assignment had a Reduced Credit Period that began + $beginReducedScoringPeriod and ended on the due date, $dueDate. During that period all additional + work done counted $reducedScoringPerCent\% of the original."); + } } # DBFIXME use iterator |
From: Arnie P. v. a. <we...@ma...> - 2010-01-31 02:51:31
|
Log Message: ----------- Add message about Reduced Credit if applicable Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: ProblemSets.pm Revision Data ------------- Index: ProblemSets.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/ProblemSets.pm,v retrieving revision 1.93 retrieving revision 1.94 diff -Llib/WeBWorK/ContentGenerator/ProblemSets.pm -Llib/WeBWorK/ContentGenerator/ProblemSets.pm -u -r1.93 -r1.94 --- lib/WeBWorK/ContentGenerator/ProblemSets.pm +++ lib/WeBWorK/ContentGenerator/ProblemSets.pm @@ -461,7 +461,16 @@ $control = "" unless $preOpenSets; $interactive = $name unless $preOpenSets; } elsif (time < $set->due_date) { - $status = "now open, due " . $self->formatDateTime($set->due_date); + $status = "now open, due " . $self->formatDateTime($set->due_date); + my $enable_reduced_scoring = $set->enable_reduced_scoring; + my $reducedScoringPeriod = $ce->{pg}->{ansEvalDefaults}->{reducedScoringPeriod}; + if ($reducedScoringPeriod > 0 and $enable_reduced_scoring ) { + my $reducedScoringPeriodSec = $reducedScoringPeriod*60; # $reducedScoringPeriod is in minutes + my $beginReducedScoringPeriod = $self->formatDateTime($set->due_date() - $reducedScoringPeriodSec); +# $status .= '. <FONT COLOR="#cc6600">Reduced Credit starts ' . $beginReducedScoringPeriod . '</FONT>'; + $status .= '. <div class="ResultsAlert">Reduced Credit starts ' . $beginReducedScoringPeriod . '</div>'; + + } $setIsOpen = 1; } elsif (time < $set->answer_date) { $status = "closed, answers on " . $self->formatDateTime($set->answer_date); |
From: dpvc v. a. <we...@ma...> - 2010-01-29 11:12:33
|
Log Message: ----------- A context that allows students to enter any string Added Files: ----------- pg/macros: contextArbitraryString.pl Revision Data ------------- --- /dev/null +++ macros/contextArbitraryString.pl @@ -0,0 +1,54 @@ +#################################################################### +# +# Implements a context in which the student's answer is treated as a +# literal string, and not parsed further. The real answer checking +# should be performed in a custom checker passed to the answer +# string's cmp() method. E.g., +# +# loadMacros("contextArbitraryString.pl"); +# Context("ArbitraryString"); +# +# ANS(Compute("The string I want")->cmp(checker => sub { +# my ($correct,$student,$ans) = @_; +# $correct = $correct->value; # get perl string from String object +# $student = $student->value; # ditto +# ## +# ## do your checking here, and return true if correct +# ## or false if incorrect. For example +# ## return $correct eq $student; +# ## +# return $score; +# })); +# + +sub _contextArbitraryString_init { + my $context = $main::context{ArbitraryString} = Parser::Context->getCopy("Numeric"); + $context->{name} = "ArbitraryString"; + $context->parens->clear(); + $context->variables->clear(); + $context->constants->clear(); + $context->operators->clear(); + $context->functions->clear(); + $context->strings->clear(); + $context->{pattern}{number} = "^\$"; + $context->variables->{patterns} = {}; + $context->strings->{patterns}{".*"} = [-20,'str']; + $context->{value}{"String()"} = "context::ArbitraryString"; + $context->{parser}{String} = "context::ArbitraryString::String"; + $context->update; +} + +package context::ArbitraryString; +sub new {shift; main::Compute(@_)} + +package context::ArbitraryString::String; +our @ISA = ('Parser::String'); + +sub new { + my $self = shift; + my ($equation,$value,$ref) = @_; + $value = $equation->{string}; + $self->SUPER::new($equation,$value,$ref); +} + +1; |
From: dpvc v. a. <we...@ma...> - 2010-01-27 13:03:45
|
Log Message: ----------- Allow error for correct answer but not student answer in getTypicalValue 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.127 retrieving revision 1.128 diff -Llib/Value/AnswerChecker.pm -Llib/Value/AnswerChecker.pm -u -r1.127 -r1.128 --- lib/Value/AnswerChecker.pm +++ lib/Value/AnswerChecker.pm @@ -1580,7 +1580,7 @@ my $self = shift; my $other = shift; my $ans = shift; return 1 if $self->type eq $other->type; my $typeMatch = $self->getTypicalValue($self); - $other = $self->getTypicalValue($other) if Value::isFormula($other); + $other = $self->getTypicalValue($other,1) if Value::isFormula($other); return 1 unless defined($other); # can't really tell, so don't report type mismatch return 1 if $typeMatch->classMatch('String') && Value::isFormula($ans->{typeMatch}); # avoid infinite loop $typeMatch->typeMatch($other,$ans); @@ -1590,11 +1590,11 @@ # Create a value from the formula (so we know the output type) # sub getTypicalValue { - my $self = shift; my $f = shift; + my $self = shift; my $f = shift; my $noError = shift; return $f->{test_values}[0] if $f->{test_values}; my $points = $f->{test_points} || $self->{test_points}; return ($f->createPointValues($points)||[])->[0] if $points; - return ((($f->createRandomPoints(1,undef,1))[1])||[])->[0]; + return ((($f->createRandomPoints(1,undef,$noError))[1])||[])->[0]; } # |
From: dpvc v. a. <we...@ma...> - 2010-01-27 12:08:43
|
Log Message: ----------- Allow creation of test points with no errors 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.65 retrieving revision 1.66 diff -Llib/Value/Formula.pm -Llib/Value/Formula.pm -u -r1.65 -r1.66 --- lib/Value/Formula.pm +++ lib/Value/Formula.pm @@ -308,7 +308,7 @@ # sub createRandomPoints { my $self = shift; my $context = $self->context; - my ($num_points,$include) = @_; my $cacheResults = !defined($num_points); + my ($num_points,$include,$noErrors) = @_; my $cacheResults = !defined($num_points); $num_points = int($self->getFlag('num_points',5)) unless defined($num_points); $num_points = 1 if $num_points < 1; @@ -358,8 +358,9 @@ my $error = "Can't generate enough valid points for comparison"; $error .= ':<div style="margin-left:1em">'.($context->{error}{message} || $@).'</div>' if ($self->getFlag('showTestPointErrors')); - $error =~ s/ (in \S+ )?at line \d+.*//s; - Value::Error($error); + $error =~ s! (in \S+ )?at line \d+.*</div>!</div>!s; + Value::Error($error) unless $noErrors; + return ($points,$values,1); } return ($points,$values) unless $cacheResults; |
From: dpvc v. a. <we...@ma...> - 2010-01-27 12:04:38
|
Log Message: ----------- Make Formula typeMatch work with test_points, and not produce error messages 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.126 retrieving revision 1.127 diff -Llib/Value/AnswerChecker.pm -Llib/Value/AnswerChecker.pm -u -r1.126 -r1.127 --- lib/Value/AnswerChecker.pm +++ lib/Value/AnswerChecker.pm @@ -1579,14 +1579,25 @@ sub typeMatch { my $self = shift; my $other = shift; my $ans = shift; return 1 if $self->type eq $other->type; - my $typeMatch = ($self->createRandomPoints(1))[1]->[0]; - $other = eval {($other->createRandomPoints(1))[1]->[0]} if Value::isFormula($other); + my $typeMatch = $self->getTypicalValue($self); + $other = $self->getTypicalValue($other) if Value::isFormula($other); return 1 unless defined($other); # can't really tell, so don't report type mismatch return 1 if $typeMatch->classMatch('String') && Value::isFormula($ans->{typeMatch}); # avoid infinite loop $typeMatch->typeMatch($other,$ans); } # +# Create a value from the formula (so we know the output type) +# +sub getTypicalValue { + my $self = shift; my $f = shift; + return $f->{test_values}[0] if $f->{test_values}; + my $points = $f->{test_points} || $self->{test_points}; + return ($f->createPointValues($points)||[])->[0] if $points; + return ((($f->createRandomPoints(1,undef,1))[1])||[])->[0]; +} + +# # Handle removal of outermost parens in a list. # Evaluate answer, if the eval option is used. # Handle the UpToConstant option. |
From: dpvc v. a. <we...@ma...> - 2010-01-24 22:52:43
|
Log Message: ----------- Changed warning message for decimal numbers in no-decimal modes Modified Files: -------------- pg/macros: contextFraction.pl Revision Data ------------- Index: contextFraction.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextFraction.pl,v retrieving revision 1.9 retrieving revision 1.10 diff -Lmacros/contextFraction.pl -Lmacros/contextFraction.pl -u -r1.9 -r1.10 --- macros/contextFraction.pl +++ macros/contextFraction.pl @@ -247,6 +247,8 @@ $context = $main::context{'Fraction-NoDecimals'} = $context->copy; $context->{name} = "Fraction-NoDecimals"; Parser::Number::NoDecimals($context); + $context->{error}{msg}{"You are not allowed to type decimal numbers in this problem"} = + "You are only allowed to enter fractions, not decimal numbers"; $context = $main::context{LimitedFraction} = $context->copy; $context->{name} = "LimitedFraction"; |
From: dpvc v. a. <we...@ma...> - 2010-01-24 02:33:50
|
Log Message: ----------- Removed deletion of i,j,k which are not in the original Point context Modified Files: -------------- pg/macros: contextLimitedPoint.pl Revision Data ------------- Index: contextLimitedPoint.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextLimitedPoint.pl,v retrieving revision 1.14 retrieving revision 1.15 diff -Lmacros/contextLimitedPoint.pl -Lmacros/contextLimitedPoint.pl -u -r1.14 -r1.15 --- macros/contextLimitedPoint.pl +++ macros/contextLimitedPoint.pl @@ -161,7 +161,6 @@ '[' => {formMatrix => 0}, ); $context->variables->are(x=>'Real'); - $context->constants->remove('i','j','k'); main::Context("LimitedPoint"); ### FIXME: probably should require author to set this explicitly } |
From: Mike G. v. a. <we...@ma...> - 2010-01-23 22:08:44
|
Log Message: ----------- Corrects bug (uncovered by newer versions of CGI.pm after version 3.29 and before 3.42) which defaulted students to "guests" in the permission popup menu used for editing the student record. It showed up only for student because there default value was 0 -- which can be treated ambiguously -- as opposed to 2 or 10 which is not. Adding the override switch forces the default value generated in the perl code to override other default values for the popupmenu and provides the expected behavior. The default value is set as [$default] so that [0] is properly recognized. This notation is usually used to select several defaults however just using $default did not work in CGI.pm 3.42. This should fix the bug where students were mysteriously reassigned as guests and lost their "submit answer" buttons. sites with older versions of CGI.pm will not have observed this problem.CVS: ---------------------------------------------------------------------- Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: UserList.pm Revision Data ------------- Index: UserList.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm,v retrieving revision 1.94 retrieving revision 1.95 diff -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -u -r1.94 -r1.95 --- lib/WeBWorK/ContentGenerator/Instructor/UserList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/UserList.pm @@ -1509,11 +1509,12 @@ $default = $val if ( $value eq $role ); } return CGI::popup_menu({ - name => $fieldName, - values => \@values, - default => $default, - labels => \%labels, - override => 1, # force default to be selected. (corrects bug on newer CGI + -name => $fieldName, + -values => \@values, + -default => [$default], # force default of 0 to be a selector value (instead of + # being considered as a null -- now works with CGI 3.42 + -labels => \%labels, + -override => 1, # force default value to be selected. (corrects bug on newer CGI }); } } |
From: dpvc v. a. <we...@ma...> - 2010-01-23 16:59:52
|
Log Message: ----------- Fixed wrong default value in comments Modified Files: -------------- pg/macros: parserImplicitEquation.pl Revision Data ------------- Index: parserImplicitEquation.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/parserImplicitEquation.pl,v retrieving revision 1.14 retrieving revision 1.15 diff -Lmacros/parserImplicitEquation.pl -Lmacros/parserImplicitEquation.pl -u -r1.14 -r1.15 --- macros/parserImplicitEquation.pl +++ macros/parserImplicitEquation.pl @@ -106,7 +106,7 @@ the minimum tolerance allowed. -=item C<S<< ImplicitAbsoluteMaxTolerance => 1E-3 >>> +=item C<S<< ImplicitAbsoluteMaxTolerance => 1 >>> the maximum tolerance allowed. |
From: dpvc v. a. <we...@ma...> - 2010-01-23 16:59:13
|
Log Message: ----------- Fixed typos in comments Modified Files: -------------- pg/macros: contextInequalities.pl Revision Data ------------- Index: contextInequalities.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextInequalities.pl,v retrieving revision 1.21 retrieving revision 1.22 diff -Lmacros/contextInequalities.pl -Lmacros/contextInequalities.pl -u -r1.21 -r1.22 --- macros/contextInequalities.pl +++ macros/contextInequalities.pl @@ -343,10 +343,10 @@ ################################################## # -# A special class usd for the variables in +# A special class used for the variables in # inequalities, since they are not really # variables for the formula. (They don't need -# to be subtituted or given values when the +# to be substituted or given values when the # formula is evaluated, and so on.) These are # really just placeholders, here. # |
From: dpvc v. a. <we...@ma...> - 2010-01-23 16:58:18
|
Log Message: ----------- Change ProperFractions to MixedNumbers in several parameters, but allow originals for backward compatibility Modified Files: -------------- pg/macros: contextFraction.pl Revision Data ------------- Index: contextFraction.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextFraction.pl,v retrieving revision 1.8 retrieving revision 1.9 diff -Lmacros/contextFraction.pl -Lmacros/contextFraction.pl -u -r1.8 -r1.9 --- macros/contextFraction.pl +++ macros/contextFraction.pl @@ -145,14 +145,16 @@ strictMultiplication=>1). These are all three 0 by default in the Fraction and Fraction-NoDecimals contexts, but 1 in LimitedFraction. -=item S<C<< allowProperFractions >>> +=item S<C<< allowMixedNumbers >>> This determines whether a space between a whole number and a fraction is interpretted as implicit multiplication (as it usually would be in WeBWorK), or as addition, allowing "4 1/2" to mean "4 and 1/2". By default, it acts as multiplication in the Fraction and Fraction-NoDecimals contexts, and as addition in LimitedFraction. If -you set allowProperFractions=>1 you should also set reduceConstants=>0. +you set allowMixedNumbers=>1 you should also set reduceConstants=>0. +This parameter used to be named allowProperFractions, which is +deprecated, but you can still use it for backward-compatibility. =item S<C<< requireProperFractions >>> @@ -160,17 +162,19 @@ It is 0 by default, meaning improper fractions are allowed. When set, you will not be able to enter 5/2 as a fraction, but must use "2 1/2". This flag is allowed only when strictFractions is in effect. -Set it to 1 only when you also set allowProperFractions, or you will +Set it to 1 only when you also set allowMixedNumbers, or you will not be able to specify fractions bigger than one. It is off by default in all three contexts. -=item S<C<< showProperFractions >>> +=item S<C<< showMixedNumbers >>> This controls whether fractions are displayed as proper fractions or not. When set, 5/2 will be displayed as 2 1/2 in the answer preview area, otherwise it will be displayed as 5/2. This flag is 0 by default in the Fraction and Fraction-NoDecimals contexts, and 1 in -LimitedFraction. +LimitedFraction. This parameter used to be named showProperFractions, +which is deprecated, but you can still use it for +backward-compatibility. =back @@ -230,9 +234,9 @@ $context->flags->set( reduceFractions => 1, strictFractions => 0, strictMinus => 0, strictMultiplication => 0, - allowProperFractions => 0, # also set reduceConstants => 0 if you change this + allowMixedNumbers => 0, # also set reduceConstants => 0 if you change this requireProperFractions => 0, - showProperFractions => 0, + showMixedNumbers => 0, ); $context->reduction->set('a/b' => 1,'a b/c' => 1, '0 a/b' => 1); $context->{value}{Fraction} = "context::Fraction::Fraction"; @@ -254,8 +258,8 @@ $context->functions->disable('All'); $context->flags->set( strictFractions => 1, strictMinus => 1, strictMultiplication => 1, - allowProperFractions => 1, reduceConstants => 0, - showProperFractions => 1, + allowMixedNumbers => 1, reduceConstants => 0, + showMixedNumbers => 1, ); $context->{cmpDefaults}{Fraction} = {studentsMustReduceFractions => 1}; @@ -411,7 +415,10 @@ my $self = shift; $self->SUPER::_check; my $isFraction = 0; - if ($self->context->flag("allowProperFractions")) { + my $allowMixedNumbers = $self->context->flag("allowProperFractions"); + $allowMixedNumbers = $self->context->flag("allowMixedNumbers") + unless defined($allowMixedNumbers) && $allowMixedNumbers ne ""; + if ($allowMixedNumbers) { $isFraction = ($self->{lop}->class =~ /INTEGER|MINUS/ && !$self->{lop}{hadParens} && $self->{rop}->class eq 'FRACTION' && !$self->{rop}{hadParens} && $self->{rop}->eval >= 0); @@ -644,7 +651,7 @@ } # -# parts are not Value objects, so don't transfer +# Parts are not Value objects, so don't transfer # sub transferFlags {} @@ -657,6 +664,14 @@ return $n =~ m/^-?\d+$/; }; +# +# Get a flag that has been renamed +# +sub getFlagWithAlias { + my $self = shift; my $flag = shift; my $alias = shift; + return $self->getFlag($alias,$self->getFlag($flag)); +} + ################################################## # @@ -759,7 +774,7 @@ my $self = shift; my $equation = shift; my $prec = shift; my ($a,$b) = @{$self->{data}}; my $n = ""; return $a if $b == 1; - if ($self->getFlag("showProperFractions") && CORE::abs($a) > $b) + if ($self->getFlagWithAlias("showMixedNumbers","showProperFractions") && CORE::abs($a) > $b) {$n = int($a/$b); $a = CORE::abs($a) % $b; $n .= " " unless $a == 0} $n .= "$a/$b" unless $a == 0 && $n ne ''; $n = "($n)" if defined $prec && $prec >= 1; @@ -770,7 +785,7 @@ my $self = shift; my $equation = shift; my $prec = shift; my ($a,$b) = @{$self->{data}}; my $n = ""; return $a if $b == 1; - if ($self->getFlag("showProperFractions") && CORE::abs($a) > $b) + if ($self->getFlagWithAlias("showMixedNumbers","showProperFractions") && CORE::abs($a) > $b) {$n = int($a/$b); $a = CORE::abs($a) % $b; $n .= " " unless $a == 0} my $s = ""; ($a,$s) = (-$a,"-") if $a < 0; $n .= ($self->{isHorizontal} ? "$s$a/$b" : "${s}{\\textstyle\\frac{$a}{$b}}") |
From: Mike G. v. a. <we...@ma...> - 2010-01-11 18:53:30
|
Log Message: ----------- warning messages if timezone hasn't been defined correctly Modified Files: -------------- webwork2/lib/WeBWorK: Utils.pm Revision Data ------------- Index: Utils.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils.pm,v retrieving revision 1.83 retrieving revision 1.84 diff -Llib/WeBWorK/Utils.pm -Llib/WeBWorK/Utils.pm -u -r1.83 -r1.84 --- lib/WeBWorK/Utils.pm +++ lib/WeBWorK/Utils.pm @@ -477,6 +477,7 @@ sub parseDateTime($;$) { my ($string, $display_tz) = @_; + warn "time zone not defined".caller() unless defined($display_tz); $display_tz ||= "local"; #warn "parseDateTime('$string', '$display_tz')\n"; @@ -590,8 +591,8 @@ sub formatDateTime($;$) { my ($dateTime, $display_tz) = @_; + warn "not defined formatDateTime('$dateTime', '$display_tz') ",join(" ",caller(2)) unless $display_tz and $dateTime; $display_tz ||= "local"; - #warn "formatDateTime('$dateTime', '$display_tz')\n"; my $dt = DateTime->from_epoch(epoch => $dateTime, time_zone => $display_tz); #warn "\t\$dt = ", $dt->strftime(DATE_FORMAT), "\n"; |
From: Mike G. v. a. <we...@ma...> - 2010-01-11 18:51:47
|
Log Message: ----------- correct typo Modified Files: -------------- webwork2/lib/WeBWorK/Utils: CourseManagement.pm Revision Data ------------- Index: CourseManagement.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils/CourseManagement.pm,v retrieving revision 1.48 retrieving revision 1.49 diff -Llib/WeBWorK/Utils/CourseManagement.pm -Llib/WeBWorK/Utils/CourseManagement.pm -u -r1.48 -r1.49 --- lib/WeBWorK/Utils/CourseManagement.pm +++ lib/WeBWorK/Utils/CourseManagement.pm @@ -588,8 +588,7 @@ croak "$courseID: course not found"; } - # fail if a course archive already exists - # FIXME there could be an option to overwrite an existing archive + # replace previous archived file if it exists. if (-e $archive_path) { unlink($archive_path) if (-w $archive_path); unless (-e $archive_path) { @@ -602,7 +601,7 @@ #### step 1: dump tables ##### unless (-e $dump_dir) { - mkdir $dump_dir or croak "Failed to create course database dump directory '$data_dir': $!"; + mkdir $dump_dir or croak "Failed to create course database dump directory '$dump_dir': $!"; } my $db = new WeBWorK::DB($ce->{dbLayout}); |
From: Mike G. v. a. <we...@ma...> - 2010-01-11 18:48:05
|
Log Message: ----------- Fix to prevent the error messages that occur when the problem set has not yet been assigned to a user. Still a bit fragile and under tested but it at least stops the error messages from being issued. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: ProblemSetDetail.pm ProblemSetList.pm Revision Data ------------- Index: ProblemSetDetail.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm,v retrieving revision 1.77 retrieving revision 1.78 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -u -r1.77 -r1.78 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm @@ -485,7 +485,8 @@ if ($field =~ /_date/) { $globalValue = $self->formatDateTime($globalValue) if defined $globalValue && $globalValue ne $labels{""}; - $userValue = $self->formatDateTime($userValue) if defined $userValue && $userValue ne $labels{""}; + # this is still fragile, but the check for blank (as opposed to 0) $userValue seems to prevent errors when no user has been assigned. + $userValue = $self->formatDateTime($userValue) if defined $userValue && $userValue =~/\S/ && $userValue ne $labels{""}; } if ( defined($properties{convertby}) && $properties{convertby} ) { Index: ProblemSetList.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm,v retrieving revision 1.109 retrieving revision 1.110 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm -u -r1.109 -r1.110 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm @@ -1096,11 +1096,11 @@ $newSetRecord->set_id($newSetID); $newSetRecord->set_header(""); $newSetRecord->hardcopy_header(""); - $newSetRecord->open_date(time + ONE_WEEK); - $newSetRecord->due_date(time + 2*ONE_WEEK ); - $newSetRecord->answer_date(time + 2*ONE_WEEK ); - $newSetRecord->published(DEFAULT_PUBLISHED_STATE); # don't want students to see an empty set - $newSetRecord->enable_reduced_scoring(DEFAULT_ENABLED_REDUCED_SCORING_STATE); + $newSetRecord->open_date(time + ONE_WEEK()); + $newSetRecord->due_date(time + 2*ONE_WEEK() ); + $newSetRecord->answer_date(time + 2*ONE_WEEK() ); + $newSetRecord->published(DEFAULT_PUBLISHED_STATE()); # don't want students to see an empty set + $newSetRecord->enable_reduced_scoring(DEFAULT_ENABLED_REDUCED_SCORING_STATE()); $db->addGlobalSet($newSetRecord); } elsif ($type eq "copy") { return CGI::div({class => "ResultsWithError"}, "Failed to duplicate set: no set selected for duplication!") unless $oldSetID =~ /\S/; |
From: jj v. a. <we...@ma...> - 2010-01-07 18:32:24
|
Log Message: ----------- Added macros to make it easier to have underlined text in a problem: BUL and EUL Modified Files: -------------- pg/macros: PGbasicmacros.pl Revision Data ------------- Index: PGbasicmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGbasicmacros.pl,v retrieving revision 1.62 retrieving revision 1.63 diff -Lmacros/PGbasicmacros.pl -Lmacros/PGbasicmacros.pl -u -r1.62 -r1.63 --- macros/PGbasicmacros.pl +++ macros/PGbasicmacros.pl @@ -61,6 +61,8 @@ $EBOLD, $BITALIC, $EITALIC, + $BUL, + $EUL, $BCENTER, $ECENTER, $HR, @@ -120,6 +122,8 @@ $main::EBOLD = EBOLD(); $main::BITALIC = BITALIC(); $main::EITALIC = EITALIC(); + $main::BUL = BUL(); + $main::EUL = EUL(); $main::BCENTER = BCENTER(); $main::ECENTER = ECENTER(); $main::HR = HR(); @@ -165,6 +169,8 @@ $EBOLD = EBOLD(); $BITALIC = BITALIC(); $EITALIC = EITALIC(); + $BUL = BUL(); + $EUL = EUL(); $BCENTER = BCENTER(); $ECENTER = ECENTER(); $HR = HR(); @@ -1219,6 +1225,8 @@ $EBOLD EBOLD() end bold typeface $BITALIC BITALIC() begin italic typeface $EITALIC EITALIC() end italic typeface + $BUL BUL() begin underlined type + $EUL EUL() end underlined type $BCENTER BCENTER() begin centered environment $ECENTER ECENTER() end centered environment $HR HR() horizontal rule @@ -1281,6 +1289,8 @@ sub EBOLD { MODES( TeX => '}', Latex2HTML => '}',HTML => '</B>'); }; sub BITALIC { MODES(TeX => '{\\it ', Latex2HTML => '{\\it ', HTML => '<I>'); }; sub EITALIC { MODES(TeX => '} ', Latex2HTML => '} ', HTML => '</I>'); }; +sub BUL { MODES(TeX => '\\underline{', Latex2HTML => '\\underline{', HTML => '<U>'); }; +sub EUL { MODES(TeX => '}', Latex2HTML => '}', HTML => '</U>'); }; sub BCENTER { MODES(TeX => '\\begin{center} ', Latex2HTML => ' \\begin{rawhtml} <div align="center"> \\end{rawhtml} ', HTML => '<div align="center">'); }; sub ECENTER { MODES(TeX => '\\end{center} ', Latex2HTML => ' \\begin{rawhtml} </div> \\end{rawhtml} ', HTML => '</div>'); }; sub HR { MODES(TeX => '\\par\\hrulefill\\par ', Latex2HTML => '\\begin{rawhtml} <HR> \\end{rawhtml}', HTML => '<HR>'); }; |
From: Mike G. v. a. <we...@ma...> - 2010-01-03 17:33:26
|
Log Message: ----------- The buttons for setConfig and getConfig are only shown in the debug display if those commands are defined and non-empty. Likewise for the setState and getState buttons. Modified Files: -------------- pg/macros: AppletObjects.pl Revision Data ------------- Index: AppletObjects.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/AppletObjects.pl,v retrieving revision 1.23 retrieving revision 1.24 diff -Lmacros/AppletObjects.pl -Lmacros/AppletObjects.pl -u -r1.23 -r1.24 --- macros/AppletObjects.pl +++ macros/AppletObjects.pl @@ -49,7 +49,6 @@ </script> <script src="/webwork2_files/js/ww_applet_support.js"> //upload functions stored in /opt/webwork/webwork2/htdocs/js ... - </script> END_HEADER_TEXT @@ -110,14 +109,14 @@ my %options = @_; # debugMode can be turned on by setting it to 1 in either the applet definition or at insertAll time - my $debugMode = (defined($options{debug}) and $options{debug}==1) ? 1 : 0; + my $debugMode = (defined($options{debug}) and $options{debug}>0) ? $options{debug} : 0; my $includeAnswerBox = (defined($options{includeAnswerBox}) and $options{includeAnswerBox}==1) ? 1 : 0; $debugMode = $debugMode || $self->debugMode; $self->debugMode( $debugMode); my $reset_button = $options{reinitialize_button} || 0; - warn qq! please change "reset_button=>1" to "reinitialize_button=>1" in the applet->installAll() command ! if defined($options{reset_button}); + warn qq! please change "reset_button=>1" to "reinitialize_button=>1" in the applet->installAll() command \n! if defined($options{reset_button}); # prepare html code for storing state my $appletName = $self->appletName; my $appletStateName = "${appletName}_state"; @@ -159,28 +158,39 @@ $base_64_encoded_answer_value =~ s/\r|\n//g; # get rid of line returns # debug version of the applet state answerBox and controls my $debug_input_element = qq!\n<textarea rows="4" cols="80" - name = "$appletStateName">$decoded_answer_value</textarea><br/> + name = "$appletStateName">$decoded_answer_value</textarea><br/>!; + if ($getState=~/\S/) { # if getStateAlias is not an empty string + $debug_input_element .= qq! <input type="button" value="$getState" onClick="debugText=''; ww_applet_list['$appletName'].getState(); if (debugText) {alert(debugText)};" - > + >!; + } + if ($setState=~/\S/) { # if setStateAlias is not an empty string + $debug_input_element .= qq! <input type="button" value="$setState" onClick="debugText=''; ww_applet_list['$appletName'].setState(); if (debugText) {alert(debugText)};" - > + >!; + } + if ($getConfig=~/\S/) { # if getConfigAlias is not an empty string + $debug_input_element .= qq! <input type="button" value="$getConfig" onClick="debugText=''; ww_applet_list['$appletName'].getConfig(); if (debugText) {alert(debugText)};" - > + >!; + } + if ($setConfig=~/\S/) { # if setConfigAlias is not an empty string + $debug_input_element .= qq! <input type="button" value="$setConfig" onClick="debugText=''; ww_applet_list['$appletName'].setConfig(); if (debugText) {alert(debugText)};" - > - !; + >!; + } my $state_input_element = ($debugMode) ? $debug_input_element : qq!\n<input type="hidden" name = "$appletStateName" value ="$base_64_encoded_answer_value">!; |
From: Mike G. v. a. <we...@ma...> - 2010-01-03 17:31:12
|
Log Message: ----------- Added name TIMEOUT for the delay time between checking whether the applet is ready. Modified Files: -------------- webwork2/htdocs/js: ww_applet_support.js Revision Data ------------- Index: ww_applet_support.js =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/js/ww_applet_support.js,v retrieving revision 1.12 retrieving revision 1.13 diff -Lhtdocs/js/ww_applet_support.js -Lhtdocs/js/ww_applet_support.js -u -r1.12 -r1.13 --- htdocs/js/ww_applet_support.js +++ htdocs/js/ww_applet_support.js @@ -22,6 +22,8 @@ var ww_applet_list = new Object; // holds java script version (jsApplet) ww_applet objects + + var TIMEOUT = 100; // time delay between successive checks for applet readiness ////////////////////////////////////////////////////////// @@ -497,7 +499,7 @@ alert(debugText ); debugText=""; } - window.setTimeout( "ww_applet_list[\""+ appletName + "\"].safe_applet_initialize(" + i + ")",100); + window.setTimeout( "ww_applet_list[\""+ appletName + "\"].safe_applet_initialize(" + i + ")",TIMEOUT); } else if( 0 < i ) { // now that applet is loaded configure it and initialize it with saved data. this.debug_add(" applet is ready = " + applet_loaded ); |