diff --git a/lib/WeBWorK/ContentGenerator/Problem.pm b/lib/WeBWorK/ContentGenerator/Problem.pm index e596fe288d..bf744717c8 100644 --- a/lib/WeBWorK/ContentGenerator/Problem.pm +++ b/lib/WeBWorK/ContentGenerator/Problem.pm @@ -29,7 +29,8 @@ use WeBWorK::Utils qw(decodeAnswers is_restricted path_is_subdir before after be wwRound is_jitar_problem_closed is_jitar_problem_hidden jitar_problem_adjusted_status jitar_id_to_seq seq_to_jitar_id jitar_problem_finished format_set_name_display); use WeBWorK::Utils::Rendering qw(getTranslatorDebuggingOptions renderPG); -use WeBWorK::Utils::ProblemProcessing qw/process_and_log_answer jitar_send_warning_email compute_reduced_score/; +use WeBWorK::Utils::ProblemProcessing qw(process_and_log_answer jitar_send_warning_email compute_reduced_score + compute_unreduced_score); use WeBWorK::AchievementEvaluator qw(checkForAchievements); use WeBWorK::DB::Utils qw(global2user); use WeBWorK::Localize; @@ -738,6 +739,7 @@ sub siblings ($c) { my $total_correct = 0; my $total_incorrect = 0; my $total_inprogress = 0; + my $is_reduced = 0; my $currentProblemID = $c->{invalidProblem} ? 0 : $c->{problem}->problem_id; my $progressBarEnabled = $c->ce->{pg}{options}{enableProgressBar}; @@ -762,7 +764,8 @@ sub siblings ($c) { $num_of_problems++; my $total_attempts = $problemRecord->num_correct + $problemRecord->num_incorrect; - my $status = $problemRecord->status; + my $status = compute_unreduced_score($ce, $problemRecord, $c->{set}); + $is_reduced = 1 if $status > $problemRecord->status; if ($isJitarSet) { $status = jitar_problem_adjusted_status($problemRecord, $db); } @@ -841,6 +844,7 @@ sub siblings ($c) { total_correct => $total_correct, total_incorrect => $total_incorrect, total_inprogress => $total_inprogress, + is_reduced => $is_reduced ); } diff --git a/templates/ContentGenerator/Problem/siblings.html.ep b/templates/ContentGenerator/Problem/siblings.html.ep index 6e158d9f5e..82f8084265 100644 --- a/templates/ContentGenerator/Problem/siblings.html.ep +++ b/templates/ContentGenerator/Problem/siblings.html.ep @@ -15,9 +15,14 @@ aria-label="correct progress bar for current problem set" role="figure" data-bs-toggle="tooltip" data-bs-placement="bottom" tabindex="0" data-bs-title="<%= maketext('Correct: [_1]/[_2]', $total_correct, $num_of_problems) %>"> - % # Perfect scores deserve some stars (★)! % if ($total_correct == $num_of_problems) { - ★Perfect★ + % if ($is_reduced) { + % # If any of the scores are reduced the set is not perfect. It is merely complete. + <%= maketext('Complete') %> + % } else { + % # Perfect scores deserve some stars (★)! + ★<%= maketext('Perfect') %>★ + % } % } % }