fcad-core-dragon 2.0.0-beta.0 → 2.0.0-beta.2

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 (84) hide show
  1. package/{.eslintrc.js → .eslintrc.cjs} +13 -18
  2. package/README.md +1 -1
  3. package/bk.scss +117 -0
  4. package/package.json +22 -40
  5. package/src/$locales/en.json +57 -19
  6. package/src/$locales/fr.json +66 -28
  7. package/src/components/AppBase.vue +790 -376
  8. package/src/components/AppBaseButton.vue +33 -5
  9. package/src/components/AppBaseErrorDisplay.vue +62 -25
  10. package/src/components/AppBaseModule.vue +831 -754
  11. package/src/components/AppBasePage.vue +60 -74
  12. package/src/components/AppCompAudio.vue +266 -0
  13. package/src/components/AppCompBranchButtons.vue +79 -89
  14. package/src/components/AppCompButtonProgress.vue +35 -61
  15. package/src/components/AppCompCarousel.vue +160 -249
  16. package/src/components/AppCompInputCheckBox.vue +9 -3
  17. package/src/components/AppCompInputDropdown.vue +2 -4
  18. package/src/components/AppCompInputRadio.vue +8 -15
  19. package/src/components/AppCompInputTextTable.vue +15 -12
  20. package/src/components/AppCompInputTextToFillDropdown.vue +16 -14
  21. package/src/components/AppCompInputTextToFillText.vue +2 -2
  22. package/src/components/AppCompJauge.vue +14 -3
  23. package/src/components/AppCompMenu.vue +284 -85
  24. package/src/components/AppCompMenuItem.vue +67 -92
  25. package/src/components/AppCompNavigation.vue +945 -0
  26. package/src/components/AppCompNoteCall.vue +141 -0
  27. package/src/components/AppCompNoteCredit.vue +267 -0
  28. package/src/components/AppCompPlayBar.vue +1122 -1391
  29. package/src/components/AppCompPlayBarProgress.vue +73 -0
  30. package/src/components/AppCompPopUp.vue +195 -135
  31. package/src/components/AppCompPopover.vue +27 -0
  32. package/src/components/AppCompQuiz.vue +90 -113
  33. package/src/components/AppCompQuizRecall.vue +277 -0
  34. package/src/components/AppCompSVG.vue +335 -0
  35. package/src/components/AppCompSettingsMenu.vue +7 -8
  36. package/src/components/AppCompTableOfContent.vue +264 -88
  37. package/src/components/AppCompTranscript.vue +19 -0
  38. package/src/components/AppCompVideoPlayer.vue +380 -0
  39. package/src/components/BaseModule.vue +37 -114
  40. package/src/main.js +130 -85
  41. package/src/mixins/$mediaMixins.js +827 -0
  42. package/src/mixins/$pageMixins.js +149 -115
  43. package/src/mixins/$quizMixins.js +12 -26
  44. package/src/mixins/timerMixin.js +39 -16
  45. package/src/module/store.js +218 -78
  46. package/src/module/xapi/ADL.js +90 -53
  47. package/src/module/xapi/Crypto/Hasher.js +8 -8
  48. package/src/module/xapi/Crypto/WordArray.js +6 -6
  49. package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +4 -4
  50. package/src/module/xapi/Crypto/algorithms/C_algo.js +14 -18
  51. package/src/module/xapi/Crypto/algorithms/HMAC.js +1 -1
  52. package/src/module/xapi/Crypto/algorithms/SHA1.js +1 -1
  53. package/src/module/xapi/Crypto/encoders/Base.js +7 -7
  54. package/src/module/xapi/Crypto/encoders/Base64.js +3 -3
  55. package/src/module/xapi/Crypto/encoders/Hex.js +4 -3
  56. package/src/module/xapi/Crypto/encoders/Latin1.js +3 -3
  57. package/src/module/xapi/Crypto/encoders/Utf8.js +3 -3
  58. package/src/module/xapi/Statement/index.js +1 -1
  59. package/src/module/xapi/launch.js +10 -10
  60. package/src/module/xapi/utils.js +17 -17
  61. package/src/module/xapi/wrapper.js +127 -54
  62. package/src/module/xapi/xapiStatement.js +29 -29
  63. package/src/plugins/gsap.js +4 -1
  64. package/src/plugins/helper.js +58 -24
  65. package/src/plugins/i18n.js +23 -10
  66. package/src/plugins/idb.js +1 -0
  67. package/src/plugins/scorm.js +14 -14
  68. package/src/public/index.html +1 -1
  69. package/src/router/index.js +40 -0
  70. package/src/router/routes.js +317 -0
  71. package/src/shared/generalfuncs.js +91 -9
  72. package/src/shared/validators.js +959 -0
  73. package/.prettierrc.js +0 -5
  74. package/babel.config.js +0 -3
  75. package/src/components/AppBaseDragChoice.vue +0 -91
  76. package/src/components/AppBaseDropZone.vue +0 -112
  77. package/src/components/AppCompDragAndDrop.vue +0 -339
  78. package/src/components/AppCompInputAssociation.vue +0 -332
  79. package/src/components/AppCompMediaPlayer.vue +0 -365
  80. package/src/components/AppCompNavigationFull.vue +0 -1791
  81. package/src/components/AppCompToolTip.vue +0 -94
  82. package/src/plugins/timeManager.js +0 -77
  83. package/src/routes.js +0 -734
  84. package/vue.config.js +0 -83
