mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Fixed some typos
This commit is contained in:
parent
e3cc2a8084
commit
ae377545b7
@ -10,8 +10,9 @@ CREATE TABLE prefix_scorm (
|
||||
version varchar(9) NOT NULL default '',
|
||||
maxgrade float(3) NOT NULL default '0',
|
||||
grademethod tinyint(2) NOT NULL default '0',
|
||||
launch int(10) unsigned NOT NULL default 0,
|
||||
launch int(10) unsigned NOT NULL default '0',
|
||||
summary text NOT NULL,
|
||||
browsemode tinyint(2) NOT NULL default '0',
|
||||
auto tinyint(1) unsigned NOT NULL default '0',
|
||||
timemodified int(10) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (id),
|
||||
|
@ -11,6 +11,7 @@ CREATE TABLE prefix_scorm (
|
||||
grademethod integer NOT NULL default '0',
|
||||
launch integer NOT NULL default '0',
|
||||
summary text NOT NULL default '',
|
||||
browsemode integer NOT NULL default '0',
|
||||
auto integer NOT NULL default '0',
|
||||
timemodified integer NOT NULL default '0'
|
||||
);
|
||||
|
@ -162,81 +162,58 @@ function scorm_grades($scormid) {
|
||||
if (!$scorm = get_record('scorm', 'id', $scormid)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!$scoes = get_records('scorm_scoes','scorm',$scormid)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ($scorm->grademethod == VALUESCOES) {
|
||||
if (!$return->maxgrade = count_records_select('scorm_scoes',"scorm='$scormid' AND launch<>''")) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
$return->grades = NULL;
|
||||
if ($scousers=get_records_select('scorm_scoes_track', "scormid='$scormid' GROUP BY userid")) {
|
||||
foreach ($scousers as $scouser) {
|
||||
$userdata=get_records_select('scorm_scoes_track',"scormid='$scormid' AND userid='$scouser->userid' AND element='cmi_core_lesson_status'");
|
||||
$scores->completed=0;
|
||||
$scores->browsed=0;
|
||||
$scores->incomplete=0;
|
||||
$scores->failed=0;
|
||||
$scores->notattempted=0;
|
||||
$result='';
|
||||
$data = current($userdata);
|
||||
foreach ($userdata as $data) {
|
||||
if ($data->value=='passed')
|
||||
$scores->completed++;
|
||||
else
|
||||
$scores->{scorm_remove_spaces($data->value)}++;
|
||||
}
|
||||
if ($scores->completed)
|
||||
$result.='<img src="'.$CFG->wwwroot.'/mod/scorm/pix/completed.gif" alt="'.get_string('completed','scorm').'" title="'.get_string('completed','scorm').'" /> '.$scores->completed;
|
||||
if ($scores->incomplete)
|
||||
$result.="<img src=\"$CFG->wwwroot/mod/scorm/pix/incomplete.gif\" alt=\"".get_string('incomplete','scorm')."\" title=\"".get_string('incomplete','scorm')."\" /> $scores->incomplete ";
|
||||
if ($scores->failed)
|
||||
$result.="<img src=\"$CFG->wwwroot/mod/scorm/pix/failed.gif\" alt=\"".get_string('failed','scorm')."\" title=\"".get_string('failed','scorm')."\" /> $scores->failed ";
|
||||
if ($scores->browsed)
|
||||
$result.="<img src=\"$CFG->wwwroot/mod/scorm/pix/browsed.gif\" alt=\"".get_string('browsed','scorm')."\" title=\"".get_string('browsed','scorm')."\" /> $scores->browsed ";
|
||||
if ($scores->notattempted)
|
||||
$result.="<img src=\"$CFG->wwwroot/mod/scorm/pix/notattempted.gif\" alt=\"".get_string('notattempted','scorm')."\" title=\"".get_string('notattempted','scorm')."\" /> $scores->notattempted ";
|
||||
|
||||
$return->grades[$scouser->userid]=$result;
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
$grades = get_records_select('scorm_scoes_track', "scormid=$scormid AND element='cmi_core_score_raw' AND value<>''",'','id,userid,value');
|
||||
//$grades = get_records_menu("scorm_scoes_track", "scormid",$scormid,"","userid,cmi_core_score_raw");
|
||||
$valutations = array();
|
||||
foreach ($grades as $grade) {
|
||||
if (!isset($valutations[$grade->userid])) {
|
||||
if ($scorm->grademethod == VALUEAVERAGE) {
|
||||
$values = array();
|
||||
$values[$grade->userid]->grade = 0;
|
||||
$values[$grade->userid]->values = 0;
|
||||
}
|
||||
$valutations[$grade->userid] = 0;
|
||||
}
|
||||
switch ($scorm->grademethod) {
|
||||
case VALUEHIGHEST:
|
||||
if ($grade->value > $valutations[$grade->userid]) {
|
||||
$valutations[$grade->userid] = $grade->value;
|
||||
}
|
||||
break;
|
||||
case VALUEAVERAGE:
|
||||
$values[$grade->userid]->grade += $grade->value;
|
||||
$values[$grade->userid]->values++;
|
||||
break;
|
||||
case VALUESUM:
|
||||
$valutations[$grade->userid] += $grade->value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($scorm->grademethod == VALUEAVERAGE) {
|
||||
foreach($values as $userid => $value) {
|
||||
$valutations[$userid] = $value->grade/$value->values;
|
||||
}
|
||||
}
|
||||
//print_r($grades);
|
||||
$return->grades = $valutations;
|
||||
$return->maxgrade = $scorm->maxgrade;
|
||||
}
|
||||
|
||||
$return->grades = NULL;
|
||||
if ($scousers=get_records_select('scorm_scoes_track', "scormid='$scormid' GROUP BY userid")) {
|
||||
foreach ($scousers as $scouser) {
|
||||
$scores = NULL;
|
||||
$scores->scoes = 0;
|
||||
$scores->values = 0;
|
||||
$scores->max = 0;
|
||||
$scores->sum = 0;
|
||||
|
||||
foreach ($scoes as $sco) {
|
||||
$userdata=scorm_get_tracks($sco->id, $scouser->userid);
|
||||
if (($userdata->status == 'completed') || ($userdata->status == 'passed')) {
|
||||
$scores->scoes++;
|
||||
}
|
||||
if (!empty($userdata->score_raw)) {
|
||||
$scores->values++;
|
||||
$scores->sum += $userdata->score_raw;
|
||||
$scores->max = ($userdata->score_raw > $scores->max)?$userdata->score_raw:$scores->max;
|
||||
}
|
||||
}
|
||||
switch ($scorm->grademethod) {
|
||||
case VALUEHIGHEST:
|
||||
$return->grades[$scouser->userid] = $scores->max;
|
||||
break;
|
||||
case VALUEAVERAGE:
|
||||
if ($score->values > 0) {
|
||||
$return->grades[$scouser->userid] = $scores->sum/$scores->values;
|
||||
} else {
|
||||
$return->grades[$scouser->userid] = 0;
|
||||
}
|
||||
break;
|
||||
case VALUESUM:
|
||||
$return->grades[$scouser->userid] = $scores->sum;
|
||||
break;
|
||||
case VALUESCOES:
|
||||
$return->grades[$scouser->userid] = $scores->scoes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,7 @@
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="text/javascript" src="<?php p($CFG->wwwroot) ?>/mod/scorm/request.js" >
|
||||
</script>
|
||||
<script type="text/javascript" src="<?php p($CFG->wwwroot) ?>/mod/scorm/request.js" ></script>
|
||||
<script type="text/javascript">
|
||||
function validate_scorm(theform,filename) {
|
||||
//alert(filename);
|
||||
@ -98,6 +97,14 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function checkmethod (grademethod,maxgrade) {
|
||||
if (grademethod.options[grademethod.selectedIndex].value == 0) {
|
||||
maxgrade.disabled=true;
|
||||
} else {
|
||||
maxgrade.disabled=false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<form name="form" method="post" action="mod.php" onsubmit="return validate_scorm(document.form,document.form.reference.value);">
|
||||
@ -139,7 +146,7 @@
|
||||
<td align="right"><b><?php print_string("grademethod", "scorm") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
choose_from_menu($SCORM_GRADE_METHOD, "grademethod", "$form->grademethod", "");
|
||||
choose_from_menu($SCORM_GRADE_METHOD, 'grademethod', "$form->grademethod", '','checkmethod(this,document.form.maxgrade);');
|
||||
helpbutton("grademethod", get_string("grademethod","scorm"), "scorm");
|
||||
?>
|
||||
</td>
|
||||
@ -151,9 +158,9 @@
|
||||
for ($i=100; $i>=1; $i--) {
|
||||
$grades[$i] = $i;
|
||||
}
|
||||
|
||||
choose_from_menu($grades, "maxgrade", "$form->maxgrade", "");
|
||||
helpbutton("maxgrade", get_string("maximumgrade"), "scorm");
|
||||
$disabled = $form->grademethod=='0';
|
||||
choose_from_menu($grades, 'maxgrade', "$form->maxgrade", '','','0',false,$disabled);
|
||||
helpbutton('maxgrade', get_string('maximumgrade'), 'scorm');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
@ -185,8 +192,6 @@
|
||||
<input type="hidden" name="datadir" value="<?php p($form->datadir) ?>" />
|
||||
<input type="hidden" name="pkgtype" value="<?php p($form->pkgtype) ?>" />
|
||||
<input type="hidden" name="launch" value="<?php p($form->launch) ?>" />
|
||||
<!-- <input type="hidden" name="maxgrade" value="<?php p($form->maxgrade) ?>" />
|
||||
<input type="hidden" name="grademethod" value="<?php p($form->grademethod) ?>" />-->
|
||||
|
||||
<input type="hidden" name="course" value="<?php p($form->course) ?>" />
|
||||
<input type="hidden" name="sesskey" value="<?php p($form->sesskey) ?>" />
|
||||
|
@ -91,6 +91,7 @@
|
||||
|
||||
foreach ($scousers as $scouser) {
|
||||
if ($userdata = scorm_get_user_data($scouser->userid)) {
|
||||
$row = '';
|
||||
$row[] = print_user_picture($scouser->userid, $course->id, $userdata->picture, false, true);
|
||||
$row[] = "<a href=\"$CFG->wwwroot/user/view.php?id=$scouser->userid&course=$course->id\">".
|
||||
"$userdata->firstname $userdata->lastname</a>";
|
||||
|
Loading…
x
Reference in New Issue
Block a user