Patrick101,
$(".test__button").on("click", function() {
var $result = true;
var indx = preQuestions.map(function(el, i) {
return el.correctAnswer - 1 + i * 3
});
$("input").each(function(i) {
if (~indx.indexOf(i) && !this.checked || !~indx.indexOf(i) && this.checked) $result = false
});
if ($result) $(".results").html("Everything is correct");
else {
$(".results").html("Wrong answer");
$("input").prop("checked", false)
}
});