Skip to content

Commit

Permalink
Achieve skills when the certificate are not generated - refs #7525
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Feb 17, 2015
1 parent 584fbc3 commit ffef26e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions main/gradebook/lib/be/category.class.php
Expand Up @@ -1625,6 +1625,14 @@ public static function register_user_certificate($category_id, $user_id)
$category = $cats_course[0];

if (!$category->getGenerateCetificates()) {
$skill = new Skill();
$skill->add_skill_to_user(
$user_id,
$category_id,
api_get_course_int_id(),
api_get_session_id()
);

return false;
}

Expand Down
4 changes: 3 additions & 1 deletion main/inc/lib/certificate.lib.php
Expand Up @@ -185,7 +185,9 @@ public function generate($params = array())
$skill = new Skill();
$skill->add_skill_to_user(
$this->user_id,
$this->certificate_data['cat_id']
$this->certificate_data['cat_id'],
$courseId,
$sessionId
);

if (is_dir($this->certification_user_path)) {
Expand Down

0 comments on commit ffef26e

Please sign in to comment.