Skip to content

Commit

Permalink
Show student names on issue reports (#1140)
Browse files Browse the repository at this point in the history
* Add student name and clickable e-mail address to issue report on question page

* fix merge conflict

* Improve default mail template for issues

* Remove spaces around student e-mail

* update ChangeLog
  • Loading branch information
coatless authored and nwalters512 committed Jun 1, 2018
1 parent 775dba1 commit de35d2e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

* __next version__ - XXXX-XX-XX

* Add student name and clickable e-mail address information to issue reports (James Balamuta).

* Upgrade to Node.js 10 and PostgreSQL 10 (Matt West).

* Fix HTML rendering by reverting `cheerio.js` to `0.22.0` (Matt West).
Expand Down Expand Up @@ -123,10 +125,10 @@

* Add developer docs about question rendering (Matt West).

* Add `load-test` support for v2 questions (Matt West).

* Add submission info modal with external grading stats (Nathan Walters).

* Add `load-test` support for v2 questions (Matt West).

* Fix broken file upload element (Nathan Walters).

* Fix broken popover and improve assessment label styles (Nathan Walters).
Expand Down
5 changes: 4 additions & 1 deletion lib/question.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
-- BLOCK select_issues
SELECT
i.*,
format_date_full(i.date, coalesce(ci.display_timezone, c.display_timezone)) AS formatted_date
format_date_full(i.date, coalesce(ci.display_timezone, c.display_timezone)) AS formatted_date,
u.uid AS user_uid,
u.name AS user_name
FROM
issues AS i
LEFT JOIN course_instances AS ci ON (ci.id = i.course_instance_id)
JOIN pl_courses AS c ON (c.id = i.course_id)
LEFT JOIN users AS u ON (u.user_id = i.user_id)
WHERE
i.variant_id = $variant_id
AND i.course_caused
Expand Down
5 changes: 2 additions & 3 deletions pages/instructorIssues/instructorIssues.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,10 @@
<%= getFormattedMessage(row) %>
</p>
<% if (row.manually_reported) { %>
<small class="text-muted mr-2">#<%= row.issue_id %> reported <span title="<%= row.formatted_date %>"><%= row.relative_date %></span> by <%= row.user_uid || '-' %></small>
<small class="text-muted mr-2">#<%= row.issue_id %> reported <span title="<%= row.formatted_date %>"><%= row.relative_date %></span> by <%= row.user_name || '-' %> (<a href="mailto:<%= row.user_uid || '-' %>?subject=Reported%20PrairieLearn%20Issue&body=Hello%20<%= row.user_name %>,%0ARegarding%20the%20issue%20of:%0A%0A%22<%= row.student_message || '-' %>%22%0A%0AWe've..."><%= row.user_uid || '-' %></a>)</small>
<% } else { %>
<small class="text-muted mr-2">#<%= row.issue_id %> reported <span title="<%= row.formatted_date %>"><%= row.relative_date %></span> for <%= row.user_uid || '-' %></small>
<small class="text-muted mr-2">#<%= row.issue_id %> reported <span title="<%= row.formatted_date %>"><%= row.relative_date %></span> for <%= row.user_name || '-' %> (<a href="mailto:<%= row.user_uid || '-' %>?subject=Reported%20PrairieLearn%20Issue&body=Hello%20<%= row.user_name %>,%0ARegarding%20the%20issue%20of:%0A%0A%22<%= row.student_message || '-' %>%22%0A%0AWe've..."><%= row.user_uid || '-' %></a>)</small>
<% } %>
<% if (row.manually_reported) { %>
<span class="badge badge-info">Manually reported</span>
<% } else { %>
Expand Down
1 change: 1 addition & 0 deletions pages/instructorIssues/instructorIssues.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ SELECT
i.question_id,
q.directory AS question_qid,
u.uid AS user_uid,
u.name AS user_name,
i.student_message,
i.variant_id,
i.open,
Expand Down
1 change: 1 addition & 0 deletions pages/partials/question.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<table class="table table-sm table-hover two-column-description">
<tbody>
<% if (devMode || authz_data.has_instructor_view) { %>
<tr><th>Student:</th><td><%= issue.user_name || '-' %> (<a href="mailto:<%= issue.user_uid || '-' %>?subject=Reported%20PrairieLearn%20Issue&body=Hello%20<%= issue.user_name %>,%0A%0ARegarding%20the%20issue%20of:%0A%0A%22<%= issue.student_message || '-' %>%22%0A%0AWe've..."><%= issue.user_uid || '-' %></a>)</td></tr>
<tr><th>Student message:</th><td><%= issue.student_message %></td></tr>
<tr><th>Instructor message:</th><td><%= issue.instructor_message %></td></tr>
<% } else { %>
Expand Down

0 comments on commit de35d2e

Please sign in to comment.