fcad-core-dragon 2.0.0-beta.9 → 2.0.1-beta.0

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.
Files changed (64) hide show
  1. package/.editorconfig +33 -33
  2. package/.eslintignore +29 -29
  3. package/.eslintrc.cjs +81 -81
  4. package/CHANGELOG +11 -0
  5. package/README.md +57 -72
  6. package/bk.scss +117 -117
  7. package/package.json +1 -1
  8. package/src/assets/data/onboardingMessages.json +47 -47
  9. package/src/components/AppBase.vue +130 -3
  10. package/src/components/AppBaseErrorDisplay.vue +438 -438
  11. package/src/components/AppBaseFlipCard.vue +84 -84
  12. package/src/components/AppBaseModule.vue +15 -18
  13. package/src/components/AppBasePopover.vue +41 -41
  14. package/src/components/AppCompBranchButtons.vue +5 -5
  15. package/src/components/AppCompInputDropdownNext.vue +1 -1
  16. package/src/components/AppCompInputRadioNext.vue +152 -152
  17. package/src/components/AppCompInputTextToFillNext.vue +171 -171
  18. package/src/components/AppCompJauge.vue +74 -74
  19. package/src/components/AppCompMenuItem.vue +238 -228
  20. package/src/components/AppCompPlayBarProgress.vue +82 -82
  21. package/src/components/AppCompSettingsMenu.vue +172 -172
  22. package/src/components/AppCompTableOfContent.vue +2 -0
  23. package/src/components/AppCompViewDisplay.vue +6 -6
  24. package/src/composables/useQuiz.js +206 -206
  25. package/src/externalComps/ModuleView.vue +22 -22
  26. package/src/externalComps/SummaryView.vue +91 -91
  27. package/src/mixins/$mediaMixins.js +819 -819
  28. package/src/mixins/timerMixin.js +195 -155
  29. package/src/module/stores/appStore.js +3 -3
  30. package/src/module/xapi/ADL.js +0 -1
  31. package/src/module/xapi/Crypto/Hasher.js +241 -241
  32. package/src/module/xapi/Crypto/WordArray.js +278 -278
  33. package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +103 -103
  34. package/src/module/xapi/Crypto/algorithms/C_algo.js +315 -315
  35. package/src/module/xapi/Crypto/algorithms/HMAC.js +9 -9
  36. package/src/module/xapi/Crypto/algorithms/SHA1.js +9 -9
  37. package/src/module/xapi/Crypto/encoders/Base.js +105 -105
  38. package/src/module/xapi/Crypto/encoders/Base64.js +99 -99
  39. package/src/module/xapi/Crypto/encoders/Hex.js +61 -61
  40. package/src/module/xapi/Crypto/encoders/Latin1.js +61 -61
  41. package/src/module/xapi/Crypto/encoders/Utf8.js +45 -45
  42. package/src/module/xapi/Crypto/index.js +53 -53
  43. package/src/module/xapi/Statement/activity.js +47 -47
  44. package/src/module/xapi/Statement/agent.js +55 -55
  45. package/src/module/xapi/Statement/group.js +26 -26
  46. package/src/module/xapi/Statement/index.js +259 -259
  47. package/src/module/xapi/Statement/statement.js +253 -253
  48. package/src/module/xapi/Statement/statementRef.js +23 -23
  49. package/src/module/xapi/Statement/substatement.js +22 -22
  50. package/src/module/xapi/Statement/verb.js +36 -36
  51. package/src/module/xapi/activitytypes.js +17 -17
  52. package/src/module/xapi/utils.js +167 -167
  53. package/src/module/xapi/verbs.js +294 -294
  54. package/src/module/xapi/wrapper.js +0 -1
  55. package/src/module/xapi/xapiStatement.js +444 -444
  56. package/src/plugins/bus.js +8 -8
  57. package/src/plugins/gsap.js +14 -14
  58. package/src/plugins/i18n.js +44 -44
  59. package/src/plugins/save.js +37 -37
  60. package/src/plugins/scorm.js +287 -287
  61. package/src/plugins/xapi.js +11 -11
  62. package/src/public/index.html +33 -33
  63. package/src/router/index.js +5 -0
  64. package/src/shared/generalfuncs.js +210 -210
