change the names of your fields
<input id="answer" type="text" name="answers[]text">
<input id="ifcorrect" type="checkbox" name="answers[]ifcorrect">
now you will get array of answers, each with an ifCorrect set
foreach ($data['answers'] as $answer) {
if(isset($answer['ifCorrect'])) {
$ans= new Answer();
$ans->answer = $answer['text'];
$ans->correct = true;
$question->answer()->save($ans);
}
}