Code Duplication    Length = 8-14 lines in 3 locations

main/exercise/exercise.class.php 1 location

@@ 7557-7564 (lines=8) @@
7554
                        //if the left side of the "matching" has been completely
7555
                        // shown but the right side still has values to show...
7556
7557
                        if (($lines_count - 1) == $num_suggestions) {
7558
                            // if it remains answers to shown at the right side
7559
                            while (isset($select_items[$lines_count])) {
7560
                                $s.='<b>'.$select_items[$lines_count]['letter'].'.</b>';
7561
                                $s .= $select_items[$lines_count]['answer'];
7562
                                $lines_count++;
7563
                            }
7564
                        }
7565
                        $s .= '</div>';
7566
                        $matching_correct_answer++;
7567
                        $s .= '</li>';

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

@@ 1017-1025 (lines=9) @@
1014
                            <td width="45%">
1015
HTML;
1016
1017
                            if (isset($select_items[$lines_count])) {
1018
                                $s .= <<<HTML
1019
                                <div id="window_{$windowId}_answer" class="window window_right_question">
1020
                                    <strong>{$select_items[$lines_count]['letter']}.</strong> {$select_items[$lines_count]['answer']}
1021
                                </div>
1022
HTML;
1023
                            } else {
1024
                                $s .= '&nbsp;';
1025
                            }
1026
1027
                            $s .= '</td></tr>';
1028
@@ 1031-1044 (lines=14) @@
1028
1029
                            $lines_count++;
1030
1031
                            if (($lines_count - 1) == $num_suggestions) {
1032
                                while (isset($select_items[$lines_count])) {
1033
                                    $s .= <<<HTML
1034
                                    <tr>
1035
                                        <td colspan="2"></td>
1036
                                        <td>
1037
                                            <strong>{$select_items[$lines_count]['letter']}</strong>
1038
                                            {$select_items[$lines_count]['answer']}
1039
                                        </td>
1040
                                    </tr>
1041
HTML;
1042
                                    $lines_count++;
1043
                                }
1044
                            }
1045
                            $matching_correct_answer++;
1046
                        }
1047
                        break;