Fix LP Final Item show finished page to 100%

ofaj
José Loguercio 10 years ago
parent c6d0a9e30c
commit 1e092a112a
  1. 21
      main/newscorm/lp_final_item.php

@ -41,7 +41,7 @@ if ($link) {
$categoryId,
$userId
);
if (isset($certificate['pdf_url']) && isset($certificate['certificate_link'])) {
if (isset($certificate['pdf_url']) && isset($certificate['certificate_link']) && isset($certificate['badge_link'])) {
$downloadCertificateLink .= Display::url(Display::returnFontAwesomeIcon('file-pdf-o') .
get_lang('DownloadCertificatePdf'),
$certificate['pdf_url'],
@ -56,9 +56,7 @@ if ($link) {
</div>
</div>
";
}
if (isset($certificate['badge_link'])) {
$skillRelUser = new SkillRelUser();
$courseId = api_get_course_int_id();
$userSkills = $skillRelUser->get_user_skills($userId, $courseId, $sessionId);
@ -100,13 +98,6 @@ if ($link) {
</div>
";
}
}
$currentScore = Category::getCurrentScore($userId, $categoryId, $courseCode, $sessionId, true);
Category::registerCurrentScore($currentScore, $userId, $categoryId);
}
}
}
$documentInfo = DocumentManager::get_document_data_by_id(
$id,
@ -119,6 +110,16 @@ $finalItemTemplate = file_get_contents($documentInfo['absolute_path']);
$finalItemTemplate = str_replace('((certificate))', $downloadCertificateLink, $finalItemTemplate);
$finalItemTemplate = str_replace('((skill))', $badgeLink, $finalItemTemplate);
} else {
Display::display_warning_message(get_lang('LearnpathPrereqNotCompleted'));
$finalItemTemplate = '';
}
$currentScore = Category::getCurrentScore($userId, $categoryId, $courseCode, $sessionId, true);
Category::registerCurrentScore($currentScore, $userId, $categoryId);
}
}
}
// Instance a new template : No page tittle, No header, No footer
$tpl = new Template(null, false, false);

Loading…
Cancel
Save