Weekly news quiz: August 11, 2017

0
30


We’re processing your free subscription.
This might take a few seconds. Please don’t close your browser yet.

FOLLOW THE WEEK ON FACEBOOK

Question 1 of 12

North Korea this week said it had a plan to fire missiles into waters near where?

Select an answer below:

‘);
}
}
}

function resetQuizPosition(){
jQuery(“html, body”).animate({ scrollTop: jQuery(‘#question-section’).offset().top – 50 }, 1000);
}
function resetQuestion(){
jQuery(‘#back-button-wrapper,#next-button-wrapper, .arrow-icon’).hide();
jQuery(‘#correct-text, #answer-feedback’).text(“http://theweek.com/”).removeClass(‘wrong’);
jQuery(‘.answer-box’).removeClass(‘correct-box’).css(‘display’,’none’);
jQuery(‘.answer-text-box’).removeClass(‘answer-correct answer-incorrect’);
}

jQuery(document).ready(function(){
displayAnswerBox();
sendGaQuestion();
jQuery(‘.answer-info’).click(function(){ // click event for active question
if((questionAttempted == false) && (currentQuestion == totalQuestionsAnswered)){
questionAttempted = true;
var correctAnswer = correctAnswerArray[currentQuestion];
// obtain box number and then check if answer is correct
selectedBoxId = parseInt(jQuery(this).attr(‘id’).replace(/choice/, “http://theweek.com/”));
if(quiz.questions[currentQuestion].answers[selectedBoxId – 1].is_correct){ // correct answer
numberCorrect++;
if(quiz.questions[currentQuestion].feedback_positive !== “http://theweek.com/”) {
jQuery(‘#answer-feedback’).html(quiz.questions[currentQuestion].feedback_positive);
var textResult = ‘Correct!’;
}
var classResult = ‘answer-correct’;
} else { // wrong answer
jQuery(‘#answer-feedback’).html(quiz.questions[currentQuestion].feedback_negative);
var textResult = ‘Incorrect.’;
var classResult = ‘answer-incorrect’;
for(i=0; i 0){
jQuery(‘#arrow-left’).show();
jQuery(‘#back-button-wrapper’).css(‘display’,’inline-block’);
}
});
});

function sendGaQuestion(){ // send a GA page view
urlOriginal = window.location.pathname;
var urlFinalVar = urlOriginal.substring(urlOriginal.lastIndexOf(‘/’) + 1);

if(isNaN(parseInt(urlFinalVar))){ // if url is not an int,
urlUpdate = urlOriginal + ‘/1′;
window.history.pushState(“http://theweek.com/”, “http://theweek.com/”, urlUpdate);
TheWeek.pushSyntheticPageview(location.pathname,’Weeklyx20newsx20quizx3Ax20Augustx2011,x202017’);
} else { // get the url without the final page and update it
urlFirstSection = window.location.pathname.substring(0,window.location.pathname.lastIndexOf(‘/’));
urlUpdate = urlFirstSection + ‘/’ + parseInt(currentQuestion+1);
window.history.pushState(“http://theweek.com/”, “http://theweek.com/”, urlUpdate);
TheWeek.pushSyntheticPageview(location.pathname,’Weeklyx20newsx20quizx3Ax20Augustx2011,x202017′);
}
}

function nextQuestion(){
var finalScore = numberCorrect / quiz.questions.length;
currentQuestion++;
sendGaQuestion();
resetQuizPosition();
if (currentQuestion 0) && (currentQuestion

TAKE ANOTHER QUIZ

‘).show();
jQuery(‘.twitter’).attr(‘data-text’, ‘I scored ‘ + numberCorrect + ‘ out of 12. Can you beat me?’)
if ((finalScore >= 0) && (finalScore 0) && (finalScore .4) && (finalScore ‘ + finalHeadline + “http://theweek.com/”);
jQuery(‘#final-feedback-inner’).html(finalText);

// if the quiz form is set to true, show the form
if( jQuery.cookie(‘TWQuiz’) == null ) {
jQuery(‘#quiz-form’).show();
jQuery(‘#next-wrapper’).hide();
}

socialButtonsUpdate();
socialButtonsActivate();
}
}

function previousQuestion(){
currentQuestion–;
resetQuestion();
displayAnswerBox();
resetQuizPosition();
jQuery(‘#currentQuestionNumber’).html(currentQuestion + 1);
jQuery(‘#question-text’).html(quiz.questions[currentQuestion].text);
// display next and back buttons
if (currentQuestion 0) && (currentQuestion

 

‘);
};

function socialButtonsActivate(){
jQuery(‘.twitter’).sharrre({
share: {
twitter: true
},
enableHover: false,
enableTracking: true,
click: function(api, options){
api.simulateClick();
api.openPopup(‘twitter’);
}
});

}

function submitAjax(form) {
jQuery(‘#loading-gif’).show();

var formData = {
‘NAME’ : jQuery(‘input[name=NAME]’).val(),
‘EMAIL’ : jQuery(‘input[name=EMAIL]’).val(),
‘ADDRESS1’ : jQuery(‘input[name=ADDRESS1]’).val(),
‘ADDRESS2’ : jQuery(‘input[name=ADDRESS2]’).val(),
‘CITY’ : jQuery(‘input[name=CITY]’).val(),
‘STATE’ : jQuery(‘input[name=STATE]’).val(),
‘ZIPCODE’ : jQuery(‘input[name=ZIPCODE]’).val(),
};

jQuery.ajax({
type : ‘POST’,
url : ‘/footer-form-submit’,
data : formData,
dataType : ‘json’,
encode : true
});

jQuery(“#submit-button”).css(‘opacity’,’.4′);

jQuery.ajax({
url: ‘/signup?’,
data: { email: jQuery(“#email”).val(), cartoons:”false”, briefing:”false”, top_opinions:”true”, captured:”false”, business:”false” },
dataType: ‘json’,
jsonp: false,
success: function(data) {
if(data.success) {
parent.formSubmitted = true;

// set the cookie
var date = new Date();
date.setTime(date.getTime() + (20*365*24*60*60*1000));
jQuery.cookie(“TWQuiz”, “true”, { expires: date });

jQuery(‘#quiz-form, #question-number, #question-top-bar, #question-text, #final-feedback’).hide();
jQuery(‘#answer-result’).css(‘height’,’8′);
jQuery(‘#quiz-recirc, #loading-gif’).show();
form.submit();

} else if(data.resubscribe) {
alert(“Thank you for subscribing. You will be sent a confirmation email soon.”);
} else if(data.invalid_email) {
jQuery(‘#quiz-form, #question-number, #question-top-bar, #question-text, #final-feedback, #next-button-wrapper’).hide();
jQuery(‘#answer-result’).css(‘height’,’8′);
jQuery(‘#quiz-recirc, #loading-gif’).show();
form.submit();
} else {
alert( ‘Sorry, there was a problem. Please check the information entered and try again. If this problem persists, please contact customer support at TheWeek@customersvc.com.’ );
jQuery(‘#loading-gif’).hide();
jQuery(“#submit-button”).css(‘opacity’,’1′);
}
}
})
.fail(function() {
alert( ‘Sorry, there was a problem. Please check the information entered and try again. If this problem persists, please contact customer support at TheWeek@customersvc.com’ );
jQuery(“#submit-button”).css(‘opacity’,’1′);
jQuery(‘#loading-gif’).hide();
});
}

jQuery(“#quiz-form”).validate({
submitHandler: submitAjax
});

jQuery(‘.second-button a’).click(function(event) { // enable popup window for facebook buttons
event.preventDefault();
window.open(jQuery(this).attr(“href”), “popupWindow”, “width=550,height=500,scrollbars=yes”);
});

socialButtonsActivate();



All Credit Goes To : Source link

Comments

comments

SHARE