Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion bases/rsptx/assignment_server_api/routers/peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,6 @@ async def clear_pairs(


@router.get("/course_students")
@instructor_role_required()
Comment thread
bnmnetp marked this conversation as resolved.
@with_course()
async def get_course_students(
request: Request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
#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); }

</style>
{% endblock %}

Expand Down Expand Up @@ -271,7 +272,6 @@ <h3>Question {{ current_qnum }} of {{ num_questions }}</h3>
</select>
</div>
</div>
<div id="pi-session-status">Vote 1 in Progress</div>
<div id="pi-assignment-navigation">
{% if not is_last %}
<button type="submit" id="nextq" class="btn btn-info" name="next" value="Next">Next Question</button>
Expand Down Expand Up @@ -387,7 +387,10 @@ <h3>Question {{ current_qnum }} of {{ num_questions }}</h3>
<div class="vote-count-strip">
<span class="vote-count-big" id="answerCountDisplay">—</span>
<div>
<div class="vote-count-main">answers received</div>
<div class="vote-count-main" id="answerCountLabel">answers received</div>
<div class="vote-count-sub" id="vote1CountLabel" style="display:none">
Vote 1 count: <span id="vote1CountDisplay">—</span>
</div>
<div class="vote-count-sub" id="messDisplay" style="display:none">
<span id="messNum">0</span> messages sent
</div>
Expand Down Expand Up @@ -475,6 +478,8 @@ <h3>Question {{ current_qnum }} of {{ num_questions }}</h3>
}
} else {
counterel.innerHTML = `<p>Vote ${v} Answers: ${spec.count}</p>`;
const vote1Label = document.getElementById('vote1CountLabel');
if (vote1Label) vote1Label.style.display = '';
}

if (spec.mess_count > 0) {
Expand Down Expand Up @@ -577,5 +582,6 @@ <h3>Question {{ current_qnum }} of {{ num_questions }}</h3>
});
syncActivityFlow();
}

</script>
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
.hidden-content {
display: none;
}


</style>
{% endblock %}

Expand Down Expand Up @@ -104,9 +106,11 @@ <h2>Peer Instruction: {{ assignment_name }}</h2>
</div>

<div id="group_select_panel" class="col-md-6" style="display: none;">
<p><strong>In person discussion:</strong> select the people in your discussion group.</p>
<p><strong>Who did you talk to?</strong> Click to open the dropdown, type a name to search or scroll to select.</p>
<select id="assignment_group" multiple class="assignment_partner_select" style="width: 95%">
<option value="" disabled hidden></option>
</select>
<p style="font-size:12px; color:#6b7280; margin-top:4px;">You can select multiple people.</p>
</div>
</div>
</div>
Expand Down Expand Up @@ -201,5 +205,7 @@ <h2>Peer Instruction: {{ assignment_name }}</h2>
await setupPeerGroup();
}
doIt();


</script>
{% endblock %}
2 changes: 2 additions & 0 deletions components/rsptx/templates/common/static_assets.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2-bootstrap-theme/0.1.0-beta.10/select2-bootstrap.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.full.js"></script>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.26.0/themes/prism.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.26.0/plugins/line-numbers/prism-line-numbers.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.26.0/components/prism-core.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.26.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.26.0/plugins/line-numbers/prism-line-numbers.min.js"
Expand Down
45 changes: 9 additions & 36 deletions components/rsptx/templates/staticAssets/js/peer.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function connect(event) {
}
} else {
if (getVoteNum() < 2) {
messarea.innerHTML = `<h3>Please give an explanation for your answer.</h3><p>Then, discuss your answer with your group members.</p>`;
messarea.innerHTML = `<h3>Wait for your instructor to start the discussion.</h3>`;
} else {
messarea.innerHTML = `<h3>Voting for this question is complete.</h3>`;
let feedbackDiv = document.getElementById(`${currentQuestion}_feedback`);
Expand Down Expand Up @@ -333,41 +333,8 @@ 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);
}
}

if (displayPeers.length > 0) {
messarea.innerHTML = `<h3>Current Verbal Discussion Group</h3><p>Please have a verbal discussion with your selected partners:</p><ul>`;
for (const p of displayPeers) {
messarea.innerHTML += `<li>${p}</li>`;
}
messarea.innerHTML += `</ul>`;
} else {
// fallback to server-provided group list
messarea.innerHTML = `<h3>Current Verbal Discussion Group</h3><p>Please have a verbal discussion with the following group:</p><ul>`;
for (const peer of groupList) {
messarea.innerHTML += `<li>${peer}</li>`;
}
messarea.innerHTML += `</ul>`;
}
messarea.innerHTML = `<h3>Current Verbal Discussion Group</h3><p>Please have a verbal discussion with your group, then select who you talked to below.</p>`;

let facechat = document.getElementById("group_select_panel");
if (facechat) {
Expand Down Expand Up @@ -605,6 +572,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;
Expand Down Expand Up @@ -805,7 +778,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,
});
Expand Down
Loading