From ee6fdecaa620afe611e3b0016014fe5e4ef0694b Mon Sep 17 00:00:00 2001 From: Jaimos Skriletz Date: Fri, 4 Feb 2022 23:48:45 -0700 Subject: [PATCH] Remove reducedScoring from PG. PG should report raw scores to webwork, and webwork should then adjust the score accordingly. This removes all reducedScoring computations from PG and the variable sub_recorded_score will no longer be set by PG, thus PG will only return the record_score to webwork.. --- macros/PGanswermacros.pl | 58 +++++----------------------------------- macros/PGgraders.pl | 17 ++---------- 2 files changed, 9 insertions(+), 66 deletions(-) diff --git a/macros/PGanswermacros.pl b/macros/PGanswermacros.pl index cf3e3ef005..fb7c60531d 100644 --- a/macros/PGanswermacros.pl +++ b/macros/PGanswermacros.pl @@ -148,12 +148,6 @@ =head1 DESCRIPTION my $functVarDefault; # ^variable my $useBaseTenLog my $useBaseTenLog; -# ^variable my $reducedScoringDate -my $reducedScoringDate; -# ^variable my $reducedScoringValue -my $reducedScoringValue; -# ^variable my $enable_reduced_scoring -my $enable_reduced_scoring; # ^variable my $dueDate my $dueDate; @@ -165,9 +159,6 @@ =head1 DESCRIPTION # ^uses $envir{functULimitDefault} # ^uses $envir{functVarDefault} # ^uses $envir{useBaseTenLog} -# ^uses $envir{reducedScoringDate} -# ^uses $envir{reducedScoringValue} -# ^uses $envir{enable_reduced_scoring} # ^uses $envir{dueDate} sub _PGanswermacros_init { @@ -181,9 +172,6 @@ sub _PGanswermacros_init { $functULimitDefault = PG_restricted_eval(q/$envir{functULimitDefault}/); $functVarDefault = PG_restricted_eval(q/$envir{functVarDefault}/); $useBaseTenLog = PG_restricted_eval(q/$envir{useBaseTenLog}/); - $reducedScoringDate = PG_restricted_eval(q/$envir{reducedScoringDate}/); - $reducedScoringValue= PG_restricted_eval(q/$envir{reducedScoringValue}/); - $enable_reduced_scoring = $reducedScoringDate ? PG_restricted_eval(q/$envir{enable_reduced_scoring}/) : 0; $dueDate = PG_restricted_eval(q/$envir{dueDate}/); } @@ -1522,20 +1510,10 @@ sub std_problem_grader { $problem_state{num_of_correct_ans}++ if $allAnswersCorrectQ == 1; $problem_state{num_of_incorrect_ans}++ if $allAnswersCorrectQ == 0; $problem_state{recorded_score} = 0 unless defined $problem_state{recorded_score}; - # Determine if we are in the reduced scoring period and act accordingly - if (!$enable_reduced_scoring or time() < $reducedScoringDate) { # the reduced scoring period is disabled or it is before the reduced scoring period + # FIXME: This check should be moved out of PG, webwork should do this check instead. + if (time() < $dueDate) { # 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}; - } - elsif (time() < $dueDate) { # we are in the reduced scoring period. - # student gets credit for all work done before the reduced scoring period plus a portion of work done during period - my $newScore = 0; - $newScore = $problem_state{sub_recorded_score} + $reducedScoringValue*($problem_result{score} - $problem_state{sub_recorded_score}) if ($problem_result{score} > $problem_state{sub_recorded_score}); - $problem_state{recorded_score} = $newScore if $newScore > $problem_state{recorded_score}; - my $reducedScoringPerCent = int(100*$reducedScoringValue+.5); - $problem_result{msg} = $problem_result{msg}."
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 @@ -1624,23 +1602,13 @@ sub std_problem_grader2 { $problem_result{score} = $allAnswersCorrectQ; $problem_state{recorded_score} = 0 unless defined $problem_state{recorded_score}; - # Determine if we are in the reduced scoring period and act accordingly - if (!$enable_reduced_scoring or time() < $reducedScoringDate) { # the reduced scoring period is disabled or it is before the reduced scoring period + # FIXME: This check should be moved out of PG, webwork should do this check instead. + if (time() < $dueDate) { # 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}; - } - elsif (time() < $dueDate) { # we are in the reduced scoring period. - # student gets credit for all work done before the reduced scoring period plus a portion of work done during period - my $newScore = 0; - $newScore = $problem_state{sub_recorded_score} + $reducedScoringValue*($problem_result{score} - $problem_state{sub_recorded_score}) if ($problem_result{score} > $problem_state{sub_recorded_score}); - $problem_state{recorded_score} = $newScore if $newScore > $problem_state{recorded_score}; - my $reducedScoringPerCent = int(100*$reducedScoringValue+.5); - $problem_result{msg} = $problem_result{msg}."
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. + # record attempt only if there have been no syntax errors. if ($record_problem_attempt == 1) { $problem_state{num_of_correct_ans}++ if $allAnswersCorrectQ == 1; $problem_state{num_of_incorrect_ans}++ if $allAnswersCorrectQ == 0; @@ -1717,22 +1685,10 @@ sub avg_problem_grader { $problem_state{num_of_correct_ans}++ if $total == $count; $problem_state{num_of_incorrect_ans}++ if $total < $count; - # Determine if we are in the reduced scoring period and if the reduced scoring period is enabled and act accordingly -#warn("enable_reduced_scoring is $enable_reduced_scoring"); -# warn("dueDate is $dueDate"); - if (!$enable_reduced_scoring or time() < $reducedScoringDate) { # the reduced scoring period is disabled or it is before the reduced scoring period + # FIXME: This check should be moved out of PG, webwork should do this instead. + if (time() < $dueDate) { # 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}; - } -elsif (time() < $dueDate) { # we are in the reduced scoring period. - # student gets credit for all work done before the reduced scoring period plus a portion of work done during period - my $newScore = 0; - $newScore = $problem_state{sub_recorded_score} + $reducedScoringValue*($problem_result{score} - $problem_state{sub_recorded_score}) if ($problem_result{score} > $problem_state{sub_recorded_score}); - $problem_state{recorded_score} = $newScore if $newScore > $problem_state{recorded_score}; - my $reducedScoringPerCent = int(100*$reducedScoringValue+.5); - $problem_result{msg} = $problem_result{msg}."
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 diff --git a/macros/PGgraders.pl b/macros/PGgraders.pl index baf78030dd..7bc9d88253 100644 --- a/macros/PGgraders.pl +++ b/macros/PGgraders.pl @@ -303,23 +303,10 @@ sub custom_problem_grader_fluid { $problem_result{score} = $total; -# Determine if we are in the reduced scoring period and if the reduced scoring period is enabled and act accordingly -#warn("enable_reduced_scoring is $enable_reduced_scoring"); -#warn("dueDate is $dueDate"); - - if (!$enable_reduced_scoring or time() < $reducedScoringDate) { # the reduced scoring period is disabled or it is before the reduced scoring period + # FIXME: This check should be moved out of PG, webwork should do this check instead. + if (time() < $dueDate) { # 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}; - } -elsif (time() < $dueDate) { # we are in the reduced scoring period. - # student gets credit for all work done before the reduced scoring period plus a portion of work done during period - my $newScore = 0; - $newScore = $problem_state{sub_recorded_score} + $reducedScoringValue*($problem_result{score} - $problem_state{sub_recorded_score}) if ($problem_result{score} > $problem_state{sub_recorded_score}); - $problem_state{recorded_score} = $newScore if $newScore > $problem_state{recorded_score}; - my $reducedScoringPerCent = int(100*$reducedScoringValue+.5); - $problem_result{msg} = $problem_result{msg}."
You are in the Reduced Scoring Period: All additional work done counts $reducedScoringPerCent\% of the original."; } (\%problem_result, \%problem_state);