Fixing progress bar and img paths.

1.10.x
Julio Montoya 11 years ago
parent 9c64df123c
commit 16e3960c4b
  1. 14
      main/newscorm/learnpath.class.php
  2. 32
      main/newscorm/scorm_api.php

@ -2440,8 +2440,13 @@ class learnpath
$text = $percentage.$text_add;
//@todo use Display::display_progress();
$output = '<div class="progress progress-striped">
<div id="progress_bar_value" class="bar" style="width: '.$text.';"></div>
</div>
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="'.$text.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$text.'%">
<span class="sr-only">'.$text.'% Complete</span>
</div>
</div>
<div class="progresstext" id="progress_text">'.$text.'</div>';
return $output;
@ -3197,7 +3202,6 @@ class learnpath
$title = Security::remove_XSS($title);
if ($item['type'] != 'dokeos_chapter' && $item['type'] != 'dir' && $item['type'] != 'dokeos_module') {
$url = $this->get_link('http', $item['id'], $toc_list);
$html .= '<a href="" onClick="switch_item('.$mycurrentitemid.','.$item['id'].');'.'return false;" >'.stripslashes(
$title
).'</a>';
@ -3210,16 +3214,12 @@ class learnpath
if ($item['type'] == 'quiz') {
if ($item['status'] == 'completed') {
$html .= "&nbsp;".Display::return_icon($icon_name[$item['status']], substr($item['status'], 0, 1), array('id' => "toc_img_".$item['id'], 'width' => '14'));
//$html .= "&nbsp;<img id='toc_img_".$item['id']."' src='".$icon_name[$item['status']]."' alt='".substr($item['status'],0,1)."' width='14' />";
} else {
$html .= "&nbsp;".Display::return_icon($icon_name['not attempted'], substr('not attempted', 0, 1), array('id' => "toc_img_".$item['id'], 'width' => '14'));
// $html .= "&nbsp;<img id='toc_img_".$item['id']."' src='".$icon_name['not attempted']."' alt='".substr('not attempted', 0, 1)."' width='14' />";
}
} else {
if ($item['type'] != 'dokeos_chapter' && $item['type'] != 'dokeos_module' && $item['type'] != 'dir') {
$html .= "&nbsp;".Display::return_icon($icon_name[$item['status']], substr($item['status'], 0, 1), array('id' => "toc_img_".$item['id'], 'width' => '14'));
//$html .= "&nbsp;<img id='toc_img_".$item['id']."' src='".$icon_name[$item['status']]."' alt='".substr($item['status'], 0, 1)."' width='14' />";
}
}

@ -46,6 +46,8 @@ if (!is_object($oItem)) {
exit;
}
$imagePath = api_get_path(WEB_IMG_PATH);
$autocomplete_when_80pct = 0;
$user = api_get_user_info();
header('Content-type: text/javascript');
@ -53,6 +55,12 @@ header('Content-type: text/javascript');
?>var scorm_logs = <?php echo ((empty($oLP->scorm_debug) or (!api_is_course_admin() && !api_is_platform_admin()) )?'0':'3');?>; //debug log level for SCORM. 0 = none, 1=light, 2=a lot, 3=all - displays logs in log frame
var lms_logs = 0; //debug log level for LMS actions. 0=none, 1=light, 2=a lot, 3=all
var notAttemptedImage = '<?php echo $imagePath ?>notattempted.gif';
var incompleteImage = '<?php echo $imagePath ?>incomplete.png';
var completedImage = '<?php echo $imagePath ?>completed.png';
var deleteImage = '<?php echo $imagePath ?>delete.png';
var notAttemptedImage = '<?php echo $imagePath ?>notattempted.gif';
// API Object initialization (eases access later on)
function APIobject() {
this.LMSInitialize=LMSInitialize; //for Scorm 1.2
@ -1159,38 +1167,38 @@ function update_toc(update_action, update_id, change_ids) {
myelem.attr('class',"scorm_item_highlight");
break;
case 'not attempted':
if( myelemimg.attr('src') != '../img/notattempted.gif') {
myelemimg.attr('src','../img/notattempted.gif');
if( myelemimg.attr('src') != notAttemptedImage) {
myelemimg.attr('src', notAttemptedImage);
myelemimg.attr('alt','n');
}
break;
case 'incomplete':
if( myelemimg.attr('src') != '../img/incomplete.png') {
myelemimg.attr('src','../img/incomplete.png');
if( myelemimg.attr('src') != incompleteImage) {
myelemimg.attr('src', incompleteImage);
myelemimg.attr('alt','i');
}
break;
case 'completed':
if( myelemimg.attr('src') != '../img/completed.png') {
myelemimg.attr('src','../img/completed.png');
if( myelemimg.attr('src') != completedImage) {
myelemimg.attr('src', completedImage);
myelemimg.attr('alt','c');
}
break;
case 'failed':
if( myelemimg.attr('src') != '../img/delete.png') {
myelemimg.attr('src','../img/delete.png');
if( myelemimg.attr('src') != deleteImage) {
myelemimg.attr('src', deleteImage);
myelemimg.attr('alt','f');
}
break;
case 'passed':
if( myelemimg.attr('src') != '../img/completed.png' && myelemimg.attr('alt') != 'passed') {
myelemimg.attr('src','../img/completed.png');
if( myelemimg.attr('src') != completedImage && myelemimg.attr('alt') != 'passed') {
myelemimg.attr('src', completedImage);
myelemimg.attr('alt','p');
}
break;
case 'browsed':
if( myelemimg.attr('src') != '../img/completed.png' && myelemimg.attr('alt') != 'browsed') {
myelemimg.attr('src','../img/completed.png');
if( myelemimg.attr('src') != completedImage && myelemimg.attr('alt') != 'browsed') {
myelemimg.attr('src', completedImage);
myelemimg.attr('alt','b');
}
break;

Loading…
Cancel
Save