Code Duplication    Length = 17-17 lines in 2 locations

main/exercice/exercise.class.php 2 locations

@@ 5318-5334 (lines=17) @@
5315
        $user_info = api_get_user_info(api_get_user_id());
5316
5317
        $oral_question_list = null;
5318
        foreach ($question_list_answers as $item) {
5319
            $question    = $item['question'];
5320
            $answer      = $item['answer'];
5321
            $answer_type = $item['answer_type'];
5322
5323
            if (!empty($question) && !empty($answer) && $answer_type == ORAL_EXPRESSION) {
5324
                $oral_question_list.='<br /><table width="730" height="136" border="0" cellpadding="3" cellspacing="3">'
5325
                    .'<tr>'
5326
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Question').'</td>'
5327
                        .'<td width="473" valign="top" bgcolor="#F3F3F3">'.$question.'</td>'
5328
                    .'</tr>'
5329
                    .'<tr>'
5330
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Answer').'</td>'
5331
                        .'<td valign="top" bgcolor="#F3F3F3">'.$answer.'</td>'
5332
                    .'</tr></table>';
5333
            }
5334
        }
5335
5336
        if (!empty($oral_question_list)) {
5337
            $msg = get_lang('OralQuestionsAttempted').'<br /><br />
@@ 5240-5256 (lines=17) @@
5237
                        .'</tr>'
5238
                    .'</table>';
5239
        $open_question_list = null;
5240
        foreach ($question_list_answers as $item) {
5241
            $question    = $item['question'];
5242
            $answer      = $item['answer'];
5243
            $answer_type = $item['answer_type'];
5244
5245
            if (!empty($question) && !empty($answer) && $answer_type == FREE_ANSWER) {
5246
                $open_question_list .=
5247
                    '<tr>'
5248
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Question').'</td>'
5249
                        .'<td width="473" valign="top" bgcolor="#F3F3F3">'.$question.'</td>'
5250
                    .'</tr>'
5251
                    .'<tr>'
5252
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Answer').'</td>'
5253
                        .'<td valign="top" bgcolor="#F3F3F3">'.$answer.'</td>'
5254
                    .'</tr>';
5255
            }
5256
        }
5257
5258
        if (!empty($open_question_list)) {
5259
            $msg .= '<p><br />'.get_lang('OpenQuestionsAttemptedAre').' :</p>'.