Skip to content

Commit

Permalink
Rename XTSetAttendace to XTSetViewed
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Reijnders committed Mar 15, 2018
1 parent 5e7736d commit 90aa489
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 11 deletions.
Expand Up @@ -578,7 +578,7 @@ function XTSetPageScoreJSON(page_nr, score)
state.setPageScore(page_nr, score);
}

function XTSetAttendance(page_nr, name, score)
function XTSetViewed(page_nr, name, score)
{
state.setPageScore(page_nr, score);
}
Expand Down
2 changes: 1 addition & 1 deletion modules/xerte/pedit/xttracking_pedit.js
Expand Up @@ -605,7 +605,7 @@ function XTSetPageScoreJSON(page_nr, score)
state.setPageScore(page_nr, score);
}

function XTSetAttendance(page_nr, name, score)
function XTSetViewed(page_nr, name, score)
{
state.setPageScore(page_nr, score);
}
Expand Down
12 changes: 10 additions & 2 deletions modules/xerte/pedit/xttracking_xapi_pedit.js
Expand Up @@ -91,7 +91,8 @@ function XApiTrackingState()

function initialise()
{

this.ALOConnectionPoint = new ALOConnection();
this.ALOConnectionPoint.handshake();
}

function formatDate(d)
Expand Down Expand Up @@ -1891,6 +1892,9 @@ function XTSetPageScore(page_nr, score, page_name)
completion: true,
success: score >= state.lo_passed,
score: {
min: 0.0,
max: 100.0,
raw: score,
scaled: score / 100
},
duration: calcDuration(this.pageStart, this.pageEnd)
Expand Down Expand Up @@ -1952,6 +1956,9 @@ function XTSetPageScoreJSON(page_nr, score, JSONGraph, page_name)
completion: true,
success: score >= state.lo_passed,
score: {
min: 0.0,
max: 100.0,
raw: score,
scaled: score / 100
},
duration: calcDuration(this.pageStart, this.pageEnd),
Expand Down Expand Up @@ -2160,7 +2167,7 @@ function XTSendScoreToPedIT()


function XTTerminate() {
XTSendScoreToPedIT();

if (!state.finished) {
var currentpageid = "";
state.finished = true;
Expand Down Expand Up @@ -2370,6 +2377,7 @@ function XTTerminate() {
);
SaveStatement(statement, false);
}
XTSendScoreToPedIT();
window.opener.innerWidth += 2;
window.opener.innerWidth -= 2;
}
Expand Down
10 changes: 7 additions & 3 deletions modules/xerte/play.php
Expand Up @@ -99,9 +99,7 @@ function show_template_page($row, $datafile="", $tsugi_enabled = false)
if($tsugi_enabled) {
$rlo_object_file = "rloObject.htm";

if($row["tsugi_xapi_enabled"] == 1) {
$tracking_js_file = array($flash_js_dir . "xAPI/xttracking_xapi.js");
}

if ($pedit_enabled)
{
if($row["tsugi_xapi_enabled"] == 1) {
Expand All @@ -112,6 +110,12 @@ function show_template_page($row, $datafile="", $tsugi_enabled = false)
$tracking_js_file = array($flash_js_dir . "pedit/ALOConnection.js", $flash_js_dir . "pedit/xttracking_pedit.js");
}
}
else
{
if($row["tsugi_xapi_enabled"] == 1) {
$tracking_js_file = array($flash_js_dir . "xAPI/xttracking_xapi.js");
}
}
}else{
$rlo_object_file = "rloObject.htm";
}
Expand Down
11 changes: 9 additions & 2 deletions modules/xerte/scorm1.2/xttracking_scorm1.2.js
Expand Up @@ -1475,8 +1475,15 @@ function XTSetPageType(page_nr, page_type, nrinteractions, weighting)
}
}

function XTSetAttendance(page_nr, name, score, page_name) {

function XTSetViewed(page_nr, name, score, page_name) {
if (state.scormmode == 'normal')
{
var sit = state.findPage(page_nr);
if (sit != null && (state.scoremode != 'first' || sit.count < 1))
{
sit.score = score;
}
}
}

function XTSetPageScore(page_nr, score, page_name)
Expand Down
11 changes: 9 additions & 2 deletions modules/xerte/scorm2004.3rd/xttracking_scorm2004.3rd.js
Expand Up @@ -1457,8 +1457,15 @@ function XTSetPageType(page_nr, page_type, nrinteractions, weighting)
}
}

function XTSetAttendance(page_nr, name, score, page_name) {

function XTSetViewed(page_nr, name, score, page_name) {
if (state.scormmode == 'normal')
{
var sit = state.findPage(page_nr);
if (sit != null && (state.scoremode != 'first' || sit.count < 1))
{
sit.score = score;
}
}
}

function XTSetPageScore(page_nr, score, page_name)
Expand Down

0 comments on commit 90aa489

Please sign in to comment.