mirror of
https://github.com/moodle/moodle.git
synced 2025-03-24 17:40:26 +01:00
MDL-75898 assignfeedback_editpdf: Don't poll readonly pages
When requesting the readonly version of pages (which contain teacher annotations), they should always be available - the PHP side even throws an exception when they're not. This means we don't need to worry about polling document converters from the JS side and can just return the pages immediately.
This commit is contained in:
parent
825609ae08
commit
90350915c2
@ -3780,6 +3780,24 @@ EDITOR.prototype = {
|
||||
var data = this.handle_response_data(response),
|
||||
poll = false;
|
||||
if (data) {
|
||||
// When we are requesting the readonly version of the pages, they should
|
||||
// always be available (see document_services::get_page_images_for_attempt)
|
||||
// so we can just serve them immediately without triggering any document
|
||||
// conversion or polling.
|
||||
//
|
||||
// This is necessary to prevent situations where the student has updated
|
||||
// their submission and the teacher has annotated a previous version of
|
||||
// the submission in the assignment grader. In this situation if a student
|
||||
// views the online version of the annotated PDF ("View annotated PDF" link)
|
||||
// the readonly pages here and the updated pages (awaiting conversion) will
|
||||
// never match, and the code endlessly polls.
|
||||
//
|
||||
// See also: MDL-45580, MDL-66626, MDL-75898.
|
||||
if (this.get('readonly') === true) {
|
||||
this.prepare_pages_for_display(data);
|
||||
return;
|
||||
}
|
||||
|
||||
this.documentstatus = data.status;
|
||||
if (data.status === 0) {
|
||||
// The combined document is still waiting for input to be ready.
|
||||
|
File diff suppressed because one or more lines are too long
@ -3780,6 +3780,24 @@ EDITOR.prototype = {
|
||||
var data = this.handle_response_data(response),
|
||||
poll = false;
|
||||
if (data) {
|
||||
// When we are requesting the readonly version of the pages, they should
|
||||
// always be available (see document_services::get_page_images_for_attempt)
|
||||
// so we can just serve them immediately without triggering any document
|
||||
// conversion or polling.
|
||||
//
|
||||
// This is necessary to prevent situations where the student has updated
|
||||
// their submission and the teacher has annotated a previous version of
|
||||
// the submission in the assignment grader. In this situation if a student
|
||||
// views the online version of the annotated PDF ("View annotated PDF" link)
|
||||
// the readonly pages here and the updated pages (awaiting conversion) will
|
||||
// never match, and the code endlessly polls.
|
||||
//
|
||||
// See also: MDL-45580, MDL-66626, MDL-75898.
|
||||
if (this.get('readonly') === true) {
|
||||
this.prepare_pages_for_display(data);
|
||||
return;
|
||||
}
|
||||
|
||||
this.documentstatus = data.status;
|
||||
if (data.status === 0) {
|
||||
// The combined document is still waiting for input to be ready.
|
||||
|
@ -483,6 +483,24 @@ EDITOR.prototype = {
|
||||
var data = this.handle_response_data(response),
|
||||
poll = false;
|
||||
if (data) {
|
||||
// When we are requesting the readonly version of the pages, they should
|
||||
// always be available (see document_services::get_page_images_for_attempt)
|
||||
// so we can just serve them immediately without triggering any document
|
||||
// conversion or polling.
|
||||
//
|
||||
// This is necessary to prevent situations where the student has updated
|
||||
// their submission and the teacher has annotated a previous version of
|
||||
// the submission in the assignment grader. In this situation if a student
|
||||
// views the online version of the annotated PDF ("View annotated PDF" link)
|
||||
// the readonly pages here and the updated pages (awaiting conversion) will
|
||||
// never match, and the code endlessly polls.
|
||||
//
|
||||
// See also: MDL-45580, MDL-66626, MDL-75898.
|
||||
if (this.get('readonly') === true) {
|
||||
this.prepare_pages_for_display(data);
|
||||
return;
|
||||
}
|
||||
|
||||
this.documentstatus = data.status;
|
||||
if (data.status === 0) {
|
||||
// The combined document is still waiting for input to be ready.
|
||||
|
Loading…
x
Reference in New Issue
Block a user