From 8753c43e9fb7e890b62ff4d3f3ae6e702f36a478 Mon Sep 17 00:00:00 2001 From: Seth Bernstein Date: Thu, 4 Jun 2026 11:24:47 -0400 Subject: [PATCH] sync pi fixes from feedback --- .../assignment_server_api/routers/peer.py | 1 - .../assignment/instructor/peer_dashboard.html | 23 +++++++++++++++- .../assignment/student/peer_question.html | 26 ++++++++++++++++++- .../rsptx/templates/staticAssets/js/peer.js | 19 +++----------- 4 files changed, 50 insertions(+), 19 deletions(-) diff --git a/bases/rsptx/assignment_server_api/routers/peer.py b/bases/rsptx/assignment_server_api/routers/peer.py index 957f8fd72..b3bf08db7 100644 --- a/bases/rsptx/assignment_server_api/routers/peer.py +++ b/bases/rsptx/assignment_server_api/routers/peer.py @@ -1222,7 +1222,6 @@ async def clear_pairs( @router.get("/course_students") -@instructor_role_required() @with_course() async def get_course_students( request: Request, diff --git a/components/rsptx/templates/assignment/instructor/peer_dashboard.html b/components/rsptx/templates/assignment/instructor/peer_dashboard.html index d868c1c00..7194621ec 100644 --- a/components/rsptx/templates/assignment/instructor/peer_dashboard.html +++ b/components/rsptx/templates/assignment/instructor/peer_dashboard.html @@ -240,6 +240,17 @@ #vote1details[open] summary::before { transform: rotate(90deg); } #vote1details summary:hover { color: var(--pi-teal-dark); } #vote1details > div { padding: 4px 16px 12px; font-size: 13px; color: var(--af-ink-2); } + + .pi-lineno { + display: inline-block; + min-width: 2em; + color: #999; + text-align: right; + border-right: 1px solid #ddd; + padding-right: 0.5em; + margin-right: 0.8em; + user-select: none; + } {% endblock %} @@ -271,7 +282,6 @@

Question {{ current_qnum }} of {{ num_questions }}

-
Vote 1 in Progress
{% if not is_last %} @@ -577,5 +587,16 @@

Question {{ current_qnum }} of {{ num_questions }}

}); syncActivityFlow(); } + + setTimeout(function addLineNumbers() { + document.querySelectorAll(".oneq pre").forEach(function (pre) { + var lines = pre.innerHTML.split("\n"); + if (lines.length <= 1) return; + if (lines[lines.length - 1].trim() === "") lines.pop(); + pre.innerHTML = lines.map(function (line, i) { + return '' + (i + 1) + "" + line; + }).join("\n"); + }); + }, 1000); {% endblock %} diff --git a/components/rsptx/templates/assignment/student/peer_question.html b/components/rsptx/templates/assignment/student/peer_question.html index 0fc0585c4..bdbba9d2d 100644 --- a/components/rsptx/templates/assignment/student/peer_question.html +++ b/components/rsptx/templates/assignment/student/peer_question.html @@ -30,6 +30,17 @@ .hidden-content { display: none; } + + .pi-lineno { + display: inline-block; + min-width: 2em; + color: #999; + text-align: right; + border-right: 1px solid #ddd; + padding-right: 0.5em; + margin-right: 0.8em; + user-select: none; + } {% endblock %} @@ -104,9 +115,11 @@

Peer Instruction: {{ assignment_name }}

@@ -201,5 +214,16 @@

Peer Instruction: {{ assignment_name }}

await setupPeerGroup(); } doIt(); + + setTimeout(function addLineNumbers() { + document.querySelectorAll(".oneq pre").forEach(function (pre) { + var lines = pre.innerHTML.split("\n"); + if (lines.length <= 1) return; + if (lines[lines.length - 1].trim() === "") lines.pop(); + pre.innerHTML = lines.map(function (line, i) { + return '' + (i + 1) + "" + line; + }).join("\n"); + }); + }, 1000); {% endblock %} diff --git a/components/rsptx/templates/staticAssets/js/peer.js b/components/rsptx/templates/staticAssets/js/peer.js index 1a7e4e28d..52e675450 100644 --- a/components/rsptx/templates/staticAssets/js/peer.js +++ b/components/rsptx/templates/staticAssets/js/peer.js @@ -236,7 +236,7 @@ function connect(event) { } } else { if (getVoteNum() < 2) { - messarea.innerHTML = `

Please give an explanation for your answer.

Then, discuss your answer with your group members.

`; + messarea.innerHTML = `

Wait for your instructor to start the discussion.

`; } else { messarea.innerHTML = `

Voting for this question is complete.

`; let feedbackDiv = document.getElementById(`${currentQuestion}_feedback`); @@ -354,20 +354,7 @@ function connect(event) { } } - if (displayPeers.length > 0) { - messarea.innerHTML = `

Current Verbal Discussion Group

Please have a verbal discussion with your selected partners:

`; - } else { - // fallback to server-provided group list - messarea.innerHTML = `

Current Verbal Discussion Group

Please have a verbal discussion with the following group:

`; - } + messarea.innerHTML = `

Current Verbal Discussion Group

Please have a verbal discussion with your group, then select who you talked to below.

`; let facechat = document.getElementById("group_select_panel"); if (facechat) { @@ -805,7 +792,7 @@ async function setupPeerGroup() { } // Make the select element searchable with multiple selections $('.assignment_partner_select').select2({ - placeholder: "Select up to 4 team members", + placeholder: "Click to search or select by name", allowClear: true, maximumSelectionLength: 4, });