Code Duplication    Length = 10-11 lines in 2 locations

main/exercice/exercise.class.php 2 locations

@@ 3672-3682 (lines=11) @@
3669
3670
                                $correctAnswer = $listCorrectAnswers['tabwords'][$i];
3671
                                $isAnswerCorrect = 0;
3672
                                if (FillBlanks::isGoodStudentAnswer(
3673
                                    $studentAnswer,
3674
                                    $correctAnswer
3675
                                )
3676
                                ) {
3677
                                    // gives the related weighting to the student
3678
                                    $questionScore += $answerWeighting[$i];
3679
                                    // increments total score
3680
                                    $totalScore += $answerWeighting[$i];
3681
                                    $isAnswerCorrect = 1;
3682
                                }
3683
                                $listCorrectAnswers['studentanswer'][$i] = $studentAnswer;
3684
                                $listCorrectAnswers['studentscore'][$i] = $isAnswerCorrect;
3685
                            }
@@ 3703-3712 (lines=10) @@
3700
                                ); $j++) {
3701
                                    $correctAnswer = $listTeacherAnswerTemp[$j];
3702
                                    if (!$found) {
3703
                                        if (FillBlanks::isGoodStudentAnswer(
3704
                                            $studentAnswer,
3705
                                            $correctAnswer
3706
                                        )
3707
                                        ) {
3708
                                            $questionScore += $answerWeighting[$i];
3709
                                            $totalScore += $answerWeighting[$i];
3710
                                            $listTeacherAnswerTemp[$j] = "";
3711
                                            $found = true;
3712
                                        }
3713
                                    }
3714
                                }
3715
                                $listCorrectAnswers['studentanswer'][$i] = $studentAnswer;