Code Duplication    Length = 22-23 lines in 2 locations

main/inc/lib/exercise.lib.php 1 location

@@ 169-190 (lines=22) @@
166
                $s .= $form->returnForm();
167
            } elseif ($answerType == ORAL_EXPRESSION) {
168
                // Add nanog
169
                if (api_get_setting('enable_record_audio') == 'true') {
170
                    //@todo pass this as a parameter
171
                    global $exercise_stat_info, $exerciseId, $exe_id;
172
173
                    if (!empty($exercise_stat_info)) {
174
                        $objQuestionTmp->initFile(
175
                            api_get_session_id(),
176
                            api_get_user_id(),
177
                            $exercise_stat_info['exe_exo_id'],
178
                            $exercise_stat_info['exe_id']
179
                        );
180
                    } else {
181
                        $objQuestionTmp->initFile(
182
                            api_get_session_id(),
183
                            api_get_user_id(),
184
                            $exerciseId,
185
                            'temp_exe'
186
                        );
187
                    }
188
189
                    echo $objQuestionTmp->returnRecorder();
190
                }
191
192
                $form = new FormValidator('free_choice_' . $questionId);
193
                $config = array(

main/exercise/exercise.class.php 1 location

@@ 7087-7109 (lines=23) @@
7084
                $s .= $form->return_form();
7085
            } elseif ($answerType == ORAL_EXPRESSION) {
7086
                // Add nanogong
7087
                if (api_get_setting('enable_record_audio') === 'true') {
7088
7089
                    //@todo pass this as a parameter
7090
                    global $exercise_stat_info, $exerciseId;
7091
7092
                    if (!empty($exercise_stat_info)) {
7093
                        $objQuestionTmp->initFile(
7094
                            api_get_session_id(),
7095
                            api_get_user_id(),
7096
                            $exercise_stat_info['exe_exo_id'],
7097
                            $exercise_stat_info['exe_id']
7098
                        );
7099
                    } else {
7100
                        $objQuestionTmp->initFile(
7101
                            api_get_session_id(),
7102
                            api_get_user_id(),
7103
                            $exerciseId,
7104
                            'temp_exe'
7105
                        );
7106
                    }
7107
7108
                    $s .= $objQuestionTmp->returnRecorder();
7109
                }
7110
7111
                $form->addElement(
7112
                    'html_editor',