Code Duplication    Length = 17-17 lines in 2 locations

main/exercise/exercise.class.php 2 locations

@@ 5392-5408 (lines=17) @@
5389
                        .'</tr>'
5390
                    .'</table>';
5391
        $open_question_list = null;
5392
        foreach ($question_list_answers as $item) {
5393
            $question    = $item['question'];
5394
            $answer      = $item['answer'];
5395
            $answer_type = $item['answer_type'];
5396
5397
            if (!empty($question) && !empty($answer) && $answer_type == FREE_ANSWER) {
5398
                $open_question_list .=
5399
                    '<tr>'
5400
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Question').'</td>'
5401
                        .'<td width="473" valign="top" bgcolor="#F3F3F3">'.$question.'</td>'
5402
                    .'</tr>'
5403
                    .'<tr>'
5404
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Answer').'</td>'
5405
                        .'<td valign="top" bgcolor="#F3F3F3">'.$answer.'</td>'
5406
                    .'</tr>';
5407
            }
5408
        }
5409
5410
        if (!empty($open_question_list)) {
5411
            $msg .= '<p><br />'.get_lang('OpenQuestionsAttemptedAre').' :</p>'.
@@ 5468-5484 (lines=17) @@
5465
        $user_info = api_get_user_info(api_get_user_id());
5466
5467
        $oral_question_list = null;
5468
        foreach ($question_list_answers as $item) {
5469
            $question    = $item['question'];
5470
            $answer      = $item['answer'];
5471
            $answer_type = $item['answer_type'];
5472
5473
            if (!empty($question) && !empty($answer) && $answer_type == ORAL_EXPRESSION) {
5474
                $oral_question_list.='<br /><table width="730" height="136" border="0" cellpadding="3" cellspacing="3">'
5475
                    .'<tr>'
5476
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Question').'</td>'
5477
                        .'<td width="473" valign="top" bgcolor="#F3F3F3">'.$question.'</td>'
5478
                    .'</tr>'
5479
                    .'<tr>'
5480
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Answer').'</td>'
5481
                        .'<td valign="top" bgcolor="#F3F3F3">'.$answer.'</td>'
5482
                    .'</tr></table>';
5483
            }
5484
        }
5485
5486
        if (!empty($oral_question_list)) {
5487
            $msg = get_lang('OralQuestionsAttempted').'<br /><br />