Code Duplication    Length = 17-17 lines in 2 locations

main/exercise/exercise.class.php 2 locations

@@ 5575-5591 (lines=17) @@
5572
                        .'</tr>'
5573
                    .'</table>';
5574
        $open_question_list = null;
5575
        foreach ($question_list_answers as $item) {
5576
            $question = $item['question'];
5577
            $answer = $item['answer'];
5578
            $answer_type = $item['answer_type'];
5579
5580
            if (!empty($question) && !empty($answer) && $answer_type == FREE_ANSWER) {
5581
                $open_question_list .=
5582
                    '<tr>'
5583
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Question').'</td>'
5584
                        .'<td width="473" valign="top" bgcolor="#F3F3F3">'.$question.'</td>'
5585
                    .'</tr>'
5586
                    .'<tr>'
5587
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Answer').'</td>'
5588
                        .'<td valign="top" bgcolor="#F3F3F3">'.$answer.'</td>'
5589
                    .'</tr>';
5590
            }
5591
        }
5592
5593
        if (!empty($open_question_list)) {
5594
            $msg .= '<p><br />'.get_lang('OpenQuestionsAttemptedAre').' :</p>'.
@@ 5645-5661 (lines=17) @@
5642
        $course_info = api_get_course_info($courseCode);
5643
5644
        $oral_question_list = null;
5645
        foreach ($question_list_answers as $item) {
5646
            $question = $item['question'];
5647
            $answer = $item['answer'];
5648
            $answer_type = $item['answer_type'];
5649
5650
            if (!empty($question) && !empty($answer) && $answer_type == ORAL_EXPRESSION) {
5651
                $oral_question_list .= '<br /><table width="730" height="136" border="0" cellpadding="3" cellspacing="3">'
5652
                    .'<tr>'
5653
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Question').'</td>'
5654
                        .'<td width="473" valign="top" bgcolor="#F3F3F3">'.$question.'</td>'
5655
                    .'</tr>'
5656
                    .'<tr>'
5657
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Answer').'</td>'
5658
                        .'<td valign="top" bgcolor="#F3F3F3">'.$answer.'</td>'
5659
                    .'</tr></table>';
5660
            }
5661
        }
5662
5663
        if (!empty($oral_question_list)) {
5664
            $msg = get_lang('OralQuestionsAttempted').'<br /><br />