File tree Expand file tree Collapse file tree
bases/rsptx/admin_server_api/routers
components/rsptx/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1146,8 +1146,13 @@ async def get_assignmentoverview(
11461146 request : Request ,
11471147 user = Depends (auth_manager ),
11481148 course = None ,
1149+ assignment_id : Optional [int ] = None ,
11491150):
1150- """Serve the assignment overview report shell page."""
1151+ """Serve the assignment overview report shell page.
1152+
1153+ If ``assignment_id`` is supplied as a query parameter the template will
1154+ pre-select that assignment and auto-generate the report on page load.
1155+ """
11511156 engine = create_engine (settings .dburl )
11521157 assignments_df = pd .read_sql_query (
11531158 """
@@ -1177,6 +1182,7 @@ async def get_assignmentoverview(
11771182 "user" : user ,
11781183 "course" : course ,
11791184 "assignments" : assignments ,
1185+ "auto_assignment_id" : assignment_id ,
11801186 "is_instructor" : True ,
11811187 "student_page" : False ,
11821188 "settings" : settings ,
Original file line number Diff line number Diff line change @@ -71,5 +71,8 @@ <h1>Assignment Summary Report</h1>
7171{% endblock %}
7272
7373{% block js %}
74+ {% if auto_assignment_id %}
75+ < script > window . AUTO_ASSIGNMENT_ID = { { auto_assignment_id } } ; </ script >
76+ {% endif %}
7477< script src ="/staticAssets/js/assignmentoverview.js "> </ script >
7578{% endblock %}
Original file line number Diff line number Diff line change 219219 . replace ( / " / g, """ ) ;
220220 }
221221} ) ( ) ;
222+
223+
224+ // -------------------------------------------------------------------------
225+ // Auto-generate if assignment_id was passed as a query parameter.
226+ // Scripts in {% block js %} run after the DOM is ready, so no need to
227+ // wait for DOMContentLoaded — just run directly.
228+ // -------------------------------------------------------------------------
229+ if ( window . AUTO_ASSIGNMENT_ID ) {
230+ const sel = document . getElementById ( "assignment-select" ) ;
231+ sel . value = String ( window . AUTO_ASSIGNMENT_ID ) ;
232+ if ( sel . value ) {
233+ window . generateReport ( ) ;
234+ }
235+ }
You can’t perform that action at this time.
0 commit comments