Code Duplication    Length = 21-26 lines in 2 locations

includes/class-sensei-grading.php 2 locations

@@ 936-956 (lines=21) @@
933
        if( $do_case_sensitive_comparison ){
934
935
            // Case Sensitive Check that the 'gap' is "exactly" equal to the given answer
936
            if ( trim(($gapfill_array[1])) == trim( $user_answer ) ) {
937
938
                return Sensei()->question->get_question_grade( $question_id );
939
940
            } else if (@preg_match('/' . $gapfill_array[1] . '/i', null) !== FALSE) {
941
942
                if (preg_match('/' . $gapfill_array[1] . '/i', $user_answer)) {
943
944
                    return Sensei()->question->get_question_grade($question_id);
945
946
                }else{
947
948
                    return false;
949
950
                }
951
952
            }else{
953
954
                return false;
955
956
            }
957
958
        }else{
959
@@ 958-983 (lines=26) @@
955
956
            }
957
958
        }else{
959
960
            // Case Sensitive Check that the 'gap' is "exactly" equal to the given answer
961
            if ( trim(strtolower($gapfill_array[1])) == trim(strtolower( $user_answer )) ) {
962
963
               return Sensei()->question->get_question_grade( $question_id );
964
965
            } else if (@preg_match('/' . $gapfill_array[1] . '/i', null) !== FALSE) {
966
967
                if (preg_match('/' . $gapfill_array[1] . '/i', $user_answer)) {
968
969
                    return  Sensei()->question->get_question_grade( $question_id );
970
971
                }else{
972
973
                    return false;
974
975
                }
976
977
            }else{
978
979
                return false;
980
981
            }
982
983
        }
984
985
    }
986