Code Duplication    Length = 8-14 lines in 3 locations

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

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

main/exercise/exercise.class.php 1 location

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