Skip to content

Commit

Permalink
creator tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gvollbach committed Dec 3, 2015
1 parent 90b619a commit 20b6b1d
Show file tree
Hide file tree
Showing 7 changed files with 276 additions and 195 deletions.
7 changes: 4 additions & 3 deletions js/InteractiveVideoPlayerUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ il.InteractiveVideoPlayerUtils = (function () {
var i;
for (i = 0; i < Object.keys(comments).length; i++)
{
if (comments[i].comment_time <= time && comments[i].comment_text != null && comments[i].is_interactive == 0)
if (comments[i].comment_time <= time && comments[i].comment_text !== null && parseInt(comments[i].is_interactive, 10) === 0)
{
html = pub.buildListElement(comments[i], comments[i].comment_time, comments[i].user_name) + html;
}
Expand Down Expand Up @@ -64,7 +64,7 @@ il.InteractiveVideoPlayerUtils = (function () {
pro.builCommentTagsHtml(comment.comment_tags) +
'</li>';
};

pro.builCommentTimeHtml = function (time, is_interactice)
{
var display_time = time;
Expand Down Expand Up @@ -133,7 +133,8 @@ il.InteractiveVideoPlayerUtils = (function () {
}
return '<br/><div class="comment_tags">' + comment_tags + '</div>';
};

pub.protect = pro;
return pub;

}());
24 changes: 14 additions & 10 deletions js/jquery.InteractiveVideoQuestionViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var InteractiveVideoQuestionViewer = (function () {
var modal = $('.modal_feedback');
modal.html('');
modal.html(feedback.html);
if (feedback.is_timed == 1) {
if (parseInt(feedback.is_timed, 10) === 1) {
modal.append('<div class="learning_recommendation"><br/>' + learning_recommendation_text + ': ' + pro.createButtonButtons('jumpToTimeInVideo', feedback_button_text + ' ' + mejs.Utility.secondsToTimeCode(feedback.time)) + '</div>');
$('#jumpToTimeInVideo').on('click', function (e) {
$('#ilQuestionModal').modal('hide');
Expand Down Expand Up @@ -147,17 +147,21 @@ var InteractiveVideoQuestionViewer = (function () {
type: 'GET', dataType: 'json'
})
).then(function (array) {
pub.comment_id = comment_id;
pub.QuestionObject = array;
pub.QuestionObject.player = player;
pro.buildQuestionForm();
if (pub.QuestionObject.player.isFullScreen === true) {
pub.QuestionObject.player.exitFullScreen();
}
$('#ilQuestionModal').modal('show');
pro.showQuestionInteractionForm(comment_id, array, player);
});
};


pro.showQuestionInteractionForm = function(comment_id, array, player) {
pub.comment_id = comment_id;
pub.QuestionObject = array;
pub.QuestionObject.player = player;
pro.buildQuestionForm();
if (pub.QuestionObject.player.isFullScreen === true) {
pub.QuestionObject.player.exitFullScreen();
}
$('#ilQuestionModal').modal('show');
};

pub.protect = pro;
return pub;

Expand Down
Loading

0 comments on commit 20b6b1d

Please sign in to comment.