fcad-core-dragon 2.1.0-beta.2 → 2.1.0-beta.3
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/.editorconfig +33 -33
- package/.eslintignore +29 -29
- package/.eslintrc.cjs +81 -81
- package/CHANGELOG +20 -0
- package/bk.scss +117 -117
- package/package.json +30 -31
- package/src/assets/data/onboardingMessages.json +47 -47
- package/src/components/AppBase.vue +167 -39
- package/src/components/AppBaseButton.test.js +0 -1
- package/src/components/AppBaseErrorDisplay.vue +438 -438
- package/src/components/AppBaseFlipCard.vue +84 -84
- package/src/components/AppBaseModule.vue +103 -116
- package/src/components/AppBasePage.vue +13 -13
- package/src/components/AppBasePopover.vue +41 -41
- package/src/components/AppCompMenu.vue +2 -1
- package/src/components/AppCompPlayBarNext.vue +157 -16
- package/src/components/AppCompPopUpNext.vue +3 -3
- package/src/components/AppCompQuizRecall.vue +2 -3
- package/src/components/AppCompSettingsMenu.vue +172 -172
- package/src/components/AppCompTableOfContent.vue +1 -1
- package/src/components/AppCompViewDisplay.vue +6 -6
- package/src/components/tests__/useTimer.spec.js +91 -0
- package/src/composables/useIdleDetector.js +56 -0
- package/src/composables/useQuiz.js +1 -1
- package/src/composables/useTimer.js +175 -0
- package/src/externalComps/ModuleView.vue +22 -22
- package/src/externalComps/SummaryView.vue +91 -91
- package/src/main.js +2 -0
- package/src/module/stores/appStore.js +10 -34
- package/src/module/xapi/ADL.js +1 -0
- package/src/module/xapi/Crypto/Hasher.js +241 -241
- package/src/module/xapi/Crypto/WordArray.js +278 -278
- package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +103 -103
- package/src/module/xapi/Crypto/algorithms/C_algo.js +315 -315
- package/src/module/xapi/Crypto/algorithms/HMAC.js +9 -9
- package/src/module/xapi/Crypto/algorithms/SHA1.js +9 -9
- package/src/module/xapi/Crypto/encoders/Base.js +105 -105
- package/src/module/xapi/Crypto/encoders/Base64.js +99 -99
- package/src/module/xapi/Crypto/encoders/Hex.js +61 -61
- package/src/module/xapi/Crypto/encoders/Latin1.js +61 -61
- package/src/module/xapi/Crypto/encoders/Utf8.js +45 -45
- package/src/module/xapi/Crypto/index.js +53 -53
- package/src/module/xapi/Statement/activity.js +47 -47
- package/src/module/xapi/Statement/agent.js +55 -55
- package/src/module/xapi/Statement/group.js +26 -26
- package/src/module/xapi/Statement/index.js +259 -259
- package/src/module/xapi/Statement/statement.js +253 -253
- package/src/module/xapi/Statement/statementRef.js +23 -23
- package/src/module/xapi/Statement/substatement.js +22 -22
- package/src/module/xapi/Statement/verb.js +36 -36
- package/src/module/xapi/activitytypes.js +17 -17
- package/src/module/xapi/utils.js +167 -167
- package/src/module/xapi/verbs.js +294 -294
- package/src/module/xapi/xapiStatement.js +444 -444
- package/src/plugins/analytics.js +34 -0
- package/src/plugins/bus.js +8 -8
- package/src/plugins/gsap.js +14 -14
- package/src/plugins/i18n.js +26 -44
- package/src/plugins/save.js +37 -37
- package/src/plugins/scorm.js +287 -287
- package/src/plugins/xapi.js +11 -11
- package/src/public/index.html +33 -33
- package/src/router/index.js +6 -3
- package/src/components/AppCompPlayBarProgress.vue +0 -82
- package/src/mixins/$mediaMixins.js +0 -809
- package/src/mixins/timerMixin.js +0 -195
- package/src/module/xapi/wrapper copy.js +0 -1963
package/src/mixins/timerMixin.js
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
@ Description: Mixins to extends general fonctionnalities in a page of an activity. Add time tracker in activities
|
|
3
|
-
@ Note: .
|
|
4
|
-
*/
|
|
5
|
-
export const timerMixin = {
|
|
6
|
-
data() {
|
|
7
|
-
return {
|
|
8
|
-
lessonTimeCounter: 0,
|
|
9
|
-
activityTimeCounter: 0,
|
|
10
|
-
activityInterval: null,
|
|
11
|
-
lessonInterval: null,
|
|
12
|
-
fullInterval: null,
|
|
13
|
-
timerState: 'stopped',
|
|
14
|
-
idleCounter: 0,
|
|
15
|
-
idleTimeoutID: null,
|
|
16
|
-
idleTimeout: 5 * 60000, //5 mins
|
|
17
|
-
idleTimer: null
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
methods: {
|
|
21
|
-
/* Start the timer */
|
|
22
|
-
startTimer(op) {
|
|
23
|
-
if (op && !['activity', 'lesson'].includes(op))
|
|
24
|
-
throw new Error('this is not a valid option for the timer')
|
|
25
|
-
if (this.timerState == 'stopped') {
|
|
26
|
-
switch (op) {
|
|
27
|
-
case 'activity':
|
|
28
|
-
this.activityInterval = setInterval(() => {
|
|
29
|
-
this.activityTimeCounter += 1
|
|
30
|
-
}, 1000)
|
|
31
|
-
break
|
|
32
|
-
|
|
33
|
-
case 'lesson':
|
|
34
|
-
this.lessonInterval = setInterval(() => {
|
|
35
|
-
this.lessonTimeCounter += 1
|
|
36
|
-
}, 1000)
|
|
37
|
-
break
|
|
38
|
-
|
|
39
|
-
default:
|
|
40
|
-
this.fullInterval = setInterval(() => {
|
|
41
|
-
this.activityTimeCounter += 1
|
|
42
|
-
this.lessonTimeCounter += 1
|
|
43
|
-
}, 1000)
|
|
44
|
-
}
|
|
45
|
-
this.timerState = 'started'
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
/* Stop the timer and reset thimer to zero */
|
|
49
|
-
stopTimer(op) {
|
|
50
|
-
if (op && !['activity', 'lesson'].includes(op))
|
|
51
|
-
throw new Error('this is not a valid parameter')
|
|
52
|
-
|
|
53
|
-
if (this.timerState == 'started') {
|
|
54
|
-
if (op === 'activity' && this.activityTimeCounter > 0) {
|
|
55
|
-
this.lessonTimeCounter =
|
|
56
|
-
this.lessonTimeCounter + this.activityTimeCounter //add to the lesson counter
|
|
57
|
-
clearInterval(this.activityInterval) //clear the interval
|
|
58
|
-
this.activityTimeCounter = 0 // reset the counter
|
|
59
|
-
} else if (op == 'lesson' && this.lessonTimeCounter > 0) {
|
|
60
|
-
clearInterval(this.lessonInterval)
|
|
61
|
-
this.lessonTimeCounter = 0
|
|
62
|
-
} else {
|
|
63
|
-
clearInterval(this.activityInterval) //clear the interval
|
|
64
|
-
clearInterval(this.fullInterval)
|
|
65
|
-
clearInterval(this.lessonInterval)
|
|
66
|
-
clearInterval(this.elapsedCounter)
|
|
67
|
-
|
|
68
|
-
this.activityTimeCounter = 0
|
|
69
|
-
this.lessonTimeCounter = 0
|
|
70
|
-
this.elapsedCounter = 0
|
|
71
|
-
}
|
|
72
|
-
this.timerState = 'stopped'
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
/* Pause the timer but does not reset to zero*/
|
|
76
|
-
pauseTimer(op) {
|
|
77
|
-
if (op && !['activity', 'lesson'].includes(op))
|
|
78
|
-
throw new Error('this is not a valid parameter')
|
|
79
|
-
|
|
80
|
-
if (op === 'activity' && this.activityTimeCounter > 0) {
|
|
81
|
-
clearInterval(this.activityInterval)
|
|
82
|
-
} else if (op === 'lesson') {
|
|
83
|
-
clearInterval(this.lessonInterval)
|
|
84
|
-
} else {
|
|
85
|
-
clearInterval(this.fullInterval)
|
|
86
|
-
clearInterval(this.elapsedCounter)
|
|
87
|
-
}
|
|
88
|
-
this.timerState = 'stopped'
|
|
89
|
-
},
|
|
90
|
-
/*
|
|
91
|
-
* Inialize the idle Timer,
|
|
92
|
-
* create a timer to trick time passed since idle is start
|
|
93
|
-
* create a countdown to pause activity timer
|
|
94
|
-
*/
|
|
95
|
-
startIdleTimer() {
|
|
96
|
-
this.idleTimer = setInterval(() => {
|
|
97
|
-
this.idleCounter += 1
|
|
98
|
-
}, 1000)
|
|
99
|
-
this.idleTimeoutID = setTimeout(
|
|
100
|
-
() => this.pauseTimer('activity'),
|
|
101
|
-
this.idleTimeout
|
|
102
|
-
)
|
|
103
|
-
},
|
|
104
|
-
/*
|
|
105
|
-
* reset idle timer .
|
|
106
|
-
* retart the activity counter
|
|
107
|
-
*/
|
|
108
|
-
resetIdleTimer() {
|
|
109
|
-
this.stopIdleTimer()
|
|
110
|
-
if (this.timerState == 'stopped') this.startTimer('activity')
|
|
111
|
-
this.startIdleTimer()
|
|
112
|
-
},
|
|
113
|
-
/**
|
|
114
|
-
* clear idle timer
|
|
115
|
-
* clear idle countdown
|
|
116
|
-
* reset idle counter
|
|
117
|
-
*/
|
|
118
|
-
stopIdleTimer() {
|
|
119
|
-
this.idleCounter = 0
|
|
120
|
-
clearInterval(this.idleTimer)
|
|
121
|
-
clearTimeout(this.idleTimeoutID)
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
/* Format seconds to ISO 8601 format */
|
|
125
|
-
formatToISOString(seconds) {
|
|
126
|
-
let d = new Date(null) //create a default date ref
|
|
127
|
-
d.setSeconds(seconds) //set the time with passed numbers of seconds
|
|
128
|
-
//Example of ISO 8601 time format of 24 chars: "1970-01-04T14:50:00.000Z"
|
|
129
|
-
let ISOTime = d.toISOString()
|
|
130
|
-
|
|
131
|
-
return ISOTime // YYYY-MM-DDTHH:mm:ss.sssZ
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
/* Parse a ISO string time period to the format of HH:mm:ss */
|
|
135
|
-
ISOTimeParser(seconds) {
|
|
136
|
-
let ISOTimePeriod = this.formatToISOString(seconds).substring(8, 19) // only the time portion of it
|
|
137
|
-
ISOTimePeriod = ISOTimePeriod.split('T')
|
|
138
|
-
const DDToHrs = (parseInt(ISOTimePeriod[0]) - 1) * 24 // convert xxT to hrs
|
|
139
|
-
const periodOfTime = ISOTimePeriod[1] ? ISOTimePeriod[1].split(':') : null
|
|
140
|
-
|
|
141
|
-
if (!periodOfTime) return '00:00:00'
|
|
142
|
-
|
|
143
|
-
let timeString = ''
|
|
144
|
-
let HH = (DDToHrs + parseInt(periodOfTime[0])).toString()
|
|
145
|
-
let mm = periodOfTime[1]
|
|
146
|
-
let ss = periodOfTime[2]
|
|
147
|
-
|
|
148
|
-
if (HH.length === 1) HH = `0${HH}`
|
|
149
|
-
|
|
150
|
-
timeString = `${HH}:${mm}:${ss}`
|
|
151
|
-
|
|
152
|
-
return timeString
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
beforeUnmount() {
|
|
156
|
-
this.$bus.$off('timer-start', this.startTimer)
|
|
157
|
-
this.$bus.$off('timer-tart', this.stopTimer)
|
|
158
|
-
this.$bus.$off('timer-pause', this.pauseTimer)
|
|
159
|
-
this.$bus.$off('stop-idle-timer', this.stopIdleTimer)
|
|
160
|
-
this.$bus.$off('start-idle-timer', this.startIdleTimer)
|
|
161
|
-
},
|
|
162
|
-
mounted() {
|
|
163
|
-
this.$bus.$on('timer-start', this.startTimer)
|
|
164
|
-
this.$bus.$on('timer-stop', this.stopTimer)
|
|
165
|
-
this.$bus.$on('timer-pause', this.pauseTimer)
|
|
166
|
-
this.$bus.$on('start-idle-timer', this.startIdleTimer)
|
|
167
|
-
this.$bus.$on('stop-idle-timer', this.stopIdleTimer)
|
|
168
|
-
},
|
|
169
|
-
computed: {
|
|
170
|
-
activityDuration() {
|
|
171
|
-
let duration
|
|
172
|
-
if (this.activityTimeCounter > 0)
|
|
173
|
-
duration = this.ISOTimeParser(this.activityTimeCounter)
|
|
174
|
-
else duration = '00:00:00'
|
|
175
|
-
|
|
176
|
-
return duration
|
|
177
|
-
},
|
|
178
|
-
lessonDuration() {
|
|
179
|
-
this.lessonTimeCounter = this.lessonTimeCounter + this.activityTimeCounter
|
|
180
|
-
|
|
181
|
-
let duration = this.ISOTimeParser(this.lessonTimeCounter)
|
|
182
|
-
return duration
|
|
183
|
-
},
|
|
184
|
-
elapsedTime() {
|
|
185
|
-
const eTime = this.elapsedCounter
|
|
186
|
-
return eTime
|
|
187
|
-
},
|
|
188
|
-
elapsedIdleTime() {
|
|
189
|
-
return this.idleCounter
|
|
190
|
-
},
|
|
191
|
-
timerCurrentState() {
|
|
192
|
-
return this.timerState
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|