{"size": 710, "ext": "js", "max_stars_repo_path": "DaniMundo/blog/static/js/custom.js", "max_stars_repo_name": "vlajna95/DaniMundo_semaphore", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "DaniMundo/blog/static/js/custom.js", "max_issues_repo_name": "vlajna95/DaniMundo_semaphore", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "DaniMundo/blog/static/js/custom.js", "max_forks_repo_name": "vlajna95/DaniMundo_semaphore", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 44.375, "max_line_length": 99, "alphanum_fraction": 0.7225352113}
function checkAnswer(origin, correct_answer_message="Bravo!", wrong_answer_message="Hmmm... no.") {
var question_name = $(origin).attr("data-question");
var correct_answer_element = $(origin).attr("data-correct");
var correct_answer_id = $("#"+correct_answer_element).val();
var correct_answer_label = $("label[for='"+correct_answer_id+"']").text();
var chosen_answer_id = $("input[name='"+question_name+"']:checked").attr("id");
var chosen_answer_label = $("label[for='"+chosen_answer_id+"']").text();
if(correct_answer_id == chosen_answer_id) {
alert(correct_answer_message);
}
else {
alert(wrong_answer_message + " \n" + correct_answer_label);
}
$("input[name="+question_name+"]").attr("disabled", true);
}
