Code Duplication    Length = 9-9 lines in 2 locations

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

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