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()
@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,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;
}
</style>
{% endblock %}

Expand Down Expand Up @@ -271,7 +282,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 @@ -577,5 +587,16 @@ <h3>Question {{ current_qnum }} of {{ num_questions }}</h3>
});
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 '<span class="pi-lineno">' + (i + 1) + "</span>" + line;
}).join("\n");
});
}, 1000);
</script>
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
</style>
{% endblock %}

Expand Down Expand Up @@ -104,9 +115,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=""></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 +214,16 @@ <h2>Peer Instruction: {{ assignment_name }}</h2>
await setupPeerGroup();
}
doIt();

setTimeout(function addLineNumbers() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this trying to add line numbers to code in a multiple choice question? If the question is written properly it will already have line numbers.

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 '<span class="pi-lineno">' + (i + 1) + "</span>" + line;
}).join("\n");
});
}, 1000);
</script>
{% endblock %}
19 changes: 3 additions & 16 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 @@ -354,20 +354,7 @@ function connect(event) {
}
}

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 @@ -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,
});
Expand Down
Loading