From ae04a5adc5e2311f253d0b2177fab4e7a60d75cc Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Mon, 3 Jul 2017 14:57:08 +0200 Subject: [PATCH] this should fix the "zombie file" bug. Turned out that the CodeOceanEditor object is not destroyed when navigating back and forth within the exercise context ( from an exercise back to the exercise index and forward to another exercise). Therefore, CodeOceanEditor.editors[] kept all "old" editors and added the new ones behind the old ones. On next autosave, they were persisted into a submission. --- app/assets/javascripts/editor/editor.js.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/javascripts/editor/editor.js.erb b/app/assets/javascripts/editor/editor.js.erb index 2ac499c4..e3e34462 100644 --- a/app/assets/javascripts/editor/editor.js.erb +++ b/app/assets/javascripts/editor/editor.js.erb @@ -182,6 +182,7 @@ configureEditors: function () { }, initializeEditors: function () { + this.editors = []; $('.editor').each(function (index, element) { // Resize frame on load