From 8753c43e9fb7e890b62ff4d3f3ae6e702f36a478 Mon Sep 17 00:00:00 2001 From: Seth Bernstein Date: Thu, 4 Jun 2026 11:24:47 -0400 Subject: [PATCH 1/6] 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, }); From b91e918b54fbe2cdc5daf1ab7fd2cc8752eb2d16 Mon Sep 17 00:00:00 2001 From: Seth Bernstein Date: Mon, 8 Jun 2026 13:08:28 -0400 Subject: [PATCH 2/6] add prism css for line numbers --- .../assignment/student/peer_question.html | 22 ++----------------- .../rsptx/templates/common/static_assets.html | 2 ++ 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/components/rsptx/templates/assignment/student/peer_question.html b/components/rsptx/templates/assignment/student/peer_question.html index bdbba9d2d..81375e4ee 100644 --- a/components/rsptx/templates/assignment/student/peer_question.html +++ b/components/rsptx/templates/assignment/student/peer_question.html @@ -31,16 +31,7 @@ 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 %} @@ -215,15 +206,6 @@

Peer Instruction: {{ assignment_name }}

} 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/common/static_assets.html b/components/rsptx/templates/common/static_assets.html index 72b0cf488..d23286885 100644 --- a/components/rsptx/templates/common/static_assets.html +++ b/components/rsptx/templates/common/static_assets.html @@ -29,6 +29,8 @@ + + {% endblock %} From 6943c8cd1bd4180049f8887fee542345934dcddf Mon Sep 17 00:00:00 2001 From: Seth Bernstein Date: Tue, 9 Jun 2026 09:36:15 -0400 Subject: [PATCH 4/6] retain the count on the first vote during the second vote --- .../templates/assignment/instructor/peer_dashboard.html | 7 ++++++- components/rsptx/templates/staticAssets/js/peer.js | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/components/rsptx/templates/assignment/instructor/peer_dashboard.html b/components/rsptx/templates/assignment/instructor/peer_dashboard.html index ead6e3caf..5c433d120 100644 --- a/components/rsptx/templates/assignment/instructor/peer_dashboard.html +++ b/components/rsptx/templates/assignment/instructor/peer_dashboard.html @@ -387,7 +387,10 @@

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

-
answers received
+
answers received
+ @@ -475,6 +478,8 @@

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

} } else { counterel.innerHTML = `

Vote ${v} Answers: ${spec.count}

`; + const vote1Label = document.getElementById('vote1CountLabel'); + if (vote1Label) vote1Label.style.display = ''; } if (spec.mess_count > 0) { diff --git a/components/rsptx/templates/staticAssets/js/peer.js b/components/rsptx/templates/staticAssets/js/peer.js index 52e675450..0d2c8df3c 100644 --- a/components/rsptx/templates/staticAssets/js/peer.js +++ b/components/rsptx/templates/staticAssets/js/peer.js @@ -592,6 +592,12 @@ async function enableFaceChat(event) { function startVote2(event) { handleButtonClick(event); + const vote1CountEl = document.getElementById('vote1CountDisplay'); + const currentCount = document.getElementById('answerCountDisplay'); + if (vote1CountEl && currentCount) { + vote1CountEl.textContent = currentCount.textContent; + } + let butt = document.querySelector("#vote2"); butt.classList.replace("btn-info", "btn-secondary"); event.srcElement.disabled = true; From fcd5a392e3db2b4f9586cf553e9b7adc2d2740b1 Mon Sep 17 00:00:00 2001 From: Seth Bernstein <70603981+sethbern@users.noreply.github.com> Date: Tue, 9 Jun 2026 20:21:36 -0400 Subject: [PATCH 5/6] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../rsptx/templates/assignment/student/peer_question.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/rsptx/templates/assignment/student/peer_question.html b/components/rsptx/templates/assignment/student/peer_question.html index 81375e4ee..63f3bb135 100644 --- a/components/rsptx/templates/assignment/student/peer_question.html +++ b/components/rsptx/templates/assignment/student/peer_question.html @@ -108,7 +108,7 @@

Peer Instruction: {{ assignment_name }}

From bbe62613dc70b7dd9685741e3956c1d8ef0c28fe Mon Sep 17 00:00:00 2001 From: Seth Bernstein Date: Wed, 10 Jun 2026 08:28:01 -0400 Subject: [PATCH 6/6] remove unused displayPeers and groupList code --- .../rsptx/templates/staticAssets/js/peer.js | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/components/rsptx/templates/staticAssets/js/peer.js b/components/rsptx/templates/staticAssets/js/peer.js index 0d2c8df3c..27e840892 100644 --- a/components/rsptx/templates/staticAssets/js/peer.js +++ b/components/rsptx/templates/staticAssets/js/peer.js @@ -333,27 +333,7 @@ function connect(event) { case "enableFaceChat": console.log("got enableFaceChat message"); console.log(`group = ${mess.group}`); - let groupList = []; - if (mess.group) { - groupList = mess.group; - } messarea = document.getElementById("imessage"); - // Prefer previously-selected partners saved in localStorage.peerList - let peerListCsv = localStorage.getItem("peerList"); - let displayPeers = []; - if (peerListCsv) { - let sids = peerListCsv.split(",").map(s => s.trim()).filter(Boolean); - let sel = document.getElementById("assignment_group"); - for (let sid of sids) { - let name = sid; - if (sel) { - let opt = sel.querySelector(`option[value="${sid}"]`); - if (opt) name = opt.textContent || opt.innerText || sid; - } - displayPeers.push(name); - } - } - 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");