Code Duplication    Length = 8-14 lines in 3 locations

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

@@ 995-1003 (lines=9) @@
992
                            <td width="45%">
993
HTML;
994
995
                        if (isset($select_items[$lines_count])) {
996
                            $s .= <<<HTML
997
                                <div id="window_{$windowId}_answer" class="window window_right_question">
998
                                    <strong>{$select_items[$lines_count]['letter']}.</strong> {$select_items[$lines_count]['answer']}
999
                                </div>
1000
HTML;
1001
                        } else {
1002
                            $s .= '&nbsp;';
1003
                        }
1004
1005
                        $s .= '</td></tr>';
1006
@@ 1009-1022 (lines=14) @@
1006
1007
                        $lines_count++;
1008
1009
                        if (($lines_count - 1) == $num_suggestions) {
1010
                            while (isset($select_items[$lines_count])) {
1011
                                $s .= <<<HTML
1012
                                    <tr>
1013
                                        <td colspan="2"></td>
1014
                                        <td>
1015
                                            <strong>{$select_items[$lines_count]['letter']}</strong>
1016
                                            {$select_items[$lines_count]['answer']}
1017
                                        </td>
1018
                                    </tr>
1019
HTML;
1020
                                $lines_count++;
1021
                            }
1022
                        }
1023
                        $matching_correct_answer++;
1024
                    }
1025
                }

main/exercice/exercise.class.php 1 location

@@ 7409-7416 (lines=8) @@
7406
                        //if the left side of the "matching" has been completely
7407
                        // shown but the right side still has values to show...
7408
7409
                        if (($lines_count - 1) == $num_suggestions) {
7410
                            // if it remains answers to shown at the right side
7411
                            while (isset($select_items[$lines_count])) {
7412
                                $s.='<b>'.$select_items[$lines_count]['letter'].'.</b>';
7413
                                $s .= $select_items[$lines_count]['answer'];
7414
                                $lines_count++;
7415
                            }
7416
                        }
7417
                        $s .= '</div>';
7418
                        $matching_correct_answer++;
7419
                        $s .= '</li>';