Code Duplication    Length = 5-5 lines in 2 locations

main/exercice/exercise.class.php 2 locations

@@ 1605-1609 (lines=5) @@
1602
        // Exercise already exists
1603
        if ($id) {
1604
            // we prepare date in the database using the api_get_utc_datetime() function
1605
            if (!empty($this->start_time) && $this->start_time != '0000-00-00 00:00:00') {
1606
                $start_time = $this->start_time;
1607
            } else {
1608
                $start_time = '0000-00-00 00:00:00';
1609
            }
1610
1611
            if (!empty($this->end_time) && $this->end_time != '0000-00-00 00:00:00') {
1612
                $end_time = $this->end_time;
@@ 1677-1681 (lines=5) @@
1674
            // In this function, api_set_default_visibility,
1675
            // the Quiz is saved too, with an $id and api_get_utc_datetime() is done.
1676
            // If we do it now, it will be done twice (cf. https://support.chamilo.org/issues/6586)
1677
            if (!empty($this->start_time) && $this->start_time != '0000-00-00 00:00:00') {
1678
                $start_time = $this->start_time;
1679
            } else {
1680
                $start_time = '0000-00-00 00:00:00';
1681
            }
1682
1683
            if (!empty($this->end_time) && $this->end_time != '0000-00-00 00:00:00') {
1684
                $end_time = $this->end_time;