Skip to content

Commit

Permalink
Merge branch 'release/0.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
bmesuere committed Aug 16, 2016
2 parents c46b6c2 + dcbd57e commit 4d0611b
Show file tree
Hide file tree
Showing 60 changed files with 383 additions and 131 deletions.
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
Expand All @@ -33,6 +31,10 @@ gem 'json-schema'
gem 'delayed_job_active_record'
# start workers in the background
gem 'daemons'
# dashboard
gem 'sinatra', github: 'sinatra/sinatra'
gem 'rack-protection', github: 'sinatra/rack-protection'
gem 'delayed_job_web'

# pagination
gem 'will_paginate'
Expand Down
61 changes: 42 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,27 @@ GIT
i18n-js (3.0.0.rc13)
i18n (~> 0.6, >= 0.6.6)

GIT
remote: git://github.com/sinatra/rack-protection.git
revision: 7e723a74763bb83989d1249cdceb9cceb2ee6f01
specs:
rack-protection (2.0.0)
rack

GIT
remote: git://github.com/sinatra/sinatra.git
revision: 285275b42fa1bf096a5c9559b6cead2f31b65b66
specs:
sinatra (2.0.0.pre.alpha)
mustermann (~> 0.4)
rack (~> 2.0)
rack-protection (~> 2.0)
tilt (~> 2.0)

GEM
remote: https://rubygems.org/
specs:
ace-rails-ap (4.0.2)
ace-rails-ap (4.1.0)
actioncable (5.0.0)
actionpack (= 5.0.0)
nio4r (~> 1.2)
Expand Down Expand Up @@ -47,19 +64,19 @@ GEM
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.3.8)
airbrussh (1.0.2)
airbrussh (1.1.0)
sshkit (>= 1.6.1, != 1.7.0)
annotate (2.7.1)
activerecord (>= 3.2, < 6.0)
rake (>= 10.4, < 12.0)
arel (7.0.0)
arel (7.1.1)
ast (2.3.0)
autoprefixer-rails (6.3.7)
autoprefixer-rails (6.4.0.1)
execjs
bcrypt (3.1.11)
builder (3.2.2)
byebug (9.0.5)
capistrano (3.5.0)
capistrano (3.6.0)
airbrussh (>= 1.0.0)
capistrano-harrow
i18n
Expand All @@ -68,7 +85,7 @@ GEM
capistrano-bundler (1.1.4)
capistrano (~> 3.1)
sshkit (~> 1.2)
capistrano-harrow (0.5.2)
capistrano-harrow (0.5.3)
capistrano-passenger (0.2.0)
capistrano (~> 3.0)
capistrano-rails (1.1.7)
Expand All @@ -88,20 +105,24 @@ GEM
coffee-script-source (1.10.0)
commonjs (0.2.7)
concurrent-ruby (1.0.2)
daemons (1.2.3)
daemons (1.2.4)
debug_inspector (0.0.2)
delayed_job (4.1.2)
activesupport (>= 3.0, < 5.1)
delayed_job_active_record (4.1.1)
activerecord (>= 3.0, < 5.1)
delayed_job (>= 3.0, < 5)
delayed_job_web (1.2.5)
activerecord (> 3.0.0)
delayed_job (> 2.0.3)
sinatra (>= 0.9.2)
devise (4.0.0.rc2)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0, < 5.1)
responders
warden (~> 1.2.3)
devise_cas_authenticatable (1.9.1)
devise_cas_authenticatable (1.9.2)
devise (>= 1.2.0)
rubycas-client (>= 2.2.1)
diffy (3.1.0)
Expand All @@ -110,11 +131,11 @@ GEM
actionmailer (>= 4.0, < 6)
activesupport (>= 4.0, < 6)
execjs (2.7.0)
ffi (1.9.12)
globalid (0.3.6)
ffi (1.9.14)
globalid (0.3.7)
activesupport (>= 4.1.0)
i18n (0.7.0)
jbuilder (2.5.0)
jbuilder (2.6.0)
activesupport (>= 3.0.0, < 5.1)
multi_json (~> 1.2)
jquery-rails (4.1.1)
Expand Down Expand Up @@ -146,6 +167,8 @@ GEM
mini_portile2 (2.1.0)
minitest (5.9.0)
multi_json (1.12.1)
mustermann (0.4.0)
tool (~> 0.2)
mysql2 (0.4.4)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
Expand All @@ -159,7 +182,7 @@ GEM
ast (~> 2.2)
pkg-config (1.1.7)
powerpack (0.1.1)
puma (3.4.0)
puma (3.6.0)
pundit (1.1.0)
activesupport (>= 3.0.0)
rack (2.0.1)
Expand Down Expand Up @@ -214,14 +237,14 @@ GEM
spring-watcher-listen (2.0.0)
listen (>= 2.7, < 4.0)
spring (~> 1.2)
sprockets (3.6.3)
sprockets (3.7.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.1.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sshkit (1.11.1)
sshkit (1.11.2)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
therubyracer (0.12.2)
Expand All @@ -230,12 +253,10 @@ GEM
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.5)
turbolinks (5.0.0)
turbolinks-source (~> 5)
turbolinks-source (5.0.0)
tool (0.2.3)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (3.0.0)
uglifier (3.0.1)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.1.0)
warden (1.2.6)
Expand Down Expand Up @@ -266,6 +287,7 @@ DEPENDENCIES
coffee-rails (~> 4.2)
daemons
delayed_job_active_record
delayed_job_web
devise (= 4.0.0.rc2)
devise_cas_authenticatable
diffy
Expand All @@ -280,15 +302,16 @@ DEPENDENCIES
mysql2 (>= 0.3.18, < 0.5)
puma
pundit
rack-protection!
rails (~> 5.0.0)
rails-i18n (~> 5.0.0.beta3)
rouge (= 1.10.1)
rubocop
sinatra!
slack-notifier
spring
spring-watcher-listen (~> 2.0.0)
therubyracer
turbolinks (~> 5)
tzinfo-data
uglifier (>= 1.3.0)
web-console (~> 3.0)
Expand Down
52 changes: 34 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,44 @@
# dodona
* Old version (JavaScript): http://dodona.ugent.be
* New version (Python): http://naos.ugent.be

