Update to bonfires. Successfully completing triggers a save. "Paired with" form field moved to bonfire view. Controller hardened for checking pair as button is no longer disabled for unfound username

This commit is contained in:
terakilobyte
2015-05-25 17:27:27 -04:00
parent fb3447c366
commit 1c4b40c8e6
4 changed files with 84 additions and 65 deletions

View File

@@ -239,10 +239,28 @@ var runTests = function(err, data) {
function showCompletion() {
var time = Math.floor(Date.now()) - started;
ga('send', 'event', 'Challenge', 'solved', challenge_Name + ', Time: ' + time +', Attempts: ' + attempts);
$('#complete-courseware-dialog').modal('show');
$('#complete-courseware-dialog').keydown(function(e) {
if (e.ctrlKey && e.keyCode == 13) {
$('#next-courseware-button').click();
var bonfireSolution = myCodeMirror.getValue();
var didCompleteWith = $('#completed-with').val() || null;
$.post(
'/completed-bonfire/',
{
challengeInfo: {
challengeId: challenge_Id,
challengeName: challenge_Name,
completedWith: didCompleteWith,
challengeType: challengeType,
solution: bonfireSolution
}
}, function(res) {
if (res) {
$('#complete-courseware-dialog').modal('show');
$('#complete-courseware-dialog').keydown(function (e) {
if (e.ctrlKey && e.keyCode == 13) {
$('#next-courseware-button').click();
}
});
}
}
});
);
}