apluslms / a-plus

A+ frontend portal - A+ LMS documentation:
https://apluslms.github.io/
Other
67 stars 72 forks source link

The inspect submission view freezes in the browser if the feedback is excessively large #1210

Closed markkuriekkinen closed 1 year ago

markkuriekkinen commented 1 year ago

If a submission has excessively large feedback, e.g., a few megabytes of text, then loading the teacher's inspect submission page seems to freeze the web browser and fail to open the web page normally. However, when the full-view feedback page is opened, then rendering the page is not particularly slow and it works well. What makes these pages so different?

Both pages seem to render the feedback in the Django templates.

However, the inspect page renders the feedback twice since it also inserts it into the form for editing the feedback. https://github.com/apluslms/a-plus/blob/74ed233d372df3cbf664f4fb6e5aaa1b72b3f489/exercise/templates/exercise/staff/_assessment_panel.html#L67

The inspect page also loads the student's submitted files via AJAX in JavaScript code. If the submitted file is small in size, then that can't cause the page to freeze, right? https://github.com/apluslms/a-plus/blob/74ed233d372df3cbf664f4fb6e5aaa1b72b3f489/exercise/static/exercise/assessment.js#L31


This submission in a real course is an example of the problem. Opening the feedback page (the first link) works fine, but opening the inspect page does not (the second link).