## roadmap
## changelog

### 0.1
* minimale rails app
* index toont een lijst van beschikbare oefeningen (directory names)
* klikken op oefening toont de testpagina waarin de code kan geplakt worden + run knop
* code wordt lokaal uitgevoerd via webworker
* minimal rails app
* index shows a list of available exercises (based on directory names)
* clicking on an exercise shows the test page where code can be pasted and handed in
* code is run in the browser using a web worker

### 0.2
* webhook om de oefeningen automatisch te updaten
* de opgave wordt ook gerenderd vanaf de markdown source
* media (images)
* formules (mathjax)
* betere code editor (ace)
* home page
* betere layout
* a web hook automatically updates the exercises
* the exercise description is shown based on markdown source
* images and formulas work
* a better code editor
* a home page
* a better layout

### 0.3
* UGent CAS login
* users in databank
* opslaan van oefeningen in de databank
* opslaan van submissions in de databank
* save users in the database
* save exercises in the database
* save submissions in the database

### 0.5
* rework submission flow and exercises
* use a server-side judge
* python exercises
* I18n

## roadmap

### 0.6
* tweak exercise layout
* add jobs dashboard
* update the judges using a webhook
* enable editing submissions

### Later
* nodejs tests
* groeperen van oefeningen in reeksen
### 1.0
* implement tags
* add grouping of exercises
* add the online python tutor
2 changes: 0 additions & 2 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
//
//= require jquery
//= require jquery_ujs
//= require turbolinks

//= require i18n
//= require i18n/translations

//= require ace-rails-ap
//= require ace/mode-javascript
//= require ace/ext-language_tools

