Skip to content

Commit 4f90e1b

Browse files
committed
Updates to achievement items from feedback.
Remove the fs-3 class from the achievement item names on the achievements page when listing the achievement items. When printing the achievement item name with the number of remaining items, don't treat separately from any > 0 value. Update the problem selection drop down forms to be clearer on what the problem number is for and clarifying when double means double the weight vs increase grade by 50%.
1 parent 4ca6bb5 commit 4f90e1b

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

lib/WeBWorK/AchievementItems.pm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,12 @@ sub UserItems ($c, $userName, $set, $records) {
124124
}
125125

126126
# Method that returns a string with the achievement name and number of remaining items.
127+
# This should only be called if count != 0.
127128
sub remaining_title ($self, $c) {
128-
if ($self->count > 1) {
129+
if ($self->count > 0) {
129130
return $c->maketext('[_1] ([_2] remaining)', $c->maketext($self->name), $self->count);
130-
} elsif ($self->count < 0) {
131-
return $c->maketext('[_1] (unlimited reusability)', $c->maketext($self->name));
132131
} else {
133-
return $c->maketext('[_1] (1 remains)', $c->maketext($self->name));
132+
return $c->maketext('[_1] (unlimited reusability)', $c->maketext($self->name));
134133
}
135134
}
136135

lib/WeBWorK/AchievementItems/DoubleProb.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ sub print_form ($self, $set, $records, $c) {
3737
return WeBWorK::AchievementItems::form_popup_menu_row(
3838
$c,
3939
id => 'dbp_problem_id',
40-
label_text => $c->maketext('Problem Number'),
41-
first_item => $c->maketext('Choose problem to double.'),
40+
label_text => $c->maketext('Problem number to double weight'),
41+
first_item => $c->maketext('Choose problem to double its weight.'),
4242
values => [
4343
map { [ $c->maketext('Problem [_1] ([_2] to [_3])', $_->problem_id, $_->value, 2 * $_->value) =>
4444
$_->problem_id ] } @$records
@@ -49,7 +49,7 @@ sub print_form ($self, $set, $records, $c) {
4949
sub use_item ($self, $set, $records, $c) {
5050
my $problemID = $c->param('dbp_problem_id');
5151
unless ($problemID) {
52-
$c->addbadmessage($c->maketext('Select problem to double with the [_1].', $self->name));
52+
$c->addbadmessage($c->maketext('Select problem to double its weight with the [_1].', $self->name));
5353
return '';
5454
}
5555

@@ -70,7 +70,7 @@ sub use_item ($self, $set, $records, $c) {
7070
$userProblem->value($problem->value);
7171
$db->putUserProblem($userProblem);
7272

73-
return $c->maketext('Problem [_1] increased from [_2] points to [_3] points.',
73+
return $c->maketext('Problem [_1] weight increased from [_2] to [_3].',
7474
$problemID, $orig_value, $problem->value);
7575
}
7676

lib/WeBWorK/AchievementItems/DuplicateProb.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ sub print_form ($self, $set, $records, $c) {
3939
WeBWorK::AchievementItems::form_popup_menu_row(
4040
$c,
4141
id => 'clone_source_problem_id',
42-
label_text => $c->maketext('Problem Number'),
42+
label_text => $c->maketext('Problem number to copy'),
4343
first_item => $c->maketext('Choose problem to copy from.'),
4444
values => [ map { [ $c->maketext('Problem [_1]', $_->problem_id) => $_->problem_id ] } @$records ],
4545
),
4646
WeBWorK::AchievementItems::form_popup_menu_row(
4747
$c,
4848
id => 'clone_dest_problem_id',
49-
label_text => $c->maketext('Problem Number'),
49+
label_text => $c->maketext('Problem number to replace'),
5050
first_item => $c->maketext('Choose problem to replace.'),
5151
values => [ map { [ $c->maketext('Problem [_1]', $_->problem_id) => $_->problem_id ] } @$records ],
5252
),

lib/WeBWorK/AchievementItems/FullCreditProb.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ sub print_form ($self, $set, $records, $c) {
4545
return WeBWorK::AchievementItems::form_popup_menu_row(
4646
$c,
4747
id => 'full_cred_problem_id',
48-
label_text => $c->maketext('Problem Number'),
48+
label_text => $c->maketext('Problem number to give full credit'),
4949
first_item => $c->maketext('Choose problem to give full credit.'),
5050
values => [
5151
map { [ $c->maketext('Problem [_1] ([_2]% to 100%)', $_->problem_id, 100 * wwRound(2, $_->status)) =>
@@ -57,7 +57,7 @@ sub print_form ($self, $set, $records, $c) {
5757
sub use_item ($self, $set, $records, $c) {
5858
my $problemID = $c->param('full_cred_problem_id');
5959
unless ($problemID) {
60-
$c->addbadmessage($c->maketext('Select problem to give 100% to the [_1].', $self->name));
60+
$c->addbadmessage($c->maketext('Select problem to give full credit with the [_1].', $self->name));
6161
return '';
6262
}
6363

@@ -79,7 +79,7 @@ sub use_item ($self, $set, $records, $c) {
7979
$userProblem->sub_status(1);
8080
$db->putUserProblem($userProblem);
8181

82-
return $c->maketext('Problem number [_1] increased to 100%.', $problemID);
82+
return $c->maketext('Problem number [_1] given full credit.', $problemID);
8383
}
8484

8585
1;

lib/WeBWorK/AchievementItems/HalfCreditProb.pm

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ sub new ($class) {
2525
return bless {
2626
id => 'HalfCreditProb',
2727
name => x('Lesser Rod of Revelation'),
28-
description => x('Increases the score of a single problem by 50%, to a maximum of 100%.')
28+
description => x('Increases the grade of a single problem by 50%, to a maximum of 100%.')
2929
}, $class;
3030
}
3131

@@ -42,8 +42,8 @@ sub print_form ($self, $set, $records, $c) {
4242
return WeBWorK::AchievementItems::form_popup_menu_row(
4343
$c,
4444
id => 'half_cred_problem_id',
45-
label_text => $c->maketext('Problem Number'),
46-
first_item => $c->maketext('Choose problem to increase 50%.'),
45+
label_text => $c->maketext('Problem number to give half credit'),
46+
first_item => $c->maketext('Choose problem to increase grade by 50%.'),
4747
values => [
4848
map { [
4949
$c->maketext(
@@ -60,7 +60,7 @@ sub print_form ($self, $set, $records, $c) {
6060
sub use_item ($self, $set, $records, $c) {
6161
my $problemID = $c->param('half_cred_problem_id');
6262
unless ($problemID) {
63-
$c->addbadmessage($c->maketext('Select problem to add 50% with the [_1].', $self->name));
63+
$c->addbadmessage($c->maketext('Select problem to increase its grade by 50% with the [_1].', $self->name));
6464
return '';
6565
}
6666

@@ -82,7 +82,8 @@ sub use_item ($self, $set, $records, $c) {
8282
$userProblem->sub_status($problem->status);
8383
$db->putUserProblem($userProblem);
8484

85-
return $c->maketext('Problem number [_1] increased to [_2]%.', $problemID, 100 * wwRound(2, $problem->status));
85+
return $c->maketext('Problem number [_1] grade increased to [_2]%.', $problemID,
86+
100 * wwRound(2, $problem->status));
8687
}
8788

8889
1;

lib/WeBWorK/AchievementItems/ResetIncorrectAttempts.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ sub print_form ($self, $set, $records, $c) {
4242
return WeBWorK::AchievementItems::form_popup_menu_row(
4343
$c,
4444
id => 'reset_attempts_problem_id',
45-
label_text => $c->maketext('Problem Number'),
45+
label_text => $c->maketext('Problem number to reset incorrect attempts'),
4646
first_item => $c->maketext('Choose problem to reset incorrect attempts.'),
4747
values => [
4848
map { [

templates/ContentGenerator/Achievements/achievement_items.html.ep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</p>
1313
<dl class="mx-4">
1414
% for my $item (@{ $c->{achievementItems} }) {
15-
<dt class="fs-3">
15+
<dt>
1616
<%= $item->remaining_title($c) %>
1717
</dt>
1818
<dd class="ms-3 mb-2"><%= maketext($item->description) %></dd>

0 commit comments

Comments
 (0)