Skip to content

Commit eb8fb7d

Browse files
committed
Add course_attrs to eBookConfig
1 parent e3f07cb commit eb8fb7d

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

bases/rsptx/assignment_server_api/routers/student.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,7 @@ async def doAssignment(
680680
latex_preamble_dict=preambles,
681681
wp_imports=get_webpack_static_imports(course),
682682
settings=settings,
683+
course_attrs=course_attrs,
683684
)
684685
response = templates.TemplateResponse(
685686
"assignment/student/doAssignment.html", context

bases/rsptx/book_server_api/routers/course.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
fetch_assignments,
2727
fetch_all_assignment_stats,
2828
fetch_course,
29+
fetch_all_course_attributes,
2930
fetch_courses_for_user,
3031
fetch_course_instructors,
3132
fetch_deadline_exception,
@@ -68,6 +69,7 @@ async def index(
6869
course = await fetch_course(course_name)
6970
instructors = await fetch_course_instructors(course_name)
7071
rslogger.debug(f"{instructors=}")
72+
attrs = await fetch_all_course_attributes(course.id)
7173
templates = Jinja2Templates(directory=template_folder)
7274
books = await fetch_library_book(course.base_course)
7375
if books is None:
@@ -167,6 +169,7 @@ def sort_key(assignment):
167169
"lti1p1": is_lti1p1_course,
168170
"now": now,
169171
"visibility_map": visibility_map,
172+
"course_attrs": attrs,
170173
},
171174
)
172175

components/rsptx/templates/common/ebook_config.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
{% endif %}
2323
eBookConfig.useRunestoneServices = true;
2424
eBookConfig.basecourse = "{{course.base_course}}";
25+
eBookConfig.course_attrs = {{ course_attrs | default({}) | tojson | safe }};
2526
eBookConfig.gradeRecordingUrl = `${eBookConfig.app}/assignments/record_grade`;
2627
eBookConfig.new_server_prefix = "/ns";
2728
eBookConfig.websocketUrl = "{{settings.websocket_url}}"

0 commit comments

Comments
 (0)