From 3cd224c57ee0e48a9fb22682353811d266c0b5ab Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Fri, 9 Sep 2016 14:19:47 +0200 Subject: [PATCH] re-applied changes for redirect to request for comments --- app/assets/javascripts/editor/submissions.js.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/editor/submissions.js.erb b/app/assets/javascripts/editor/submissions.js.erb index 08e62dba..e860c7a6 100644 --- a/app/assets/javascripts/editor/submissions.js.erb +++ b/app/assets/javascripts/editor/submissions.js.erb @@ -54,8 +54,8 @@ CodeOceanEditorSubmissions = { // This is the case, since it is set via a call to ancestor_id on the model, which returns either file_id if set, or id if it is not set. // therefore the else part is not needed any longer... - // if we have an file_id set (the file is a copy of a teacher supplied given file) - if (file_id_old != null){ + // if we have an file_id set (the file is a copy of a teacher supplied given file) and the new file-ids are present in the response + if (file_id_old != null && data.files){ // if we find file_id_old (this is the reference to the base file) in the submission, this is the match for(var j = 0; j< data.files.length; j++){ if(data.files[j].file_id == file_id_old){