coursewares properly push timestamps to user object
This commit is contained in:
@@ -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';
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user