@@ -1,155 +1,195 @@
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
- elapsedCounter: 0, // count the elapse time since lesson started
11
- activityInterval: null,
12
- lessonInterval: null,
13
- fullInterval: null,
14
- timerState: 'stopped',
15
- elapsedInterval: null // interval of passed time since the lesson is started. used only for saving purposed
16
- }
17
- },
18
- methods: {
19
- /* Start the timer */
20
- startTimer(op) {
21
- if (op && !['activity', 'lesson'].includes(op))
22
- throw new Error('this is not a valid option for the timer')
23
- if (this.timerState === 'stopped') {
24
- switch (op) {
25
- case 'activity':
26
- this.activityInterval = setInterval(() => {
27
- this.activityTimeCounter += 1
28
- }, 1000)
29
- this.timerState = 'started'
30
-
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
- }
46
- },
47
- /* Stop the timer and reset thimer to zero */
48
- stopTimer(op) {
49
- if (op && !['activity', 'lesson'].includes(op))
50
- throw new Error('this is not a valid parameter')
51
-
52
- if (this.timerState === 'started') {
53
- if (op === 'activity' && this.activityTimeCounter > 0) {
54
- this.lessonTimeCounter =
55
- this.lessonTimeCounter + this.activityTimeCounter //add to the lesson counter
56
- clearInterval(this.activityInterval) //clear the interval
57
- this.activityTimeCounter = 0 // reset the counter
58
- this.timerState = 'stopped'
59
- } else if (op === 'lesson' && this.lessonTimeCounter > 0) {
60
- clearInterval(this.lessonInterval)
61
- this.lessonTimeCounter = 0
62
- } else {
63
- clearInterval(this.fullInterval)
64
- clearInterval(this.elapsedCounter)
65
- clearInterval(this.elapsedInterval)
66
-
67
- this.activityTimeCounter = 0
68
- this.lessonTimeCounter = 0
69
- this.elapsedCounter = 0
70
- }
71
- }
72
- },
73
- /* Pause the timer but does not reset to zero*/
74
- pauseTimer(op) {
75
- if (op && !['activity', 'lesson'].includes(op))
76
- throw new Error('this is not a valid parameter')
77
-
78
- if (op === 'activity' && this.activityTimeCounter > 0) {
79
- clearInterval(this.activityInterval)
80
- } else if (op === 'lesson') {
81
- clearInterval(this.lessonInterval)
82
- } else {
83
- clearInterval(this.fullInterval)
84
- clearInterval(this.elapsedInterval)
85
- }
86
- },
87
-
88
- /* Format seconds to ISO 8601 format */
89
- formatToISOString(seconds) {
90
- let d = new Date(null) //create a default date ref
91
- d.setSeconds(seconds) //set the time with passed numbers of seconds
92
- //Example of ISO 8601 time format of 24 chars: "1970-01-04T14:50:00.000Z"
93
- let ISOTime = d.toISOString()
94
-
95
- return ISOTime // YYYY-MM-DDTHH:mm:ss.sssZ
96
- },
97
-
98
- /* Parse a ISO string time period to the format of HH:mm:ss */
99
- ISOTimeParser(seconds) {
100
- let ISOTimePeriod = this.formatToISOString(seconds).substring(8, 19) // only the time portion of it
101
- ISOTimePeriod = ISOTimePeriod.split('T')
102
- const DDToHrs = (parseInt(ISOTimePeriod[0]) - 1) * 24 // convert xxT to hrs
103
- const periodOfTime = ISOTimePeriod[1] ? ISOTimePeriod[1].split(':') : null
104
-
105
- if (!periodOfTime) return '00:00:00'
106
-
107
- let timeString = ''
108
- let HH = (DDToHrs + parseInt(periodOfTime[0])).toString()
109
- let mm = periodOfTime[1]
110
- let ss = periodOfTime[2]
111
-
112
- if (HH.length === 1) HH = `0${HH}`
113
-
114
- timeString = `${HH}:${mm}:${ss}`
115
-
116
- return timeString
117
- }
118
- },
119
- beforeUnmount() {
120
- this.$bus.$off('start-timer', this.startTimer)
121
- this.$bus.$off('stop-timer', this.stopTimer)
122
- this.$bus.$off('pause-timer', this.pauseTimer)
123
- },
124
- mounted() {
125
- this.$bus.$on('start-timer', this.startTimer)
126
-
127
- this.$bus.$on('stop-timer', this.stopTimer)
128
-
129
- this.$bus.$on('pause-timer', this.pauseTimer)
130
-
131
- this.elapsedInterval = setInterval(() => {
132
- this.elapsedCounter += 1
133
- }, 1000)
134
- },
135
- computed: {
136
- activityDuration() {
137
- let duration
138
- if (this.activityTimeCounter > 0)
139
- duration = this.ISOTimeParser(this.activityTimeCounter)
140
- else duration = '00:00:00'
141
-
142
- return duration
143
- },
144
- lessonDuration() {
145
- this.lessonTimeCounter = this.lessonTimeCounter + this.activityTimeCounter
146
-
147
- let duration = this.ISOTimeParser(this.lessonTimeCounter)
148
- return duration
149
- },
150
- elapsedTime() {
151
- const eTime = this.elapsedCounter
152
- return eTime
153
- }
154
- }
155
- }
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
+ }
@@ -628,7 +628,7 @@ export const useAppStore = defineStore('$appStore', {
628
628
  this.introAcitve = status
629
629
  },
630
630
 
631
- setAppDebugMode(state, bool) {
631
+ setAppDebugMode(bool) {
632
632
  this.appDebugMode = bool
633
633
  },
634
634
 
@@ -641,7 +641,7 @@ export const useAppStore = defineStore('$appStore', {
641
641
  setDeviceType(device) {
642
642
  this.deviceType = device
643
643
  },
644
- setErrorMenu(state, error) {
644
+ setErrorMenu(error) {
645
645
  this.errMenuSetting = error
646
646
  },
647
647
  setApplicationSettings(settings) {
@@ -652,7 +652,7 @@ export const useAppStore = defineStore('$appStore', {
652
652
  this.mediaVolume = volume
653
653
  },
654
654
 
655
- setMediaMuted(state, bool) {
655
+ setMediaMuted(bool) {
656
656
  this.mediaMuted = bool
657
657
  },
658
658
 
@@ -191,7 +191,6 @@ export default class ADL {
191
191
  } else {
192
192
  userData = {}
193
193
  }
194
-
195
194
  return userData
196
195
  } catch (err) {
197
196
  console.log(err)