Code Duplication    Length = 7-10 lines in 2 locations

main/gradebook/lib/be/exerciselink.class.php 1 location

@@ 355-364 (lines=10) @@
352
        $documentPath = api_get_path(SYS_COURSE_PATH).$this->course_code."/document";
353
        require_once api_get_path(SYS_CODE_PATH).'exercise/hotpotatoes.lib.php';
354
        $data = $this->get_exercise_data();
355
        if ($this->is_hp == 1) {
356
            if (isset($data['path'])) {
357
                $title = GetQuizName($data['path'], $documentPath);
358
                if ($title == '') {
359
                    $title = basename($data['path']);
360
                }
361
362
                return $title;
363
            }
364
        }
365
366
        return $data['title'];
367
    }

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

@@ 229-235 (lines=7) @@
226
227
            //if the array provided contained subarrays with 'title' entry,
228
            // then print the title in the PDF
229
            if (is_array($file) && isset($file['title'])) {
230
                $html_title = $file['title'];
231
                $file = $file['path'];
232
            } else {
233
                //we suppose we've only been sent a file path
234
                $html_title = basename($file);
235
            }
236
237
            if (empty($file) && !empty($html_title)) {
238
                //this is a chapter, print title & skip the rest