Code Duplication    Length = 17-17 lines in 2 locations

main/exercice/exercise.class.php 2 locations

@@ 5242-5258 (lines=17) @@
5239
                        .'</tr>'
5240
                    .'</table>';
5241
        $open_question_list = null;
5242
        foreach ($question_list_answers as $item) {
5243
            $question    = $item['question'];
5244
            $answer      = $item['answer'];
5245
            $answer_type = $item['answer_type'];
5246
5247
            if (!empty($question) && !empty($answer) && $answer_type == FREE_ANSWER) {
5248
                $open_question_list .=
5249
                    '<tr>'
5250
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Question').'</td>'
5251
                        .'<td width="473" valign="top" bgcolor="#F3F3F3">'.$question.'</td>'
5252
                    .'</tr>'
5253
                    .'<tr>'
5254
                        .'<td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;'.get_lang('Answer').'</td>'
5255
                        .'<td valign="top" bgcolor="#F3F3F3">'.$answer.'</td>'
5256
                    .'</tr>';
5257
            }
5258
        }
5259
5260
        if (!empty($open_question_list)) {
5261
            $msg .= '<p><br />'.get_lang('OpenQuestionsAttemptedAre').' :</p>'.
@@ 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 />