You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(53) |
Feb
(56) |
Mar
|
Apr
|
May
(30) |
Jun
(78) |
Jul
(121) |
Aug
(155) |
Sep
(77) |
Oct
(61) |
Nov
(45) |
Dec
(94) |
2006 |
Jan
(116) |
Feb
(33) |
Mar
(11) |
Apr
(23) |
May
(60) |
Jun
(89) |
Jul
(130) |
Aug
(109) |
Sep
(124) |
Oct
(63) |
Nov
(82) |
Dec
(45) |
2007 |
Jan
(31) |
Feb
(35) |
Mar
(123) |
Apr
(36) |
May
(18) |
Jun
(134) |
Jul
(133) |
Aug
(241) |
Sep
(126) |
Oct
(31) |
Nov
(15) |
Dec
(5) |
2008 |
Jan
(11) |
Feb
(6) |
Mar
(16) |
Apr
(29) |
May
(43) |
Jun
(149) |
Jul
(27) |
Aug
(29) |
Sep
(37) |
Oct
(20) |
Nov
(4) |
Dec
(6) |
2009 |
Jan
(34) |
Feb
(30) |
Mar
(16) |
Apr
(6) |
May
(1) |
Jun
(32) |
Jul
(22) |
Aug
(7) |
Sep
(18) |
Oct
(50) |
Nov
(22) |
Dec
(8) |
2010 |
Jan
(17) |
Feb
(15) |
Mar
(10) |
Apr
(9) |
May
(67) |
Jun
(30) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
|
From: Arnie P. v. a. <we...@ma...> - 2009-11-02 17:10:56
|
Log Message: ----------- Allow reduced scoring to be enabled or disabled for individual assignments. Default is disabled. 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.108 retrieving revision 1.109 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm -u -r1.108 -r1.109 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm @@ -86,14 +86,15 @@ use constant HIDE_SETS_THRESHOLD => 500; use constant DEFAULT_PUBLISHED_STATE => 1; +use constant DEFAULT_ENABLED_REDUCED_SCORING_STATE => 0; use constant ONE_WEEK => 60*60*24*7; use constant EDIT_FORMS => [qw(cancelEdit saveEdit)]; use constant VIEW_FORMS => [qw(filter sort edit publish import export score create delete)]; use constant EXPORT_FORMS => [qw(cancelExport saveExport)]; -use constant VIEW_FIELD_ORDER => [ qw( select set_id problems users published open_date due_date answer_date) ]; -use constant EDIT_FIELD_ORDER => [ qw( set_id published open_date due_date answer_date) ]; +use constant VIEW_FIELD_ORDER => [ qw( select set_id problems users published enable_reduced_scoring open_date due_date answer_date) ]; +use constant EDIT_FIELD_ORDER => [ qw( set_id published enable_reduced_scoring open_date due_date answer_date) ]; use constant EXPORT_FIELD_ORDER => [ qw( select set_id filename) ]; # permissions needed to perform a given action @@ -166,6 +167,11 @@ size => 4, access => "readwrite", }, + enable_reduced_scoring => { + type => "checked", + size => 4, + access => "readwrite", + }, assignment_type => { type => "text", size => 20, @@ -312,7 +318,8 @@ open_date due_date answer_date - published + published + enable_reduced_scoring )} = ( "Select", "Edit<br> Problems", @@ -324,7 +331,8 @@ "Open Date", "Due Date", "Answer Date", - "Visible", + "Visible", + "Reduced Scoring<br> Enabled" ); ########## set initial values for state fields @@ -533,6 +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; print CGI::p({},"Showing ", scalar @visibleSetIDs, " out of ", scalar @allSetIDs, " sets."); @@ -861,6 +870,74 @@ return $result } +sub enable_reduced_scoring_form { + my ($self, $onChange, %actionParams) = @_; + + return join ("", + "Make ", + CGI::popup_menu( + -name => "action.enable_reduced_scoring.scope", + -values => [ qw(none all selected) ], + -default => $actionParams{"action.enable_reduced_scoring.scope"}->[0] || "selected", + -labels => { + none => "", + all => "all sets", +# visible => "visible sets", + selected => "selected sets", + }, + -onchange => $onChange, + ), + CGI::popup_menu( + -name => "action.enable_reduced_scoring.value", + -values => [ 0, 1 ], + -default => $actionParams{"action.enable_reduced_scoring.value"}->[0] || "1", + -labels => { + 0 => "disable", + 1 => "enable", + }, + -onchange => $onChange, + ), + " reduced sccoring.", + ); +} + +sub enable_reduced_scoring_handler { + my ($self, $genericParams, $actionParams, $tableParams) = @_; + + my $r = $self->r; + my $db = $r->db; + + my $result = ""; + + my $scope = $actionParams->{"action.enable_reduced_scoring.scope"}->[0]; + my $value = $actionParams->{"action.enable_reduced_scoring.value"}->[0]; + + my $verb = $value ? "enabled" : "disabled"; + + my @setIDs; + + if ($scope eq "none") { # FIXME: double negative "Make no sets hidden" might make professor expect all sets to be made visible. + @setIDs = (); + $result = "No change made to any set."; + } elsif ($scope eq "all") { + @setIDs = @{ $self->{allSetIDs} }; + $result = "Reduced Scoring $verb for all sets."; + } elsif ($scope eq "visible") { + @setIDs = @{ $self->{visibleSetIDs} }; + $result = "Reduced Scoring $verb for visable sets."; + } elsif ($scope eq "selected") { + @setIDs = @{ $genericParams->{selected_sets} }; + $result = "Reduced Scoring $verb for selected sets."; + } + + # can we use UPDATE here, instead of fetch/change/store? + my @sets = $db->getGlobalSets(@setIDs); + + map { $_->enable_reduced_scoring("$value") if $_; $db->putGlobalSet($_); } @sets; + + return $result + +} sub score_form { my ($self, $onChange, %actionParams) = @_; @@ -1023,6 +1100,7 @@ $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/; @@ -1498,6 +1576,7 @@ $newSetRecord->due_date($dueDate); $newSetRecord->answer_date($answerDate); $newSetRecord->published(DEFAULT_PUBLISHED_STATE); + $newSetRecord->enable_reduced_scoring(DEFAULT_ENABLED_REDUCED_SCORING_STATE); # gateway/version data. these should are all initialized to '' # by readSetDef, so for non-gateway/versioned sets they'll just @@ -2020,6 +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 $users = $db->countSetUsers($Set->set_id); my $totalUsers = $self->{totalUsers}; @@ -2109,6 +2189,7 @@ $fieldValue = $self->formatDateTime($fieldValue) if $field =~ /_date/; $fieldValue =~ s/ / /g unless $editMode; $fieldValue = ($fieldValue) ? "Yes" : "No" if $field =~ /published/ and not $editMode; + $fieldValue = ($fieldValue) ? "Yes" : "No" if $field =~ /enable_reduced_scoring/ and not $editMode; push @tableCells, CGI::font({class=>$publishedClass}, $self->fieldEditHTML($fieldName, $fieldValue, \%properties)); #$fakeRecord{$field} = CGI::font({class=>$publishedClass}, $self->fieldEditHTML($fieldName, $fieldValue, \%properties)); } |
From: Arnie P. v. a. <we...@ma...> - 2009-11-02 17:10:32
|
Log Message: ----------- Allow reduced scoring to be enabled or disabled for individual assignments. Default is disabled. 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.75 retrieving revision 1.76 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -u -r1.75 -r1.76 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm @@ -38,7 +38,7 @@ # but they are functionally and semantically different # these constants determine which fields belong to what type of record -use constant SET_FIELDS => [qw(set_header hardcopy_header open_date due_date answer_date published restrict_ip relax_restrict_ip assignment_type attempts_per_version version_time_limit time_limit_cap versions_per_interval time_interval problem_randorder problems_per_page hide_score:hide_score_by_problem hide_work)]; +use constant SET_FIELDS => [qw(set_header hardcopy_header open_date due_date answer_date published enable_reduced_scoring restrict_ip relax_restrict_ip assignment_type attempts_per_version version_time_limit time_limit_cap versions_per_interval time_interval problem_randorder problems_per_page hide_score:hide_score_by_problem hide_work)]; use constant PROBLEM_FIELDS =>[qw(source_file value max_attempts)]; use constant USER_PROBLEM_FIELDS => [qw(problem_seed status num_correct num_incorrect)]; @@ -56,7 +56,7 @@ # FIXME: in the long run, we may want to let hide_score and hide_work be # FIXME: set for non-gateway assignments. right now (11/30/06) they are # FIXME: only used for gateways -use constant SET_FIELD_ORDER => [qw(open_date due_date answer_date published restrict_ip relax_restrict_ip assignment_type)]; +use constant SET_FIELD_ORDER => [qw(open_date due_date answer_date published enable_reduced_scoring restrict_ip relax_restrict_ip assignment_type)]; # use constant GATEWAY_SET_FIELD_ORDER => [qw(attempts_per_version version_time_limit time_interval versions_per_interval problem_randorder problems_per_page hide_score hide_work)]; use constant GATEWAY_SET_FIELD_ORDER => [qw(version_time_limit time_limit_cap attempts_per_version time_interval versions_per_interval problem_randorder problems_per_page hide_score:hide_score_by_problem hide_work)]; @@ -138,6 +138,16 @@ 0 => "No", }, }, + enable_reduced_scoring => { + name => "Reduced Scoring Enabled", + type => "choose", + override => "all", + choices => [qw( 0 1 )], + labels => { + 1 => "Yes", + 0 => "No", + }, + }, restrict_ip => { name => "Restrict Access by IP", type => "choose", |
From: Arnie P. v. a. <we...@ma...> - 2009-11-02 17:09:39
|
Log Message: ----------- Allow reduced scoring to be enabled or disabled for individual assignments. Default is disabled. Modified Files: -------------- webwork2/lib/WeBWorK/Utils: Tasks.pm Revision Data ------------- Index: Tasks.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils/Tasks.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -Llib/WeBWorK/Utils/Tasks.pm -Llib/WeBWorK/Utils/Tasks.pm -u -r1.18 -r1.19 --- lib/WeBWorK/Utils/Tasks.pm +++ lib/WeBWorK/Utils/Tasks.pm @@ -81,7 +81,8 @@ $set->open_date(time()); $set->due_date(time()); $set->answer_date(time()); - $set->published(0); + $set->published(0); + $set->enable_reduced_scoring(0); $set->hardcopy_header(""); return($set); } @@ -96,7 +97,8 @@ $set->open_date(time()); $set->due_date(time()); $set->answer_date(time()); - $set->published(0); + $set->published(0); + $set->enable_reduced_scoring(); $set->hardcopy_header(""); $set->version_id(1); $set->attempts_per_version(0); |
From: Arnie P. v. a. <we...@ma...> - 2009-11-02 17:08:28
|
Log Message: ----------- Allow reduced scoring to be enabled or disabled for individual assignments. Default is disabled. Modified Files: -------------- webwork2/lib/WeBWorK/DB/Record: Set.pm Revision Data ------------- Index: Set.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Record/Set.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -Llib/WeBWorK/DB/Record/Set.pm -Llib/WeBWorK/DB/Record/Set.pm -u -r1.22 -r1.23 --- lib/WeBWorK/DB/Record/Set.pm +++ lib/WeBWorK/DB/Record/Set.pm @@ -35,6 +35,7 @@ due_date => { type=>"BIGINT" }, answer_date => { type=>"BIGINT" }, published => { type=>"INT" }, + enable_reduced_scoring => { type=>"INT" }, assignment_type => { type=>"TEXT" }, attempts_per_version => { type=>"INT" }, time_interval => { type=>"INT" }, |
From: Arnie P. v. a. <we...@ma...> - 2009-11-02 17:07:54
|
Log Message: ----------- Allow reduced scoring to be enabled or disabled for individual assignments. Default is disabled. Modified Files: -------------- webwork2/lib/WeBWorK/DB/Record: UserSet.pm Revision Data ------------- Index: UserSet.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Record/UserSet.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -Llib/WeBWorK/DB/Record/UserSet.pm -Llib/WeBWorK/DB/Record/UserSet.pm -u -r1.21 -r1.22 --- lib/WeBWorK/DB/Record/UserSet.pm +++ lib/WeBWorK/DB/Record/UserSet.pm @@ -37,6 +37,7 @@ due_date => { type=>"BIGINT" }, answer_date => { type=>"BIGINT" }, published => { type=>"INT" }, + enable_reduced_scoring => { type=>"INT" }, assignment_type => { type=>"TEXT" }, attempts_per_version => { type=>"INT" }, time_interval => { type=>"INT" }, @@ -46,9 +47,9 @@ problem_randorder => { type=>"INT" }, version_last_attempt_time => { type=>"BIGINT" }, problems_per_page => { type=>"INT" }, - hide_score => { type=>"ENUM('N','Y','BeforeAnswerDate')" }, - hide_score_by_problem => { type=>"ENUM('N','Y')" }, - hide_work => { type=>"ENUM('N','Y','BeforeAnswerDate')" }, + hide_score => { type=>"ENUM('N','Y','BeforeAnswerDate')" }, + hide_score_by_problem => { type=>"ENUM('N','Y')" }, + hide_work => { type=>"ENUM('N','Y','BeforeAnswerDate')" }, time_limit_cap => { type=>"ENUM('0','1')" }, restrict_ip => { type=>"ENUM('No','RestrictTo','DenyFrom')" }, relax_restrict_ip => { type=>"ENUM('No','AfterAnswerDate','AfterVersionAnswerDate')" }, |
From: Mike G. v. a. <we...@ma...> - 2009-10-29 01:59:12
|
Log Message: ----------- Adding help files containing the syntax for entering functions and algebraic equations as asnwers . Tags: ---- rel-2-4-patches Added Files: ----------- webwork2/htdocs/helpFiles: Syntax.html Revision Data ------------- --- /dev/null +++ htdocs/helpFiles/Syntax.html @@ -0,0 +1,136 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> + <title>Syntax for entering answers to WeBWorK</title> + <meta name="generator" content="BBEdit 8.7"> +</head> +<body> +<h1 id="firstHeading">Syntax for entering answers to WeBWorK</h1> + + +<h4> <span class="mw-headline">Mathematical Symbols Available In WeBWorK</span></h4> +<ul><li> + Addition +</li><li> - Subtraction +</li><li> * Multiplication can also be indicated by a space or juxtaposition, e.g. 2x, 2 x or 2*x, also 2(3+4). +</li><li> / Division +</li><li> ^ or ** You can use either ^ or ** for exponentiation, e.g. 3^2 or 3**2 +</li><li> Parentheses: () - You can also use square brackets, [ ], and braces, { }, for grouping, e.g. [1+2]/[3(4+5)] +</li></ul> +<a name="Syntax_for_entering_expressions"></a><h4> <span class="mw-headline">Syntax for entering expressions</span></h4> +<ul><li> Be careful entering expressions just as you would be careful entering expressions in a calculator. +</li><li> <b>Use the "Preview Button" to see exactly how your entry +looks. E.g. to tell the difference between 1+2/3*4 and [1+2]/[3*4] +click the "Preview Button".</b> +</li><li> Sometimes using the * symbol to indicate mutiplication makes +things easier to read. For example (1+2)*(3+4) and (1+2)(3+4) are both +valid. So are 3*4 and 3 4 (3 space 4, not 34) but using a * makes +things clearer. +</li><li> Use ('s and )'s to make your meaning clear. You can also use ['s and ]'s and {'s and }'s. +</li><li> Don't enter 2/4+5 (which is 5.5) when you really want 2/(4+5) (which is 2/9). +</li><li> Don't enter 2/3*4 (which is 8/3) when you really want 2/(3*4) (which is 2/12). +</li><li> Entering big quotients with square brackets, e.g. [1+2+3+4]/[5+6+7+8], is a good practice. +</li><li> Be careful when entering functions. It's always good practice +to use parentheses when entering functions. Write sin(t) instead of +sint or sin t even though WeBWorK is smart enough to <b>usually</b> accept sin t or even sint. For example, sin 2t is interpreted as sin(2)t, i.e. (sin(2))*t so be careful. +</li><li> You can enter sin^2(t) as a short cut although mathematically +speaking sin^2(t) is shorthand for (sin(t))^2(the square of sin of t). +(You can enter it as sin(t)^2 or even sint^2, but don't try such things +unless you <b>really</b> understand the precedence of operations. The +"sin" operation has highest precedence, so it is performed first, using +the next token (i.e. t) as an argument. Then the result is squared.) +You can always use the Preview button to see a typeset version of what +you entered and check whether what you wrote was what you +meant. :-) +</li><li> For example 2+3sin^2(4x) will work and is equivalent to +2+3(sin(4x))^2 or 2+3sin(4x)^2. Why does the last expression work? +Because things in parentheses are always done first [ i.e. (4x)], next +all functions, such as sin, are evaluated [giving sin(4x)], next all +exponents are taken [giving sin(4x)^2], next all multiplications and +divisions are performed in order from left to right [giving +3sin(4x)^2], and finally all additions and subtractions are performed +[giving 2+3sin(4x)^2]. +</li><li> Is -5^2 positive or negative? It's negative. This is because +the square operation is done before the negative sign is applied. Use +(-5)^2 if you want to square negative 5. +</li><li> When in doubt use parentheses!!! :-) +</li><li> The complete rules for the precedence of operations, in addition to the above, are +<ul><li> Multiplications and divisions are performed left to right: 2/3*4 = (2/3)*4 = 8/3. +</li><li> Additions and subtractions are performed left to right: 1-2+3 = (1-2)+3 = 2. +</li><li> Exponents are taken right to left: 2^3^4 = 2^(3^4) = 2^81 = a big number. +</li></ul> +</li><li> <b>Use the "Preview Button" to see exactly how your entry +looks. E.g. to tell the difference between 1+2/3*4 and [1+2]/[3*4] +click the "Preview Button".</b> +</li></ul> +<a name="Mathematical_Constants_Available_In_WeBWorK"></a><h4> <span class="mw-headline">Mathematical Constants Available In WeBWorK</span></h4> +<ul><li> pi This gives 3.14159265358979, e.g. cos(pi) is -1 +</li><li> e This gives 2.71828182845905, e.g. ln(e*2) is 1 + ln(2) +</li></ul> +<a name="Scientific_Notation_Available_In_WeBWorK"></a><h4> <span class="mw-headline">Scientific Notation Available In WeBWorK</span></h4> +<ul><li> 2.1E2 is the same as 210 +</li><li> 2.1E-2 is the same as .021 +</li></ul> +<a name="Mathematical_Functions_Available_In_WeBWorK"></a><h4> <span class="mw-headline">Mathematical Functions Available In WeBWorK</span></h4> +<p>Note that sometimes one or more of these functions is disabled for a WeBWorK problem because the +instructor wants you to calculate the answer by some means other than just using the function. +</p> +<ul><li> abs( ) The absolute value +</li><li> cos( ) Note: cos( ) uses radian measure +</li><li> sin( ) Note: sin( ) uses radian measure +</li><li> tan( ) Note: tan( ) uses radian measure +</li><li> sec( ) Note: sec( ) uses radian measure +</li><li> cot( ) Note: cot( ) uses radian measure +</li><li> csc( ) Note: csc( ) uses radian measure +</li><li> exp( ) The same function as e^x +</li><li> log( ) This is usually the natural log but your professor may have redined this as log to the base 10 +</li><li> ln( ) The natural log +</li><li> logten( ) The log to the base 10 +</li><li> arcsin( ) +</li><li> asin( ) or sin^-1() Another name for arcsin +</li><li> arccos( ) +</li><li> acos( ) or cos^-1() Another name for arccos +</li><li> arctan( ) +</li><li> atan( ) or tan^-1() Another name for arctan +</li><li> arccot( ) +</li><li> acot( ) or cot^-1() Another name for arccot +</li><li> arcsec( ) +</li><li> asec( ) or sec^-1() Another name for arcsec +</li><li> arccsc( ) +</li><li> acsc( ) or csc^-1() Another name for arccsc +</li><li> sinh( ) +</li><li> cosh( ) +</li><li> tanh( ) +</li><li> sech( ) +</li><li> csch( ) +</li><li> coth( ) +</li><li> arcsinh( ) +</li><li> asinh( ) or sinh^-1() Another name for arcsinh +</li><li> arccosh( ) +</li><li> acosh( ) or cosh^-1()Another name for arccosh +</li><li> arctanh( ) +</li><li> atanh( ) or tanh^-1()Another name for arctanh +</li><li> arcsech( ) +</li><li> asech( ) or sech^-1()Another name for arcsech +</li><li> arccsch( ) +</li><li> acsch( ) or csch^-1() Another name for arccsch +</li><li> arccoth( ) +</li><li> acoth( ) or coth^-1() Another name for arccoth +</li><li> sqrt( ) +</li><li> n! (n factorial -- defined for <span class="typeset"><nobr><span class="scale"><span style="position: relative;"><span style="position: absolute; top: -0.131em; left: 0em;"><span class="cmmi10">n</span><span style="position: relative; margin-left: 0.277em;"><span class="cmsy10">Ã</span></span><span style="position: relative; margin-left: 0.277em;"><span class="cmr10">0</span></span> </span><span class="blank" style="width: 2.429em; height: 0.722em; vertical-align: 0.722em;"></span></span><span class="blank" style="height: 0.93em; vertical-align: 0.744em;"></span></span></nobr></span> +</li><li> These functions may not always be available for every problem. +<ul><li> sgn( ) The sign function, either -1, 0, or 1 +</li><li> step( ) The step function (0 if <span class="typeset"><nobr><span class="scale"><span style="position: relative;"><span style="position: absolute; top: -0.131em; left: 0em;"><span class="cmmi10">x</span><span style="position: relative; margin-left: 0.277em;"><span class="cmmi10"><</span></span><span style="position: relative; margin-left: 0.277em;"><span class="cmr10">0</span></span> </span><span class="blank" style="width: 2.429em; height: 0.722em; vertical-align: 0.722em;"></span></span><span class="blank" style="height: 0.833em; vertical-align: 0.744em;"></span></span></nobr></span>, 1 if <span class="typeset"><nobr><span class="scale"><span style="position: relative;"><span style="position: absolute; top: -0.131em; left: 0em;"><span class="cmmi10">x</span><span style="position: relative; margin-left: 0.277em;"><span class="cmsy10">Ã</span></span><span style="position: relative; margin-left: 0.277em;"><span class="cmr10">0</span></span> </span><span class="blank" style="width: 2.429em; height: 0.722em; vertical-align: 0.722em;"></span></span><span class="blank" style="height: 0.93em; vertical-align: 0.744em;"></span></span></nobr></span>) +</li><li> fact(n) The factorial function n! (defined only for nonnegative integers) +</li><li> P(n,k) = n*(n-1)*(n-2)...(n-k+1) the number of ordered sequences of k elements chosen from n elements +</li><li> C(n,k) = "n choose k" the number of unordered sequences of k elements chosen from n elements +</li></ul> +</li></ul> + +For more information: + +<a href="http://webwork.maa.org/wiki/Available_Functions">http://webwork.maa.org/wiki/Available_Functions</a> + + +</body> +</html> |
From: Mike G. v. a. <we...@ma...> - 2009-10-29 01:58:54
|
Log Message: ----------- Added helpFile for the syntax for entering answers -- including available functions Added Files: ----------- webwork2/htdocs/helpFiles: Syntax.html Revision Data ------------- --- /dev/null +++ htdocs/helpFiles/Syntax.html @@ -0,0 +1,136 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> + <title>Syntax for entering answers to WeBWorK</title> + <meta name="generator" content="BBEdit 8.7"> +</head> +<body> +<h1 id="firstHeading">Syntax for entering answers to WeBWorK</h1> + + +<h4> <span class="mw-headline">Mathematical Symbols Available In WeBWorK</span></h4> +<ul><li> + Addition +</li><li> - Subtraction +</li><li> * Multiplication can also be indicated by a space or juxtaposition, e.g. 2x, 2 x or 2*x, also 2(3+4). +</li><li> / Division +</li><li> ^ or ** You can use either ^ or ** for exponentiation, e.g. 3^2 or 3**2 +</li><li> Parentheses: () - You can also use square brackets, [ ], and braces, { }, for grouping, e.g. [1+2]/[3(4+5)] +</li></ul> +<a name="Syntax_for_entering_expressions"></a><h4> <span class="mw-headline">Syntax for entering expressions</span></h4> +<ul><li> Be careful entering expressions just as you would be careful entering expressions in a calculator. +</li><li> <b>Use the "Preview Button" to see exactly how your entry +looks. E.g. to tell the difference between 1+2/3*4 and [1+2]/[3*4] +click the "Preview Button".</b> +</li><li> Sometimes using the * symbol to indicate mutiplication makes +things easier to read. For example (1+2)*(3+4) and (1+2)(3+4) are both +valid. So are 3*4 and 3 4 (3 space 4, not 34) but using a * makes +things clearer. +</li><li> Use ('s and )'s to make your meaning clear. You can also use ['s and ]'s and {'s and }'s. +</li><li> Don't enter 2/4+5 (which is 5.5) when you really want 2/(4+5) (which is 2/9). +</li><li> Don't enter 2/3*4 (which is 8/3) when you really want 2/(3*4) (which is 2/12). +</li><li> Entering big quotients with square brackets, e.g. [1+2+3+4]/[5+6+7+8], is a good practice. +</li><li> Be careful when entering functions. It's always good practice +to use parentheses when entering functions. Write sin(t) instead of +sint or sin t even though WeBWorK is smart enough to <b>usually</b> accept sin t or even sint. For example, sin 2t is interpreted as sin(2)t, i.e. (sin(2))*t so be careful. +</li><li> You can enter sin^2(t) as a short cut although mathematically +speaking sin^2(t) is shorthand for (sin(t))^2(the square of sin of t). +(You can enter it as sin(t)^2 or even sint^2, but don't try such things +unless you <b>really</b> understand the precedence of operations. The +"sin" operation has highest precedence, so it is performed first, using +the next token (i.e. t) as an argument. Then the result is squared.) +You can always use the Preview button to see a typeset version of what +you entered and check whether what you wrote was what you +meant. :-) +</li><li> For example 2+3sin^2(4x) will work and is equivalent to +2+3(sin(4x))^2 or 2+3sin(4x)^2. Why does the last expression work? +Because things in parentheses are always done first [ i.e. (4x)], next +all functions, such as sin, are evaluated [giving sin(4x)], next all +exponents are taken [giving sin(4x)^2], next all multiplications and +divisions are performed in order from left to right [giving +3sin(4x)^2], and finally all additions and subtractions are performed +[giving 2+3sin(4x)^2]. +</li><li> Is -5^2 positive or negative? It's negative. This is because +the square operation is done before the negative sign is applied. Use +(-5)^2 if you want to square negative 5. +</li><li> When in doubt use parentheses!!! :-) +</li><li> The complete rules for the precedence of operations, in addition to the above, are +<ul><li> Multiplications and divisions are performed left to right: 2/3*4 = (2/3)*4 = 8/3. +</li><li> Additions and subtractions are performed left to right: 1-2+3 = (1-2)+3 = 2. +</li><li> Exponents are taken right to left: 2^3^4 = 2^(3^4) = 2^81 = a big number. +</li></ul> +</li><li> <b>Use the "Preview Button" to see exactly how your entry +looks. E.g. to tell the difference between 1+2/3*4 and [1+2]/[3*4] +click the "Preview Button".</b> +</li></ul> +<a name="Mathematical_Constants_Available_In_WeBWorK"></a><h4> <span class="mw-headline">Mathematical Constants Available In WeBWorK</span></h4> +<ul><li> pi This gives 3.14159265358979, e.g. cos(pi) is -1 +</li><li> e This gives 2.71828182845905, e.g. ln(e*2) is 1 + ln(2) +</li></ul> +<a name="Scientific_Notation_Available_In_WeBWorK"></a><h4> <span class="mw-headline">Scientific Notation Available In WeBWorK</span></h4> +<ul><li> 2.1E2 is the same as 210 +</li><li> 2.1E-2 is the same as .021 +</li></ul> +<a name="Mathematical_Functions_Available_In_WeBWorK"></a><h4> <span class="mw-headline">Mathematical Functions Available In WeBWorK</span></h4> +<p>Note that sometimes one or more of these functions is disabled for a WeBWorK problem because the +instructor wants you to calculate the answer by some means other than just using the function. +</p> +<ul><li> abs( ) The absolute value +</li><li> cos( ) Note: cos( ) uses radian measure +</li><li> sin( ) Note: sin( ) uses radian measure +</li><li> tan( ) Note: tan( ) uses radian measure +</li><li> sec( ) Note: sec( ) uses radian measure +</li><li> cot( ) Note: cot( ) uses radian measure +</li><li> csc( ) Note: csc( ) uses radian measure +</li><li> exp( ) The same function as e^x +</li><li> log( ) This is usually the natural log but your professor may have redined this as log to the base 10 +</li><li> ln( ) The natural log +</li><li> logten( ) The log to the base 10 +</li><li> arcsin( ) +</li><li> asin( ) or sin^-1() Another name for arcsin +</li><li> arccos( ) +</li><li> acos( ) or cos^-1() Another name for arccos +</li><li> arctan( ) +</li><li> atan( ) or tan^-1() Another name for arctan +</li><li> arccot( ) +</li><li> acot( ) or cot^-1() Another name for arccot +</li><li> arcsec( ) +</li><li> asec( ) or sec^-1() Another name for arcsec +</li><li> arccsc( ) +</li><li> acsc( ) or csc^-1() Another name for arccsc +</li><li> sinh( ) +</li><li> cosh( ) +</li><li> tanh( ) +</li><li> sech( ) +</li><li> csch( ) +</li><li> coth( ) +</li><li> arcsinh( ) +</li><li> asinh( ) or sinh^-1() Another name for arcsinh +</li><li> arccosh( ) +</li><li> acosh( ) or cosh^-1()Another name for arccosh +</li><li> arctanh( ) +</li><li> atanh( ) or tanh^-1()Another name for arctanh +</li><li> arcsech( ) +</li><li> asech( ) or sech^-1()Another name for arcsech +</li><li> arccsch( ) +</li><li> acsch( ) or csch^-1() Another name for arccsch +</li><li> arccoth( ) +</li><li> acoth( ) or coth^-1() Another name for arccoth +</li><li> sqrt( ) +</li><li> n! (n factorial -- defined for <span class="typeset"><nobr><span class="scale"><span style="position: relative;"><span style="position: absolute; top: -0.131em; left: 0em;"><span class="cmmi10">n</span><span style="position: relative; margin-left: 0.277em;"><span class="cmsy10">Ã</span></span><span style="position: relative; margin-left: 0.277em;"><span class="cmr10">0</span></span> </span><span class="blank" style="width: 2.429em; height: 0.722em; vertical-align: 0.722em;"></span></span><span class="blank" style="height: 0.93em; vertical-align: 0.744em;"></span></span></nobr></span> +</li><li> These functions may not always be available for every problem. +<ul><li> sgn( ) The sign function, either -1, 0, or 1 +</li><li> step( ) The step function (0 if <span class="typeset"><nobr><span class="scale"><span style="position: relative;"><span style="position: absolute; top: -0.131em; left: 0em;"><span class="cmmi10">x</span><span style="position: relative; margin-left: 0.277em;"><span class="cmmi10"><</span></span><span style="position: relative; margin-left: 0.277em;"><span class="cmr10">0</span></span> </span><span class="blank" style="width: 2.429em; height: 0.722em; vertical-align: 0.722em;"></span></span><span class="blank" style="height: 0.833em; vertical-align: 0.744em;"></span></span></nobr></span>, 1 if <span class="typeset"><nobr><span class="scale"><span style="position: relative;"><span style="position: absolute; top: -0.131em; left: 0em;"><span class="cmmi10">x</span><span style="position: relative; margin-left: 0.277em;"><span class="cmsy10">Ã</span></span><span style="position: relative; margin-left: 0.277em;"><span class="cmr10">0</span></span> </span><span class="blank" style="width: 2.429em; height: 0.722em; vertical-align: 0.722em;"></span></span><span class="blank" style="height: 0.93em; vertical-align: 0.744em;"></span></span></nobr></span>) +</li><li> fact(n) The factorial function n! (defined only for nonnegative integers) +</li><li> P(n,k) = n*(n-1)*(n-2)...(n-k+1) the number of ordered sequences of k elements chosen from n elements +</li><li> C(n,k) = "n choose k" the number of unordered sequences of k elements chosen from n elements +</li></ul> +</li></ul> + +For more information: + +<a href="http://webwork.maa.org/wiki/Available_Functions">http://webwork.maa.org/wiki/Available_Functions</a> + + +</body> +</html> |
From: Mike G. v. a. <we...@ma...> - 2009-10-29 01:47:42
|
Log Message: ----------- can use \{helpFiles("syntax")\} to display a help page for entering answers into WeBWorK. Tags: ---- rel-2-4-patches Modified Files: -------------- pg/macros: PGbasicmacros.pl Revision Data ------------- Index: PGbasicmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGbasicmacros.pl,v retrieving revision 1.47.2.2.2.8 retrieving revision 1.47.2.2.2.9 diff -Lmacros/PGbasicmacros.pl -Lmacros/PGbasicmacros.pl -u -r1.47.2.2.2.8 -r1.47.2.2.2.9 --- macros/PGbasicmacros.pl +++ macros/PGbasicmacros.pl @@ -1938,6 +1938,7 @@ my %typeHash = ( 'interval notation' => 'IntervalNotation.html', 'units' => 'Units.html', + 'syntax' => 'Syntax.html', ); my $infoRef = $typeHash{$type}; |
From: Mike G. v. a. <we...@ma...> - 2009-10-26 16:21:11
|
Log Message: ----------- modifications which check that wwassignment objects are properly defined. This is designed to prevent silent failures that were occuring when some of the information in wwassignment objects (or in event log objects) was not defined. This is an interim commit -- there are still some error_log messages which allow tracking the correct behavior of the functions update_dirty_sets() and refresh_events() These will be commented out once testing is complete Modified Files: -------------- wwmoodle/wwassignment4/moodle/mod/wwassignment: lib.php Revision Data ------------- Index: lib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/lib.php,v retrieving revision 1.15 retrieving revision 1.16 diff -Lwwassignment4/moodle/mod/wwassignment/lib.php -Lwwassignment4/moodle/mod/wwassignment/lib.php -u -r1.15 -r1.16 --- wwassignment4/moodle/mod/wwassignment/lib.php +++ wwassignment4/moodle/mod/wwassignment/lib.php @@ -531,26 +531,30 @@ // means just one database lookup $logRecords = get_logs("l.module LIKE \"wwassignment\" AND l.time >$lastcron ", "l.time ASC"); + // possible actions generating a log entry include view, update and 'view all' $wwmodificationtime=array(); - foreach ($logRecords as $record) { - $wwmodtimes[$wwid =$record->info] = $record->time; + foreach ($logRecords as $record) { + $wwid =$record->info; + if ($wwid > 0) { // the $wwid must not be 0 or blank -- blank id's occur for view all. + $wwmodtimes[$wwid] = $record->time; + } } // Create an array with the wwid values $idValues= "( ".implode(",", array_keys($wwmodtimes) ). " )"; - - //error_log("values string $idValues"); + + error_log("values string $idValues"); //error_log("last modification times".print_r($wwmodtimes,true)); $sql = "SELECT a.*, cm.idnumber as cmidnumber, a.course as courseid, cm.id as wwinstanceid FROM {$CFG->prefix}wwassignment a, {$CFG->prefix}course_modules cm, {$CFG->prefix}modules m WHERE m.name='wwassignment' AND m.id=cm.module AND cm.instance=a.id AND a.id IN $idValues"; - - $sql3 = "SELECT a.* FROM {$CFG->prefix}wwassignment a WHERE a.id IN $idValues"; + error_log("sql $sql"); + //$sql3 = "SELECT a.* FROM {$CFG->prefix}wwassignment a WHERE a.id IN $idValues"; //error_log("last modification times".print_r($wwmodificationtime,true)); - - if ($rs = get_recordset_sql($sql)) { + $rs = get_recordset_sql($sql); + if ($rs) { while ($wwassignment = rs_fetch_next_record($rs)) { if (!$wwassignment->cmidnumber) { // is this ever needed? $wwassignment->cmidnumber =_wwassignment_cmid() ; @@ -598,7 +602,7 @@ function wwassignment_refresh_events($courseid = 0) { - error_log('wwassignment_refresh_events called --not yet defined'); + // error_log('wwassignment_refresh_events called --not yet defined'); // This standard function will check all instances of this module // and make sure there are up-to-date events created for each of them. @@ -606,7 +610,7 @@ // only wwassignment events belonging to the course specified are checked. // This function is used, in its new format, by restore_refresh_events() and by the cron function // - // find wwassignment instances associated with this course or all wwassignment modules +// find wwassignment instances associated with this course or all wwassignment modules $courses = array(); # create array of courses if ($courseid) { if (! $wwassignments = get_records("wwassignment", "course", $courseid)) { @@ -632,39 +636,58 @@ } - // $courses now holds a list of courses with wwassignment modules - $moduleid = _wwassignment_cmid(); - $cids = array_keys($courses); # collect course ids - error_log("cids".print_r($cids, true)); - $wwclient = new wwassignment_client(); - foreach ($cids as $cid) { - // connect to WeBWorK - $wwcoursename = _wwassignment_mapped_course($cid,false); - $wwassignment->webwork_course = $wwcoursename; - if ( $wwcoursename== -1) { - error_log("Can't connect course $cid to webwork"); - break; - } - // retrieve wwassignments associated with this course - foreach($courses[$cid] as $wwassignment ) { - //checking mappings - $wwsetname = $wwassignment->webwork_set; - error_log("updating events for $wwcoursename $wwsetname"); - //get data from WeBWorK - $wwsetdata = $wwclient->get_assignment_data($wwcoursename,$wwsetname,false); - $wwassignment->grade = $wwclient->get_max_grade($wwcoursename,$wwsetname,false); - $wwassignment->timemodified = time(); - $returnid = update_record('wwassignment',$wwassignment); - // update event - //this part won't work because these items implicitly require the course. - _wwassignment_delete_events($wwassignment->id); - _wwassignment_create_events($wwassignment, $wwsetdata); - } - - } - + // $courses now holds a list of course wwassignments - return true; + if ( $wwclient = new wwassignment_client() ) { + $moduleid = _wwassignment_cmid(); + $cids = array_keys($courses); # collect course ids + error_log("course ids ".print_r($cids, true)); + foreach ($cids as $cid) { + error_log("processing cid $cid"); + // connect to WeBWorK + $wwcoursename = _wwassignment_mapped_course($cid,false); + $wwassignment->webwork_course = $wwcoursename; + if ( $wwcoursename== -1) { + error_log("Can't connect course $cid to webwork"); + break; + } + + // retrieve wwassignments associated with this course + foreach($courses[$cid] as $wwassignment ) { + if (!isset($wwassignment)) { + error_log("no wwassignments yet"); + break; + } + //checking mappings + $wwsetname = $wwassignment->webwork_set; + error_log(" wwassignment_refresh_events updating events for course |$wwcoursename| set |$wwsetname| " ); + if ( isset($wwsetname) ) { + + //get data from WeBWorK + $wwsetdata = $wwclient->get_assignment_data($wwcoursename,$wwsetname,false); + $wwassignment->grade = $wwclient->get_max_grade($wwcoursename,$wwsetname,false); + $wwassignment->timemodified = time(); + $returnid = update_record('wwassignment',$wwassignment); + // update event + //this part won't work because these items implicitly require the course. + if ( isset( $wwsetdata ) ) { + _wwassignment_delete_events($wwassignment->id); + _wwassignment_create_events($wwassignment, $wwsetdata); + } else { + error_log("Can't update events for course |$wwcoursename| set |$wwsetname|"); + } + error_log("Done updating course |$wwcoursename| set |$wwsetname|"); + } else { + error_log ("no wwsetname |$wwsetname|" ); + } + } + } + error_log("done with cids"); + } else { + error_log("Can't connect to webwork course"); + } + error_log("done with wwassignment_refresh_events() "); + return(true); } |
From: Mike G. v. a. <we...@ma...> - 2009-10-26 16:18:33
|
Log Message: ----------- modifications in error messages and comments Modified Files: -------------- wwmoodle/wwassignment4/moodle/mod/wwassignment: locallib.php Revision Data ------------- Index: locallib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/locallib.php,v retrieving revision 1.14 retrieving revision 1.15 diff -Lwwassignment4/moodle/mod/wwassignment/locallib.php -Lwwassignment4/moodle/mod/wwassignment/locallib.php -u -r1.14 -r1.15 --- wwassignment4/moodle/mod/wwassignment/locallib.php +++ wwassignment4/moodle/mod/wwassignment/locallib.php @@ -104,7 +104,7 @@ unset($event); - $event->name = addslashes($name); + $event->name = addslashes($name); // backslash characters where necessary $event->description = 'WeBWorK Set Event'; $event->courseid = $courseid; $event->groupid = 0; @@ -137,7 +137,7 @@ function _wwassignment_delete_events($wwassignmentid) { if ($events = get_records_select('event', "modulename = 'wwassignment' and instance = '$wwassignmentid'")) { foreach($events as $event) { - // error_log("deleting event ".$event->id); + error_log("deleting event ".$event->id); delete_event($event->id); } } @@ -156,7 +156,7 @@ } $wwclient = new wwassignment_client(); $wwsetname = $wwassignment->webwork_set; - error_log("updating events for $wwcoursename $wwsetname"); + error_log(" _wwassignment_refresh_eventsupdating events for $wwcoursename $wwsetname"); //get data from WeBWorK $wwsetdata = $wwclient->get_assignment_data($wwcoursename,$wwsetname,false); $wwassignment->grade = $wwclient->get_max_grade($wwcoursename,$wwsetname,false); |
From: Arnie P. v. a. <we...@ma...> - 2009-10-22 16:54:11
|
Log Message: ----------- Make the default locations of CAPA resources math the set uo instructions 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.218 retrieving revision 1.219 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.218 -r1.219 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -898,10 +898,10 @@ # Locations of CAPA resources. (Only necessary if you need to use converted CAPA # problems.) -$pg{specialPGEnvironmentVars}{CAPA_Tools} = "$courseDirs{macros}/CAPA_Tools/", -$pg{specialPGEnvironmentVars}{CAPA_MCTools} = "$courseDirs{macros}/CAPA_MCTools/", -$pg{specialPGEnvironmentVars}{CAPA_GraphicsDirectory} = "$courseDirs{html}/CAPA_Graphics/", -$pg{specialPGEnvironmentVars}{CAPA_Graphics_URL} = "$courseURLs{html}/CAPA_Graphics/", +$pg{specialPGEnvironmentVars}{CAPA_Tools} = "/opt/webwork/CAPA/CAPA_Tools/", +$pg{specialPGEnvironmentVars}{CAPA_MCTools} = "/opt/webwork/CAPA/CAPA_MCTools/", +$pg{specialPGEnvironmentVars}{CAPA_GraphicsDirectory} = "$webworkDirs{htdocs}/CAPA_Graphics/", +$pg{specialPGEnvironmentVars}{CAPA_Graphics_URL} = "$webworkURLs{htdocs}/CAPA_Graphics/", # Size in pixels of dynamically-generated images, i.e. graphs. $pg{specialPGEnvironmentVars}{onTheFlyImageSize} = 400, |
From: Arnie P. v. a. <we...@ma...> - 2009-10-21 16:43:43
|
Log Message: ----------- Added Pod::WSDL to list of modules to check Modified Files: -------------- webwork2/bin: check_modules.pl Revision Data ------------- Index: check_modules.pl =================================================================== RCS file: /webwork/cvs/system/webwork2/bin/check_modules.pl,v retrieving revision 1.18 retrieving revision 1.19 diff -Lbin/check_modules.pl -Lbin/check_modules.pl -u -r1.18 -r1.19 --- bin/check_modules.pl +++ bin/check_modules.pl @@ -72,6 +72,7 @@ Opcode PHP::Serialization Pod::Usage + Pod::WSDL Safe Scalar::Util SOAP::Lite |
From: Arnie P. v. a. <we...@ma...> - 2009-10-17 16:10:21
|
Log Message: ----------- Implement a Reduced Scoring Period. 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. Modified Files: -------------- webwork2/lib/WeBWorK/DB/Record: UserProblem.pm Revision Data ------------- Index: UserProblem.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Record/UserProblem.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -Llib/WeBWorK/DB/Record/UserProblem.pm -Llib/WeBWorK/DB/Record/UserProblem.pm -u -r1.11 -r1.12 --- lib/WeBWorK/DB/Record/UserProblem.pm +++ lib/WeBWorK/DB/Record/UserProblem.pm @@ -42,6 +42,7 @@ last_answer => { type=>"TEXT" }, num_correct => { type=>"INT" }, num_incorrect => { type=>"INT" }, + sub_status => { type=>"FLOAT" }, # A subsidiary status used to implement the reduced scoring period ); } |
From: Arnie P. v. a. <we...@ma...> - 2009-10-17 16:09:35
|
Log Message: ----------- Implement a Reduced Scoring Period. 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. Modified Files: -------------- webwork2/lib/WeBWorK/DB: Utils.pm Revision Data ------------- Index: Utils.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Utils.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -Llib/WeBWorK/DB/Utils.pm -Llib/WeBWorK/DB/Utils.pm -u -r1.24 -r1.25 --- lib/WeBWorK/DB/Utils.pm +++ lib/WeBWorK/DB/Utils.pm @@ -67,6 +67,7 @@ $userProblem->num_correct(0); $userProblem->num_incorrect(0); $userProblem->problem_seed($seed); + $userProblem->sub_status(0.0); return $userProblem; } |
From: Arnie P. v. a. <we...@ma...> - 2009-10-17 16:09:05
|
Log Message: ----------- Implement a Reduced Scoring Period. 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. Modified Files: -------------- webwork2/lib/WeBWorK/PG: Remote.pm Revision Data ------------- Index: Remote.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/PG/Remote.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -Llib/WeBWorK/PG/Remote.pm -Llib/WeBWorK/PG/Remote.pm -u -r1.6 -r1.7 --- lib/WeBWorK/PG/Remote.pm +++ lib/WeBWorK/PG/Remote.pm @@ -100,6 +100,7 @@ envir => $envir, problem_state => { recorded_score => $problem->status, + sub_recorded_score => $problem->sub_status, num_of_correct_ans => $problem->num_correct, num_of_incorrect_ans => $problem->num_incorrect, }, |
From: Arnie P. v. a. <we...@ma...> - 2009-10-17 16:08:53
|
Log Message: ----------- Implement a Reduced Scoring Period. 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. Modified Files: -------------- webwork2/lib/WeBWorK/Utils: Tasks.pm Revision Data ------------- Index: Tasks.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils/Tasks.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -Llib/WeBWorK/Utils/Tasks.pm -Llib/WeBWorK/Utils/Tasks.pm -u -r1.17 -r1.18 --- lib/WeBWorK/Utils/Tasks.pm +++ lib/WeBWorK/Utils/Tasks.pm @@ -134,7 +134,8 @@ $problem->problem_seed($options{'problem_seed'}) if(defined($options{'problem_seed'})); - $problem->status(0); + $problem->status(0); + $problem->sub_status(0); $problem->attempted(0); $problem->last_answer(""); $problem->num_correct(0); |
From: Arnie P. v. a. <we...@ma...> - 2009-10-17 16:07:38
|
Log Message: ----------- Implement a Reduced Scoring Period. 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. Modified Files: -------------- webwork2/lib/WeBWorK/PG: Local.pm Revision Data ------------- Index: Local.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/PG/Local.pm,v retrieving revision 1.27 retrieving revision 1.28 diff -Llib/WeBWorK/PG/Local.pm -Llib/WeBWorK/PG/Local.pm -u -r1.27 -r1.28 --- lib/WeBWorK/PG/Local.pm +++ lib/WeBWorK/PG/Local.pm @@ -358,6 +358,7 @@ #warn "PG: retrieving the problem state and giving it to the translator\n"; $translator->rh_problem_state({ recorded_score => $problem->status, + sub_recorded_score => $problem->sub_status, num_of_correct_ans => $problem->num_correct, num_of_incorrect_ans => $problem->num_incorrect, }); @@ -390,7 +391,7 @@ ($result, $state) = $translator->grade_problem( answers_submitted => $translationOptions->{processAnswers}, ANSWER_ENTRY_ORDER => \@answerOrder, - %{$formFields}, #FIXME? this is used by sequentialGrader is there a better way? + %{$formFields}, #FIXME? this is used by sequentialGrader is there a better way ); } |
From: Arnie P. v. a. <we...@ma...> - 2009-10-17 16:06:56
|
Log Message: ----------- Implement a Reduced Scoring Period. 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. 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.92 retrieving revision 1.93 diff -Llib/WeBWorK/ContentGenerator/ProblemSet.pm -Llib/WeBWorK/ContentGenerator/ProblemSet.pm -u -r1.92 -r1.93 --- lib/WeBWorK/ContentGenerator/ProblemSet.pm +++ lib/WeBWorK/ContentGenerator/ProblemSet.pm @@ -308,6 +308,19 @@ my $hardcopyURL = $self->systemLink($hardcopyPage); print CGI::p(CGI::a({href=>$hardcopyURL}, "Download a hardcopy of this homework set.")); + + + my $reducedScoringPeriod = $ce->{pg}->{ansEvalDefaults}->{reducedScoringPeriod}; + if ($reducedScoringPeriod > 0) { + my $dueDate = $self->formatDateTime($set->due_date()); + my $reducedScoringPeriodSec = $reducedScoringPeriod*60; # $reducedScoringPeriod is in minutes + 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."); + } # DBFIXME use iterator my @problemNumbers = $db->listUserProblems($effectiveUser, $setName); |
From: Arnie P. v. a. <we...@ma...> - 2009-10-17 16:06:36
|
Log Message: ----------- Implement a Reduced Scoring Period. 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. 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.218 retrieving revision 1.219 diff -Llib/WeBWorK/ContentGenerator/Problem.pm -Llib/WeBWorK/ContentGenerator/Problem.pm -u -r1.218 -r1.219 --- lib/WeBWorK/ContentGenerator/Problem.pm +++ lib/WeBWorK/ContentGenerator/Problem.pm @@ -875,10 +875,12 @@ # store state in DB if it makes sense if ($will{recordAnswers}) { $problem->status($pg->{state}->{recorded_score}); + $problem->sub_status($pg->{state}->{sub_recorded_score}); $problem->attempted(1); $problem->num_correct($pg->{state}->{num_of_correct_ans}); $problem->num_incorrect($pg->{state}->{num_of_incorrect_ans}); $pureProblem->status($pg->{state}->{recorded_score}); + $pureProblem->sub_status($pg->{state}->{sub_recorded_score}); $pureProblem->attempted(1); $pureProblem->num_correct($pg->{state}->{num_of_correct_ans}); $pureProblem->num_incorrect($pg->{state}->{num_of_incorrect_ans}); |
From: Arnie P. v. a. <we...@ma...> - 2009-10-17 16:06:11
|
Log Message: ----------- Implement a Reduced Scoring Period. 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. 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.59 retrieving revision 1.60 diff -Llib/WeBWorK/Constants.pm -Llib/WeBWorK/Constants.pm -u -r1.59 -r1.60 --- lib/WeBWorK/Constants.pm +++ lib/WeBWorK/Constants.pm @@ -2,12 +2,12 @@ # WeBWorK Online Homework Delivery System # Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/ # $CVSHeader$ -# +# # This program is free software; you can redistribute it and/or modify it under # the terms of either: (a) the GNU General Public License as published by the # Free Software Foundation; either version 2, or (at your option) any later # version, or (b) the "Artistic License" which comes with this package. -# +# # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the @@ -30,27 +30,27 @@ ################################################################################ # If true, WeBWorK::Debug will print debugging output. -# +# $WeBWorK::Debug::Enabled = 0; # If non-empty, debugging output will be sent to the file named rather than STDERR. -# +# $WeBWorK::Debug::Logfile = ""; # If defined, prevent subroutines matching the following regular expression from # logging. -# +# # For example, this pattern prevents the dispatch() function from logging: # $WeBWorK::Debug::DenySubroutineOutput = qr/^WeBWorK::dispatch$/; -# +# $WeBWorK::Debug::DenySubroutineOutput = undef; # If defined, allow only subroutines matching the following regular expression # to log. -# +# # For example, this pattern allow only some function being worked on to log: # $WeBWorK::Debug::AllowSubroutineOutput = qr/^WeBWorK::SomePkg::myFunc$/; -# +# $WeBWorK::Debug::AllowSubroutineOutput = undef; ################################################################################ @@ -58,7 +58,7 @@ ################################################################################ # If true, don't delete temporary files -# +# $WeBWorK::ContentGenerator::Hardcopy::PreserveTempFiles = 0; ################################################################################ @@ -74,28 +74,28 @@ ################################################################################ # Arguments to pass to dvipng. This is dependant on the version of dvipng. -# +# # For dvipng versions 0.x # $WeBWorK::PG::ImageGenerator::DvipngArgs = "-x4000.5 -bgTransparent -Q6 -mode toshiba -D180"; # For dvipng versions 1.0 to 1.5 # $WeBWorK::PG::ImageGenerator::DvipngArgs = "-bgTransparent -D120 -q -depth"; -# +# # For dvipng versions 1.6 (and probably above) # $WeBWorK::PG::ImageGenerator::DvipngArgs = "-bgtransparent -D120 -q -depth"; -# Note: In 1.6 and later, bgTransparent gives alpha-channel transparency while +# Note: In 1.6 and later, bgTransparent gives alpha-channel transparency while # bgtransparent gives single-bit transparency. If you use alpha-channel transparency, -# the images will not be viewable with MSIE. bgtransparent works for version 1.5, +# the images will not be viewable with MSIE. bgtransparent works for version 1.5, # but does not give transparent backgrounds. It does not work for version 1.2. It has not # been tested with other versions. # $WeBWorK::PG::ImageGenerator::DvipngArgs = "-bgtransparent -D120 -q -depth"; # If true, don't delete temporary files -# +# $WeBWorK::PG::ImageGenerator::PreserveTempFiles = 0; # TeX to prepend to equations to be processed. -# +# $WeBWorK::PG::ImageGenerator::TexPreamble = <<'EOF'; \documentclass[12pt]{article} \nonstopmode @@ -107,7 +107,7 @@ EOF # TeX to append to equations to be processed. -# +# $WeBWorK::PG::ImageGenerator::TexPostamble = <<'EOF'; \end{document} EOF @@ -117,11 +117,11 @@ ################################################################################ # Configuation data -# It is organized by section. The allowable types are +# It is organized by section. The allowable types are # 'text' for a text string (no quote marks allowed), # 'number' for a number, # 'list' for a list of text strings, -# 'permission' for a permission value, +# 'permission' for a permission value, # 'boolean' for variables which really hold 0/1 values as flags. # 'checkboxlist' for variables which really hold a list of values which # can be independently picked yes/no as checkboxes @@ -134,7 +134,7 @@ type => 'text'}, { var => 'defaultTheme', doc => 'Theme (refresh page after saving changes to reveal new theme)', - doc2 => 'There are currently four themes (or skins) to choose from: ur, math, math2 and moodle. The theme + doc2 => 'There are currently four themes (or skins) to choose from: ur, math, math2 and moodle. The theme specifies a unified look and feel for the WeBWorK course web pages.', values => [qw(math math2 ur moodle union)], type => 'popuplist'}, @@ -220,28 +220,28 @@ min => 1, values => ["plainText", "formattedText", "images", "jsMath", "asciimath", "LaTeXMathML"], type => 'checkboxlist'}, - + { var => 'pg{options}{displayMode} ', doc => 'The default display mode', doc2 => 'Enter one of the allowed display mode types above. See \'display modes entry\' for descriptions.', min => 1, type => 'text'}, - + { var => 'pg{ansEvalDefaults}{useBaseTenLog}', doc => 'Use log base 10 instead of base <i>e</i>', doc2 => 'Set to true for log to mean base 10 log and false for log to mean natural logarithm', type => 'boolean'}, - + { var => 'pg{ansEvalDefaults}{useOldAnswerMacros}', doc => 'Use older answer checkers', doc2 => 'During summer 2005, a newer version of the answer checkers was implemented for answers which are functions and numbers. The newer checkers allow more functions in student answers, and behave better in certain cases. Some problems are specifically coded to use new (or old) answer checkers. However, for the bulk of the problems, you can choose what the default will be here. <p>Choosing <i>false</i> here means that the newer answer checkers will be used by default, and choosing <i>true</i> means that the old answer checkers will be used by default.', type => 'boolean'}, - + { var => 'pg{ansEvalDefaults}{defaultDisplayMatrixStyle}', doc => 'Control string for displaying matricies', doc2 => 'String of three characters for defining the defaults for displaying matricies. The first and last characters give the left and right delimiters of the matrix, so usually one of ([| for a left delimiter, and one of )]| for the right delimiter. It is also legal to specify "." for no delimiter. <p> The middle character indicates how to display vertical lines in a matrix (e.g., for an augmented matrix). This can be s for solid lines and d for dashed lines. While you can specify the defaults, individual problems may override these values.', type => 'text'}, - + { var => 'pg{ansEvalDefaults}{numRelPercentTolDefault}', doc => 'Allowed error, as a percentage, for numerical comparisons', doc2 => "When numerical answers are checked, most test if the student's answer @@ -251,18 +251,42 @@ <p> 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 + 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 + 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> + 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 + 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 + Period: All additional work done counts 50% of the original." <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'}, ], ['E-Mail', { var => 'mail{feedbackSubjectFormat}', doc => 'Format for the subject line in feedback e-mails', - doc2 => 'When students click the <em>Email Instructor</em> button - to send feedback, WeBWorK fills in the subject line. Here you can set the - subject line. In it, you can have various bits of information filled in + doc2 => 'When students click the <em>Email Instructor</em> button + to send feedback, WeBWorK fills in the subject line. Here you can set the + subject line. In it, you can have various bits of information filled in with the following escape sequences. <p> <ul> <li> %c = course ID -<li> %u = user ID +<li> %u = user ID <li> %s = set ID <li> %p = problem ID <li> %x = section @@ -290,7 +314,7 @@ doc => 'E-mail feedback from students automatically sent to this permission level and higher:', doc2 => 'Users with this permssion level or greater will automatically be sent feedback from students (generated when they use the "Contact instructor" button on any problem page). In addition the feedback message will be sent to addresses listed below. To send ONLY to addresses listed below set permission level to "nobody".', type => 'permission'}, - + { var => 'mail{feedbackRecipients}', doc => 'Additional addresses for receiving feedback e-mail.', doc2 => 'By default, feeback is sent to all users above who have permission to receive feedback. Feedback is also sent to any addresses specified in this blank. Separate email address entries by commas.', |
From: Arnie P. v. a. <we...@ma...> - 2009-10-17 16:05:16
|
Log Message: ----------- Implement a Reduced Scoring Period. 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. Also clean up the LDAP section 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.217 retrieving revision 1.218 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.217 -r1.218 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -608,14 +608,15 @@ }; $authen{ldap_options} = { - # hosts to attempt to connect to, in order. for example: + # hosts to attempt to connect to, in order. For example: # auth.myschool.edu -- uses LDAP scheme and port 389 # ldap://auth.myschool.edu:666 -- non-standard port # ldaps://auth.myschool.edu -- uses LDAPS scheme and port 636 # ldaps://auth.myschool.edu:389 -- SSL on non-SSL port + # Edit the host(s) below: net_ldap_hosts => [ - "ldaps://corona-dmc.its.rochester.edu", - "ldaps://corona-dmb.acs.rochester.edu", + "ldaps://auth1.myschool.edu", + "ldaps://auth2.myschool.edu", ], # connection options net_ldap_options => { @@ -623,7 +624,8 @@ version => 3, }, # base to use when searching for user's DN - net_ldap_base => "ou=people,dc=rochester,dc=edu", + # Edit the data below: + net_ldap_base => "ou=people,dc=myschool,dc=edu", # Use a Bind account if set to 1 bindAccount => 0, @@ -631,8 +633,6 @@ searchDN => "cn=search,DC=youredu,DC=edu", bindPassword => "password", - - # If LDAP rejects password, check it against the WeBWorK password database failover => 1, }; @@ -996,6 +996,8 @@ numZeroLevelTolDefault => 1E-12, useBaseTenLog => 0, defaultDisplayMatrixStyle => "[s]", + reducedScoringPeriod => 0, # Length of 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...> - 2009-10-17 16:03:20
|
Log Message: ----------- Implement a Reduced Scoring Period. 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. Modified Files: -------------- pg/macros: PGanswermacros.pl Revision Data ------------- Index: PGanswermacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGanswermacros.pl,v retrieving revision 1.69 retrieving revision 1.70 diff -Lmacros/PGanswermacros.pl -Lmacros/PGanswermacros.pl -u -r1.69 -r1.70 --- macros/PGanswermacros.pl +++ macros/PGanswermacros.pl @@ -148,6 +148,12 @@ my $functVarDefault; # ^variable my $useBaseTenLog my $useBaseTenLog; +# ^variable my $reducedScoringPeriod +my $reducedScoringPeriod; +# ^variable my $reducedScoringValue +my $reducedScoringValue; +# ^variable my $dueDate +my $dueDate; # ^function _PGanswermacros_init # ^uses loadMacros @@ -157,6 +163,10 @@ # ^uses $envir{functULimitDefault} # ^uses $envir{functVarDefault} # ^uses $envir{useBaseTenLog} +# ^uses $envir{reducedScoringPeriod} +# ^uses $envir{reducedScoringValue} +# ^uses $envir{dueDate} + sub _PGanswermacros_init { loadMacros('PGnumericevaluators.pl'); # even if these files are already loaded they need to be initialized. loadMacros('PGfunctionevaluators.pl'); @@ -168,8 +178,13 @@ $functULimitDefault = PG_restricted_eval(q/$envir{functULimitDefault}/); $functVarDefault = PG_restricted_eval(q/$envir{functVarDefault}/); $useBaseTenLog = PG_restricted_eval(q/$envir{useBaseTenLog}/); + $reducedScoringPeriod= PG_restricted_eval(q/$envir{reducedScoringPeriod}/); + $reducedScoringValue= PG_restricted_eval(q/$envir{reducedScoringValue}/); + $dueDate = PG_restricted_eval(q/$envir{dueDate}/); } + + =head1 MACROS =head2 Answer evaluator macros @@ -1613,24 +1628,28 @@ } # report the results $problem_result{score} = $allAnswersCorrectQ; + + $problem_state{num_of_correct_ans}++ if $allAnswersCorrectQ == 1; + $problem_state{num_of_incorrect_ans}++ if $allAnswersCorrectQ == 0; - # I don't like to put in this bit of code. - # It makes it hard to construct error free problem graders - # I would prefer to know that the problem score was numeric. - unless (defined($problem_state{recorded_score}) and $problem_state{recorded_score} =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/ ) { - $problem_state{recorded_score} = 0; # This gets rid of non-numeric scores - } - # - if ($allAnswersCorrectQ == 1 or $problem_state{recorded_score} == 1) { - $problem_state{recorded_score} = 1; - } - else { - $problem_state{recorded_score} = 0; + # Determine if we are in the reduced scoring period and act accordingly + + my $reducedScoringPeriodSec = $reducedScoringPeriod*60; # $reducedScoringPeriod is in minutes + if (time() < ($dueDate - $reducedScoringPeriodSec)) { # it is before the reduced scoring period + # increase recorded score if the current score is greater. + $problem_state{recorded_score} = $problem_result{score} if $problem_result{score} > $problem_state{recorded_score}; + # 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. + # 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_state{num_of_correct_ans}++ if $allAnswersCorrectQ == 1; - $problem_state{num_of_incorrect_ans}++ if $allAnswersCorrectQ == 0; - $problem_state{state_summary_msg} = ''; # an HTML formatted message printed at the bottom of the problem page (\%problem_result, \%problem_state); @@ -1683,6 +1702,7 @@ # syntax errors are not counted. my $record_problem_attempt = 1; # Checks + # FIXME: syntax errors are never checked for so this grader does not perform as advertised my $ansCount = keys %evaluated_answers; # get the number of answers unless ($ansCount > 0 ) { @@ -1715,18 +1735,22 @@ # report the results $problem_result{score} = $allAnswersCorrectQ; - # I don't like to put in this bit of code. - # It makes it hard to construct error free problem graders - # I would prefer to know that the problem score was numeric. - unless ($problem_state{recorded_score} =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/ ) { - $problem_state{recorded_score} = 0; # This gets rid of non-numeric scores - } - # - if ($allAnswersCorrectQ == 1 or $problem_state{recorded_score} == 1) { - $problem_state{recorded_score} = 1; - } - else { - $problem_state{recorded_score} = 0; + # Determine if we are in the reduced scoring period and act accordingly + + my $reducedScoringPeriodSec = $reducedScoringPeriod*60; # $reducedScoringPeriod is in minutes + if (time() < ($dueDate - $reducedScoringPeriodSec)) { # it is before the reduced scoring period + # increase recorded score if the current score is greater. + $problem_state{recorded_score} = $problem_result{score} if $problem_result{score} > $problem_state{recorded_score}; + # 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. + # 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."; } # record attempt only if there have been no syntax errors. @@ -1765,7 +1789,6 @@ # By default the old problem state is simply passed back out again. my %problem_state = %$rh_problem_state; - # %form_options might include # The user login name # The permission level of the user @@ -1802,15 +1825,30 @@ } # Calculate score rounded to three places to avoid roundoff problems $problem_result{score} = $total/$count if $count; - # increase recorded score if the current score is greater. - $problem_state{recorded_score} = $problem_result{score} if $problem_result{score} > $problem_state{recorded_score}; - $problem_state{num_of_correct_ans}++ if $total == $count; - $problem_state{num_of_incorrect_ans}++ if $total < $count ; + $problem_state{num_of_incorrect_ans}++ if $total < $count; + + # Determine if we are in the reduced scoring period and act accordingly + + my $reducedScoringPeriodSec = $reducedScoringPeriod*60; # $reducedScoringPeriod is in minutes + if (time() < ($dueDate - $reducedScoringPeriodSec)) { # it is before the reduced scoring period + # increase recorded score if the current score is greater. + $problem_state{recorded_score} = $problem_result{score} if $problem_result{score} > $problem_state{recorded_score}; + # 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. + # 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_state{state_summary_msg} = ''; # an HTML formatted message printed at the bottom of the problem page - + warn "Error in grading this problem the total $total is larger than $count" if $total > $count; (\%problem_result, \%problem_state); } |
From: Mike G. v. a. <we...@ma...> - 2009-10-11 01:01:17
|
Log Message: ----------- pod doc corrections Tags: ---- rel-2-4-patches Modified Files: -------------- pg/macros: PGgraders.pl Revision Data ------------- Index: PGgraders.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGgraders.pl,v retrieving revision 1.1.18.1.2.1 retrieving revision 1.1.18.1.2.2 diff -Lmacros/PGgraders.pl -Lmacros/PGgraders.pl -u -r1.1.18.1.2.1 -r1.1.18.1.2.2 --- macros/PGgraders.pl +++ macros/PGgraders.pl @@ -9,11 +9,11 @@ =pod -########################################################### -# full_partial_grader -# If the final answer is correct, then the problem is given full credit -# and a message is generated to that effect. Otherwise, partial credit -# is given for previous parts. + ########################################################### + # full_partial_grader + # If the final answer is correct, then the problem is given full credit + # and a message is generated to that effect. Otherwise, partial credit + # is given for previous parts. =cut @@ -71,21 +71,21 @@ =pod -################################################################ -# custom_problem_grader_0_60_100 -# -# We need a special problem grader on this problem, since we -# want the student to get full credit for all five answers correct, -# 60% credit for four correct, and 0% for three or fewer correct. -# To change this scheme, look through the following mess of code -# for the place where the variable $numright appears, and change -# that part. -# Also change the long line beginning "msg ==>", to show what will -# appear on the screen for the student. -# -# To look at the problem itself, look for the boxed comment below -# announcing the problem itself. -################################################################ + ################################################################ + # custom_problem_grader_0_60_100 + # + # We need a special problem grader on this problem, since we + # want the student to get full credit for all five answers correct, + # 60% credit for four correct, and 0% for three or fewer correct. + # To change this scheme, look through the following mess of code + # for the place where the variable $numright appears, and change + # that part. + # Also change the long line beginning "msg ==>", to show what will + # appear on the screen for the student. + # + # To look at the problem itself, look for the boxed comment below + # announcing the problem itself. + ################################################################ =cut @@ -173,37 +173,37 @@ =pod -################################################################ -# This problem grader custom_problem_grader_fluid -# was contributed by Prof. Zig Fiedorowicz, -# Dept. of Mathematics, Ohio State University on 8/25/01. -# As written, the problem grader should be put in a separate macro file. -# If actually inserted into a problem, you need to replace a couple -# of backslashes by double tildes. -# -# This is a generalization of the previous custom grader. -# This grader expects two array references to be passed to it, eg. -# $ENV['grader_numright'] = [2,5,7,10]; -# $ENV['grader_scores'] = [0.1,0.4,0.6,1] -# Both arrays should be of the same length, and in strictly -# increasing order. The first array is an array of possible -# raw scores, the number of parts of the problem the student might -# get right. The second array is the corresponding array of scores -# the student would be credited with for getting that many parts -# right. The scores should be real numbers between 0 and 1. -# The last element of the 'grader_scores' array should be 1 (perfect -# score). The corresponding last element of 'grader_numright' would -# be the total number of parts of the problem the student would have -# to get right for a perfect score. Normally this would be the total -# number of parts to the problem. In the example shown above, the -# student would get 10% credit for getting 2-4 parts right, 40% -# credit for getting 5-6 parts right, 60% credit for getting 7-9 parts -# right, and 100% credit for getting 10 (or more) parts right. -# A message to be displayed to the student about the grading policy -# for the problems should be passed via -# $ENV{'grader_message'} = "The grading policy for this problem is..."; -# or something similar. -################################################################ + ################################################################ + # This problem grader custom_problem_grader_fluid + # was contributed by Prof. Zig Fiedorowicz, + # Dept. of Mathematics, Ohio State University on 8/25/01. + # As written, the problem grader should be put in a separate macro file. + # If actually inserted into a problem, you need to replace a couple + # of backslashes by double tildes. + # + # This is a generalization of the previous custom grader. + # This grader expects two array references to be passed to it, eg. + # $ENV['grader_numright'] = [2,5,7,10]; + # $ENV['grader_scores'] = [0.1,0.4,0.6,1] + # Both arrays should be of the same length, and in strictly + # increasing order. The first array is an array of possible + # raw scores, the number of parts of the problem the student might + # get right. The second array is the corresponding array of scores + # the student would be credited with for getting that many parts + # right. The scores should be real numbers between 0 and 1. + # The last element of the 'grader_scores' array should be 1 (perfect + # score). The corresponding last element of 'grader_numright' would + # be the total number of parts of the problem the student would have + # to get right for a perfect score. Normally this would be the total + # number of parts to the problem. In the example shown above, the + # student would get 10% credit for getting 2-4 parts right, 40% + # credit for getting 5-6 parts right, 60% credit for getting 7-9 parts + # right, and 100% credit for getting 10 (or more) parts right. + # A message to be displayed to the student about the grading policy + # for the problems should be passed via + # $ENV{'grader_message'} = "The grading policy for this problem is..."; + # or something similar. + ################################################################ =cut |
From: Mike G. v. a. <we...@ma...> - 2009-10-11 01:00:38
|
Log Message: ----------- pod doc corrections Modified Files: -------------- pg/macros: PGgraders.pl Revision Data ------------- Index: PGgraders.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGgraders.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -Lmacros/PGgraders.pl -Lmacros/PGgraders.pl -u -r1.3 -r1.4 --- macros/PGgraders.pl +++ macros/PGgraders.pl @@ -9,11 +9,11 @@ =pod -########################################################### -# full_partial_grader -# If the final answer is correct, then the problem is given full credit -# and a message is generated to that effect. Otherwise, partial credit -# is given for previous parts. + ########################################################### + # full_partial_grader + # If the final answer is correct, then the problem is given full credit + # and a message is generated to that effect. Otherwise, partial credit + # is given for previous parts. =cut @@ -71,21 +71,21 @@ =pod -################################################################ -# custom_problem_grader_0_60_100 -# -# We need a special problem grader on this problem, since we -# want the student to get full credit for all five answers correct, -# 60% credit for four correct, and 0% for three or fewer correct. -# To change this scheme, look through the following mess of code -# for the place where the variable $numright appears, and change -# that part. -# Also change the long line beginning "msg ==>", to show what will -# appear on the screen for the student. -# -# To look at the problem itself, look for the boxed comment below -# announcing the problem itself. -################################################################ + ################################################################ + # custom_problem_grader_0_60_100 + # + # We need a special problem grader on this problem, since we + # want the student to get full credit for all five answers correct, + # 60% credit for four correct, and 0% for three or fewer correct. + # To change this scheme, look through the following mess of code + # for the place where the variable $numright appears, and change + # that part. + # Also change the long line beginning "msg ==>", to show what will + # appear on the screen for the student. + # + # To look at the problem itself, look for the boxed comment below + # announcing the problem itself. + ################################################################ =cut @@ -173,37 +173,37 @@ =pod -################################################################ -# This problem grader custom_problem_grader_fluid -# was contributed by Prof. Zig Fiedorowicz, -# Dept. of Mathematics, Ohio State University on 8/25/01. -# As written, the problem grader should be put in a separate macro file. -# If actually inserted into a problem, you need to replace a couple -# of backslashes by double tildes. -# -# This is a generalization of the previous custom grader. -# This grader expects two array references to be passed to it, eg. -# $ENV['grader_numright'] = [2,5,7,10]; -# $ENV['grader_scores'] = [0.1,0.4,0.6,1] -# Both arrays should be of the same length, and in strictly -# increasing order. The first array is an array of possible -# raw scores, the number of parts of the problem the student might -# get right. The second array is the corresponding array of scores -# the student would be credited with for getting that many parts -# right. The scores should be real numbers between 0 and 1. -# The last element of the 'grader_scores' array should be 1 (perfect -# score). The corresponding last element of 'grader_numright' would -# be the total number of parts of the problem the student would have -# to get right for a perfect score. Normally this would be the total -# number of parts to the problem. In the example shown above, the -# student would get 10% credit for getting 2-4 parts right, 40% -# credit for getting 5-6 parts right, 60% credit for getting 7-9 parts -# right, and 100% credit for getting 10 (or more) parts right. -# A message to be displayed to the student about the grading policy -# for the problems should be passed via -# $ENV{'grader_message'} = "The grading policy for this problem is..."; -# or something similar. -################################################################ + ################################################################ + # This problem grader custom_problem_grader_fluid + # was contributed by Prof. Zig Fiedorowicz, + # Dept. of Mathematics, Ohio State University on 8/25/01. + # As written, the problem grader should be put in a separate macro file. + # If actually inserted into a problem, you need to replace a couple + # of backslashes by double tildes. + # + # This is a generalization of the previous custom grader. + # This grader expects two array references to be passed to it, eg. + # $ENV['grader_numright'] = [2,5,7,10]; + # $ENV['grader_scores'] = [0.1,0.4,0.6,1] + # Both arrays should be of the same length, and in strictly + # increasing order. The first array is an array of possible + # raw scores, the number of parts of the problem the student might + # get right. The second array is the corresponding array of scores + # the student would be credited with for getting that many parts + # right. The scores should be real numbers between 0 and 1. + # The last element of the 'grader_scores' array should be 1 (perfect + # score). The corresponding last element of 'grader_numright' would + # be the total number of parts of the problem the student would have + # to get right for a perfect score. Normally this would be the total + # number of parts to the problem. In the example shown above, the + # student would get 10% credit for getting 2-4 parts right, 40% + # credit for getting 5-6 parts right, 60% credit for getting 7-9 parts + # right, and 100% credit for getting 10 (or more) parts right. + # A message to be displayed to the student about the grading policy + # for the problems should be passed via + # $ENV{'grader_message'} = "The grading policy for this problem is..."; + # or something similar. + ################################################################ =cut |
From: dpvc v. a. <we...@ma...> - 2009-10-10 14:00:39
|
Log Message: ----------- Added comments and minor cleanup Modified Files: -------------- pg/macros: contextReaction.pl Revision Data ------------- Index: contextReaction.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextReaction.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -Lmacros/contextReaction.pl -Lmacros/contextReaction.pl -u -r1.1 -r1.2 --- macros/contextReaction.pl +++ macros/contextReaction.pl @@ -66,19 +66,29 @@ =cut +###################################################################### + sub _contextReaction_init {context::Reaction::Init()} ###################################################################### - +# +# The main MathObject class for reactions +# package context::Reaction; our @ISA = ('Value::Formula'); +# +# Some type declarations for the various classes +# our $ELEMENT = {isValue => 1, type => Value::Type("Element",1)}; our $MOLECULE = {isValue => 1, type => Value::Type("Molecule",1)}; our $COMPOUND = {isValue => 1, type => Value::Type("Compound",1)}; our $REACTION = {isValue => 1, type => Value::Type("Reaction",1)}; our $CONSTANT = {isValue => 1, type => Value::Type("Constant",1)}; +# +# Set up the context and Reaction() constructor +# sub Init { my $context = $main::context{Reaction} = Parser::Context->getCopy("Numeric"); $context->functions->clear(); @@ -128,7 +138,6 @@ ); $context->{parser}{Number} = "context::Reaction::Number"; $context->{parser}{Variable} = "context::Reaction::Variable"; - $context->{parser}{List} = "context::Reaction::List"; $context->{parser}{Formula} = "context::Reaction"; $context->{value}{Reaction} = "context::Reaction"; $context->{value}{Element} = "context::Reaction::Variable"; @@ -138,6 +147,9 @@ main::PG_restricted_eval('sub Reaction {Value->Package("Formula")->new(@_)};'); } +# +# Compare by checking of the trees are equivalent +# sub compare { my ($l,$r) = @_; my $self = $l; my $context = $self->context; @@ -145,35 +157,56 @@ return ($l->{tree}->equivalent($r->{tree}) ? 0 : 1); } +# +# Don't allow evaluation +# sub eval { my $self = shift; $self->Error("Can't evaluate ".$self->TYPE); } +# +# Provide a useful name +# sub TYPE {'a chemical reaction'} sub cmp_class {'a Chemical Reaction'} +# +# Set up the answer checker. Avoid the list checker in +# Value::Formula::cmp_equal (for when the answer is a +# sum of compounds) and provide a postprocessor to +# give warnings when a reaction is compared to a +# student answer that isn't a reaction. +# sub cmp_defaults {(showTypeWarnings => 1)} - sub cmp_equal {Value::cmp_equal(@_)}; - sub cmp_postprocess { my $self = shift; my $ans = shift; return unless $self->{tree}->type eq 'Reaction'; - $self->cmp_Error($ans,"Your answer doesn't seem to be a reaction (it should contain a reaction arrow '-->')") - unless $ans->{student_value}{tree}->type eq 'Reaction'; + $self->cmp_Error($ans,"Your answer doesn't seem to be a reaction\n(it should contain a reaction arrow '-->')") + if $ans->{showTypeWarnings} && $ans->{student_value}{tree}->type ne 'Reaction'; } +# +# Since the context only allows things that are comparable, we +# don't really have to check anything. (But if somone added +# strings or constants, we would.) +# sub typeMatch { my $self = shift; my $other = shift; return 1; } ###################################################################### - +# +# The replacement for the Parser:Number class +# package context::Reaction::Number; our @ISA = ('Parser::Number'); +# +# Equivalent is equal +# sub equivalent { my $self = shift; my $other = shift; return 0 unless $other->class eq 'Number'; @@ -186,10 +219,15 @@ sub TYPE {'a Number'} ###################################################################### - +# +# The replacement for Parser::Variable. We hold the elements here. +# package context::Reaction::Variable; our @ISA = ('Parser::Variable'); +# +# Two elements are equivalent if their names are equal +# sub equivalent { my $self = shift; my $other = shift; return 0 unless $other->class eq 'Variable'; @@ -200,6 +238,9 @@ sub isChemical {1} +# +# Print element names in Roman +# sub TeX { my $self = shift; return "{\\rm $self->{name}}"; @@ -207,40 +248,56 @@ sub class {'Variable'} +# +# For a printable name, use a constant's name, +# and 'an element' for an element. +# sub TYPE { my $self = shift; return ($self->type eq 'Constant'? "'$self->{name}'" : 'an element'); } ###################################################################### - +# +# General binary operator (add, multiply, arrow, and underscore +# are subclasses of this). +# package context::Reaction::BOP; our @ISA = ('Parser::BOP'); +# +# Binary operators produce chemcicals (unless overridden, as in arrow) +# sub isChemical {1} sub eval {context::Reaction::eval(@_)} +# +# Two nodes are equivalent if their operands are equivalent +# and they have the same operator +# sub equivalent { my $self = shift; my $other = shift; - return 0 unless substr($other->class,0,3) eq 'BOP'; + return 0 unless $other->class eq 'BOP'; + return 0 unless $self->{bop} eq $other->{bop}; return $self->{lop}->equivalent($other->{lop}) && $self->{rop}->equivalent($other->{rop}); } -sub class { - my $self = shift; - my $class = ref($self); - $class =~ s/.*::BOP::/BOP::/; - return $class; -} - ###################################################################### - +# +# Implements the --> operator +# package context::Reaction::BOP::arrow; our @ISA = ('context::Reaction::BOP'); +# +# It is a reaction, not a chemical +# sub isChemical {0} +# +# Check that the operands are correct. +# sub _check { my $self = shift; $self->Error("The left-hand side of '-->' must be a (sum of) reactants, not %s", @@ -253,10 +310,16 @@ sub TYPE {'a reaction'} ###################################################################### - +# +# Implements addition, which forms a list of operands, so acts like +# the Parser::BOP::comma operator +# package context::Reaction::BOP::add; our @ISA = ('Parser::BOP::comma','context::Reaction::BOP'); +# +# Check that the operands are OK +# sub _check { my $self = shift; $self->Error("Can't add %s and %s",$self->{lop}->TYPE,$self->{rop}->TYPE) @@ -264,6 +327,11 @@ $self->SUPER::_check(@_); } +# +# Two are equivalent if they are equivalent in either order. +# (never really gets used, since these result in the creation +# of a list rather than an "add" node in the final tree. +# sub equivalent { my $self = shift; my $other = shift; return 0 unless substr($other->class,0,3) eq 'BOP'; @@ -274,10 +342,16 @@ sub TYPE {'a sum of Compounds'} ###################################################################### - +# +# Implements concatenation, which produces compounds or integer +# multiples of elements or molecules. +# package context::Reaction::BOP::multiply; our @ISA = ('context::Reaction::BOP'); +# +# Check that the operands are OK +# sub _check { my $self = shift; $self->Error("Can't combine %s and %s",$self->{lop}->TYPE,$self->{rop}->TYPE) @@ -291,7 +365,7 @@ } # -# No space for implied multiplication +# No space in output for implied multiplication # sub string { my $self = shift; @@ -305,10 +379,15 @@ sub TYPE {'a compound'} ###################################################################### - +# +# Implements the underscore for creating molecules +# package context::Reaction::BOP::underscore; our @ISA = ('context::Reaction::BOP'); +# +# Check that the operands are OK +# sub _check { my $self = shift; $self->Error("The left-hand side of '_' must be an element, not %s",$self->{lop}->TYPE) @@ -318,6 +397,9 @@ $self->{type} = $MOLECULE->{type}; } +# +# Create proper TeX output +# sub TeX { my $self = shift; return $self->{lop}->TeX."_{".$self->{rop}->TeX."}"; @@ -326,20 +408,16 @@ sub TYPE {'a molecule'} ###################################################################### - -package context::Reaction::List; -our @ISA = ('Parser::List::List'); - -sub cmp_compare { - my $self = shift; my $other = shift; my $ans = shift; - return $self->{tree}->equivalent($other->{tree}); -} - -###################################################################### - +# +# Implements sums of compounds as a list +# package context::Reaction::List::List; our @ISA = ('Parser::List::List'); +# +# Two sums are equivalent if their terms agree in any order. +# (we check by stringifying them and sorting, then compare results) +# sub equivalent { my $self = shift; my $other = shift; return 0 unless $self->length == $other->length; @@ -348,6 +426,9 @@ return join(',',@left) eq join(',',@right); } +# +# Use "+" between entries in the list (with no parens) +# sub TeX { my $self = shift; my $precedence = shift; my @coords = (); foreach my $x (@{$self->{coords}}) {push(@coords,$x->TeX)} |