Code Duplication    Length = 9-9 lines in 2 locations

main/inc/lib/exercise.lib.php 2 locations

@@ 987-995 (lines=9) @@
984
                            $selectedValue = 0;
985
                            $selectedIndex = 0;
986
987
                            if ($user_choice) {
988
                                foreach ($user_choice as $chosen) {
989
                                    if ($answerCorrect != $chosen['answer']) {
990
                                        continue;
991
                                    }
992
                                    $selectedValue = $chosen['answer'];
993
                                }
994
                            }
995
996
                            foreach ($select_items as $key => $select_item) {
997
                                $draggableSelectOptions[$select_item['id']] = $select_item['letter'];
998
                            }
@@ 889-897 (lines=9) @@
886
                            $selectedValue = 0;
887
                            $selectedIndex = 0;
888
889
                            if ($user_choice) {
890
                                foreach ($user_choice as $chosen) {
891
                                    if ($answerCorrect != $chosen['answer']) {
892
                                        continue;
893
                                    }
894
895
                                    $selectedValue = $chosen['answer'];
896
                                }
897
                            }
898
899
                            foreach ($select_items as $key => $select_item) {
900
                                $draggableSelectOptions[$select_item['id']] = $select_item['letter'];