Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plugins bot
moodle-plugins-snapshots
Commits
7a2121d7
Commit
7a2121d7
authored
Jan 31, 2017
by
Andrew Nicols
Browse files
Merge branch 'wip-MDL-57785-master' of
git://github.com/amygroshek/moodle
parents
ca12fb54
c178ba72
Changes
2
Hide whitespace changes
Inline
Side-by-side
mod/scorm/datamodels/scorm_12.js
View file @
7a2121d7
...
...
@@ -16,7 +16,8 @@
//
// SCORM 1.2 API Implementation
//
function
SCORMapi1_2
(
def
,
cmiobj
,
cmiint
,
cmistring256
,
cmistring4096
,
scormdebugging
,
scormauto
,
scormid
,
cfgwwwroot
,
sesskey
,
scoid
,
attempt
,
viewmode
,
cmid
,
currentorg
,
autocommit
,
masteryoverride
)
{
function
SCORMapi1_2
(
def
,
cmiobj
,
cmiint
,
cmistring256
,
cmistring4096
,
scormdebugging
,
scormauto
,
scormid
,
cfgwwwroot
,
sesskey
,
scoid
,
attempt
,
viewmode
,
cmid
,
currentorg
,
autocommit
,
masteryoverride
,
hidetoc
)
{
var
prerequrl
=
cfgwwwroot
+
"
/mod/scorm/prereqs.php?a=
"
+
scormid
+
"
&scoid=
"
+
scoid
+
"
&attempt=
"
+
attempt
+
"
&mode=
"
+
viewmode
+
"
¤torg=
"
+
currentorg
+
"
&sesskey=
"
+
sesskey
;
var
datamodelurl
=
cfgwwwroot
+
"
/mod/scorm/datamodel.php
"
;
...
...
@@ -413,12 +414,17 @@ function SCORMapi1_2(def, cmiobj, cmiint, cmistring256, cmistring4096, scormdebu
if
(
param
==
""
)
{
if
(
Initialized
)
{
result
=
StoreData
(
cmi
,
false
);
// trigger TOC update
var
callback
=
M
.
mod_scorm
.
connectPrereqCallback
;
YUI
().
use
(
'
io-base
'
,
function
(
Y
)
{
Y
.
on
(
'
io:complete
'
,
callback
.
success
,
Y
);
Y
.
io
(
prerequrl
);
});
// Trigger TOC update only if TOC is displayed.
// Checks against setting Display course structure in player:
// 0 = To the side, 1 = Hidden, 2 = In a drop down menu, 3 = Disabled
if
(
hidetoc
!==
'
3
'
)
{
Y
.
log
(
'
Refreshing toc
'
);
var
callback
=
M
.
mod_scorm
.
connectPrereqCallback
;
YUI
().
use
(
'
io-base
'
,
function
(
Y
)
{
Y
.
on
(
'
io:complete
'
,
callback
.
success
,
Y
);
Y
.
io
(
prerequrl
);
});
}
if
(
scormdebugging
)
{
LogAPICall
(
"
Commit
"
,
param
,
""
,
0
);
}
...
...
@@ -659,6 +665,8 @@ function SCORMapi1_2(def, cmiobj, cmiint, cmistring256, cmistring4096, scormdebu
M
.
scorm_api
=
{};
M
.
scorm_api
.
init
=
function
(
Y
,
def
,
cmiobj
,
cmiint
,
cmistring256
,
cmistring4096
,
scormdebugging
,
scormauto
,
scormid
,
cfgwwwroot
,
sesskey
,
scoid
,
attempt
,
viewmode
,
cmid
,
currentorg
,
autocommit
,
masteryoverride
)
{
window
.
API
=
new
SCORMapi1_2
(
def
,
cmiobj
,
cmiint
,
cmistring256
,
cmistring4096
,
scormdebugging
,
scormauto
,
scormid
,
cfgwwwroot
,
sesskey
,
scoid
,
attempt
,
viewmode
,
cmid
,
currentorg
,
autocommit
,
masteryoverride
);
M
.
scorm_api
.
init
=
function
(
Y
,
def
,
cmiobj
,
cmiint
,
cmistring256
,
cmistring4096
,
scormdebugging
,
scormauto
,
scormid
,
cfgwwwroot
,
sesskey
,
scoid
,
attempt
,
viewmode
,
cmid
,
currentorg
,
autocommit
,
masteryoverride
,
hidetoc
)
{
window
.
API
=
new
SCORMapi1_2
(
def
,
cmiobj
,
cmiint
,
cmistring256
,
cmistring4096
,
scormdebugging
,
scormauto
,
scormid
,
cfgwwwroot
,
sesskey
,
scoid
,
attempt
,
viewmode
,
cmid
,
currentorg
,
autocommit
,
masteryoverride
,
hidetoc
);
}
mod/scorm/datamodels/scorm_12.php
View file @
7a2121d7
...
...
@@ -55,11 +55,12 @@ $scorm->autocommit = ($scorm->autocommit === "1") ? true : false;
$scorm
->
masteryoverride
=
(
$scorm
->
masteryoverride
===
"1"
)
?
true
:
false
;
$PAGE
->
requires
->
js_init_call
(
'M.scorm_api.init'
,
array
(
$def
,
$cmiobj
,
$cmiint
,
$cmistring256
,
$cmistring4096
,
scorm_debugging
(
$scorm
),
$scorm
->
auto
,
$scorm
->
id
,
$CFG
->
wwwroot
,
sesskey
(),
$scoid
,
$attempt
,
$mode
,
$id
,
$currentorg
,
$scorm
->
autocommit
,
$scorm
->
masteryoverride
));
sesskey
(),
$scoid
,
$attempt
,
$mode
,
$id
,
$currentorg
,
$scorm
->
autocommit
,
$scorm
->
masteryoverride
,
$scorm
->
hidetoc
));
// Pull in the debugging utilities.
if
(
scorm_debugging
(
$scorm
))
{
require_once
(
$CFG
->
dirroot
.
'/mod/scorm/datamodels/debug.js.php'
);
echo
html_writer
::
script
(
'AppendToLog("Moodle SCORM 1.2 API Loaded, Activity: '
.
$scorm
->
name
.
', SCO: '
.
$sco
->
identifier
.
'", 0);'
);
}
\ No newline at end of file
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment