gnarus_exercise 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -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) {
|
data/config/routes.rb
CHANGED
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.
|
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
|