Skip to content
Merged
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
4 changes: 4 additions & 0 deletions bases/rsptx/assignment_server_api/routers/peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ async def get_peer_dashboard(
rslogger.info(f"New index: {new_idx}")
assignment.current_index = new_idx
await update_assignment(assignment, pi_update=True)
elif next == "Previous":
rslogger.info("Going back to previous question")
assignment.current_index = max((assignment.current_index or 0) - 1, 0)
await update_assignment(assignment, pi_update=True)

# Get all questions for this assignment
questions_result = await fetch_assignment_questions(assignment_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#pi-assignment-navigation .btn { font-size: 13.5px; }
#nextq.btn-info { background-color: #1a6a83 !important; border-color: #155a70 !important; }
#nextq.btn-info:hover { background-color: #124f63 !important; border-color: #124f63 !important; }
#prevq.btn-info { background-color: #1a6a83 !important; border-color: #155a70 !important; }
#prevq.btn-info:hover { background-color: #124f63 !important; border-color: #124f63 !important; }


:root {
Expand Down Expand Up @@ -280,6 +282,9 @@ <h3>Question {{ current_qnum }} of {{ num_questions }}</h3>
</div>
</div>
<div id="pi-assignment-navigation">
{% if current_qnum > 1 %}
<button type="submit" id="prevq" class="btn btn-info" name="next" value="Previous">Previous Question</button>
{% endif %}
{% if not is_last %}
<button type="submit" id="nextq" class="btn btn-info" name="next" value="Next">Next Question</button>
{% else %}
Expand Down
Loading