Code Duplication    Length = 17-17 lines in 2 locations

main/exercise/exercise.class.php 2 locations

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