Skip to content

Synchrnous PI fixes from feedback#1228

Merged
bnmnetp merged 6 commits into
RunestoneInteractive:mainfrom
sethbern:sync-pi-feedback-v2
Jun 10, 2026
Merged

Synchrnous PI fixes from feedback#1228
bnmnetp merged 6 commits into
RunestoneInteractive:mainfrom
sethbern:sync-pi-feedback-v2

Conversation

@sethbern

@sethbern sethbern commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Fixed several sync PI issues from testing feedback:

  • Show real student names in the verbal group select dropdown instead of anonymous names
  • Fixed premature "discuss" message after vote 1 stops
  • Added line numbers to code blocks displayed in PI questions (does not touch the actual questions, just adds them visually during a PI session based on instructor feedback that it makes discussion easier)
  • Improved group select placeholder text

Also, some PI pages still seem to route to web2py instead of FastAPI. I think it's because nginx serves /staticAssets/ from the web2py static directory, but if it's something else on my end let me know and I can fix it.

@sethbern sethbern requested a review from bnmnetp as a code owner June 4, 2026 15:52
@bnmnetp

bnmnetp commented Jun 5, 2026

Copy link
Copy Markdown
Member

When we build the nginx container we copy only the components/rsptx/templates/staticAssets folder into the nginx container. It does not have access to the web2py files.

@bnmnetp bnmnetp left a comment

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.

It does not look like this fixes any routing problems. Can you make a list of where you think the routing has gone wrong?

}
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah this is adding in line numbers that are not rendering during PI even when the question is created with them. I believe the questions are being created properly using the assignment builder interface and it still does not show them.

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.

Can you point me to a specific question? It may be that we are just missing including the prism js/css files that do the coloring and line numbers.

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.

Yes, the templates for peer_question.html and doAssignment.html are missing the needed prism files for decorating code questions. Adding those is the right fix.

@sethbern

sethbern commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

For the routing issue, when navigating to PI from the book page, it routes to runestone/peer/student.html or runestone/peer/instructor.html instead of the correct FastAPI routes assignment/peer/student or assignment/peer/instructor. Navigating from the course home or instructor dashboard goes to FastAPI correctly. It seems like the book page links are the only thing still pointing to the old web2py routes.

@bnmnetp

bnmnetp commented Jun 8, 2026

Copy link
Copy Markdown
Member

Yes we need to make some updates to the master templates of the books both on the legacy_support branch for old RST based books. And in PreTeXt. I'm already working on a PR to do that for PreTeXt that will encompass the PI pages as well as new login/logout/register pages.

@sethbern

sethbern commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Ok I went ahead and fixed the line numbers by adding the missing Prism CSS to static_assets.html and removing the custom JS workaround I had. It works for questions created with the new assignment builder but older questions don't show line numbers since their HTML source is missing the line-numbers class on the pre tag. Is it worth backfilling that class on existing questions or is the expectation that instructors should just update them?

@bnmnetp

bnmnetp commented Jun 8, 2026

Copy link
Copy Markdown
Member

When you say old questions, are they questions written in PreTeXt or are they old RST based questions?

Old RST questions required that the author used .. code-block:: language and then there was a parameter like :linenos: to make it number the lines.

@sethbern

sethbern commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Old RST-based questions. They use div class="highlight-python notranslate" instead of pre class="line-numbers" so Prism doesn't pick them up.

@bnmnetp

bnmnetp commented Jun 8, 2026

Copy link
Copy Markdown
Member

No RST used its own method for adding line numbers and coloring code.

@bnmnetp

bnmnetp commented Jun 8, 2026

Copy link
Copy Markdown
Member

Se my little edit to the previous comment.

@sethbern

sethbern commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

I see then so for those RST questions without line numbers it was just an authoring choice. In that case is it best to leave those as is?

@bnmnetp

bnmnetp commented Jun 8, 2026

Copy link
Copy Markdown
Member

Yeah, if the authors of those questions want line numbers they can edit the book (or question) and add them. I don't think we should impose a style over the top of something an author already has control of.

@bnmnetp

bnmnetp commented Jun 8, 2026

Copy link
Copy Markdown
Member

Now, time is short for RST questions. The editor for those old questions will not be gone by the start of classes in the fall.

@sethbern

sethbern commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Got it, makes sense to leave it to the authors then. I also cleaned up some leftover line number CSS and JS from the dashboard template. Anything else I should do before merge?

Comment thread bases/rsptx/assignment_server_api/routers/peer.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Peer Instruction (PI) synchronous workflow and UI to address issues found during testing/instructor feedback, including clearer student guidance, improved group-selection UX, and better vote-count visibility.

Changes:

  • Adjust PI messaging to avoid prompting discussion prematurely and simplify the “verbal discussion group” instructions.
  • Enhance in-person group selection UX (clearer instructions + Select2 placeholder tweaks).
  • Add Prism line-number styling assets to support line-numbered code blocks during PI.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
components/rsptx/templates/staticAssets/js/peer.js Updates PI control-message text, simplifies face-chat messaging, and copies Vote 1 count into a new UI element when starting Vote 2; tweaks Select2 placeholder.
components/rsptx/templates/common/static_assets.html Adds Prism theme + line-numbers plugin CSS to visually enable code line numbers.
components/rsptx/templates/assignment/student/peer_question.html Improves group-selection instructions and adds an empty option to support placeholder behavior.
components/rsptx/templates/assignment/instructor/peer_dashboard.html Adds UI elements to display Vote 1 count during Vote 2; removes an older session-status element.
bases/rsptx/assignment_server_api/routers/peer.py Removes instructor-only restriction from /course_students endpoint (now returns {username: full_name} for the course).
Comments suppressed due to low confidence (1)

bases/rsptx/assignment_server_api/routers/peer.py:1230

  • Removing @instructor_role_required() makes this endpoint available to any logged-in user in the course and returns a full roster mapping of username -> full name. Elsewhere (/ns/auth/course_students) roster access is restricted for base courses and instructors are filtered out; aligning this endpoint with that behavior would reduce unintended data exposure.
@router.get("/course_students")
@with_course()
async def get_course_students(
    request: Request,
    user=Depends(auth_manager),
    course=None,
):

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread components/rsptx/templates/assignment/student/peer_question.html
Comment thread components/rsptx/templates/staticAssets/js/peer.js Outdated
sethbern and others added 2 commits June 9, 2026 20:21
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@bnmnetp bnmnetp merged commit 71860eb into RunestoneInteractive:main Jun 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants