Code Duplication    Length = 12-13 lines in 2 locations

main/gradebook/lib/GradebookUtils.php 1 location

@@ 75-87 (lines=13) @@
72
     * @param float
73
     * @return   bool    false on error, true on success
74
     */
75
    public static function update_resource_from_course_gradebook($link_id, $course_code, $weight)
76
    {
77
        $course_code = Database::escape_string($course_code);
78
        if (!empty($link_id)) {
79
            $link_id = intval($link_id);
80
            $sql = 'UPDATE ' . Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK) . '
81
                    SET weight = ' . "'" . Database::escape_string((float) $weight) . "'" . '
82
                    WHERE course_code = "' . $course_code . '" AND id = ' . $link_id;
83
            Database::query($sql);
84
        }
85
86
        return true;
87
    }
88
89
    /**
90
     * Remove a resource from the unique gradebook of a given course

main/inc/lib/certificate.lib.php 1 location

@@ 270-281 (lines=12) @@
267
    * @param string $path_certificate the path name of the certificate
268
    * @return void()
269
    */
270
    public function update_user_info_about_certificate(
271
        $cat_id,
272
        $user_id,
273
        $path_certificate
274
    ) {
275
        $table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE);
276
        if (!UserManager::is_user_certified($cat_id,$user_id)) {
277
            $sql='UPDATE '.$table_certificate.' SET path_certificate="'.Database::escape_string($path_certificate).'"
278
                 WHERE cat_id="'.intval($cat_id).'" AND user_id="'.intval($user_id).'" ';
279
            Database::query($sql);
280
        }
281
    }
282
283
    /**
284
     *