aboutsummaryrefslogtreecommitdiffhomepage
path: root/assets
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2015-03-17 23:57:56 +0000
committerSean Whitton <spwhitton@spwhitton.name>2015-03-17 23:57:56 +0000
commit848b343eaacd83fa840f341de1bd33f1ff3a432c (patch)
tree515ce86d7256b8dbf66adff61709b035ac22c8e8 /assets
parent2bdd1707aaa0f7d5a8d2e630013bc7e7391588f4 (diff)
downloadsariulclocks-848b343eaacd83fa840f341de1bd33f1ff3a432c.tar.gz
submit points and time wasted (to be rewritten as non-hidden form)
Diffstat (limited to 'assets')
-rw-r--r--assets/js/main.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/assets/js/main.js b/assets/js/main.js
index 02b8ae0..1610d60 100644
--- a/assets/js/main.js
+++ b/assets/js/main.js
@@ -113,12 +113,13 @@ function endLesson()
return false;
}
- // TODO: submit time wasted and points (probs. via a form in a hidden div)
+ timeWastingClock.stop();
+ // set the form field values: the other gets set by the tick function
+ $("#class_points").val(points);
- // set the cookie and reload to start the session
+ // submit the form data
timeWastingClock.reset();
- createCookie("class_cookie", "Nothing", 1);
- location.reload(true);
+ $("#end_of_class_form").submit();
}
// choose a student
@@ -171,6 +172,7 @@ var timeWastingClock = MyFlipClock($('#time-wasting-clock'), {
$.ionSound.play("button_tiny");
var time = timeWastingClock.getTime().time;
$.jStorage.set("time_wasted", time);
+ $("#class_time_wasted").val(time);
}
}
});