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
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ def peer_async():
question_num = int(request.vars.question_num)

current_question, all_done = _get_numbered_question(assignment_id, question_num - 1)
total_questions = len(_get_assignment_questions(assignment_id))

assignment = db(db.assignments.id == assignment_id).select().first()

Expand Down Expand Up @@ -762,6 +763,8 @@ def peer_async():
assignment_id=assignment_id,
assignment_name=assignment.name,
nextQnum=question_num + 1,
total_questions=total_questions,
is_last_question=(question_num >= total_questions),
all_done=all_done,
has_vote1=has_vote1,
has_reflection=has_reflection,
Expand Down Expand Up @@ -938,23 +941,22 @@ def get_async_llm_reflection():
"do not sound like a teacher.\n"
"do not explain step by step.\n"
"never say something is right or wrong.\n"
"your answer can shift throughout the conversation\n"
"do not pretend to have picked an answer yourself.\n"
"never mention a choice letter as the correct answer.\n"
"never clearly describe the final result of the code.\n"
"never fully state what the program prints.\n"
"use common misconceptions relating to the specific problem.\n"
"be aware of common misconceptions but do not introduce them yourself.\n"
"refer to code loosely like 'that line' or 'the loop' or 'the head' or 'the print'.\n"
"often hedge with uncertainty.\n"
#"never agree with the other student's interpretation even if it sounds correct.\n" #porter found when PI is adversarial students disengage
"use content from the other multiple choice options in your reponses when needed\n"
"let your mental model shift slightly under pressure but keep reasoning partial and never fully resolve\n"
"if the other student clearly sounds confident or repeats the same answer twice stop debating and tell them to vote again or submit it.\n"
"ask the other student to explain why they picked their answer and how they reasoned through it.\n"
"ask follow up questions about their reasoning like 'what makes you think that' or 'how did you trace through it'.\n"
"do not push them toward a different answer or imply their answer is wrong.\n"
"do not make up what the code does or claim it produces output that it doesn't.\n"
"if you are unsure about something say so honestly instead of guessing.\n"
"if the other student clearly sounds confident or repeats the same answer twice tell them to vote again or submit it.\n"
"do not continue reasoning after telling them to vote again.\n"
"sometimes question whether you even read the code correctly before forming an opinion.\n"
"occasionally bring up a wrong answer option as if it might be right without committing to it.\n"
"pick an answer choice different than the one the student selected and ask the student to explain why it cannot be correct.\n"
"show reasoning process not conclusions, think out loud rather than arriving anywhere.\n"
"focus on reasoning not teaching.\n\n"
"focus on getting them to think through the problem not on changing their mind.\n\n"
)

if question:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Configuration for the PI steps and helper functions to handle step progression in the instructor's interface
console.log("PEER JS VERSION TEST 12345");
const STEP_CONFIG = {
vote1: {
next: ['makep', 'facechat', 'makeabgroups'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@
</div>

<h2>Peer Instruction Question (After Class)</h2>

{{ if all_done == "false": }}
<div id="stepBanner" style="
background: #337ab7;
color: #fff;
padding: 10px 16px;
border-radius: 4px;
margin-bottom: 12px;
font-size: 16px;
font-weight: bold;
">
Step 1 of 3: Answer the question
</div>
{{ pass }}

<div id="imessage">
<p>This page is meant for you to use <i>after</i> the inclass peer instruction is over.
<ol>
Expand All @@ -42,7 +57,7 @@ <h2>Peer Instruction Question (After Class)</h2>
<li>Answer the question <strong>again.</strong> Even if you are not changing your answer from the first time.</li>
</ol>
</p>
</div>
</div>

<div class="row">
{{ if all_done == "false": }}
Expand Down Expand Up @@ -105,6 +120,15 @@ <h3>Congratulations, you have completed this assignment!</h3>
</div>
</div>
{{pass}}
{{ if all_done == "false": }}
<div class="col-md-12" style="text-align: right; margin-top: 10px; margin-bottom: 20px;">
<form action="/peer/peer_async" style="display: inline;">
<input type="hidden" name="assignment_id" value="{{=assignment_id}}" />
<input type="hidden" name="question_num" value="{{=nextQnum}}" />
<button type="submit" onclick="return checkVoteCount()" class="btn btn-default">{{ if is_last_question: }}Done{{ else: }}Next Question{{ pass }}</button>
</form>
</div>
{{ pass }}
</div>
{{ if has_vote1 and has_reflection and llm_reply: }}
<hr>
Expand All @@ -113,16 +137,6 @@ <h3>Congratulations, you have completed this assignment!</h3>
<p>{{=llm_reply}}</p>
</div>
{{ pass }}

{{ if all_done == "false": }}
<div>
<form action="/peer/peer_async">
<input type="hidden" name="assignment_id" value="{{=assignment_id}}" />
<input type="hidden" name="question_num" value="{{=nextQnum}}" />
<button type="submit" onclick="return checkVoteCount()" style="float: right; margin-bottom: 20px;">Next Question</button>
</form>
</div>
{{ pass }}
<script>
window.DISABLE_ASYNC_EXPLAINER = true;
</script>
Expand Down Expand Up @@ -157,6 +171,28 @@ <h3>Congratulations, you have completed this assignment!</h3>
if (btn) btn.disabled = true;
}

function updateStepBanner(step) {
const banner = document.getElementById("stepBanner");
if (!banner) return;
if (step === 1) {
banner.textContent = "Step 1 of 3: Answer the question";
banner.style.background = "#337ab7";
} else if (step === 2) {
banner.textContent = "Step 2 of 3: Explain your answer and discuss";
banner.style.background = "#f0ad4e";
banner.style.color = "#333";
} else if (step === 3) {
banner.textContent = "Step 3 of 3: Vote again — you may keep or change your answer";
banner.style.background = "#427e44";
banner.style.color = "#fff";
} else if (step === 4) {
const hasNextQ = document.querySelector('form[action="/peer/peer_async"]');
banner.textContent = hasNextQ ? "Done! Move to the next question." : "Done! You have completed this assignment.";
banner.style.background = "#427e44";
banner.style.color = "#fff";
}
}

function setReflectionPanelEnabled(enabled) {
const panel = document.getElementById("reflectionPanel");
if (!panel) return;
Expand All @@ -174,6 +210,7 @@ <h3>Congratulations, you have completed this assignment!</h3>
alert("Please submit your first vote before voting again.");
return;
}
updateStepBanner(3);

window._vote2Enabled = true;
window._vote1Locked = false;
Expand Down Expand Up @@ -631,6 +668,7 @@ <h3>Congratulations, you have completed this assignment!</h3>
if (studentVoteCount === 1 && !window._vote2Enabled) {
hasVote1 = true;
console.log("vote 1 submitted");
updateStepBanner(2);

const vote2Btn = document.getElementById("readyVote2Btn");
if (vote2Btn) {
Expand All @@ -648,6 +686,7 @@ <h3>Congratulations, you have completed this assignment!</h3>
studentVoteCount = 2;
studentSubmittedVote2 = true;
window._vote2Enabled = false;
updateStepBanner(4);
}
if (studentSubmittedVote2) {
try {
Expand Down
Loading