Skip to content

Commit

Permalink
Fixed lesson status skin support
Browse files Browse the repository at this point in the history
  • Loading branch information
bobopinna committed Feb 3, 2006
1 parent 8eae75e commit 3a19de6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
13 changes: 7 additions & 6 deletions mod/scorm/lib.php
Expand Up @@ -215,7 +215,7 @@ function scorm_user_complete($course, $user, $mod, $scorm) {
global $CFG;

$liststyle = 'structlist';
$scormpixdir = $CFG->wwwroot.'/mod/scorm/pix/';
$scormpixdir = $CFG->modpixpath."/scorm/pix/";
$now = time();
$firstmodify = $now;
$lastmodify = 0;
Expand Down Expand Up @@ -1069,6 +1069,7 @@ function scorm_count_launchable($scormid,$organization) {
function scorm_display_structure($scorm,$liststyle,$currentorg='',$scoid='',$mode='normal',$play=false) {
global $USER, $CFG;

$scormpixdir = $CFG->modpixpath."/scorm/pix/";
$strexpand = get_string('expcoll','scorm');

echo "<ul id='0' class='$liststyle'>";
Expand Down Expand Up @@ -1115,9 +1116,9 @@ function scorm_display_structure($scorm,$liststyle,$currentorg='',$scoid='',$mod
$nextsco = next($scoes);
if (($nextsco !== false) && ($sco->parent != $nextsco->parent) && (($level==0) || (($level>0) && ($nextsco->parent == $sco->identifier)))) {
$sublist++;
echo '<a href="#" onClick="expandCollide(img'.$sublist.','.$sublist.');"><img id="img'.$sublist.'" src="'.$CFG->wwwroot.'/mod/scorm/pix/minus.gif" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>';
echo '<a href="#" onClick="expandCollide(img'.$sublist.','.$sublist.');"><img id="img'.$sublist.'" src="'.$scormpixdir.'minus.gif" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>';
} else {
echo '<img src="'.$CFG->wwwroot.'/mod/scorm/pix/spacer.gif" />';
echo '<img src="'.$scormpixdir.'spacer.gif" />';
}
if (empty($sco->title)) {
$sco->title = $sco->identifier;
Expand All @@ -1134,7 +1135,7 @@ function scorm_display_structure($scorm,$liststyle,$currentorg='',$scoid='',$mod
$usertrack->status = 'notattempted';
}
$strstatus = get_string($usertrack->status,'scorm');
echo "<img src='".$CFG->wwwroot."/mod/scorm/pix/".$usertrack->status.".gif' alt='$strstatus' title='$strstatus' />";
echo "<img src='".$scormpixdir.$usertrack->status.".gif' alt='$strstatus' title='$strstatus' />";
if (($usertrack->status == 'notattempted') || ($usertrack->status == 'incomplete') || ($usertrack->status == 'browsed')) {
$incomplete = true;
if ($play && empty($scoid)) {
Expand All @@ -1149,10 +1150,10 @@ function scorm_display_structure($scorm,$liststyle,$currentorg='',$scoid='',$mod
$scoid = $sco->id;
}
if ($sco->scormtype == 'sco') {
echo '<img src="'.$CFG->wwwroot.'/mod/scorm/pix/notattempted.gif" alt="'.get_string('notattempted','scorm').'" title="'.get_string('notattempted','scorm').'" />';
echo '<img src="'.$scormpixdir.'notattempted.gif" alt="'.get_string('notattempted','scorm').'" title="'.get_string('notattempted','scorm').'" />';
$incomplete = true;
} else {
echo '<img src="'.$CFG->wwwroot.'/mod/scorm/pix/asset.gif" alt="'.get_string('asset','scorm').'" title="'.get_string('asset','scorm').'" />';
echo '<img src="'.$scormpixdir.'asset.gif" alt="'.get_string('asset','scorm').'" title="'.get_string('asset','scorm').'" />';
}
}
if ($sco->id == $scoid) {
Expand Down
11 changes: 5 additions & 6 deletions mod/scorm/playscorm.php
Expand Up @@ -95,9 +95,6 @@
<tr>
<th>
<div class="structurehead"><?php print_string('coursestruct','scorm') ?></div>
<!--<div class="popupbutton">
<a href='#' onClick='popup(main,popupimg);'><img id='popupimg' src="pix/popup.gif" alt="<?php echo $strpopup ?>" title="<?php echo $strpopup ?>"/></a>
</div> -->
</th>
</tr>
<tr><td class="top">
Expand All @@ -118,6 +115,8 @@
$SESSION->scorm_status = 'Not Initialized';
$SESSION->scorm_mode = $mode;

$scormpixdir = $CFG->modpixpath."/scorm/pix/";

?>
<script language="JavaScript" type="text/javascript" src="request.js"></script>
<script language="JavaScript" type="text/javascript" src="api.php?id=<?php echo $cm->id.$scoidstring.$modestring ?>"></script>
Expand Down Expand Up @@ -151,7 +150,7 @@ function playSCO(scoid) {

function popup(win,image) {
win = window.open("loadSCO.php?id=<?php echo $cm->id.$scoidstring.$modestring ?>","","width=<?php echo $scorm->width ?>,height=<?php echo $scorm->height ?>,scrollbars=1");
image.src = "pix/popdown.gif";
image.src = "<?php echo $scormpixdir ?>popdown.gif";
return win;
}

Expand All @@ -170,10 +169,10 @@ function expandCollide(which,list) {
var mid=w3c?").style":".style";

if (eval(beg+list+mid+".display") != "none") {
which.src = "pix/plus.gif";
which.src = "<?php echo $scormpixdir ?>plus.gif";
eval(beg+list+mid+".display='none';");
} else {
which.src = "pix/minus.gif";
which.src = "<?php echo $scormpixdir ?>minus.gif";
eval(beg+list+mid+".display='block';");
}
}
Expand Down
7 changes: 5 additions & 2 deletions mod/scorm/report.php
Expand Up @@ -68,6 +68,9 @@
}
print_heading(format_string($scorm->name));
}

$scormpixdir = $CFG->modpixpath."/scorm/pix/";

if (!empty($id)) {
if ($scoes = get_records_select("scorm_scoes","scorm='$scorm->id' ORDER BY id")) {
if ($scousers=get_records_select("scorm_scoes_track", "scormid='$scorm->id' GROUP BY userid,scormid", "", "userid,scormid")) {
Expand Down Expand Up @@ -112,7 +115,7 @@
$trackdata->total_time = '';
}
$strstatus = get_string($trackdata->status,'scorm');
$row[] = $anchorstart.'<img src="pix/'.$trackdata->status.'.gif" alt="'.$strstatus.'" title="'.
$row[] = $anchorstart.'<img src="'.$scormpixdir.$trackdata->status.'.gif" alt="'.$strstatus.'" title="'.
$strstatus.'">&nbsp;'.$trackdata->total_time.$scoreview.$anchorend;
}
}
Expand Down Expand Up @@ -146,7 +149,7 @@
$trackdata->total_time = '';
}
$strstatus = get_string($trackdata->status,'scorm');
echo '<img src="pix/'.$trackdata->status.'.gif" alt="'.$strstatus.'" title="'.
echo '<img src="'.$scormpixdir.$trackdata->status.'.gif" alt="'.$strstatus.'" title="'.
$strstatus.'">&nbsp;'.$trackdata->total_time.'<br />'.$scoreview.'<br />';
echo '</div>'."\n";
foreach($trackdata as $element => $value) {
Expand Down
6 changes: 4 additions & 2 deletions mod/scorm/view.php
Expand Up @@ -131,6 +131,8 @@
echo '<input type="hidden" name="mode" value="review" />'."\n";
}
}

$scormpixdir = $CFG->modpixpath."/scorm/pix/";
?>
<br />
<input type="hidden" name="scoid" />
Expand All @@ -152,10 +154,10 @@ function expandCollide(which,list) {
var mid=w3c?").style":".style";

if (eval(beg+list+mid+".display") != "none") {
which.src = "pix/plus.gif";
which.src = "<?php echo $scormpixdir ?>plus.gif";
eval(beg+list+mid+".display='none';");
} else {
which.src = "pix/minus.gif";
which.src = "<?php echo $scormpixdir ?>minus.gif";
eval(beg+list+mid+".display='block';");
}
}
Expand Down

0 comments on commit 3a19de6

Please sign in to comment.