Code Duplication    Length = 14-15 lines in 2 locations

main/inc/lib/tracking.lib.php 2 locations

@@ 372-385 (lines=14) @@
369
                            learnpath::get_objectives_count_from_db($row['iv_id'], $course_id) > 0) &&
370
                            !$extend_all
371
                        ) {
372
                            if ($extendAttemptId == $row['iv_id']) {
373
                                // The extend button for this attempt has been clicked.
374
                                $extend_this_attempt = 1;
375
                                $extend_attempt_link = Display::url(
376
                                    Display::return_icon('visible.gif', get_lang('HideAttemptView')),
377
                                    api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&fold_attempt_id=' . $row['iv_id'] . $url_suffix
378
                                );
379
                            } else { // Same case if fold_attempt_id is set, so not implemented explicitly.
380
                                // The extend button for this attempt has not been clicked.
381
                                $extend_attempt_link = Display::url(
382
                                    Display::return_icon('invisible.gif', get_lang('ExtendAttemptView')),
383
                                    api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix
384
                                );
385
                            }
386
                        }
387
388
                        if (($counter % 2) == 0) {
@@ 573-587 (lines=15) @@
570
571
                    $extend_attempt_link = '';
572
                    if ($inter_num > 0 || $objec_num > 0) {
573
                        if (!empty($extendAttemptId) && $extendAttemptId == $row['iv_id']) {
574
                            // The extend button for this attempt has been clicked.
575
                            $extend_this_attempt = 1;
576
                            $extend_attempt_link = Display::url(
577
                                Display::return_icon('visible.gif', get_lang('HideAttemptView')),
578
                                api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&fold_attempt_id=' . $row['iv_id'] . $url_suffix
579
                            );
580
                        } else {
581
                            // Same case if fold_attempt_id is set, so not implemented explicitly.
582
                            // The extend button for this attempt has not been clicked.
583
                            $extend_attempt_link = Display::url(
584
                                Display::return_icon('invisible.gif', get_lang('ExtendAttemptView')),
585
                                api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix
586
                            );
587
                        }
588
                    }
589
590
                    if (($counter % 2) == 0) {