@@ -7,84 +7,76 @@
7
7
  <b-col
8
8
  v-for="activity of activities"
9
9
  :key="activity.id"
10
+ cols="6"
10
11
  class="menu-section-activity"
11
12
  :aria-describedby="activity.id + '-subMenu'"
12
13
  >
13
- <app-base-button
14
+ <b-link
14
15
  :id="activity.id + '-subMenu'"
15
- v-b-toggle="'sidebar-submenu'"
16
16
  :title="activity.title"
17
- @click="activityInfo(activity)"
17
+ :to="{
18
+ name: createRoutes(activity.id)
19
+ }"
20
+ @click="startActivity(activity)"
18
21
  >
19
22
  <div class="menu-card" tag="article">
20
23
  <b-row>
21
- <div v-show="activity.title" class="title">
22
- <h5>{{ activity.title || '' }}</h5>
24
+ <div v-if="activity.subtitle === undefined" class="title">
25
+ <h4 v-html="activity.title"></h4>
23
26
  </div>
24
- <div v-show="activity.subtitle" class="subtitle">
25
- <h4>{{ activity.subtitle || '' }}</h4>
27
+ <div v-else class="title">
28
+ <h4 v-html="`${activity.title} : ${activity.subtitle}`"></h4>
26
29
  </div>
30
+
27
31
  <div class="time">
28
32
  <p class="time">
29
- <svg
30
- xmlns="http://www.w3.org/2000/svg"
31
- viewBox="0 0 18 21.01"
32
- width="18 "
33
- height="21.01"
34
- :aria-label="$t('label.timer')"
35
- >
36
- <path
37
- id="Path_3904"
38
- d="M12,0H6v2h6V0z M8,13h2V7H8V13z M16.03,6.39l1.42-1.42c-0.43-0.51-0.9-0.98-1.41-1.41l-1.42,1.42
39
- c-3.88-3.1-9.55-2.47-12.65,1.41s-2.47,9.55,1.41,12.65s9.55,2.47,12.65-1.41C18.66,14.34,18.66,9.68,16.03,6.39z M9,19
40
- c-3.87,0-7-3.13-7-7s3.13-7,7-7s7,3.13,7,7c0,3.86-3.13,7-6.99,7C9.01,19,9,19,9,19z"
41
- />
33
+ <svg width="18" height="21.01" :aria-label="$t('label.timer')">
34
+ <use href="#clock-icon" />
42
35
  </svg>
43
36
  {{ activity.time || '00:00' }}
44
37
  </p>
45
38
  </div>
46
39
  <div class="box-gauge">
47
40
  <app-comp-jauge
48
- :state="getProgressStatus(activity.id)"
49
41
  :max-value="getActivitySize(activity.id)"
50
42
  :value="getPageComplete(activity.id)"
51
- :pourcent="getPourcentGauge"
52
- :fraction="getFractionGauge"
53
43
  />
54
44
  </div>
55
45
  </b-row>
56
46
  </div>
57
- </app-base-button>
47
+ </b-link>
58
48
  </b-col>
59
- <app-comp-table-of-content></app-comp-table-of-content>
60
49
  </b-row>
61
50
  </template>
62
51
  <script>
63
52
  // ...
64
53
  import { mapGetters } from 'vuex'
