Skip to content

Commit 21ff097

Browse files
committed
A little code clean up.
1 parent 26c801c commit 21ff097

File tree

2 files changed

+38
-40
lines changed

2 files changed

+38
-40
lines changed

templates/ContentGenerator/Feedback/feedback_email.html.ep

+38-38
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@
3636
</thead>
3737
<tbody>
3838
% my @rows = (
39-
% ['Problem ID', $problem->problem_id],
40-
% ['Source file', $problem->source_file],
41-
% ['Value', $problem->value],
42-
% ['Max attempts', $problem->max_attempts == -1 ? 'unlimited' : $problem->max_attempts],
43-
% ['Random seed', $problem->problem_seed],
44-
% ['Status', $problem->status],
45-
% ['Attempted', $problem->attempted ? 'yes' : 'no'],
46-
% ['Correct attempts', $problem->num_correct],
47-
% ['Incorrect attempts', $problem->num_incorrect]
39+
% [ 'Problem ID', $problem->problem_id ],
40+
% [ 'Source file', $problem->source_file ],
41+
% [ 'Value', $problem->value ],
42+
% [ 'Max attempts', $problem->max_attempts == -1 ? 'unlimited' : $problem->max_attempts ],
43+
% [ 'Random seed', $problem->problem_seed ],
44+
% [ 'Status', $problem->status ],
45+
% [ 'Attempted', $problem->attempted ? 'yes' : 'no' ],
46+
% [ 'Correct attempts', $problem->num_correct ],
47+
% [ 'Incorrect attempts', $problem->num_incorrect ]
4848
% );
4949
% for (@rows) {
5050
<tr>
@@ -81,24 +81,24 @@
8181
</thead>
8282
<tbody>
8383
% my @rows = (
84-
% ['Set ID', $set->set_id],
85-
% ['Set header file', $set->set_header],
86-
% ['Hardcopy header file', $set->hardcopy_header],
87-
% ['Open date', $c->formatDateTime($set->open_date)],
88-
% ['Close date', $c->formatDateTime($set->due_date)],
89-
% ['Answer date', $c->formatDateTime($set->answer_date)],
90-
% ['Visible', $set->visible ? 'yes' : 'no'],
91-
% ['Assignment type', $set->assignment_type]
84+
% [ 'Set ID', $set->set_id ],
85+
% [ 'Set header file', $set->set_header ],
86+
% [ 'Hardcopy header file', $set->hardcopy_header ],
87+
% [ 'Open date', $c->formatDateTime($set->open_date) ],
88+
% [ 'Close date', $c->formatDateTime($set->due_date) ],
89+
% [ 'Answer date', $c->formatDateTime($set->answer_date) ],
90+
% [ 'Visible', $set->visible ? 'yes' : 'no' ],
91+
% [ 'Assignment type', $set->assignment_type ]
9292
% );
9393
% if ($set->assignment_type =~ /gateway/) {
9494
% push @rows, (
95-
% ['Attempts per version', $set->attempts_per_version],
96-
% ['Time interval', $set->time_interval],
97-
% ['Versions per interval', $set->versions_per_interval],
98-
% ['Version time limit', $set->version_time_limit],
99-
% ['Version creation time', $c->formatDateTime($set->version_creation_time)],
100-
% ['Problem randorder', $set->problem_randorder],
101-
% ['Version last attempt time', $set->version_last_attempt_time]
95+
% [ 'Attempts per version', $set->attempts_per_version ],
96+
% [ 'Time interval', $set->time_interval ],
97+
% [ 'Versions per interval', $set->versions_per_interval ],
98+
% [ 'Version time limit', $set->version_time_limit ],
99+
% [ 'Version creation time', $c->formatDateTime($set->version_creation_time) ],
100+
% [ 'Problem randorder', $set->problem_randorder ],
101+
% [ 'Version last attempt time', $set->version_last_attempt_time ]
102102
% );
103103
% }
104104
% for (@rows) {
@@ -118,11 +118,11 @@
118118
</thead>
119119
<tbody>
120120
% my @rows = (
121-
% ['Display Mode', param('displayMode')],
122-
% ['Show Old Answers', param('showOldAnswers') ? 'yes' : 'no'],
123-
% ['Show Correct Answers', param('showCorrectAnswers') ? 'yes' : 'no'],
124-
% ['Show Hints', param('showHints') ? 'yes' : 'no'],
125-
% ['Show Solutions', param('showSolutions') ? 'yes' : 'no']
121+
% [ 'Display Mode', param('displayMode') ],
122+
% [ 'Show Old Answers', param('showOldAnswers') ? 'yes' : 'no' ],
123+
% [ 'Show Correct Answers', param('showCorrectAnswers') ? 'yes' : 'no' ],
124+
% [ 'Show Hints', param('showHints') ? 'yes' : 'no' ],
125+
% [ 'Show Solutions', param('showSolutions') ? 'yes' : 'no' ]
126126
% );
127127
% for (@rows) {
128128
<tr>
@@ -142,22 +142,22 @@
142142
</thead>
143143
<tbody>
144144
% my @rows = (
145-
% ['User ID', $user->user_id],
146-
% ['Name', $user->full_name],
147-
% ['Email', $user->email_address]
145+
% [ 'User ID', $user->user_id ],
146+
% [ 'Name', $user->full_name ],
147+
% [ 'Email', $user->email_address ]
148148
% );
149-
% unless ($ce->{blockStudentIDinFeedback}) {push @rows, ['Student ID', $user->student_id];}
149+
% unless ($ce->{blockStudentIDinFeedback}) { push @rows, ['Student ID', $user->student_id]; }
150150
% my $status_name = $ce->status_abbrev_to_name($user->status);
151151
% my $status_string =
152152
% defined $status_name
153153
% ? "$status_name ('" . $user->status . q{')}
154154
% : $user->status . ' (unknown status abbreviation)';
155155
% push @rows, (
156-
% ['Status', $status_string],
157-
% ['Section', $user->section],
158-
% ['Recitation', $user->recitation],
159-
% ['Comment', $user->comment],
160-
% ['IP Address', $remote_host]
156+
% [ 'Status', $status_string ],
157+
% [ 'Section', $user->section ],
158+
% [ 'Recitation', $user->recitation ],
159+
% [ 'Comment', $user->comment ],
160+
% [ 'IP Address', $remote_host ]
161161
%);
162162
% for (@rows) {
163163
<tr>

templates/ContentGenerator/Feedback/feedback_email.txt.ep

-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Feedback sent from:
1515
% if ($feedback) {
1616
<%== $user->full_name %> (<%== $user->user_id %>) wrote:
1717

18-
1918
<%== $feedback %>
2019

2120
% }
@@ -96,7 +95,6 @@ Section: <%== $user->section %>
9695
Recitation: <%== $user->recitation %>
9796
Comment: <%== $user->comment %>
9897
IP Address: <%== $remote_host %>:<%== $c->tx->remote_port || 'UNKNOWN' %>
99-
10098
% }
10199
% if ($verbosity >= 2) {
102100

0 commit comments

Comments
 (0)