@learnpack/learnpack 5.0.335 → 5.0.339
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/run +17 -17
- package/lib/commands/init.js +41 -41
- package/lib/commands/serve.js +589 -126
- package/lib/creatorDist/assets/index-BhqDgBS9.js +8448 -78631
- package/lib/creatorDist/assets/index-CjddKHB_.css +1 -1688
- package/lib/managers/config/exercise.js +2 -14
- package/lib/managers/readmeHistoryService.js +3 -1
- package/lib/managers/server/routes.js +2 -1
- package/lib/utils/configBuilder.js +2 -1
- package/lib/utils/creatorUtilities.js +14 -14
- package/lib/utils/exerciseFileOrder.d.ts +20 -0
- package/lib/utils/exerciseFileOrder.js +49 -0
- package/lib/utils/export/epub.js +26 -26
- package/lib/utils/readmeSanitizer.d.ts +8 -0
- package/lib/utils/readmeSanitizer.js +13 -0
- package/lib/utils/templates/epub/epub.css +146 -146
- package/lib/utils/templates/scorm/config/api.js +175 -175
- package/package.json +1 -1
- package/src/commands/init.ts +655 -655
- package/src/commands/publish.ts +670 -670
- package/src/commands/serve.ts +5853 -5216
- package/src/creator/eslint.config.js +28 -28
- package/src/creator/src/index.css +227 -227
- package/src/creator/src/utils/lib.ts +471 -471
- package/src/creatorDist/assets/index-BhqDgBS9.js +8448 -78631
- package/src/creatorDist/assets/index-CjddKHB_.css +1 -1688
- package/src/managers/config/exercise.ts +3 -15
- package/src/managers/readmeHistoryService.ts +3 -1
- package/src/managers/server/routes.ts +15 -6
- package/src/managers/session.ts +184 -184
- package/src/ui/_app/app.css +1 -1
- package/src/ui/_app/app.js +1950 -1878
- package/src/ui/app.tar.gz +0 -0
- package/src/utils/api.ts +675 -675
- package/src/utils/configBuilder.ts +102 -100
- package/src/utils/creatorUtilities.ts +536 -536
- package/src/utils/errors.ts +108 -108
- package/src/utils/exerciseFileOrder.ts +50 -0
- package/src/utils/export/epub.ts +553 -553
- package/src/utils/export/index.ts +4 -4
- package/src/utils/export/scorm.ts +121 -121
- package/src/utils/export/shared.ts +61 -61
- package/src/utils/export/types.ts +25 -25
- package/src/utils/export/zip.ts +55 -55
- package/src/utils/readmeSanitizer.ts +10 -0
- package/src/utils/rigoActions.ts +642 -642
- package/src/utils/templates/epub/epub.css +146 -146
- package/src/utils/templates/scorm/config/api.js +175 -175
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
/* Basic EPUB styling */
|
|
2
|
-
body {
|
|
3
|
-
font-family: "Georgia", serif;
|
|
4
|
-
line-height: 1.6;
|
|
5
|
-
margin: 2em;
|
|
6
|
-
color: #333;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
h1,
|
|
10
|
-
h2,
|
|
11
|
-
h3,
|
|
12
|
-
h4,
|
|
13
|
-
h5,
|
|
14
|
-
h6 {
|
|
15
|
-
color: #2c3e50;
|
|
16
|
-
margin-top: 1.5em;
|
|
17
|
-
margin-bottom: 0.5em;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
h1 {
|
|
21
|
-
font-size: 2em;
|
|
22
|
-
border-bottom: 2px solid #3498db;
|
|
23
|
-
padding-bottom: 0.3em;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
h2 {
|
|
27
|
-
font-size: 1.5em;
|
|
28
|
-
border-bottom: 1px solid #bdc3c7;
|
|
29
|
-
padding-bottom: 0.2em;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
p {
|
|
33
|
-
margin-bottom: 1em;
|
|
34
|
-
text-align: justify;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
code {
|
|
38
|
-
background-color: #f8f9fa;
|
|
39
|
-
padding: 0.2em 0.4em;
|
|
40
|
-
border-radius: 3px;
|
|
41
|
-
font-family: "Courier New", monospace;
|
|
42
|
-
font-size: 0.9em;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
pre {
|
|
46
|
-
background-color: #f8f9fa;
|
|
47
|
-
padding: 1em;
|
|
48
|
-
border-radius: 5px;
|
|
49
|
-
overflow-x: auto;
|
|
50
|
-
border-left: 4px solid #3498db;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
pre code {
|
|
54
|
-
background-color: transparent;
|
|
55
|
-
padding: 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
blockquote {
|
|
59
|
-
border-left: 4px solid #bdc3c7;
|
|
60
|
-
margin: 1em 0;
|
|
61
|
-
padding-left: 1em;
|
|
62
|
-
font-style: italic;
|
|
63
|
-
color: #7f8c8d;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
ul,
|
|
67
|
-
ol {
|
|
68
|
-
margin-bottom: 1em;
|
|
69
|
-
padding-left: 2em;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
li {
|
|
73
|
-
margin-bottom: 0.5em;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
a {
|
|
77
|
-
color: #3498db;
|
|
78
|
-
text-decoration: none;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
a:hover {
|
|
82
|
-
text-decoration: underline;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
img {
|
|
86
|
-
max-width: 100%;
|
|
87
|
-
height: auto;
|
|
88
|
-
display: block;
|
|
89
|
-
margin: 1em auto;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
table {
|
|
93
|
-
border-collapse: collapse;
|
|
94
|
-
width: 100%;
|
|
95
|
-
margin: 1em 0;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
th,
|
|
99
|
-
td {
|
|
100
|
-
border: 1px solid #ddd;
|
|
101
|
-
padding: 8px;
|
|
102
|
-
text-align: left;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
th {
|
|
106
|
-
background-color: #f2f2f2;
|
|
107
|
-
font-weight: bold;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
#toc {
|
|
111
|
-
background-color: #f8f9fa;
|
|
112
|
-
padding: 1em;
|
|
113
|
-
border-radius: 5px;
|
|
114
|
-
margin-bottom: 2em;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
#toc h2 {
|
|
118
|
-
border-bottom: none;
|
|
119
|
-
margin-top: 0;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
#toc ol {
|
|
123
|
-
padding-left: 1em;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
#toc li {
|
|
127
|
-
margin-bottom: 0.3em;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
#toc a {
|
|
131
|
-
color: #2c3e50;
|
|
132
|
-
font-weight: 500;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/* Open question styles */
|
|
136
|
-
.open-question {
|
|
137
|
-
border: 1px solid #c2c2c2;
|
|
138
|
-
padding: 1em;
|
|
139
|
-
background-color: #fafafa;
|
|
140
|
-
margin: 1em 0;
|
|
141
|
-
width: 100%;
|
|
142
|
-
height: 150px;
|
|
143
|
-
color: #c2c2c2;
|
|
144
|
-
border-radius: 5px;
|
|
145
|
-
font-style: italic;
|
|
146
|
-
}
|
|
1
|
+
/* Basic EPUB styling */
|
|
2
|
+
body {
|
|
3
|
+
font-family: "Georgia", serif;
|
|
4
|
+
line-height: 1.6;
|
|
5
|
+
margin: 2em;
|
|
6
|
+
color: #333;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
h1,
|
|
10
|
+
h2,
|
|
11
|
+
h3,
|
|
12
|
+
h4,
|
|
13
|
+
h5,
|
|
14
|
+
h6 {
|
|
15
|
+
color: #2c3e50;
|
|
16
|
+
margin-top: 1.5em;
|
|
17
|
+
margin-bottom: 0.5em;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
h1 {
|
|
21
|
+
font-size: 2em;
|
|
22
|
+
border-bottom: 2px solid #3498db;
|
|
23
|
+
padding-bottom: 0.3em;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
h2 {
|
|
27
|
+
font-size: 1.5em;
|
|
28
|
+
border-bottom: 1px solid #bdc3c7;
|
|
29
|
+
padding-bottom: 0.2em;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
p {
|
|
33
|
+
margin-bottom: 1em;
|
|
34
|
+
text-align: justify;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
code {
|
|
38
|
+
background-color: #f8f9fa;
|
|
39
|
+
padding: 0.2em 0.4em;
|
|
40
|
+
border-radius: 3px;
|
|
41
|
+
font-family: "Courier New", monospace;
|
|
42
|
+
font-size: 0.9em;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
pre {
|
|
46
|
+
background-color: #f8f9fa;
|
|
47
|
+
padding: 1em;
|
|
48
|
+
border-radius: 5px;
|
|
49
|
+
overflow-x: auto;
|
|
50
|
+
border-left: 4px solid #3498db;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
pre code {
|
|
54
|
+
background-color: transparent;
|
|
55
|
+
padding: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
blockquote {
|
|
59
|
+
border-left: 4px solid #bdc3c7;
|
|
60
|
+
margin: 1em 0;
|
|
61
|
+
padding-left: 1em;
|
|
62
|
+
font-style: italic;
|
|
63
|
+
color: #7f8c8d;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
ul,
|
|
67
|
+
ol {
|
|
68
|
+
margin-bottom: 1em;
|
|
69
|
+
padding-left: 2em;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
li {
|
|
73
|
+
margin-bottom: 0.5em;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
a {
|
|
77
|
+
color: #3498db;
|
|
78
|
+
text-decoration: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
a:hover {
|
|
82
|
+
text-decoration: underline;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
img {
|
|
86
|
+
max-width: 100%;
|
|
87
|
+
height: auto;
|
|
88
|
+
display: block;
|
|
89
|
+
margin: 1em auto;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
table {
|
|
93
|
+
border-collapse: collapse;
|
|
94
|
+
width: 100%;
|
|
95
|
+
margin: 1em 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
th,
|
|
99
|
+
td {
|
|
100
|
+
border: 1px solid #ddd;
|
|
101
|
+
padding: 8px;
|
|
102
|
+
text-align: left;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
th {
|
|
106
|
+
background-color: #f2f2f2;
|
|
107
|
+
font-weight: bold;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
#toc {
|
|
111
|
+
background-color: #f8f9fa;
|
|
112
|
+
padding: 1em;
|
|
113
|
+
border-radius: 5px;
|
|
114
|
+
margin-bottom: 2em;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
#toc h2 {
|
|
118
|
+
border-bottom: none;
|
|
119
|
+
margin-top: 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
#toc ol {
|
|
123
|
+
padding-left: 1em;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
#toc li {
|
|
127
|
+
margin-bottom: 0.3em;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
#toc a {
|
|
131
|
+
color: #2c3e50;
|
|
132
|
+
font-weight: 500;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* Open question styles */
|
|
136
|
+
.open-question {
|
|
137
|
+
border: 1px solid #c2c2c2;
|
|
138
|
+
padding: 1em;
|
|
139
|
+
background-color: #fafafa;
|
|
140
|
+
margin: 1em 0;
|
|
141
|
+
width: 100%;
|
|
142
|
+
height: 150px;
|
|
143
|
+
color: #c2c2c2;
|
|
144
|
+
border-radius: 5px;
|
|
145
|
+
font-style: italic;
|
|
146
|
+
}
|
|
@@ -1,175 +1,175 @@
|
|
|
1
|
-
var findAPITries = 0;
|
|
2
|
-
|
|
3
|
-
function findAPI(win) {
|
|
4
|
-
while (win.API == null && win.parent != null && win.parent != win) {
|
|
5
|
-
findAPITries++;
|
|
6
|
-
|
|
7
|
-
if (findAPITries > 7) {
|
|
8
|
-
alert("Error finding API -- too deeply nested.");
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
win = win.parent;
|
|
13
|
-
}
|
|
14
|
-
return win.API;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function getAPI() {
|
|
18
|
-
var theAPI = findAPI(window);
|
|
19
|
-
|
|
20
|
-
if (
|
|
21
|
-
theAPI == null &&
|
|
22
|
-
window.opener != null &&
|
|
23
|
-
typeof window.opener != "undefined"
|
|
24
|
-
) {
|
|
25
|
-
theAPI = findAPI(window.opener);
|
|
26
|
-
}
|
|
27
|
-
if (theAPI == null) {
|
|
28
|
-
alert("Unable to find an API adapter");
|
|
29
|
-
}
|
|
30
|
-
return theAPI;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
var SCORM_TRUE = "true";
|
|
34
|
-
var SCORM_FALSE = "false";
|
|
35
|
-
var SCORM_NO_ERROR = "0";
|
|
36
|
-
|
|
37
|
-
var finishCalled = false;
|
|
38
|
-
|
|
39
|
-
var initialized = false;
|
|
40
|
-
|
|
41
|
-
var API = null;
|
|
42
|
-
|
|
43
|
-
function ScormProcessInitialize() {
|
|
44
|
-
var result;
|
|
45
|
-
|
|
46
|
-
API = getAPI();
|
|
47
|
-
|
|
48
|
-
if (API == null) {
|
|
49
|
-
alert(
|
|
50
|
-
"ERROR - Could not establish a connection with the LMS.\n\nYour results may not be recorded."
|
|
51
|
-
);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
result = API.LMSInitialize("");
|
|
56
|
-
|
|
57
|
-
if (result == SCORM_FALSE) {
|
|
58
|
-
var errorNumber = API.LMSGetLastError();
|
|
59
|
-
var errorString = API.LMSGetErrorString(errorNumber);
|
|
60
|
-
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
61
|
-
|
|
62
|
-
var errorDescription =
|
|
63
|
-
"Number: " +
|
|
64
|
-
errorNumber +
|
|
65
|
-
"\nDescription: " +
|
|
66
|
-
errorString +
|
|
67
|
-
"\nDiagnostic: " +
|
|
68
|
-
diagnostic;
|
|
69
|
-
|
|
70
|
-
alert(
|
|
71
|
-
"Error - Could not initialize communication with the LMS.\n\nYour results may not be recorded.\n\n" +
|
|
72
|
-
errorDescription
|
|
73
|
-
);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
initialized = true;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function ScormProcessFinish() {
|
|
81
|
-
var result;
|
|
82
|
-
|
|
83
|
-
if (initialized == false || finishCalled == true) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
result = API.LMSFinish("");
|
|
88
|
-
|
|
89
|
-
finishCalled = true;
|
|
90
|
-
|
|
91
|
-
if (result == SCORM_FALSE) {
|
|
92
|
-
var errorNumber = API.LMSGetLastError();
|
|
93
|
-
var errorString = API.LMSGetErrorString(errorNumber);
|
|
94
|
-
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
95
|
-
|
|
96
|
-
var errorDescription =
|
|
97
|
-
"Number: " +
|
|
98
|
-
errorNumber +
|
|
99
|
-
"\nDescription: " +
|
|
100
|
-
errorString +
|
|
101
|
-
"\nDiagnostic: " +
|
|
102
|
-
diagnostic;
|
|
103
|
-
|
|
104
|
-
alert(
|
|
105
|
-
"Error - Could not terminate communication with the LMS.\n\nYour results may not be recorded.\n\n" +
|
|
106
|
-
errorDescription
|
|
107
|
-
);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function ScormProcessGetValue(element) {
|
|
113
|
-
var result;
|
|
114
|
-
|
|
115
|
-
if (initialized == false || finishCalled == true) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
result = API.LMSGetValue(element);
|
|
120
|
-
|
|
121
|
-
if (result == "") {
|
|
122
|
-
var errorNumber = API.LMSGetLastError();
|
|
123
|
-
|
|
124
|
-
if (errorNumber != SCORM_NO_ERROR) {
|
|
125
|
-
var errorString = API.LMSGetErrorString(errorNumber);
|
|
126
|
-
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
127
|
-
|
|
128
|
-
var errorDescription =
|
|
129
|
-
"Number: " +
|
|
130
|
-
errorNumber +
|
|
131
|
-
"\nDescription: " +
|
|
132
|
-
errorString +
|
|
133
|
-
"\nDiagnostic: " +
|
|
134
|
-
diagnostic;
|
|
135
|
-
|
|
136
|
-
alert(
|
|
137
|
-
"Error - Could not retrieve a value from the LMS.\n\n" +
|
|
138
|
-
errorDescription
|
|
139
|
-
);
|
|
140
|
-
return "";
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return result;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function ScormProcessSetValue(element, value) {
|
|
148
|
-
var result;
|
|
149
|
-
|
|
150
|
-
if (initialized == false || finishCalled == true) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
result = API.LMSSetValue(element, value);
|
|
155
|
-
|
|
156
|
-
if (result == SCORM_FALSE) {
|
|
157
|
-
var errorNumber = API.LMSGetLastError();
|
|
158
|
-
var errorString = API.LMSGetErrorString(errorNumber);
|
|
159
|
-
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
160
|
-
|
|
161
|
-
var errorDescription =
|
|
162
|
-
"Number: " +
|
|
163
|
-
errorNumber +
|
|
164
|
-
"\nDescription: " +
|
|
165
|
-
errorString +
|
|
166
|
-
"\nDiagnostic: " +
|
|
167
|
-
diagnostic;
|
|
168
|
-
|
|
169
|
-
alert(
|
|
170
|
-
"Error - Could not store a value in the LMS.\n\nYour results may not be recorded.\n\n" +
|
|
171
|
-
errorDescription
|
|
172
|
-
);
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
1
|
+
var findAPITries = 0;
|
|
2
|
+
|
|
3
|
+
function findAPI(win) {
|
|
4
|
+
while (win.API == null && win.parent != null && win.parent != win) {
|
|
5
|
+
findAPITries++;
|
|
6
|
+
|
|
7
|
+
if (findAPITries > 7) {
|
|
8
|
+
alert("Error finding API -- too deeply nested.");
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
win = win.parent;
|
|
13
|
+
}
|
|
14
|
+
return win.API;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function getAPI() {
|
|
18
|
+
var theAPI = findAPI(window);
|
|
19
|
+
|
|
20
|
+
if (
|
|
21
|
+
theAPI == null &&
|
|
22
|
+
window.opener != null &&
|
|
23
|
+
typeof window.opener != "undefined"
|
|
24
|
+
) {
|
|
25
|
+
theAPI = findAPI(window.opener);
|
|
26
|
+
}
|
|
27
|
+
if (theAPI == null) {
|
|
28
|
+
alert("Unable to find an API adapter");
|
|
29
|
+
}
|
|
30
|
+
return theAPI;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var SCORM_TRUE = "true";
|
|
34
|
+
var SCORM_FALSE = "false";
|
|
35
|
+
var SCORM_NO_ERROR = "0";
|
|
36
|
+
|
|
37
|
+
var finishCalled = false;
|
|
38
|
+
|
|
39
|
+
var initialized = false;
|
|
40
|
+
|
|
41
|
+
var API = null;
|
|
42
|
+
|
|
43
|
+
function ScormProcessInitialize() {
|
|
44
|
+
var result;
|
|
45
|
+
|
|
46
|
+
API = getAPI();
|
|
47
|
+
|
|
48
|
+
if (API == null) {
|
|
49
|
+
alert(
|
|
50
|
+
"ERROR - Could not establish a connection with the LMS.\n\nYour results may not be recorded."
|
|
51
|
+
);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
result = API.LMSInitialize("");
|
|
56
|
+
|
|
57
|
+
if (result == SCORM_FALSE) {
|
|
58
|
+
var errorNumber = API.LMSGetLastError();
|
|
59
|
+
var errorString = API.LMSGetErrorString(errorNumber);
|
|
60
|
+
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
61
|
+
|
|
62
|
+
var errorDescription =
|
|
63
|
+
"Number: " +
|
|
64
|
+
errorNumber +
|
|
65
|
+
"\nDescription: " +
|
|
66
|
+
errorString +
|
|
67
|
+
"\nDiagnostic: " +
|
|
68
|
+
diagnostic;
|
|
69
|
+
|
|
70
|
+
alert(
|
|
71
|
+
"Error - Could not initialize communication with the LMS.\n\nYour results may not be recorded.\n\n" +
|
|
72
|
+
errorDescription
|
|
73
|
+
);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
initialized = true;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function ScormProcessFinish() {
|
|
81
|
+
var result;
|
|
82
|
+
|
|
83
|
+
if (initialized == false || finishCalled == true) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
result = API.LMSFinish("");
|
|
88
|
+
|
|
89
|
+
finishCalled = true;
|
|
90
|
+
|
|
91
|
+
if (result == SCORM_FALSE) {
|
|
92
|
+
var errorNumber = API.LMSGetLastError();
|
|
93
|
+
var errorString = API.LMSGetErrorString(errorNumber);
|
|
94
|
+
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
95
|
+
|
|
96
|
+
var errorDescription =
|
|
97
|
+
"Number: " +
|
|
98
|
+
errorNumber +
|
|
99
|
+
"\nDescription: " +
|
|
100
|
+
errorString +
|
|
101
|
+
"\nDiagnostic: " +
|
|
102
|
+
diagnostic;
|
|
103
|
+
|
|
104
|
+
alert(
|
|
105
|
+
"Error - Could not terminate communication with the LMS.\n\nYour results may not be recorded.\n\n" +
|
|
106
|
+
errorDescription
|
|
107
|
+
);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function ScormProcessGetValue(element) {
|
|
113
|
+
var result;
|
|
114
|
+
|
|
115
|
+
if (initialized == false || finishCalled == true) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
result = API.LMSGetValue(element);
|
|
120
|
+
|
|
121
|
+
if (result == "") {
|
|
122
|
+
var errorNumber = API.LMSGetLastError();
|
|
123
|
+
|
|
124
|
+
if (errorNumber != SCORM_NO_ERROR) {
|
|
125
|
+
var errorString = API.LMSGetErrorString(errorNumber);
|
|
126
|
+
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
127
|
+
|
|
128
|
+
var errorDescription =
|
|
129
|
+
"Number: " +
|
|
130
|
+
errorNumber +
|
|
131
|
+
"\nDescription: " +
|
|
132
|
+
errorString +
|
|
133
|
+
"\nDiagnostic: " +
|
|
134
|
+
diagnostic;
|
|
135
|
+
|
|
136
|
+
alert(
|
|
137
|
+
"Error - Could not retrieve a value from the LMS.\n\n" +
|
|
138
|
+
errorDescription
|
|
139
|
+
);
|
|
140
|
+
return "";
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function ScormProcessSetValue(element, value) {
|
|
148
|
+
var result;
|
|
149
|
+
|
|
150
|
+
if (initialized == false || finishCalled == true) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
result = API.LMSSetValue(element, value);
|
|
155
|
+
|
|
156
|
+
if (result == SCORM_FALSE) {
|
|
157
|
+
var errorNumber = API.LMSGetLastError();
|
|
158
|
+
var errorString = API.LMSGetErrorString(errorNumber);
|
|
159
|
+
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
160
|
+
|
|
161
|
+
var errorDescription =
|
|
162
|
+
"Number: " +
|
|
163
|
+
errorNumber +
|
|
164
|
+
"\nDescription: " +
|
|
165
|
+
errorString +
|
|
166
|
+
"\nDiagnostic: " +
|
|
167
|
+
diagnostic;
|
|
168
|
+
|
|
169
|
+
alert(
|
|
170
|
+
"Error - Could not store a value in the LMS.\n\nYour results may not be recorded.\n\n" +
|
|
171
|
+
errorDescription
|
|
172
|
+
);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
}
|