Code Duplication    Length = 4-4 lines in 2 locations

main/exercice/exercise.class.php 2 locations

@@ 5030-5033 (lines=4) @@
5027
                    if ($debug) {
5028
                        error_log("reply " . print_r($reply, 1) . "");
5029
                    }
5030
                    for ($i = 0; $i < sizeof($reply); $i++) {
5031
                        $ans = $reply[$i];
5032
                        Event::saveQuestionAttempt($questionScore, $ans, $quesId, $exeId, $i, $this->id);
5033
                    }
5034
                } else {
5035
                    Event::saveQuestionAttempt($questionScore, 0, $quesId, $exeId, 0, $this->id);
5036
                }
@@ 5040-5043 (lines=4) @@
5037
            } elseif ($answerType == MULTIPLE_ANSWER_COMBINATION) {
5038
                if ($choice != 0) {
5039
                    $reply = array_keys($choice);
5040
                    for ($i = 0; $i < sizeof($reply); $i++) {
5041
                        $ans = $reply[$i];
5042
                        Event::saveQuestionAttempt($questionScore, $ans, $quesId, $exeId, $i, $this->id);
5043
                    }
5044
                } else {
5045
                    Event::saveQuestionAttempt($questionScore, 0, $quesId, $exeId, 0, $this->id);
5046
                }