Code Duplication    Length = 7-9 lines in 2 locations

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

@@ 649-655 (lines=7) @@
646
		$root = array(0, get_lang('RootCat'), $level);
647
		$targets[] = $root;
648
649
		if (isset($this->courseId) && !empty($this->courseId)) {
650
			$crscats = Category::load(null,null,$this->course_code,0);
651
			foreach ($crscats as $cat) {
652
				$targets[] = array ($cat->get_id(), $cat->get_name(), $level+1);
653
				$targets = $this->add_target_subcategories($targets, $level+1, $cat->get_id());
654
			}
655
		}
656
657
		$indcats = Category::load(null,$user,0,0);
658
		foreach ($indcats as $cat) {

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

@@ 1320-1328 (lines=9) @@
1317
            $root = array(0, get_lang('RootCat'), $level);
1318
            $targets[] = $root;
1319
1320
            if (isset($this->course_code) && !empty($this->course_code)) {
1321
                $crscats = Category::load(null,null,$this->course_code,0);
1322
                foreach ($crscats as $cat) {
1323
                    if ($this->can_be_moved_to_cat($cat)) {
1324
                        $targets[] = array ($cat->get_id(), $cat->get_name(), $level+1);
1325
                        $targets = $this->add_target_subcategories($targets, $level+1, $cat->get_id());
1326
                    }
1327
                }
1328
            }
1329
1330
            $indcats = Category::load(null,$user,0,0);
1331
            foreach ($indcats as $cat) {