gnarus_exercise 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,23 @@
1
1
  var gnarus = {
2
2
  attemptForm : function(solution, viewer, returnUri) {
3
3
 
4
+ var finishWith = function(solution) {
5
+ var form = $('<form action=' + returnUri + '></form>');
6
+ var input = $('<input name="solution" />');
7
+ input.val(solution);
8
+ form.insertAfter(input);
9
+ form.submit();
10
+ };
11
+
4
12
  var viewChanged = function(execution) {
5
13
  viewer(execution);
6
- if(execution.suceeded) {
7
- var form = $('<form action=' + returnUri + '></form>');
8
- var input = $('<input name="solution" />');
9
- input.val(execution.solution);
10
- form.insertAfter(input);
11
- form.submit();
12
- }
14
+ if(execution.suceeded) finishWith(execution.solution);
13
15
  };
14
16
 
15
17
  return {
18
+ skip : function() {
19
+ finishWith("skiped");
20
+ },
16
21
  process : function() {
17
22
  var target = $('#exercise').attr('action');
18
23
  $.post(target, solution(), function(r) {
@@ -0,0 +1,11 @@
1
+ module GnarusExercise
2
+ class StatusController < ApplicationController
3
+
4
+ skip_before_filter :verify_authenticity_token
5
+
6
+ def ping
7
+ render :json => {:status => "alive"}
8
+ end
9
+
10
+ end
11
+ end
data/config/routes.rb CHANGED
@@ -8,4 +8,6 @@ GnarusExercise::Engine.routes.draw do
8
8
  end
9
9
  end
10
10
 
11
+ match "/ping" => "status#ping"
12
+
11
13
  end
@@ -1,3 +1,3 @@
1
1
  module GnarusExercise
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnarus_exercise
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -57,6 +57,7 @@ files:
57
57
  - app/controllers/gnarus_exercise/attempts_controller.rb
58
58
  - app/controllers/gnarus_exercise/executions_controller.rb
59
59
  - app/controllers/gnarus_exercise/exercises_controller.rb
60
+ - app/controllers/gnarus_exercise/status_controller.rb
60
61
  - app/helpers/gnarus_exercise/application_helper.rb
61
62
  - app/models/activity_processor.rb
62
63
  - app/models/gnarus_exercise/attempt.rb