From 34c9d791f43c83a4b75a7d9ecba28139b0560c29 Mon Sep 17 00:00:00 2001 From: John Geiger Date: Sun, 29 May 2016 17:30:49 +0200 Subject: [PATCH 1/8] Finishing up graphs. Formatting and adding "Runs" lines. --- Gemfile | 2 +- app/assets/javascripts/exercise_graphs.js | 65 ++--- app/assets/javascripts/working_time_graphs.js | 5 +- db/schema.rb | 225 ------------------ 4 files changed, 43 insertions(+), 254 deletions(-) delete mode 100644 db/schema.rb diff --git a/Gemfile b/Gemfile index 540b11b2..bf089d6c 100644 --- a/Gemfile +++ b/Gemfile @@ -37,7 +37,7 @@ gem 'tubesock' gem 'faye-websocket' gem 'nokogiri' gem 'd3-rails' -gem 'rest-client’ +gem 'rest-client' group :development do gem 'better_errors', platform: :ruby diff --git a/app/assets/javascripts/exercise_graphs.js b/app/assets/javascripts/exercise_graphs.js index 2d3588c6..f0a9f0fc 100644 --- a/app/assets/javascripts/exercise_graphs.js +++ b/app/assets/javascripts/exercise_graphs.js @@ -9,6 +9,7 @@ $(function() { submissionsScoreAndTimeAssess = [[0,0]]; submissionsScoreAndTimeSubmits = [[0,0]]; + submissionsScoreAndTimeRuns = []; var maximumValue = 0; var wtimes = $('#wtimes').data('working_times'); //.hidden#wtimes data-working_times=ActiveSupport::JSON.encode(working_times_until) @@ -18,43 +19,38 @@ $(function() { for (var i = 0;i 0) { + submissionArray[1] = workingTime; + } + if(submission.score>maximumValue){ + maximumValue = submission.score; + } if(submission.cause == "assess"){ - var workingTime = get_minutes(wtimes[i]); - var submissionArray = [submission.score, 0]; - - if (workingTime > 0) { - submissionArray[1] = workingTime; - } - - if(submission.score>maximumValue){ - maximumValue = submission.score; - } submissionsScoreAndTimeAssess.push(submissionArray); } else if(submission.cause == "submit"){ - var workingTime = get_minutes(wtimes[i]); - var submissionArray = [submission.score, 0]; - - if (workingTime > 0) { - submissionArray[1] = workingTime; - } - - if(submission.score>maximumValue){ - maximumValue = submission.score; - } submissionsScoreAndTimeSubmits.push(submissionArray); + } else if(submission.cause == "run"){ + submissionsScoreAndTimeRuns.push(submissionArray[1]); } } // console.log(submissionsScoreAndTimeAssess.length); // console.log(submissionsScoreAndTimeSubmits); + // console.log(submissionsScoreAndTimeRuns); function get_minutes (time_stamp) { try { hours = time_stamp.split(":")[0]; minutes = time_stamp.split(":")[1]; seconds = time_stamp.split(":")[2]; - - minutes = parseFloat(hours * 60) + parseInt(minutes); + seconds /= 60; + minutes = parseFloat(hours * 60) + parseInt(minutes) + seconds; if (minutes > 0){ return minutes; } else{ @@ -82,6 +78,9 @@ $(function() { function graph_assesses() { // MAKE THE GRAPH var width_ratio = .8; + if (width_ratio > 1000){ + width_ratio = 1000; + } var height_ratio = .7; // percent of height var margin = {top: 100, right: 20, bottom: 70, left: 70},//30,50 @@ -221,10 +220,21 @@ $(function() { .attr("cx", function(d) { return x(d[1]); }) .attr("cy", function(d) { return y(d[0]); }); + for (var i = 0; i < submissionsScoreAndTimeRuns.length; i++) { + svg.append("line") + .attr("stroke", "red") + .attr("stroke-width", 1) + .attr("fill", "none")// end new + .attr("y1", y(0)) + .attr("y2", 0) + .attr("x1", x(submissionsScoreAndTimeRuns[i])) + .attr("x2", x(submissionsScoreAndTimeRuns[i])); + } var color_hash = { 0 : ["Submissions", "blue"], - 1 : ["Assesses", "orange"] - } + 1 : ["Assesses", "orange"], + 2 : ["Runs", "red"] + }; // add legend var legend = svg.append("g") @@ -234,7 +244,8 @@ $(function() { .attr("height", 100) .attr("width", 100); - var dataset = [submissionsScoreAndTimeSubmits,submissionsScoreAndTimeAssess]; + var dataset = [submissionsScoreAndTimeSubmits,submissionsScoreAndTimeAssess, submissionsScoreAndTimeRuns]; + var yOffset = -70; legend.selectAll('g').data(dataset) .enter() @@ -243,14 +254,14 @@ $(function() { var g = d3.select(this); g.append("rect") .attr("x", 20) - .attr("y", i*25 + 8) + .attr("y", i*25 + yOffset)// + 8 .attr("width", 10) .attr("height", 10) .style("fill", color_hash[String(i)][1]); g.append("text") .attr("x", 40) - .attr("y", i * 25 + 18) + .attr("y", i * 25 + yOffset + 10)// + 18 .attr("height",30) .attr("width",100) .style("fill", color_hash[String(i)][1]) diff --git a/app/assets/javascripts/working_time_graphs.js b/app/assets/javascripts/working_time_graphs.js index 315d2c09..4b6db432 100644 --- a/app/assets/javascripts/working_time_graphs.js +++ b/app/assets/javascripts/working_time_graphs.js @@ -4,7 +4,7 @@ $(function() { if ($.isController('exercises') && $('.graph-functions').isPresent()) { var working_times = $('#data').data('working-time'); - + function get_minutes (time_stamp){ try{ hours = time_stamp.split(":")[0]; @@ -67,6 +67,9 @@ $(function() { // DRAW THE LINE GRAPH ------------------------------------------------------------------------------ function draw_line_graph() { var width_ratio = .8; + if (width_ratio > 1000){ + width_ratio = 1000; + } var height_ratio = .7; // percent of height // currently sets as percentage of window width, however, unfortunately diff --git a/db/schema.rb b/db/schema.rb deleted file mode 100644 index bcf1a675..00000000 --- a/db/schema.rb +++ /dev/null @@ -1,225 +0,0 @@ -# encoding: UTF-8 -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended that you check this file into your version control system. - -ActiveRecord::Schema.define(version: 20160510145341) do - - # These are extensions that must be enabled in order to support this database - enable_extension "plpgsql" - - create_table "code_harbor_links", force: true do |t| - t.string "oauth2token" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "user_id" - end - - add_index "code_harbor_links", ["user_id"], name: "index_code_harbor_links_on_user_id", using: :btree - - create_table "comments", force: true do |t| - t.integer "user_id" - t.integer "file_id" - t.string "user_type" - t.integer "row" - t.integer "column" - t.string "text" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "comments", ["file_id"], name: "index_comments_on_file_id", using: :btree - add_index "comments", ["user_id"], name: "index_comments_on_user_id", using: :btree - - create_table "consumers", force: true do |t| - t.string "name" - t.datetime "created_at" - t.datetime "updated_at" - t.string "oauth_key" - t.string "oauth_secret" - end - - create_table "errors", force: true do |t| - t.integer "execution_environment_id" - t.text "message" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "submission_id" - end - - add_index "errors", ["submission_id"], name: "index_errors_on_submission_id", using: :btree - - create_table "execution_environments", force: true do |t| - t.string "docker_image" - t.string "name" - t.datetime "created_at" - t.datetime "updated_at" - t.string "run_command" - t.string "test_command" - t.string "testing_framework" - t.text "help" - t.string "exposed_ports" - t.integer "permitted_execution_time" - t.integer "user_id" - t.string "user_type" - t.integer "pool_size" - t.integer "file_type_id" - t.integer "memory_limit" - t.boolean "network_enabled" - end - - create_table "exercises", force: true do |t| - t.text "description" - t.integer "execution_environment_id" - t.string "title" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "user_id" - t.text "instructions" - t.boolean "public" - t.string "user_type" - t.string "token" - t.integer "team_id" - t.boolean "hide_file_tree" - t.boolean "allow_file_creation" - end - - add_index "exercises", ["execution_environment_id"], name: "test3", using: :btree - - create_table "external_users", force: true do |t| - t.integer "consumer_id" - t.string "email" - t.string "external_id" - t.string "name" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "file_types", force: true do |t| - t.string "editor_mode" - t.string "file_extension" - t.integer "indent_size" - t.string "name" - t.integer "user_id" - t.datetime "created_at" - t.datetime "updated_at" - t.boolean "executable" - t.boolean "renderable" - t.string "user_type" - t.boolean "binary" - end - - create_table "files", force: true do |t| - t.text "content" - t.integer "context_id" - t.string "context_type" - t.integer "file_id" - t.integer "file_type_id" - t.boolean "hidden" - t.string "name" - t.boolean "read_only" - t.datetime "created_at" - t.datetime "updated_at" - t.string "native_file" - t.string "role" - t.string "hashed_content" - t.string "feedback_message" - t.float "weight" - t.string "path" - end - - add_index "files", ["context_id", "context_type"], name: "index_files_on_context_id_and_context_type", using: :btree - - create_table "hints", force: true do |t| - t.integer "execution_environment_id" - t.string "locale" - t.text "message" - t.string "name" - t.string "regular_expression" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "internal_users", force: true do |t| - t.integer "consumer_id" - t.string "email" - t.string "name" - t.string "role" - t.datetime "created_at" - t.datetime "updated_at" - t.string "crypted_password" - t.string "salt" - t.integer "failed_logins_count", default: 0 - t.datetime "lock_expires_at" - t.string "unlock_token" - t.string "remember_me_token" - t.datetime "remember_me_token_expires_at" - t.string "reset_password_token" - t.datetime "reset_password_token_expires_at" - t.datetime "reset_password_email_sent_at" - t.string "activation_state" - t.string "activation_token" - t.datetime "activation_token_expires_at" - end - - add_index "internal_users", ["activation_token"], name: "index_internal_users_on_activation_token", using: :btree - add_index "internal_users", ["email"], name: "index_internal_users_on_email", unique: true, using: :btree - add_index "internal_users", ["remember_me_token"], name: "index_internal_users_on_remember_me_token", using: :btree - add_index "internal_users", ["reset_password_token"], name: "index_internal_users_on_reset_password_token", using: :btree - - create_table "internal_users_teams", force: true do |t| - t.integer "internal_user_id" - t.integer "team_id" - end - - add_index "internal_users_teams", ["internal_user_id"], name: "index_internal_users_teams_on_internal_user_id", using: :btree - add_index "internal_users_teams", ["team_id"], name: "index_internal_users_teams_on_team_id", using: :btree - - create_table "request_for_comments", force: true do |t| - t.integer "user_id", null: false - t.integer "exercise_id", null: false - t.integer "file_id", null: false - t.datetime "requested_at" - t.datetime "created_at" - t.datetime "updated_at" - t.string "user_type" - t.text "question" - end - - create_table "submissions", force: true do |t| - t.integer "exercise_id" - t.float "score" - t.integer "user_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "cause" - t.string "user_type" - end - - add_index "submissions", ["exercise_id"], name: "test1", where: "((user_type)::text = 'ExternalUser'::text)", using: :btree - add_index "submissions", ["exercise_id"], name: "test2", using: :btree - - create_table "teams", force: true do |t| - t.string "name" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "testruns", force: true do |t| - t.boolean "passed" - t.text "output" - t.integer "file_id" - t.integer "submission_id" - t.datetime "created_at" - t.datetime "updated_at" - end - -end From 2ff04cf59df90dd0c3432268b8de784a6ee5d50c Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Thu, 2 Jun 2016 15:27:36 +0200 Subject: [PATCH 2/8] fixed scaling of graphs --- app/assets/javascripts/exercise_graphs.js | 4 ++-- app/assets/javascripts/working_time_graphs.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/exercise_graphs.js b/app/assets/javascripts/exercise_graphs.js index f0a9f0fc..8b11f668 100644 --- a/app/assets/javascripts/exercise_graphs.js +++ b/app/assets/javascripts/exercise_graphs.js @@ -78,8 +78,8 @@ $(function() { function graph_assesses() { // MAKE THE GRAPH var width_ratio = .8; - if (width_ratio > 1000){ - width_ratio = 1000; + if (getWidth()*width_ratio > 1000){ + width_ratio = 1000/getWidth(); } var height_ratio = .7; // percent of height diff --git a/app/assets/javascripts/working_time_graphs.js b/app/assets/javascripts/working_time_graphs.js index 4b6db432..181b3799 100644 --- a/app/assets/javascripts/working_time_graphs.js +++ b/app/assets/javascripts/working_time_graphs.js @@ -67,8 +67,8 @@ $(function() { // DRAW THE LINE GRAPH ------------------------------------------------------------------------------ function draw_line_graph() { var width_ratio = .8; - if (width_ratio > 1000){ - width_ratio = 1000; + if (getWidth()*width_ratio > 1000){ + width_ratio = 1000/getWidth(); } var height_ratio = .7; // percent of height From 5ba980b31612c092afa8ac98d7470e57705a7636 Mon Sep 17 00:00:00 2001 From: John Geiger Date: Thu, 2 Jun 2016 15:30:18 +0200 Subject: [PATCH 3/8] Fix x-axis domain problem --- app/assets/javascripts/exercise_graphs.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/exercise_graphs.js b/app/assets/javascripts/exercise_graphs.js index 8b11f668..efde486d 100644 --- a/app/assets/javascripts/exercise_graphs.js +++ b/app/assets/javascripts/exercise_graphs.js @@ -130,8 +130,17 @@ $(function() { .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + var largestSubmittedTimeStamp = submissions[submissions_length-1]; + var largestArrayForRange; + if(largestSubmittedTimeStamp.cause == "assess"){ + largestArrayForRange = submissionsScoreAndTimeAssess; + } else if(largestSubmittedTimeStamp.cause == "submit"){ + largestArrayForRange = submissionsScoreAndTimeSubmits; + } else if(largestSubmittedTimeStamp.cause == "run"){ + largestArrayForRange = submissionsScoreAndTimeRuns; + } - x.domain(d3.extent(submissionsScoreAndTimeAssess, function (d) { + x.domain(d3.extent(largestArrayForRange, function (d) { // console.log(d[1]); return (d[1]); })); From 3c8bd90e2b03fec1d904ccefb3e0ce89346f13e2 Mon Sep 17 00:00:00 2001 From: John Geiger Date: Thu, 2 Jun 2016 15:40:18 +0200 Subject: [PATCH 4/8] fix indexing for x axis --- app/assets/javascripts/exercise_graphs.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/exercise_graphs.js b/app/assets/javascripts/exercise_graphs.js index efde486d..8e6263bf 100644 --- a/app/assets/javascripts/exercise_graphs.js +++ b/app/assets/javascripts/exercise_graphs.js @@ -131,18 +131,23 @@ $(function() { .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); var largestSubmittedTimeStamp = submissions[submissions_length-1]; + var indexForTime; var largestArrayForRange; if(largestSubmittedTimeStamp.cause == "assess"){ - largestArrayForRange = submissionsScoreAndTimeAssess; + largestArrayForRange = submissionsScoreAndTimeAssess[1]; + indexForTime = 1; } else if(largestSubmittedTimeStamp.cause == "submit"){ - largestArrayForRange = submissionsScoreAndTimeSubmits; + largestArrayForRange = submissionsScoreAndTimeSubmits[1]; + indexForTime = 1; } else if(largestSubmittedTimeStamp.cause == "run"){ - largestArrayForRange = submissionsScoreAndTimeRuns; + largestArrayForRange = submissionsScoreAndTimeRuns[0]; + indexForTime = 0; + } x.domain(d3.extent(largestArrayForRange, function (d) { // console.log(d[1]); - return (d[1]); + return (d[indexForTime]); })); y.domain(d3.extent(submissionsScoreAndTimeAssess, function (d) { // console.log(d[0]); From cd005483ab4814be176f53791f326853c0ee224e Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Thu, 2 Jun 2016 16:34:13 +0200 Subject: [PATCH 5/8] removed incorrect array accesses. --- app/assets/javascripts/exercise_graphs.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/exercise_graphs.js b/app/assets/javascripts/exercise_graphs.js index 8e6263bf..8e8e15db 100644 --- a/app/assets/javascripts/exercise_graphs.js +++ b/app/assets/javascripts/exercise_graphs.js @@ -134,13 +134,13 @@ $(function() { var indexForTime; var largestArrayForRange; if(largestSubmittedTimeStamp.cause == "assess"){ - largestArrayForRange = submissionsScoreAndTimeAssess[1]; + largestArrayForRange = submissionsScoreAndTimeAssess; indexForTime = 1; } else if(largestSubmittedTimeStamp.cause == "submit"){ - largestArrayForRange = submissionsScoreAndTimeSubmits[1]; + largestArrayForRange = submissionsScoreAndTimeSubmits; indexForTime = 1; } else if(largestSubmittedTimeStamp.cause == "run"){ - largestArrayForRange = submissionsScoreAndTimeRuns[0]; + largestArrayForRange = submissionsScoreAndTimeRuns; indexForTime = 0; } From 52ba35d0e4d20f4a41ad7d64a7efde1dcdee770c Mon Sep 17 00:00:00 2001 From: John Geiger Date: Wed, 8 Jun 2016 13:55:09 +0200 Subject: [PATCH 6/8] fixed graph sizing --- app/assets/javascripts/exercise_graphs.js | 38 ++++++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/exercise_graphs.js b/app/assets/javascripts/exercise_graphs.js index 8e8e15db..f5640788 100644 --- a/app/assets/javascripts/exercise_graphs.js +++ b/app/assets/javascripts/exercise_graphs.js @@ -10,6 +10,8 @@ $(function() { submissionsScoreAndTimeAssess = [[0,0]]; submissionsScoreAndTimeSubmits = [[0,0]]; submissionsScoreAndTimeRuns = []; + submissionsSaves = []; + submissionsAutosaves = []; var maximumValue = 0; var wtimes = $('#wtimes').data('working_times'); //.hidden#wtimes data-working_times=ActiveSupport::JSON.encode(working_times_until) @@ -38,6 +40,10 @@ $(function() { submissionsScoreAndTimeSubmits.push(submissionArray); } else if(submission.cause == "run"){ submissionsScoreAndTimeRuns.push(submissionArray[1]); + } else if(submission.cause == "autosave"){ + submissionsAutosaves.push(submissionArray[1]); + } else if(submission.cause == "save"){ + submissionsSaves.push(submissionArray[1]); } } // console.log(submissionsScoreAndTimeAssess.length); @@ -131,8 +137,8 @@ $(function() { .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); var largestSubmittedTimeStamp = submissions[submissions_length-1]; - var indexForTime; var largestArrayForRange; + if(largestSubmittedTimeStamp.cause == "assess"){ largestArrayForRange = submissionsScoreAndTimeAssess; indexForTime = 1; @@ -142,17 +148,33 @@ $(function() { } else if(largestSubmittedTimeStamp.cause == "run"){ largestArrayForRange = submissionsScoreAndTimeRuns; indexForTime = 0; - + x.domain([0,largestArrayForRange[largestArrayForRange.length - 1][1]]).clamp(true); + } else if(largestSubmittedTimeStamp.cause == "submit"){ + largestArrayForRange = submissionsScoreAndTimeSubmits; + x.domain([0,largestArrayForRange[largestArrayForRange.length - 1][1]]).clamp(true); + } else if(largestSubmittedTimeStamp.cause == "run"){ + largestArrayForRange = submissionsScoreAndTimeRuns; + x.domain([0,largestArrayForRange[largestArrayForRange.length - 1][1]]).clamp(true); + } else if(largestSubmittedTimeStamp.cause == "autosave"){ + largestArrayForRange = submissionsAutosaves; + x.domain([0,largestArrayForRange[largestArrayForRange.length - 1]]).clamp(true); + } else if(largestSubmittedTimeStamp.cause == "save"){ + largestArrayForRange = submissionsSaves; + x.domain([0,largestArrayForRange[largestArrayForRange.length - 1]]).clamp(true); } - x.domain(d3.extent(largestArrayForRange, function (d) { - // console.log(d[1]); - return (d[indexForTime]); - })); - y.domain(d3.extent(submissionsScoreAndTimeAssess, function (d) { + // x.domain(d3.extent(largestArrayForRange, function (d) { + // // console.log(d[1]); + // return (d[indexForTime]); + // })); + + // take maximum value between assesses and submits + var yDomain = submissionsScoreAndTimeAssess.concat(submissionsScoreAndTimeSubmits); + y.domain(d3.extent(yDomain, function (d) { // console.log(d[0]); return (d[0]); })); + // y.domain([0,2]).clamp(true); svg.append("g") //x axis .attr("class", "x axis") @@ -298,7 +320,7 @@ $(function() { try{ graph_assesses(); } catch(err){ - // not enough data + alert("could not draw the graph"); } } From 9e5297c1de6b0bc08b9e1d1f4507f69c5ac693a9 Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Wed, 8 Jun 2016 14:05:13 +0200 Subject: [PATCH 7/8] re-add schema.rb --- db/schema.rb | 220 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 db/schema.rb diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 00000000..f519dfe1 --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,220 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20160512131539) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "code_harbor_links", force: true do |t| + t.string "oauth2token" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "user_id" + end + + add_index "code_harbor_links", ["user_id"], name: "index_code_harbor_links_on_user_id", using: :btree + + create_table "comments", force: true do |t| + t.integer "user_id" + t.integer "file_id" + t.string "user_type" + t.integer "row" + t.integer "column" + t.text "text" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "comments", ["file_id"], name: "index_comments_on_file_id", using: :btree + add_index "comments", ["user_id"], name: "index_comments_on_user_id", using: :btree + + create_table "consumers", force: true do |t| + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + t.string "oauth_key" + t.string "oauth_secret" + end + + create_table "errors", force: true do |t| + t.integer "execution_environment_id" + t.text "message" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "submission_id" + end + + add_index "errors", ["submission_id"], name: "index_errors_on_submission_id", using: :btree + + create_table "execution_environments", force: true do |t| + t.string "docker_image" + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + t.string "run_command" + t.string "test_command" + t.string "testing_framework" + t.text "help" + t.string "exposed_ports" + t.integer "permitted_execution_time" + t.integer "user_id" + t.string "user_type" + t.integer "pool_size" + t.integer "file_type_id" + t.integer "memory_limit" + t.boolean "network_enabled" + end + + create_table "exercises", force: true do |t| + t.text "description" + t.integer "execution_environment_id" + t.string "title" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "user_id" + t.text "instructions" + t.boolean "public" + t.string "user_type" + t.string "token" + t.integer "team_id" + t.boolean "hide_file_tree" + t.boolean "allow_file_creation" + end + + create_table "external_users", force: true do |t| + t.integer "consumer_id" + t.string "email" + t.string "external_id" + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "file_types", force: true do |t| + t.string "editor_mode" + t.string "file_extension" + t.integer "indent_size" + t.string "name" + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "executable" + t.boolean "renderable" + t.string "user_type" + t.boolean "binary" + end + + create_table "files", force: true do |t| + t.text "content" + t.integer "context_id" + t.string "context_type" + t.integer "file_id" + t.integer "file_type_id" + t.boolean "hidden" + t.string "name" + t.boolean "read_only" + t.datetime "created_at" + t.datetime "updated_at" + t.string "native_file" + t.string "role" + t.string "hashed_content" + t.string "feedback_message" + t.float "weight" + t.string "path" + end + + add_index "files", ["context_id", "context_type"], name: "index_files_on_context_id_and_context_type", using: :btree + + create_table "hints", force: true do |t| + t.integer "execution_environment_id" + t.string "locale" + t.text "message" + t.string "name" + t.string "regular_expression" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "internal_users", force: true do |t| + t.integer "consumer_id" + t.string "email" + t.string "name" + t.string "role" + t.datetime "created_at" + t.datetime "updated_at" + t.string "crypted_password" + t.string "salt" + t.integer "failed_logins_count", default: 0 + t.datetime "lock_expires_at" + t.string "unlock_token" + t.string "remember_me_token" + t.datetime "remember_me_token_expires_at" + t.string "reset_password_token" + t.datetime "reset_password_token_expires_at" + t.datetime "reset_password_email_sent_at" + t.string "activation_state" + t.string "activation_token" + t.datetime "activation_token_expires_at" + end + + add_index "internal_users", ["activation_token"], name: "index_internal_users_on_activation_token", using: :btree + add_index "internal_users", ["email"], name: "index_internal_users_on_email", unique: true, using: :btree + add_index "internal_users", ["remember_me_token"], name: "index_internal_users_on_remember_me_token", using: :btree + add_index "internal_users", ["reset_password_token"], name: "index_internal_users_on_reset_password_token", using: :btree + + create_table "internal_users_teams", force: true do |t| + t.integer "internal_user_id" + t.integer "team_id" + end + + add_index "internal_users_teams", ["internal_user_id"], name: "index_internal_users_teams_on_internal_user_id", using: :btree + add_index "internal_users_teams", ["team_id"], name: "index_internal_users_teams_on_team_id", using: :btree + + create_table "request_for_comments", force: true do |t| + t.integer "user_id", null: false + t.integer "exercise_id", null: false + t.integer "file_id", null: false + t.datetime "requested_at" + t.datetime "created_at" + t.datetime "updated_at" + t.string "user_type" + t.text "question" + end + + create_table "submissions", force: true do |t| + t.integer "exercise_id" + t.float "score" + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "cause" + t.string "user_type" + end + + create_table "teams", force: true do |t| + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "testruns", force: true do |t| + t.boolean "passed" + t.text "output" + t.integer "file_id" + t.integer "submission_id" + t.datetime "created_at" + t.datetime "updated_at" + end + +end \ No newline at end of file From 81fe1f1f14a5c2e00ce45968c2e4c4f920d92cc2 Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Wed, 8 Jun 2016 14:07:34 +0200 Subject: [PATCH 8/8] fix end-line of schema.rb --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/schema.rb b/db/schema.rb index f519dfe1..104a1469 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -217,4 +217,4 @@ ActiveRecord::Schema.define(version: 20160512131539) do t.datetime "updated_at" end -end \ No newline at end of file +end