Code Duplication    Length = 14-15 lines in 2 locations

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

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