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
5 changes: 4 additions & 1 deletion bases/rsptx/admin_server_api/routers/instructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ async def get_course_settings(
"show_points": course_attrs.get("show_points") == "true",
"groupsize": course_attrs.get("groupsize", "3"),
"enable_async_llm_modes": course_attrs.get("enable_async_llm_modes", "false"),
"use_pretext_student_pages": str(
course_attrs.get("use_pretext_student_pages", "false")
).lower(),
}

return templates.TemplateResponse("admin/instructor/course_settings.html", context)
Expand Down Expand Up @@ -1151,7 +1154,7 @@ async def _copy_one_assignment(
assignment_questions = await fetch_assignment_questions(old_assignment_id)

for question_data in assignment_questions:
question, assignment_question = question_data
assignment_question = question_data.AssignmentQuestion

new_assignment_question_data = AssignmentQuestionValidator(
assignment_id=new_assignment.id,
Expand Down
9 changes: 5 additions & 4 deletions bases/rsptx/assignment_server_api/routers/instructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
from rsptx.auth.session import auth_manager, is_instructor
from rsptx.templates import template_folder
from rsptx.configuration import settings
from rsptx.response_helpers import construct_course_url
from rsptx.response_helpers.core import (
make_json_response,
get_webpack_static_imports,
Expand Down Expand Up @@ -116,8 +117,6 @@
from rsptx.data_types.language import LanguageOptions
from rsptx.data_types.question_type import QuestionType

from .student import get_course_url

# Routing
# =======
# See `APIRouter config` for an explanation of this approach.
Expand Down Expand Up @@ -184,9 +183,11 @@ async def review_peer_assignment(
# This replacement is to render images
bts = q.Question.htmlsrc
htmlsrc = bts.replace(
'src="../_static/', 'src="' + get_course_url(course, "_static/")
'src="../_static/', 'src="' + construct_course_url(course, "_static/")
)
htmlsrc = htmlsrc.replace(
"../_images", construct_course_url(course, "_images")
)
htmlsrc = htmlsrc.replace("../_images", get_course_url(course, "_images"))

# Rewrite xref links and knowls in fillintheblank questions
if "fillintheblank" in htmlsrc:
Expand Down
8 changes: 4 additions & 4 deletions bases/rsptx/assignment_server_api/routers/peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ async def get_peer_dashboard(
questions_result = await fetch_assignment_questions(assignment_id)
questions = []
for row in questions_result:
question, assignment_question = row
question = row.Question
questions.append(question)

# Get current question based on assignment's current_index
Expand Down Expand Up @@ -287,7 +287,7 @@ async def get_peer_extra(

assignment = await fetch_one_assignment(assignment_id)
questions_result = await fetch_assignment_questions(assignment_id)
questions = [q for q, _aq in questions_result]
questions = [q.Question for q in questions_result]

current_idx = (
assignment.current_index if assignment.current_index is not None else 0
Expand Down Expand Up @@ -400,7 +400,7 @@ async def get_peer_question(
questions_result = await fetch_assignment_questions(assignment_id)
questions = []
for row in questions_result:
question, assignment_question = row
question = row.Question
questions.append(question)

# Get the current question based on assignment's current_index
Expand Down Expand Up @@ -529,7 +529,7 @@ async def get_peer_async(
)

qa_pairs = list(await fetch_assignment_questions(assignment_id))
questions = [q for q, _aq in qa_pairs]
questions = [q.Question for q in qa_pairs]
total_questions = len(questions)

idx = question_num - 1
Expand Down
Loading
Loading