Show forums on LP view - refs #7972

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent 52befbee0d
commit 0ac8d56a2b
  1. 247
      app/Resources/public/css/scorm.css
  2. 90
      main/inc/ajax/lp.ajax.php
  3. 2
      main/inc/lib/javascript/jquery.lp_minipanel.js
  4. 66
      main/newscorm/learnpath.class.php
  5. 37
      main/newscorm/learnpathItem.class.php
  6. 4
      main/newscorm/lp_view.php
  7. 49
      main/newscorm/scorm_api.php
  8. 382
      main/template/default/learnpath/view.tpl

@ -7,17 +7,14 @@ See https://support.chamilo.org/issues/6976
/* Default LP left column values */
#learning_path_left_zone {
float:left;
height:100%;
padding-left: 8px;
padding-right: 4px;
}
#learning_path_left_zone #header {
font-size:14px;
}
#scorm-info.panel-default{
margin: 0px;
}
#author_image {
@ -38,31 +35,11 @@ See https://support.chamilo.org/issues/6976
margin-top: 2px;
}
#lp_media_file {
float: left;
text-align:center;
width: 94%;
}
#learning_path_toc {
font-size:9pt;
margin:0;
}
#learning_path_left_zone .image-avatar{
text-align: center;
padding: 10px;
border:1px solid #dddddd;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
margin-bottom: 5px;
margin-top: 5px;
}
#learning_path_left_zone #scorm-gamification{
padding: 10px;
border: 1px solid #DDD;
border-radius: 5px;
margin-bottom: 5px;
}
#scorm-gamification .fa-star{
font-size: 20px;
@ -72,20 +49,11 @@ See https://support.chamilo.org/issues/6976
color: #D9534F;
}
#learning_path_left_zone .navegation-bar .buttons{
text-align: center;
padding-top: 5px;
padding-bottom: 5px;
margin-bottom: 5px;
}
#learning_path_left_zone .description-autor{
color: #666666;
font-size: 12px;
text-align: left;
line-height: 20px;
}
.inner_lp_toc {
overflow: auto;
}
.inner_lp_toc .scorm_item a {
@ -197,19 +165,10 @@ See https://support.chamilo.org/issues/6976
}
#learning_path_right_zone{
border-left: 1px solid #CCCCCC;
padding-left: 10px;
box-sizing: border-box;
}
#learning_path_breadcrumb_zone .breadcrumb{
background: #2b3d53; /* Old browsers */
background: -moz-linear-gradient(top, #2b3d53 0%, #2c3d4d 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2b3d53), color-stop(100%,#2c3d4d)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #2b3d53 0%,#2c3d4d 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #2b3d53 0%,#2c3d4d 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #2b3d53 0%,#2c3d4d 100%); /* IE10+ */
background: linear-gradient(to bottom, #2b3d53 0%,#2c3d4d 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2b3d53', endColorstr='#2c3d4d',GradientType=0 ); /* IE6-9 */
background-color: #2b3d53;
border-radius: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
@ -227,34 +186,12 @@ See https://support.chamilo.org/issues/6976
margin-top: 5px;
margin-right: 10px;
}
#learning_path_left_zone #accordion .panel-heading{
text-align: center;
}
#learning_path_left_zone #ui-option{
width: 100%;
display: block;
text-align: center;
cursor: pointer;
}
#learning_path_left_zone #ui-option #icon-up,
#learning_path_left_zone #ui-option #icon-down{
width: 100%;
display: block;
}
.hidden{
visibility: hidden;
display: none;
}
.sidebar-scorm,
.content-scorm{
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
.sidebar-scorm,
.content-scorm{
float: left;
}
.total{
width: 100%;
@ -273,9 +210,6 @@ See https://support.chamilo.org/issues/6976
z-index: 2
}
.inner_lp_toc{
overflow-y:scroll;
}
.scorm-heading{
font-size: 14px;
padding-top: 5px;
@ -300,8 +234,7 @@ See https://support.chamilo.org/issues/6976
font-size: 12px;
}
#lp_navigation_elem .buttons {
margin-bottom: .5em;
text-align: center;
}
#learning_path_left_zone .scorm_title{
@ -362,21 +295,6 @@ See https://support.chamilo.org/issues/6976
.scorm_item_normal a:hover{
text-decoration: none;
}
#scorm-info .panel-heading{
padding: 5px;
}
#scorm-info #progress_bar .progress{
margin-bottom: 5px;
}
.scorm-body .scorm-title{
font-size: 18px;
margin-top: 5px;
margin-bottom: 5px;
color: #666;
}
.scorm-body .scorm-title .fa-book{
color: #00829C;
}
.scorm_item_normal.scorm_completed {
background:url("../../main/img/scorm/scorm_completed.png") no-repeat left center;
}
@ -402,4 +320,151 @@ See https://support.chamilo.org/issues/6976
color: #009AB8 !important;
}
/* END SCORM CSS BASE*/
/* END SCORM CSS BASE*/
#scorm-info .panel-heading{
padding: 2px;
}
#scorm-info .panel-body {
padding: 10px;
}
#scorm-info .image-avatar {
padding: 5px 0;
}
#scorm-info .image-avatar .description-autor {
font-size: 13px;
line-height: 1.2em;
}
#scorm-info .image-avatar .description-autor p {
margin-bottom: 5px;
}
#scorm-info hr {
background-color: #DDD;
width: 100%;
}
#scorm-info #progress_bar .progress{
margin-bottom: 5px;
}
.scorm-title{
color: #666;
font-size: 20px;
font-weight: bold;
line-height: 1.5em;
margin: 0 0 10px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#lp_navigation_elem a {
color: black;
}
#learning_path_right_zone .lp-view-tabs li a {
padding: 5px 10px;
}
/* Extra small devices (mobiles, 767px and down) */
/* Small devices (tablets, 768px and up) */
@media (min-width: 768px) {
}
/* Medium devices (desktops, 992px and up) */
@media (min-width: 992px) {
#learning_path_main {
height: 100%;
margin: 0;
position: relative;
}
#learning_path_left_zone {
bottom: 0;
box-sizing: content-box;
left: 0;
margin: 0;
padding: 0;
position: absolute;
right: 0;
top: 0;
width: 350px;
}
#learning_path_right_zone {
bottom: 0;
box-sizing: content-box;
left: 350px;
margin: 0;
padding: 0;
position: absolute;
right: 0;
top: 0;
width: calc(100% - 350px);
}
#learning_path_main.lp-view-include-breadcrumb #learning_path_left_zone,
#learning_path_main.lp-view-include-breadcrumb #learning_path_right_zone {
top: 40px;
}
#learning_path_left_zone .lp-view-zone-container,
#learning_path_right_zone .lp-view-zone-container {
bottom: 0;
left: 0;
padding: 10px;
position: absolute;
right: 0;
top: 0;
}
#learning_path_left_zone .lp-view-zone-container {
padding-right: 5px;
}
#learning_path_right_zone .lp-view-zone-container {
padding-left: 5px;
}
#learning_path_toc {
bottom: 10px;
left: 10px;
overflow: auto;
position: absolute;
right: 5px;
top: 100%;
transition-property: top;
transition-duration: 0.1s;
}
#lp_navigation_elem {
position: absolute;
right: 10px;
top: 45px;
width: 75%;
}
#learning_path_right_zone .lp-view-tabs .tab-content {
bottom: 10px;
left: 5px;
position: absolute;
right: 10px;
top: 100px;
}
#learning_path_right_zone .tab-pane{
height: 100%;
position: relative;
}
#learning_path_right_zone .tab-pane iframe {
border: 0 none;
height: 100%;
width: 100%;
}
}
/* Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
}

@ -171,6 +171,96 @@ switch ($action) {
}
}
break;
case 'get_forum_thread':
$lpId = isset($_GET['lp']) ? intval($_GET['lp']) : 0;
$lpItemId = isset($_GET['lp_item']) ? intval($_GET['lp_item']) : 0;
$sessionId = api_get_session_id();
if (empty($lpId) || empty($lpItemId)) {
echo json_encode([
'error' => true,
]);
break;
}
$learningPath = new learnpath(
api_get_course_id(),
$lpId,
api_get_user_id()
);
$lpItem = $learningPath->getItem($lpItemId);
if (empty($lpItem)) {
echo json_encode([
'error' => true,
]);
break;
}
$lpHasForum = $learningPath->lpHasForum();
if (!$lpHasForum) {
echo json_encode([
'error' => true
]);
break;
}
$forum = $learningPath->getForum($sessionId);
if (empty($forum)) {
require_once '../../forum/forumfunction.inc.php';
$forumCategory = getForumCategoryByTitle(
get_lang('LearningPaths'),
$course_id,
$sessionId
);
if (empty($forumCategory)) {
$forumCategoryId = store_forumcategory(
[
'lp_id' => 0,
'forum_category_title' => get_lang('LearningPaths'),
'forum_category_comment' => null
],
[],
false
);
} else {
$forumCategoryId = $forumCategory['cat_id'];
}
$forumId = $learningPath->createForum($forumCategoryId);
} else {
$forumId = $forum['forum_id'];
}
$lpItemHasThread = $lpItem->lpItemHasThread($course_id);
if (!$lpItemHasThread) {
echo json_encode([
'error' => true
]);
break;
}
$forumThread = $lpItem->getForumThread($course_id, $sessionId);
if (empty($forumThread)) {
$lpItem->createForumTthread($forumId);
$forumThread = $lpItem->getForumThread($course_id, $sessionId);
}
$forumThreadId = $forumThread['thread_id'];
echo json_encode([
'error' => false,
'forumId' => intval($forum['forum_id']),
'threadId' => intval($forumThreadId)
]);
break;
case 'update_gamification':
$lp = isset($_SESSION['oLP']) ? $_SESSION['oLP'] : null;

@ -17,8 +17,6 @@ $(document).ready(function() {
$('#learning_path_right_zone').toggleClass('total');
$(function(){
$('#learning_path_right_zone').slideToggle(300);
$('#control-bottom').toggle("slow");
});
});

@ -1924,19 +1924,25 @@ class learnpath
if ($this->mode == 'fullscreen') {
$navbar = '
<div id="'.$idBar.'" class="buttons well" style="'.$display.'">
<a href="lp_controller.php?action=stats&'.api_get_cidreq(true).'&lp_id='.$lp_id.'" onClick="window.parent.API.save_asset();return true;" target="content_name_blank" title="stats" id="stats_link"><img border="0" src="../img/btn_stats.png" title="' . get_lang('Reporting') . '"></a>
<a id="scorm-previous" href="" onClick="switch_item(' . $mycurrentitemid . ',\'previous\');return false;" title="previous"><img border="0" src="../img/btn_previous.png" title="' . get_lang('ScormPrevious') . '"></a>
<a id="scorm-next" href="" onClick="switch_item(' . $mycurrentitemid . ',\'next\');return false;" title="next" ><img border="0" src="../img/btn_next.png" title="' . get_lang('ScormNext') . '"></a>.
<a href="lp_controller.php?action=stats&'.api_get_cidreq(true).'&lp_id='.$lp_id.'" onclick="window.parent.API.save_asset();return true;" target="content_name_blank" title="stats" id="stats_link"><img border="0" src="../img/btn_stats.png" title="' . get_lang('Reporting') . '"></a>
<a id="scorm-previous" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'previous\');return false;" title="previous"><img border="0" src="../img/btn_previous.png" title="' . get_lang('ScormPrevious') . '"></a>
<a id="scorm-next" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'next\');return false;" title="next" ><img border="0" src="../img/btn_next.png" title="' . get_lang('ScormNext') . '"></a>.
<a href="lp_controller.php?action=mode&mode=embedded" target="_top" title="embedded mode"><img border="0" src="../img/view_choose.gif" title="'.get_lang('ScormExitFullScreen').'"></a>
</div>';
} else {
$navbar = '
<div id="'.$idBar.'" class="buttons well" style="'.$display.'">
<a href="lp_controller.php?action=stats&'.api_get_cidreq(true).'&lp_id='.$lp_id.'" onClick="window.parent.API.save_asset();return true;" target="content_name" title="stats" id="stats_link"><img border="0" src="../img/btn_stats.png" title="' . get_lang('Reporting') . '"></a>
<a id="scorm-previous" href="" onClick="switch_item(' . $mycurrentitemid . ',\'previous\');return false;" title="previous"><img border="0" src="../img/btn_previous.png" title="' . get_lang('ScormPrevious') . '"></a>
<a id="scorm-next" href="" onClick="switch_item(' . $mycurrentitemid . ',\'next\');return false;" title="next" ><img border="0" src="../img/btn_next.png" title="' . get_lang('ScormNext') . '"></a>
</div>';
<span id="'.$idBar.'" class="buttons text-right">
<a class="btn btn-xs btn-link" href="lp_controller.php?action=stats&'.api_get_cidreq(true).'&lp_id='.$lp_id.'" onclick="window.parent.API.save_asset();return true;" target="content_name" title="stats" id="stats_link">
<span class="fa fa-info-circle fa-3x"></span><span class="sr-only">' . get_lang('Reporting') . '</span>
</a>
<a class="btn btn-xs btn-link" id="scorm-previous" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'previous\');return false;" title="previous">
<span class="fa fa-chevron-circle-left fa-3x"></span><span class="sr-only">' . get_lang('ScormPrevious') . '</span>
</a>
<a class="btn btn-xs btn-link" id="scorm-next" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'next\');return false;" title="next">
<span class="fa fa-chevron-circle-right fa-3x"></span><span class="sr-only">' . get_lang('ScormNext') . '</span>
</a>
</span>';
}
return $navbar;
@ -3189,7 +3195,7 @@ class learnpath
$html .= '<div class="'.$style_item.' scorm_section_level_'.$item['level'].'" title="'.$description.'" >';
} else {
$html .= '<div class="'.$style_item.' scorm_item_level_'.$item['level'].' scorm_type_'.learnpath::format_scorm_type_item($item['type']).'" title="'.$description.'" >';
$html .= '<a name="atoc_'.$item['id'].'" />';
$html .= '<a name="atoc_'.$item['id'].'"></a>';
}
if (in_array($item['type'], $dirTypes)) {
@ -3198,7 +3204,7 @@ class learnpath
$html .= stripslashes($title);
} else {
$this->get_link('http', $item['id'], $toc_list);
$html .= '<a class="items-list" href="" onClick="switch_item(' .$mycurrentitemid . ',' .$item['id'] . ');' .'return false;" >' . stripslashes($title) . '</a>';
$html .= '<a class="items-list" href="#" onclick="switch_item(' .$mycurrentitemid . ',' .$item['id'] . ');' .'return false;" >' . stripslashes($title) . '</a>';
}
$html .= "</div>";
@ -3230,7 +3236,7 @@ class learnpath
$gradebook = Security:: remove_XSS($_GET['gradebook']);
}
if ($this->get_lp_session_id() == api_get_session_id()) {
$html .= '<div id="actions_lp" class="actions_lp">';
$html .= '<div id="actions_lp" class="actions_lp"><hr>';
$html .= '<div class="btn-group">';
$html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?" . api_get_cidreq()."&gradebook=$gradebook&action=build&lp_id=" . $this->lp_id . "' target='_parent'>" .
Display::returnFontAwesomeIcon('street-view') . get_lang('Overview') . "</a>";
@ -5650,7 +5656,7 @@ class learnpath
}
}
$delete_icon .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&action=delete_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '" onClick="return confirmation(\'' . addslashes($title) . '\');" class="btn btn-default">';
$delete_icon .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&action=delete_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '" onclick="return confirmation(\'' . addslashes($title) . '\');" class="btn btn-default">';
$delete_icon .= Display::return_icon('delete.png', get_lang('LearnpathDeleteModule'), array(), ICON_SIZE_TINY);
$delete_icon .= '</a>';
@ -10476,6 +10482,42 @@ EOD;
return $src;
}
/**
* Check if this LP has a created forum in the basis course
* @return boolean
*/
public function lpHasForum()
{
$forumTable = Database::get_course_table(TABLE_FORUM);
$itemProperty = Database::get_course_table(TABLE_ITEM_PROPERTY);
$fakeFrom = "
$forumTable f
INNER JOIN $itemProperty ip
ON (f.forum_id = ip.ref AND f.c_id = ip.c_id)
";
$resultData = Database::select(
'COUNT(f.iid) AS qty',
$fakeFrom,
[
'where' => [
'ip.visibility != ? AND ' => 2,
'ip.tool = ? AND ' => TOOL_FORUM,
'f.c_id = ? AND ' => intval($this->course_int_id),
'f.lp_id = ?' => intval($this->lp_id)
]
],
'first'
);
if ($resultData['qty'] > 0) {
return true;
}
return false;
}
/**
* Get the forum for this learning path
* @return boolean

@ -4413,6 +4413,43 @@ class learnpathItem
$this->prerequisiteMinScore = $prerequisiteMinScore;
}
/**
* Check if this LP item has a created thread in the basis course from the forum of its LP
* @param int $lpCourseId The course ID
* @return boolean
*/
public function lpItemHasThread($lpCourseId)
{
$forumThreadTable = Database::get_course_table(TABLE_FORUM_THREAD);
$itemProperty = Database::get_course_table(TABLE_ITEM_PROPERTY);
$fakeFrom = "
$forumThreadTable ft
INNER JOIN $itemProperty ip
ON (ft.thread_id = ip.ref AND ft.c_id = ip.c_id)
";
$resultData = Database::select(
'COUNT(ft.iid) AS qty',
$fakeFrom,
[
'where' => [
'ip.visibility != ? AND ' => 2,
'ip.tool = ? AND ' => TOOL_FORUM_THREAD,
'ft.c_id = ? AND ' => intval($lpCourseId),
'ft.lp_item_id = ?' => intval($this->db_id)
]
],
'first'
);
if ($resultData['qty'] > 0) {
return true;
}
return false;
}
/**
* Get the forum thread info
* @param int $lpCourseId The course ID from the learning path

@ -80,7 +80,7 @@ $my_style = $platform_theme;
$htmlHeadXtra[] = '<script type="text/javascript">
<!--
var jQueryFrameReadyConfigPath = \''.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.min.js\';
var jQueryFrameReadyConfigPath = \''.api_get_jquery_web_path().'\';
-->
</script>';
$htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js"></script>';
@ -513,7 +513,7 @@ $template->assign(
Display::img(
$lpPreviewImagePath,
$_SESSION['oLP']->name,
array('class' => 'img-circle'),
[],
ICON_SIZE_BIG
)
);

@ -1663,9 +1663,58 @@ function switch_item(current_item, next_item){
});
olms.switch_finished = 0; //only changed back once LMSInitialize() happens
loadForumThead(olms.lms_lp_id, next_item);
return true;
}
/**
* Get a forum info when the learning path item has a associated forum
*/
var loadForumThead = function(lpId, lpItemId) {
var loadForum = $.getJSON('<?php echo api_get_path(WEB_AJAX_PATH) ?>lp.ajax.php', {
a: 'get_forum_thread',
lp: lpId,
lp_item: lpItemId
}
);
$.when(loadForum).done(function(forumThreadData) {
var tabForumLink = $('.lp-view-tabs a[href="#lp-view-forum"]'),
tabForum = tabForumLink.parent();
if (forumThreadData.error) {
tabForumLink.removeAttr('data-toggle');
tabForum.addClass('disabled');
$('#lp-view-forum').html('');
return;
}
tabForumLink.attr('data-toggle', 'tab');
tabForum.removeClass('disabled');
var forumIframe = $('<iframe>').attr({
width:'100%',
frameborder:'0',
scrolling:'no',
tabindex:'0',
id:'chamilo-disqus',
src: '<?php echo api_get_path(WEB_CODE_PATH) ?>forum/viewthread.php?<?php echo api_get_cidreq() ?>&' + $.param({
gradebook: 0,
origin: 'learnpath',
forum: forumThreadData.forumId,
thread: forumThreadData.threadId,
posts_order: 'desc'
})
});
$('#lp-view-forum').html(forumIframe);
});
};
/**
* Save a specific item (with its interactions, if any) into the LMS through
* an AJAX call to lp_ajax_save_item.php.

@ -1,239 +1,245 @@
<div id="learning_path_main" style="width:100%; height: 100%;">
<div id="learning_path_main" class="{{ is_allowed_to_edit ? 'lp-view-include-breadcrumb' }}">
{% if is_allowed_to_edit %}
<div class="row">
<div id="learning_path_breadcrumb_zone" class="col-md-12">
{{ breadcrumb }}
</div>
<div id="learning_path_breadcrumb_zone">
{{ breadcrumb }}
</div>
{% endif %}
<button id="touch-button" class="btn btn-default btn-lg btn-touch">
<span class="fa fa-chevron-left fa-2x" aria-hidden="true"></span><span class="sr-only">{{ 'Hide'|get_lang }}</span>
</button>
<div class="container-fluid">
<div class="row">
<div id="learning_path_left_zone" class="sidebar-scorm">
<div class="lp-view-zone-container">
<div class="panel-group" id="scorm-info-accordion" role="tablist" aria-multiselectable="true">
<div id="scorm-info" class="panel panel-default">
<div class="panel-heading">
<a id="ui-option">
<em id="icon-down" class="fa fa-chevron-down hidden"></em>
<em id="icon-up" class="fa fa-chevron-up"></em>
<div class="panel-heading text-center" role="tab" id="scorm-info-panel-title">
<a id="ui-option" role="button" data-toggle="collapse" data-parent="#scorm-info-accordion" href="#scorm-info-panel-content" aria-expanded="true" aria-controls="scorm-info-panel-content">
<span class="fa fa-chevron-up fa-fw" aria-hidden="true"></span>
<span class="sr-only">{{ 'Hide'|get_lang }}</span>
</a>
</div>
{# Author image preview #}
<div id="panel-scorm" class="panel-body">
<a href="{{ button_home_url }}" class="btn btn-primary btn-block" target="_self" onclick="javascript: window.parent.API.save_asset();">
<em class="fa fa-home"></em> {{ button_home_text }}
</a>
<div class="image-avatar">
<div class="row">
<div id="scorm-info-panel-content" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="scorm-info-panel-title">
{# Author image preview #}
<div id="panel-scorm" class="panel-body">
<div class="image-avatar">
{% if lp_author == '' %}
<div class="col-md-12">
<div class="text-center">
{{ lp_preview_image }}
</div>
{% else %}
<div class="col-md-4">
{{ lp_preview_image }}
</div>
<div class="col-md-8">
<div class="description-autor"> {{ lp_author }} </div>
<div class="media">
<div class="media-left">
{{ lp_preview_image }}
</div>
<div class="media-body">
<div class="description-autor"> {{ lp_author }} </div>
</div>
</div>
{% endif %}
</div>
</div>
<div id="lp_navigation_elem" class="navegation-bar">
{{ navigation_bar }}
</div>
{% if gamification_mode == 1 %}
<!--- gamification -->
<div id="scorm-gamification">
<div class="row">
<div class="col-xs-8">
{% if gamification_stars > 0 %}
{% for i in 1..gamification_stars %}
<em class="fa fa-star level"></em>
{% endfor %}
{% endif %}
{% if gamification_stars < 4 %}
{% for i in 1..4 - gamification_stars %}
<em class="fa fa-star"></em>
{% endfor %}
{% endif %}
</div>
<div class="col-xs-4 text-right">
{{ "XPoints"|get_lang|format(gamification_points) }}
</div>
{% if show_audio_player %}
<div id="lp_media_file">
{{ media_player }}
</div>
<div class="row">
<div class="col-xs-12 navegation-bar" id="lp_navigation_elem">
<div id="progress_bar">
{{ progress_bar }}
{% endif %}
{% if gamification_mode == 1 %}
<hr>
<!--- gamification -->
<div id="scorm-gamification">
<div class="row">
<div class="col-xs-8">
{% if gamification_stars > 0 %}
{% for i in 1..gamification_stars %}
<em class="fa fa-star level"></em>
{% endfor %}
{% endif %}
{% if gamification_stars < 4 %}
{% for i in 1..4 - gamification_stars %}
<em class="fa fa-star"></em>
{% endfor %}
{% endif %}
</div>
<div class="col-xs-4 text-right">
{{ "XPoints"|get_lang|format(gamification_points) }}
</div>
</div>
<div class="row">
<div class="col-xs-12 navegation-bar">
<div id="progress_bar">
{{ progress_bar }}
</div>
</div>
</div>
</div>
<!--- end gamification -->
{% else %}
<div id="progress_bar">
{{ progress_bar }}
</div>
{% endif %}
{{ teacher_toc_buttons }}
</div>
<!--- end gamification -->
{% else %}
<div id="progress_bar">
{{ progress_bar }}
</div>
{% endif %}
{% if show_audio_player %}
<div id="lp_media_file">
{{ media_player }}
</div>
{% endif %}
{{ teacher_toc_buttons }}
</div>
</div>
</div>
</div>
{# TOC layout #}
<div id="toc_id" class="scorm-body" name="toc_name">
<div class="scorm-title"> <em class="fa fa-book"></em> {{ lp_title_scorm }}</div>
<div id="learning_path_toc" class="scorm-list">
{{ lp_html_toc }}
</div>
</div>
{# end TOC layout #}
</div>
</div>
{# end left zone #}
{# <div id="hide_bar" class="scorm-toggle" style="display:inline-block; width: 25px; height: 1000px;"></div> #}
{# right zone #}
<div id="learning_path_right_zone" style="height:100%" class="content-scorm">
{% if lp_mode == 'fullscreen' %}
<iframe id="content_id_blank" name="content_name_blank" src="blank.php" border="0" frameborder="0" style="width: 100%; height: 100%" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
{% else %}
<iframe id="content_id" name="content_name" src="{{ iframe_src }}" border="0" frameborder="0" style="display: block; width: 100%; height: 100%" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
{% endif %}
<div id="learning_path_right_zone" class="content-scorm">
<div class="lp-view-zone-container">
<div id="lp_navigation_elem" class="navegation-bar pull-right text-right">
<a href="{{ button_home_url }}" class="btn btn-link" target="_self" onclick="javascript: window.parent.API.save_asset();">
<em class="fa fa-home fa-2x"></em> {{ button_home_text }}
</a>
{{ navigation_bar }}
</div>
<h1 class="scorm-title">{{ lp_title_scorm }}</h1>
<div class="lp-view-tabs">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<a href="#lp-view-content" aria-controls="lp-view-content" role="tab" data-toggle="tab">
<span class="fa fa-book fa-2x fa-fw" aria-hidden="true"></span><span class="sr-only">{{ 'Lesson'|get_lang }}</span>
</a>
</li>
<li role="presentation">
<a href="#lp-view-forum" aria-controls="lp-view-forum" role="tab" data-toggle="tab">
<span class="fa fa-commenting-o fa-2x fa-fw" aria-hidden="true"></span><span class="sr-only">{{ 'Forum'|get_lang }}</span>
</a>
</li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="lp-view-content">
{% if lp_mode == 'fullscreen' %}
<iframe id="content_id_blank" name="content_name_blank" src="blank.php" border="0" frameborder="0" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
{% else %}
<iframe id="content_id" name="content_name" src="{{ iframe_src }}" border="0" frameborder="0" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
{% endif %}
</div>
<div role="tabpanel" class="tab-pane" id="lp-view-forum">
</div>
</div>
</div>
</div>
</div>
{# end right Zone #}
{{ navigation_bar_bottom }}
</div>
</div>
</div>
<script>
// Resize right and left pane to full height (HUB 20-05-2010).
var updateContentHeight = function () {
document.body.style.overflow = 'hidden';
var IE = window.navigator.appName.match(/microsoft/i);
/* Identified new height */
var heightControl = $('#control-bottom').height();
var heightBreadcrumb = ($('#learning_path_breadcrumb_zone').height()) ? $('#learning_path_breadcrumb_zone').height() : 0;
var heightScormInfo = $('#scorm-info').height();
var heightTop = heightScormInfo + 100;
jQuery('.scrollbar-light').scrollbar();
//heightTop = (heightTop > 300)? heightTop : 300;
var innerHeight = $(window).height();
if (innerHeight <= 640) {
$('.scrollbar-light').css('height', innerHeight - heightTop - 5 + "px");
$('#content_id').css('height', innerHeight - heightControl + "px");
} else {
$('.scrollbar-light').css('height', innerHeight - heightBreadcrumb - heightTop - 5 + "px");
$('#content_id').css('height', innerHeight - heightControl + "px");
}
//var innerHeight = (IE) ? document.body.clientHeight : window.innerHeight ;
// Loads the glossary library.
{% if glossary_extra_tools in glossary_tool_availables %}
{% if show_glossary_in_documents == 'ismanual' %}
$.frameReady(
function(){
// $("<div>I am a div courses</div>").prependTo("body");
},
"top.content_name",
{
load: [
{ type:"script", id:"_fr1", src:"{{ jquery_web_path }}"},
{ type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
{ type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
{ type:"script", id:"_fr2", src:"{{ _p.web_lib }}javascript/jquery.highlight.js"},
{{ fix_link }}
]
}
);
{% elseif show_glossary_in_documents == 'isautomatic' %}
$.frameReady(
function(){
// $("<div>I am a div courses</div>").prependTo("body");
},
"top.content_name",
{
load: [
{ type:"script", id:"_fr1", src:"{{ jquery_web_path }}"},
{ type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
{ type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
{ type:"script", id:"_fr2", src:"{{ _p.web_lib }}javascript/jquery.highlight.js"},
{{ fix_link }}
]
}
);
{% elseif fix_link != '' %}
$.frameReady(
function(){
// $("<div>I am a div courses</div>").prependTo("body");
},
"top.content_name",
{
load: [
{ type:"script", id:"_fr1", src:"{{ jquery_web_path }}"},
{ type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
{ type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
{{ fix_link }}
]
}
);
{% endif %}
{% endif %}
};
$(document).ready(function() {
updateContentHeight();
$('#touch-button').children().click(function(){
updateContentHeight();
});
(function () {
var LPViewUtils = {
setHeightLPToc: function () {
var scormInfoHeight = $('#scorm-info-accordion').outerHeight(true);
$('#learning_path_toc').css({
top: scormInfoHeight
});
}
};
$(document).on('ready', function () {
$('.lp-view-tabs').on('click', '.disabled', function (e) {
e.preventDefault();
});
$(window).resize(function() {
updateContentHeight();
});
});
$('a#ui-option').on('click', function (e) {
e.preventDefault();
var icon = $(this).children('.fa');
window.onload = updateContentHeight();
window.onresize = updateContentHeight();
if (icon.is('.fa-chevron-up')) {
icon.removeClass('fa-chevron-up').addClass('fa-chevron-down');
$(document).ready(function(){
$("#icon-down").click(function(){
$("#icon-up").removeClass("hidden");
$(this).addClass("hidden");
return;
}
$('#panel-scorm').slideDown("slow",function(){
updateContentHeight();
icon.removeClass('fa-chevron-down').addClass('fa-chevron-up');
});
$('#scorm-info-panel-content').on('shown.bs.collapse', function () {
LPViewUtils.setHeightLPToc();
});
});
$("#icon-up").click(function(){
$("#icon-down").removeClass("hidden");
$(this).addClass("hidden");
$('#panel-scorm').slideUp("slow",function(){
updateContentHeight();
$('#scorm-info-panel-content').on('hidden.bs.collapse', function () {
LPViewUtils.setHeightLPToc();
});
LPViewUtils.setHeightLPToc();
loadForumThead({{ lp_id }}, {{ lp_current_item_id }});
{% if glossary_extra_tools in glossary_tool_availables %}
// Loads the glossary library.
(function () {
{% if show_glossary_in_documents == 'ismanual' %}
$.frameReady(
function(){
// $("<div>I am a div courses</div>").prependTo("body");
},
"top.content_name",
{
load: [
{ type:"script", id:"_fr1", src:"{{ jquery_web_path }}"},
{ type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
{ type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
{ type:"script", id:"_fr2", src:"{{ _p.web_lib }}javascript/jquery.highlight.js"},
{{ fix_link }}
]
}
);
{% elseif show_glossary_in_documents == 'isautomatic' %}
$.frameReady(
function(){
// $("<div>I am a div courses</div>").prependTo("body");
},
"top.content_name",
{
load: [
{ type:"script", id:"_fr1", src:"{{ jquery_web_path }}"},
{ type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
{ type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
{ type:"script", id:"_fr2", src:"{{ _p.web_lib }}javascript/jquery.highlight.js"},
{{ fix_link }}
]
}
);
{% elseif fix_link != '' %}
$.frameReady(
function(){
// $("<div>I am a div courses</div>").prependTo("body");
},
"top.content_name",
{
load: [
{ type:"script", id:"_fr1", src:"{{ jquery_web_path }}"},
{ type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
{ type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
{{ fix_link }}
]
}
);
{% endif %}
})();
{% endif %}
});
});
})();
</script>

Loading…
Cancel
Save