diff --git a/bases/rsptx/assignment_server_api/routers/peer.py b/bases/rsptx/assignment_server_api/routers/peer.py
index 957f8fd72..3dcfb30e8 100644
--- a/bases/rsptx/assignment_server_api/routers/peer.py
+++ b/bases/rsptx/assignment_server_api/routers/peer.py
@@ -38,6 +38,7 @@
fetch_course_students,
fetch_api_token,
fetch_question,
+ create_user_experiment_entry,
)
from rsptx.db.models import UseinfoValidation, Useinfo
from rsptx.db.async_session import async_session
@@ -750,6 +751,12 @@ def process_peep(
rslogger.debug(f"FINAL PEEPS IN CHAT = {peeps}")
rslogger.debug(f"FINAL PEEPS IN PERSON = {peeps_in_person}")
+ experiment_id = f"{div_id}_ab"
+ for sid in peeps_in_person:
+ await create_user_experiment_entry(sid=sid, ab=experiment_id, group=0)
+ for sid in peeps_in_chat:
+ await create_user_experiment_entry(sid=sid, ab=experiment_id, group=1)
+
# Chat pairing for the remaining students in `peeps`
done = len(peeps) == 0
while not done:
@@ -1222,7 +1229,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..4ad426016 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 %}
Next Question
@@ -333,11 +343,12 @@
Question {{ current_qnum }} of {{ num_questions }}
Enable In-Person Chat
or
Enable Text Chat
- {% if enable_ab %}
- or
+
+ {% if enable_ab %}
+
Run A/B Experiment
- {% endif %}
+ {% endif %}
@@ -577,5 +588,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 }}
-
In person discussion: select the people in your discussion group.
+
Who did you talk to? Click to open the dropdown, type a name to search or scroll to select.
+
+
You can select multiple people.
@@ -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..4308401a9 100644
--- a/components/rsptx/templates/staticAssets/js/peer.js
+++ b/components/rsptx/templates/staticAssets/js/peer.js
@@ -1,15 +1,15 @@
// Configuration for the PI steps and helper functions to handle step progression in the instructor's interface
const STEP_CONFIG = {
vote1: {
- next: ['makep', 'facechat', 'makeabgroups'],
+ next: ['makep', 'facechat'],
status: 'Vote 1 Stopped'
},
makep: {
- next: ['vote2'],
+ next: ['vote2', 'makeabgroups'],
status: 'Text Chat in Progress…'
},
facechat: {
- next: ['vote2'],
+ next: ['vote2', 'makeabgroups'],
status: 'In-person Chat in Progress…'
},
makeabgroups: {
@@ -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:
`;
- for (const p of displayPeers) {
- messarea.innerHTML += `${p} `;
- }
- messarea.innerHTML += ` `;
- } else {
- // fallback to server-provided group list
- messarea.innerHTML = `Current Verbal Discussion Group Please have a verbal discussion with the following group:
`;
- for (const peer of groupList) {
- messarea.innerHTML += `${peer} `;
- }
- messarea.innerHTML += ` `;
- }
+ 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,
});