@@ 94-106 (lines=13) @@ | ||
91 | * @param int Link/Resource ID |
|
92 | * @return bool false on error, true on success |
|
93 | */ |
|
94 | public static function remove_resource_from_course_gradebook($link_id) |
|
95 | { |
|
96 | if (empty($link_id)) { |
|
97 | return false; |
|
98 | } |
|
99 | ||
100 | // TODO find the corresponding category (the first one for this course, ordered by ID) |
|
101 | $l = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK); |
|
102 | $sql = "DELETE FROM $l WHERE id = ".(int)$link_id; |
|
103 | Database::query($sql); |
|
104 | ||
105 | return true; |
|
106 | } |
|
107 | ||
108 | /** |
|
109 | * Block students |
@@ 1544-1555 (lines=12) @@ | ||
1541 | * |
|
1542 | * @return bool |
|
1543 | */ |
|
1544 | public static function clear_session_ref_promotion($id_promotion) |
|
1545 | { |
|
1546 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
|
1547 | $id_promotion = intval($id_promotion); |
|
1548 | $sql = "UPDATE $tbl_session SET promotion_id=0 |
|
1549 | WHERE promotion_id = $id_promotion"; |
|
1550 | if (Database::query($sql)) { |
|
1551 | return true; |
|
1552 | } else { |
|
1553 | return false; |
|
1554 | } |
|
1555 | } |
|
1556 | ||
1557 | /** |
|
1558 | * Subscribes students to the given session and optionally (default) unsubscribes previous users |