65
- import AppCompJauge from './AppCompJauge'
54
+ import AppCompJauge from './AppCompJauge.vue'
66
55
  export default {
67
56
  components: {
68
57
  AppCompJauge
69
58
  },
70
59
  computed: {
71
60
  ...mapGetters([
72
- 'getIntroStatus',
61
+ 'getAllActivities',
73
62
  'getAllActivitiesState',
74
63
  'getAllCompleted',
75
64
  'getAppConfigs',
76
- 'getMenuSettings'
65
+ 'getMenuSettings',
66
+ 'getModuleInfo'
77
67
  ]),
78
68
  activities() {
79
69
  // get the data for list of the page for this module from the store and
80
70
  // get the route of the page from the router to build the menu with its routes
81
71
  let count = 0
82
72
  const collection = []
83
- this.$store.getters.getAllActivities.list.forEach((value, key) => {
73
+
74
+ this.getAllActivities().list.forEach((value, key) => {
84
75
  let theActivity,
85
76
  activityTitle,
86
77
  activitySubTitle,
87
- activityTime = null
78
+ activityTime = null,
79
+ activityPath = ''
88
80
 
89
81
  if (this.menuInfo[key]) {
90
82
  const { title, subTitle, time } = this.menuInfo[key] //get time subTitle time from menu info
@@ -98,41 +90,34 @@ export default {
98
90
  // This is the Introduction
99
91
  if (key === 'A00') {
100
92
  activityTitle = activityTitle || this.$t('text.introduction')
101
- theActivity = {
102
- id: key,
103
- title: activityTitle,
104
- subtitle: activitySubTitle,
105
- time: activityTime,
106
- path: 'introduction',
107
- data: value
108
- }
109
- if (this.getIntroStatus) collection.push(theActivity) // include or not the Introduction in the collection
93
+ activityPath = 'introduction'
94
+ } else if (key === 'A99') {
95
+ activityTitle = activityTitle || this.$t('text.conclusion')
96
+ activityPath = 'conclusion'
110
97
  } else {
111
98
  count++
112
99
  activityTitle =
113
100
  activityTitle || `${this.$t('text.activity')} ${count}`
114
- theActivity = {
115
- id: key,
116
- title: activityTitle,
117
- subtitle: activitySubTitle,
118
- time: activityTime,
119
- path: `activite_${count}`,
120
- data: value
121
- }
122
- collection.push(theActivity) // push the activity in the collection
101
+ activityPath = `activite_${count}`
102
+ }
103
+
104
+ theActivity = {
105
+ id: key,
106
+ title: activityTitle,
107
+ subtitle: activitySubTitle,
108
+ time: activityTime,
109
+ path: activityPath,
110
+ data: value
123
111
  }
112
+
113
+ collection.push(theActivity) // push the activity in the collection
124
114
  })
115
+
125
116
  return collection
126
117
  },
127
118
  menuInfo() {
128
119
  let menuInfo = this.getMenuSettings
129
120
  return menuInfo
130
- },
131
- getFractionGauge() {
132
- return this.getAppConfigs.jauge.fraction
133
- },
134
- getPourcentGauge() {
135
- return this.getAppConfigs.jauge.pourcent
136
121
  }
137
122
  },
138
123
  mounted() {},
@@ -145,48 +130,14 @@ export default {
145
130
  getPageComplete(idActivity) {
146
131
  /// give all the page that are complete to the gauge
147
132
  if (idActivity) {
148
- //get the page which is defined as the menu
149
- const toIgnore = this.$helper
150
- .getRoutesFromVueRouter('A00')
151
- .all_routes.find((el) => el.name === 'menu').meta.id
152
-
153
133
  let completed = []
154
134
  if (this.getAllCompleted[idActivity]) {
155
135
  completed = this.getAllCompleted[idActivity] //get all completed page for the activity
156
-
157
- //for A00 return all completed pages except the menu page
158
- if (idActivity === 'A00')
159
- completed = completed.filter((c) => Object.keys(c)[0] !== toIgnore)
160
136
  }
161
- return completed.length
162
- }
163
- },
164
- /**
165
- * @description give a state of an activity. this available to change style but non mandatory
166
- * @param {String} activityID
167
- * @returns {String} [started|completed|incompleted]
168
- */
169
- getProgressStatus(activityID) {
170
- if (activityID !== 'ID') {
171
- let progress = 'incomplete'
172
- // if activity as a page to complete
173
- if (this.getAllCompleted[activityID]) {
174
- let activitySize = this.getActivitySize(activityID)
175
137
 
176
- // if all activity are in allCompleted give attriube complete if not started
177
- if (activitySize === this.getPageComplete(activityID)) {
178
- progress = 'completed'
179
- } else progress = 'started'
180
- }
181
- return progress
138
+ return completed.length
182
139
  }
183
140
  },
184
-
185
- activityInfo(activity) {
186
- //tell the toc which activity was click to fill the information
187
- this.$bus.$emit('info-activity', activity)
188
- },
189
-
190
141
  /**
191
142
  * @description give the size of the state of the activity
192
143
  * @param {String} activityID
@@ -206,11 +157,35 @@ export default {
206
157
  ? allActivitiesState[activityID].size
207
158
  : 0
208
159
 
209
- // reduce the size if in A00
210
- if (activityID === 'A00' && size > 0) size = size - 1
211
-
212
160
  return size
161
+ },
162
+ createRoutes(data) {
163
+ let activity
164
+
165
+ if (data.charAt(1) == '0' || data.charAt(1) == 0) {
166
+ activity = data.substr(2)
167
+ } else {
168
+ activity = data.substr(1)
169
+ }
170
+
171
+ if (activity == 0 && activity == '0') return `introduction`
172
+ if (activity == '99') return `conclusion`
173
+ else return `activite_${activity}`
174
+ },
175
+ startActivity(a) {
176
+ //this.$bus.$emit('send-starting-event', a)
213
177
  }
214
178
  }
215
179
  }
216
180
  </script>
181
+ <style lang="scss">
182
+ .menu-card {
183
+ width: 100%;
184
+ padding: 24px;
185
+
186
+ .row {
187
+ margin: 0;
188
+ flex-direction: column;
189
+ }
190
+ }
191
+ </style>