Fix Flowr support and generic event framework

This commit is contained in:
Sebastian Serth
2020-10-07 17:28:29 +02:00
parent a5416758eb
commit 398bd67e1c
5 changed files with 15 additions and 5 deletions

View File

@ -31,6 +31,10 @@ var CodeOceanEditor = {
<% self.class.include Rails.application.routes.url_helpers %>
<% @config ||= CodeOcean::Config.new(:code_ocean).read(erb: false) %>
// Important notice: Changing the config values requires any content-wise
// modification for this file in the development environment. Lacking to do so
// will result in the old, server-side cached serving of this file even across
// server restarts!
sendEvents: <%= @config['codeocean_events'] ? @config['codeocean_events']['enabled'] : false %>,
eventURL: "<%= @config['codeocean_events'] ? events_path : '' %>",
fileTypeURL: "<%= file_types_path %>",

View File

@ -21,7 +21,7 @@ CodeOceanEditorFlowr = {
getInsights: function () {
<% self.class.include Rails.application.routes.url_helpers %>
var flowrUrl = '<%= insights_path %>';
var stackOverflowUrl = 'http://api.stackexchange.com/2.2/search/advanced';
var stackOverflowUrl = 'https://api.stackexchange.com/2.2/search/advanced';
return jQuery.ajax({
dataType: "json",
@ -78,7 +78,7 @@ CodeOceanEditorFlowr = {
category: eventType,
data: data,
exercise_id: $('#editor').data('exercise-id'),
file_id: null
file_id: CodeOceanEditor.active_file.id,
});
};
},