From bf0e6149da31c3bc3644e74dd73471f0a3b7afc5 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Fri, 22 Dec 2023 00:28:59 +0100 Subject: [PATCH] Remove obsolete context-type attribute for submissions The value and function is no longer used. --- app/assets/javascripts/editor/editor.js.erb | 4 ---- app/assets/javascripts/editor/submissions.js | 5 ----- app/views/exercises/_editor_frame.html.slim | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/app/assets/javascripts/editor/editor.js.erb b/app/assets/javascripts/editor/editor.js.erb index 8d1d4425..9f5a8610 100644 --- a/app/assets/javascripts/editor/editor.js.erb +++ b/app/assets/javascripts/editor/editor.js.erb @@ -537,10 +537,6 @@ var CodeOceanEditor = { return this.isActiveFileRunnable() && this.running; }, - isActiveFileSubmission: function () { - return ['Submission'].includes(this.active_frame.data('contextType')); - }, - isActiveFileTestable: function () { return this.isActiveFileExecutable() && ['teacher_defined_test', 'user_defined_test', 'teacher_defined_linter'].includes(this.active_frame.data('role')); }, diff --git a/app/assets/javascripts/editor/submissions.js b/app/assets/javascripts/editor/submissions.js index a8047364..ae822988 100644 --- a/app/assets/javascripts/editor/submissions.js +++ b/app/assets/javascripts/editor/submissions.js @@ -53,11 +53,6 @@ CodeOceanEditorSubmissions = { }, createSubmissionCallback: function(submission){ - // set all frames context types to submission - $('.frame').each(function(index, element) { - $(element).data('context-type', 'Submission'); - }); - // update the ids of the editors and reload the annotations for (const editor of this.editors) { diff --git a/app/views/exercises/_editor_frame.html.slim b/app/views/exercises/_editor_frame.html.slim index 2c6f9be6..b0b9791d 100644 --- a/app/views/exercises/_editor_frame.html.slim +++ b/app/views/exercises/_editor_frame.html.slim @@ -1,4 +1,4 @@ -div class=(defined?(own_solution) ? "own-frame" : "frame") data-executable=file.file_type.executable? data-filename=file.filepath data-renderable=file.file_type.renderable? data-role=file.role data-binary=file.file_type.binary? data-context-type=file.context_type data-read-only=file.read_only +div class=(defined?(own_solution) ? "own-frame" : "frame") data-executable=file.file_type.executable? data-filename=file.filepath data-renderable=file.file_type.renderable? data-role=file.role data-binary=file.file_type.binary? data-read-only=file.read_only - if file.file_type.binary? - file_path = protected_upload_path(id: file.id, filename: file.filepath) .binary-file data-file-id=file.ancestor_id