Code Duplication    Length = 17-17 lines in 2 locations

main/exercice/exercise.class.php 2 locations

@@ 5296-5312 (lines=17) @@
5293
                        .'</tr>'
5294
                    .'</table>';
5295
        $open_question_list = null;
5296
        foreach ($question_list_answers as $item) {
5297
            $question    = $item['question'];
5298
            $answer      = $item['answer'];
5299
            $answer_type = $item['answer_type'];
5300
5301
            if (!empty($question) && !empty($answer) && $answer_type == FREE_ANSWER) {
5302
                $open_question_list .=
5303
                    '<tr>'
5304
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Question').'</td>'
5305
                        .'<td width="473" valign="top" bgcolor="#F3F3F3">'.$question.'</td>'
5306
                    .'</tr>'
5307
                    .'<tr>'
5308
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Answer').'</td>'
5309
                        .'<td valign="top" bgcolor="#F3F3F3">'.$answer.'</td>'
5310
                    .'</tr>';
5311
            }
5312
        }
5313
5314
        if (!empty($open_question_list)) {
5315
            $msg .= '<p><br />'.get_lang('OpenQuestionsAttemptedAre').' :</p>'.
@@ 5372-5388 (lines=17) @@
5369
        $user_info = api_get_user_info(api_get_user_id());
5370
5371
        $oral_question_list = null;
5372
        foreach ($question_list_answers as $item) {
5373
            $question    = $item['question'];
5374
            $answer      = $item['answer'];
5375
            $answer_type = $item['answer_type'];
5376
5377
            if (!empty($question) && !empty($answer) && $answer_type == ORAL_EXPRESSION) {
5378
                $oral_question_list.='<br /><table width="730" height="136" border="0" cellpadding="3" cellspacing="3">'
5379
                    .'<tr>'
5380
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Question').'</td>'
5381
                        .'<td width="473" valign="top" bgcolor="#F3F3F3">'.$question.'</td>'
5382
                    .'</tr>'
5383
                    .'<tr>'
5384
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Answer').'</td>'
5385
                        .'<td valign="top" bgcolor="#F3F3F3">'.$answer.'</td>'
5386
                    .'</tr></table>';
5387
            }
5388
        }
5389
5390
        if (!empty($oral_question_list)) {
5391
            $msg = get_lang('OralQuestionsAttempted').'<br /><br />