//= require vendor
Expand Down
50 changes: 31 additions & 19 deletions app/assets/javascripts/exercise.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function init_exercise_show(exerciseId, programmingLanguage, loggedIn) {
initLightboxes();

centerImagesAndTables();
swapActionButtons();

// submit source code if button is clicked on editor panel
$("#editor-process-btn").click(function () {
Expand All @@ -18,6 +19,11 @@ function init_exercise_show(exerciseId, programmingLanguage, loggedIn) {
.fail(submissionFailed);
});

$("#exercise-handin-link").on('shown.bs.tab', function() {
// refresh editor after show
editor.resize(true);
});

// configure mathjax
MathJax.Hub.Config({
tex2jax: {
Expand All @@ -30,16 +36,11 @@ function init_exercise_show(exerciseId, programmingLanguage, loggedIn) {
]
}
});
MathJax.Hub.Queue(function () {
/* MathJax has not been run yet*/
if ($('span.MathJax').length === 0) {
MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
}
});

// export function
dodona.feedbackLoaded = feedbackLoaded;
dodona.feedbackTableLoaded = feedbackTableLoaded;
dodona.setEditorText = setEditorText;
}

function initEditor() {
Expand All @@ -55,36 +56,46 @@ function init_exercise_show(exerciseId, programmingLanguage, loggedIn) {
editor.focus();
}

function setEditorText(text) {
editor.setValue(text, 1);
}

function initLightboxes() {
initStrip();

var index = 1;
var images = [];
$(".exercise-description img").each(function () {
var imagesrc = $(this).attr('src');
var alttext = $(this).attr('alt');
alttext = alttext ? alttext : imagesrc.split("/").pop();
image_object = {
$(".exercise-description img, a.dodona-lightbox").each(function () {
var imagesrc = $(this).data('large') || $(this).attr('src') || $(this).attr('href');
var altText = $(this).data("caption") || $(this).attr('alt') || imagesrc.split("/").pop();
var image_object = {
url: imagesrc,
caption: alttext
caption: altText
};
images.push(image_object);

$(this).data('image_index', index++);

});

$(".exercise-description img").click(function () {
$(".exercise-description img, a.dodona-lightbox").click(function () {
Strip.show(images, {
side: 'top'
}, $(this).data('image_index'));
return false;
});
}

function centerImagesAndTables() {
$(".exercise-description p > img").parent().wrapInner("<center></center>");
$(".exercise-description table").wrap("<center></center>");
$(".exercise-description iframe").wrap("<center></center>");
$(".exercise-description > table").wrap("<center></center>");
$(".exercise-description > iframe").wrap("<center></center>");
}

function swapActionButtons() {
$("#exercise-handin-link").on("shown.bs.tab", function(e) { $("#editor-process-btn").removeClass("hidden-fab"); });
$("#exercise-handin-link").on("hide.bs.tab", function(e) { $("#editor-process-btn").addClass("hidden-fab"); });
$("#exercise-feedback-link").on("shown.bs.tab", function(e) { $("#submission-copy-btn").removeClass("hidden-fab"); });
$("#exercise-feedback-link").on("hide.bs.tab", function(e) { $("#submission-copy-btn").addClass("hidden-fab"); });
}

function submitSolution(code) {
Expand All @@ -96,22 +107,23 @@ function init_exercise_show(exerciseId, programmingLanguage, loggedIn) {
});
}

function feedbackLoaded() {
function feedbackLoaded(edit_link) {
$('#feedback').removeClass("hidden");
$('#exercise-feedback-link').removeClass("hidden");
$('#exercise-feedback-link').tab('show');
$('#submission-copy-btn').attr('href', edit_link);
}

function feedbackTableLoaded() {
if (lastSubmission) {
var $submissionRow = $("#submission_" + lastSubmission);
var status = $submissionRow.data("status");
if (status == "queued" || status == "running") {
setTimeout(function() {
setTimeout(function () {
$.get("submissions.js");
}, 1000);
} else {
if($("#exercise-submission-link").parent().hasClass("active")) {
if ($("#exercise-submission-link").parent().hasClass("active")) {
$submissionRow.find(".load-submission").click();
}
showNotification(I18n.t("js.submission-processed"));
Expand Down
Loading

0 comments on commit 4d0611b

Please sign in to comment.