coursewares properly push timestamps to user object

This commit is contained in:
Nathan Leniz
2015-03-21 14:28:00 +09:00
parent cd89ad1574
commit be91849d20
4 changed files with 27 additions and 34 deletions

View File

@@ -30,19 +30,19 @@ $(document).ready(function() {
.addClass('animated fadeInDown');
});
$('.completed-challenge').on('click', function() {
$('#complete-challenge-dialog').modal('show');
// Only post to server if there is an authenticated user
if ($('.signup-btn-nav').length < 1) {
l = location.pathname.split('/');
cn = l[l.length - 1];
$.ajax({
type: 'POST',
data: {challengeNumber: cn},
url: '/completed-challenge/'
});
}
});
//$('.completed-challenge').on('click', function() {
// $('#complete-challenge-dialog').modal('show');
// // Only post to server if there is an authenticated user
// if ($('.signup-btn-nav').length < 1) {
// l = location.pathname.split('/');
// cn = l[l.length - 1];
// $.ajax({
// type: 'POST',
// data: {challengeNumber: cn},
// url: '/completed-challenge/'
// });
// }
//});
function completedBonfire(didCompleteWith, bonfireSolution, thisBonfireHash) {
@@ -105,18 +105,21 @@ $(document).ready(function() {
editor.focus();
});
$('#next-courseware-button').on('click', function() {
console.log(passedCoursewareHash);
if ($('.signup-btn-nav').length < 1) {
$.post(
'/completed-courseware',
'/completed-courseware/',
{
coursewareInfo: {
coursewareHash: passedCoursewareHash
}
}).success(
function() {
function(res) {
if (res) {
window.location.href = '/coursewares';
}
}
)
);
}
});