@gamelearn/arcade-components 0.12.0 → 0.14.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.
- package/dist/components/arcade-render/loading/LoadingLogic.js +4 -3
- package/dist/components/arcade-render/scene/ConfigController.js +70 -4
- package/dist/components/arcade-render/scene/index.js +8 -3
- package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js +7 -1
- package/dist/components/cards-selector-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/components/cartel-component/components/CartelComponent.js +24 -6
- package/dist/components/chained-image-click-puzzle-component/components/CurrentImagePuzzle.js +7 -2
- package/dist/components/conversational-component/components/ConversationalComponent.js +3 -1
- package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +5 -2
- package/dist/components/conversational-pro-component/components/SlotList.js +3 -1
- package/dist/components/conversational-pro-component/components/scene/Panel.js +4 -3
- package/dist/components/conversational-pro-component/components/scene/Panels.js +4 -2
- package/dist/components/conversational-pro-component/components/scene/index.js +4 -2
- package/dist/components/conversational-pro-component/mocks/mockForStory.js +266 -2
- package/dist/components/cracker-puzzle-component/components/CrackerPuzzleComponent.js +11 -21
- package/dist/components/cracker-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/components/decision-component/components/DecisionBody.js +0 -2
- package/dist/components/decision-component/components/DecisionComponent.js +9 -2
- package/dist/components/decision-component/components/Feedback.js +0 -2
- package/dist/components/decision-component/mocks/mockForStory.js +20 -6
- package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +0 -1
- package/dist/components/frame-click-puzzle-component/components/PlayButton/index.js +2 -2
- package/dist/components/hacker-puzzle-component/components/HackerPuzzleComponent.js +6 -8
- package/dist/components/hacker-puzzle-component/components/languages.js +2 -1
- package/dist/components/hacker-puzzle-component/mocks/mockForStory.js +3 -0
- package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +33 -64
- package/dist/components/index.js +8 -0
- package/dist/components/inventory-item/components/InventoryItem.js +3 -2
- package/dist/components/keyboard-puzzle-component/components/KeyboardPuzzleComponent.js +10 -1
- package/dist/components/keyboard-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/components/login-puzzle-component/components/LoginPuzzleComponent.js +6 -0
- package/dist/components/login-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/components/media-visor/components/MediaVisor.js +140 -0
- package/dist/components/media-visor/index.js +13 -0
- package/dist/components/media-visor/mocks/mockForStory.js +27 -0
- package/dist/components/pdf-component/components/PdfComponent.js +1 -1
- package/dist/components/pdf-component/components/PdfVisor.js +4 -5
- package/dist/components/rewards-component/components/RewardsComponent.js +0 -1
- package/dist/components/survey-component/components/SurveyComponent.js +13 -8
- package/dist/components/terminal-puzzle-component/components/TerminalPuzzleComponent.js +6 -1
- package/dist/components/terminal-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/components/web-builder-puzzle-component/components/WebBuilderPuzzleComponent.js +5 -0
- package/dist/components/web-builder-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/components/writer-puzzle-component/components/WriterPuzzleComponent.js +7 -6
- package/dist/components/writer-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/helpers/deviceDetection.js +13 -0
- package/dist/helpers/drawLOD.js +16 -10
- package/dist/helpers/index.js +7 -1
- package/dist/helpers/useWindowSize.js +56 -0
- package/package.json +4 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.conversationPropsNoFeedbackNoRewards = exports.withoutBackground = exports.voiceOverProps = exports.conversationProps = exports.converOld = void 0;
|
|
6
|
+
exports.conversationPropsLodSettings = exports.conversationPropsNoFeedbackNoRewards = exports.withoutBackground = exports.voiceOverProps = exports.conversationProps = exports.converOld = void 0;
|
|
7
7
|
var animations = {
|
|
8
8
|
neutral: {
|
|
9
9
|
url: 'https://min.int.gamelearn.io/cooked.gl-lms-storage/clients/5981fca94d82290bcbe957fe/animation/5f06e116f9efdd00112fcc6f/male_missunderstand_1.glb'
|
|
@@ -846,4 +846,268 @@ var conversationPropsNoFeedbackNoRewards = {
|
|
|
846
846
|
uid: 'kjTHqx'
|
|
847
847
|
}]
|
|
848
848
|
};
|
|
849
|
-
exports.conversationPropsNoFeedbackNoRewards = conversationPropsNoFeedbackNoRewards;
|
|
849
|
+
exports.conversationPropsNoFeedbackNoRewards = conversationPropsNoFeedbackNoRewards;
|
|
850
|
+
var conversationPropsLodSettings = {
|
|
851
|
+
lodSettings: {
|
|
852
|
+
currentLOD: 'original',
|
|
853
|
+
rgbSimulation: true,
|
|
854
|
+
showHelpers: true,
|
|
855
|
+
showStats: true
|
|
856
|
+
},
|
|
857
|
+
lines: [{
|
|
858
|
+
flex: true,
|
|
859
|
+
slots: [{
|
|
860
|
+
emotion: '',
|
|
861
|
+
text: '',
|
|
862
|
+
uid: 'DbKslR',
|
|
863
|
+
talking: false,
|
|
864
|
+
alias: 'paco',
|
|
865
|
+
text_labelId: 'text_0_0_nlrZh8Np',
|
|
866
|
+
alias_labelId: 'alias_0_0_nlrZh2Iq'
|
|
867
|
+
}, {
|
|
868
|
+
emotion: 'neutral',
|
|
869
|
+
text: '',
|
|
870
|
+
uid: null,
|
|
871
|
+
talking: false,
|
|
872
|
+
text_labelId: 'text_0_1_nlrZiNfB',
|
|
873
|
+
alias_labelId: 'alias_0_1_nlrZijhw'
|
|
874
|
+
}, {
|
|
875
|
+
emotion: 'neutral',
|
|
876
|
+
text: '',
|
|
877
|
+
uid: null,
|
|
878
|
+
talking: false,
|
|
879
|
+
text_labelId: 'text_0_2_nlrZiBF3',
|
|
880
|
+
alias_labelId: 'alias_0_2_nlrZiR6G'
|
|
881
|
+
}, {
|
|
882
|
+
emotion: 'neutral',
|
|
883
|
+
text: '',
|
|
884
|
+
uid: null,
|
|
885
|
+
talking: false,
|
|
886
|
+
text_labelId: 'text_0_3_nlrZinJN',
|
|
887
|
+
alias_labelId: 'alias_0_3_nlrZjLWB'
|
|
888
|
+
}, {
|
|
889
|
+
emotion: 'neutral',
|
|
890
|
+
text: 'Hola!',
|
|
891
|
+
uid: 'kjTHqt',
|
|
892
|
+
talking: true,
|
|
893
|
+
alias: 'manolo',
|
|
894
|
+
text_labelId: 'text_0_4_nlrZjUV9',
|
|
895
|
+
alias_labelId: 'alias_0_4_nlrZj81d'
|
|
896
|
+
}],
|
|
897
|
+
audioId: '5f1078861d84860011e179d0',
|
|
898
|
+
hasAlias: true,
|
|
899
|
+
text_labelId: 'text_0_nlrZj4Nr',
|
|
900
|
+
audioId_labelId: 'audioId_0_nlrZkkdo'
|
|
901
|
+
}, {
|
|
902
|
+
flex: true,
|
|
903
|
+
slots: [{
|
|
904
|
+
emotion: '',
|
|
905
|
+
text: '',
|
|
906
|
+
uid: 'DbKslR',
|
|
907
|
+
talking: false,
|
|
908
|
+
alias: 'paco',
|
|
909
|
+
text_labelId: 'text_0_0_nlrZh8Np',
|
|
910
|
+
alias_labelId: 'alias_0_0_nlrZh2Iq'
|
|
911
|
+
}, {
|
|
912
|
+
emotion: 'neutral',
|
|
913
|
+
text: '',
|
|
914
|
+
uid: null,
|
|
915
|
+
talking: false,
|
|
916
|
+
text_labelId: 'text_0_1_nlrZiNfB',
|
|
917
|
+
alias_labelId: 'alias_0_1_nlrZijhw'
|
|
918
|
+
}, {
|
|
919
|
+
emotion: 'neutral',
|
|
920
|
+
text: '',
|
|
921
|
+
uid: null,
|
|
922
|
+
talking: false,
|
|
923
|
+
text_labelId: 'text_0_2_nlrZiBF3',
|
|
924
|
+
alias_labelId: 'alias_0_2_nlrZiR6G'
|
|
925
|
+
}, {
|
|
926
|
+
emotion: 'neutral',
|
|
927
|
+
text: '',
|
|
928
|
+
uid: null,
|
|
929
|
+
talking: false,
|
|
930
|
+
text_labelId: 'text_0_3_nlrZinJN',
|
|
931
|
+
alias_labelId: 'alias_0_3_nlrZjLWB'
|
|
932
|
+
}, {
|
|
933
|
+
emotion: 'neutral',
|
|
934
|
+
text: 'Hola!',
|
|
935
|
+
uid: 'kjTHqi',
|
|
936
|
+
talking: true,
|
|
937
|
+
alias: 'manolo',
|
|
938
|
+
text_labelId: 'text_0_4_nlrZjUV9',
|
|
939
|
+
alias_labelId: 'alias_0_4_nlrZj81d'
|
|
940
|
+
}],
|
|
941
|
+
audioId: '5f1078861d84860011e179d0',
|
|
942
|
+
hasAlias: true,
|
|
943
|
+
text_labelId: 'text_0_nlrZj4Nr',
|
|
944
|
+
audioId_labelId: 'audioId_0_nlrZkkdo'
|
|
945
|
+
}, {
|
|
946
|
+
flex: true,
|
|
947
|
+
slots: [{
|
|
948
|
+
emotion: '',
|
|
949
|
+
text: '',
|
|
950
|
+
uid: 'DbKslR',
|
|
951
|
+
talking: false,
|
|
952
|
+
alias: 'paco',
|
|
953
|
+
text_labelId: 'text_0_0_nlrZh8Np',
|
|
954
|
+
alias_labelId: 'alias_0_0_nlrZh2Iq'
|
|
955
|
+
}, {
|
|
956
|
+
emotion: 'neutral',
|
|
957
|
+
text: '',
|
|
958
|
+
uid: null,
|
|
959
|
+
talking: false,
|
|
960
|
+
text_labelId: 'text_0_1_nlrZiNfB',
|
|
961
|
+
alias_labelId: 'alias_0_1_nlrZijhw'
|
|
962
|
+
}, {
|
|
963
|
+
emotion: 'neutral',
|
|
964
|
+
text: '',
|
|
965
|
+
uid: null,
|
|
966
|
+
talking: false,
|
|
967
|
+
text_labelId: 'text_0_2_nlrZiBF3',
|
|
968
|
+
alias_labelId: 'alias_0_2_nlrZiR6G'
|
|
969
|
+
}, {
|
|
970
|
+
emotion: 'neutral',
|
|
971
|
+
text: '',
|
|
972
|
+
uid: null,
|
|
973
|
+
talking: false,
|
|
974
|
+
text_labelId: 'text_0_3_nlrZinJN',
|
|
975
|
+
alias_labelId: 'alias_0_3_nlrZjLWB'
|
|
976
|
+
}, {
|
|
977
|
+
emotion: 'neutral',
|
|
978
|
+
text: 'Hola!',
|
|
979
|
+
uid: 'kjTHqx',
|
|
980
|
+
talking: true,
|
|
981
|
+
alias: 'manolo',
|
|
982
|
+
text_labelId: 'text_0_4_nlrZjUV9',
|
|
983
|
+
alias_labelId: 'alias_0_4_nlrZj81d'
|
|
984
|
+
}],
|
|
985
|
+
audioId: '5f1078861d84860011e179d0',
|
|
986
|
+
hasAlias: true,
|
|
987
|
+
text_labelId: 'text_0_nlrZj4Nr',
|
|
988
|
+
audioId_labelId: 'audioId_0_nlrZkkdo'
|
|
989
|
+
}, {
|
|
990
|
+
payload: {
|
|
991
|
+
options: [{
|
|
992
|
+
id: 0,
|
|
993
|
+
right: false,
|
|
994
|
+
text: 'Si',
|
|
995
|
+
rewards: [],
|
|
996
|
+
audioId: '',
|
|
997
|
+
text_labelId: 'text_3_0_u4s8j5fa',
|
|
998
|
+
audioId_labelId: 'audioId_3_0_u4s8jyiK'
|
|
999
|
+
}, {
|
|
1000
|
+
id: 1,
|
|
1001
|
+
right: false,
|
|
1002
|
+
text: 'No',
|
|
1003
|
+
rewards: [],
|
|
1004
|
+
audioId: '',
|
|
1005
|
+
text_labelId: 'text_3_1_u4s8jzBF',
|
|
1006
|
+
audioId_labelId: 'audioId_3_1_u4s8jaJY'
|
|
1007
|
+
}, {
|
|
1008
|
+
id: 2,
|
|
1009
|
+
right: true,
|
|
1010
|
+
text: 'Patata',
|
|
1011
|
+
rewards: [],
|
|
1012
|
+
audioId: '',
|
|
1013
|
+
text_labelId: 'text_3_2_u4s8jA2Z',
|
|
1014
|
+
audioId_labelId: 'audioId_3_2_u4s8j23g'
|
|
1015
|
+
}],
|
|
1016
|
+
required: true,
|
|
1017
|
+
question: 'Decisión en conversacion sin feedback ni puntos',
|
|
1018
|
+
question_labelId: 'question_3_u4s8i10a'
|
|
1019
|
+
},
|
|
1020
|
+
decision: true
|
|
1021
|
+
}, {
|
|
1022
|
+
flex: true,
|
|
1023
|
+
slots: [{
|
|
1024
|
+
emotion: 'angry',
|
|
1025
|
+
text: '',
|
|
1026
|
+
uid: 'DbKslR',
|
|
1027
|
+
talking: false,
|
|
1028
|
+
alias: 'paco',
|
|
1029
|
+
text_labelId: 'text_0_0_nlrZh8Np',
|
|
1030
|
+
alias_labelId: 'alias_0_0_nlrZh2Iq'
|
|
1031
|
+
}, {
|
|
1032
|
+
emotion: 'neutral',
|
|
1033
|
+
text: '',
|
|
1034
|
+
uid: null,
|
|
1035
|
+
talking: false,
|
|
1036
|
+
text_labelId: 'text_0_1_nlrZiNfB',
|
|
1037
|
+
alias_labelId: 'alias_0_1_nlrZijhw'
|
|
1038
|
+
}, {
|
|
1039
|
+
emotion: 'neutral',
|
|
1040
|
+
text: '',
|
|
1041
|
+
uid: null,
|
|
1042
|
+
talking: false,
|
|
1043
|
+
text_labelId: 'text_0_2_nlrZiBF3',
|
|
1044
|
+
alias_labelId: 'alias_0_2_nlrZiR6G'
|
|
1045
|
+
}, {
|
|
1046
|
+
emotion: 'neutral',
|
|
1047
|
+
text: '',
|
|
1048
|
+
uid: null,
|
|
1049
|
+
talking: false,
|
|
1050
|
+
text_labelId: 'text_0_3_nlrZinJN',
|
|
1051
|
+
alias_labelId: 'alias_0_3_nlrZjLWB'
|
|
1052
|
+
}, {
|
|
1053
|
+
emotion: 'neutral',
|
|
1054
|
+
text: 'Hola!',
|
|
1055
|
+
uid: 'kjTHqi',
|
|
1056
|
+
talking: true,
|
|
1057
|
+
alias: 'manolo',
|
|
1058
|
+
text_labelId: 'text_0_4_nlrZjUV9',
|
|
1059
|
+
alias_labelId: 'alias_0_4_nlrZj81d'
|
|
1060
|
+
}],
|
|
1061
|
+
audioId: '5f1078861d84860011e179d0',
|
|
1062
|
+
hasAlias: true,
|
|
1063
|
+
text_labelId: 'text_0_nlrZj4Nr',
|
|
1064
|
+
audioId_labelId: 'audioId_0_nlrZkkdo'
|
|
1065
|
+
}],
|
|
1066
|
+
background: {
|
|
1067
|
+
imgId: '605369a5901f3e00123b81ca',
|
|
1068
|
+
imgName: 'b27bb40dcb1189d14012131a35b48a36.jpeg',
|
|
1069
|
+
img: {
|
|
1070
|
+
url: 'https://min.int.gamelearn.io/cooked.gl-lms-storage/clients/58dccfba26561500117caf53/image/605369a5901f3e00123b81ca/b27bb40dcb1189d14012131a35b48a36.jpeg'
|
|
1071
|
+
}
|
|
1072
|
+
},
|
|
1073
|
+
characters: [{
|
|
1074
|
+
name: 'Testing',
|
|
1075
|
+
resourceId: '5f68d7b6a373890011a78a11',
|
|
1076
|
+
resource: {
|
|
1077
|
+
url: 'https://min.int.gamelearn.io/cooked.gl-lms-storage/clients/5981fca94d82290bcbe957fe/object/5eff09c2085be00011aae087/pr0238_yacht_001.glb'
|
|
1078
|
+
},
|
|
1079
|
+
type: 'object',
|
|
1080
|
+
uid: 'DbKslR'
|
|
1081
|
+
}, {
|
|
1082
|
+
name: 'Male senior dark-skinned 01',
|
|
1083
|
+
resourceId: '5f5214cec39e26001123797f',
|
|
1084
|
+
resource: {
|
|
1085
|
+
url: 'https://min.int.gamelearn.io/cooked.gl-lms-storage/clients/5981fca94d82290bcbe957fe/character/5f5214cec39e26001123797f/ch0112_philip_001.glb',
|
|
1086
|
+
animations: animations
|
|
1087
|
+
},
|
|
1088
|
+
type: 'character',
|
|
1089
|
+
uid: 'kjTHqi'
|
|
1090
|
+
}, {
|
|
1091
|
+
name: 'Female senior light-skinned 01',
|
|
1092
|
+
resourceId: '5f5214cec39e26001123797f',
|
|
1093
|
+
resource: {
|
|
1094
|
+
url: 'https://min.int.gamelearn.io/cooked.gl-lms-storage/clients/5981fca94d82290bcbe957fe/character/5f60759328beb100113b694c/ch0116_bima_001_rig_v01_llaveronuevo.glb',
|
|
1095
|
+
animations: {
|
|
1096
|
+
neutral: {
|
|
1097
|
+
resource: {}
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
},
|
|
1101
|
+
type: 'character',
|
|
1102
|
+
uid: 'kjTHqt'
|
|
1103
|
+
}, {
|
|
1104
|
+
name: 'Taxi',
|
|
1105
|
+
resourceId: '5f5214cec39e26001123797f',
|
|
1106
|
+
resource: {
|
|
1107
|
+
url: 'https://min.int.gamelearn.io/cooked.gl-lms-storage/clients/5981fca94d82290bcbe957fe/object/5e53b649ef1f60000fb9cc1c/draco_pr0065_car_004.glb'
|
|
1108
|
+
},
|
|
1109
|
+
type: 'object',
|
|
1110
|
+
uid: 'kjTHqx'
|
|
1111
|
+
}]
|
|
1112
|
+
};
|
|
1113
|
+
exports.conversationPropsLodSettings = conversationPropsLodSettings;
|
|
@@ -9,8 +9,6 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
12
|
var _reactTypist = _interopRequireDefault(require("react-typist"));
|
|
15
13
|
|
|
16
14
|
var _helpers = require("./helpers");
|
|
@@ -70,6 +68,7 @@ var DIFFICULTY_MAP = {
|
|
|
70
68
|
|
|
71
69
|
var CrackerPuzzleComponent = function CrackerPuzzleComponent(_ref) {
|
|
72
70
|
var emitEvent = _ref.emitEvent,
|
|
71
|
+
soundActions = _ref.soundActions,
|
|
73
72
|
info = _ref.info,
|
|
74
73
|
velocity = _ref.velocity,
|
|
75
74
|
password = _ref.password,
|
|
@@ -77,6 +76,9 @@ var CrackerPuzzleComponent = function CrackerPuzzleComponent(_ref) {
|
|
|
77
76
|
difficulty = _ref.difficulty,
|
|
78
77
|
setResolveAction = _ref.setResolveAction;
|
|
79
78
|
|
|
79
|
+
var _soundActions = _slicedToArray(soundActions, 1),
|
|
80
|
+
playSound = _soundActions[0];
|
|
81
|
+
|
|
80
82
|
var translate = function translate(id) {
|
|
81
83
|
return emitEvent({
|
|
82
84
|
type: 'translate',
|
|
@@ -134,21 +136,19 @@ var CrackerPuzzleComponent = function CrackerPuzzleComponent(_ref) {
|
|
|
134
136
|
if (finished) {
|
|
135
137
|
disableExit(true);
|
|
136
138
|
}
|
|
137
|
-
}, [finished]);
|
|
139
|
+
}, [finished, disableExit]);
|
|
138
140
|
(0, _react.useEffect)(function () {
|
|
139
141
|
setResolveAction(function (resolve) {
|
|
142
|
+
playSound('score');
|
|
140
143
|
setFinished(true);
|
|
141
144
|
setTimeout(function () {
|
|
142
145
|
resolve();
|
|
143
146
|
}, 4000);
|
|
144
147
|
});
|
|
145
|
-
}, [setResolveAction]);
|
|
148
|
+
}, [setResolveAction, playSound]);
|
|
146
149
|
|
|
147
150
|
var handleFinish = function handleFinish() {
|
|
148
|
-
|
|
149
|
-
type: 'playSound',
|
|
150
|
-
payload: 'click-ui'
|
|
151
|
-
});
|
|
151
|
+
playSound('click-ui');
|
|
152
152
|
var rewards = solution.right.rewards;
|
|
153
153
|
emitEvent({
|
|
154
154
|
type: 'addPoints',
|
|
@@ -233,8 +233,8 @@ var CrackerPuzzleComponent = function CrackerPuzzleComponent(_ref) {
|
|
|
233
233
|
})[0];
|
|
234
234
|
|
|
235
235
|
if (char) {
|
|
236
|
-
var index = char.index;
|
|
237
|
-
|
|
236
|
+
var index = char.index;
|
|
237
|
+
playSound('score');
|
|
238
238
|
var newPasswordPosition = passwordPosition;
|
|
239
239
|
newPasswordPosition[index].used = true;
|
|
240
240
|
setPasswordPosition(newPasswordPosition);
|
|
@@ -251,10 +251,7 @@ var CrackerPuzzleComponent = function CrackerPuzzleComponent(_ref) {
|
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
if (remainingPassword <= 0) {
|
|
254
|
-
|
|
255
|
-
type: 'playSound',
|
|
256
|
-
payload: 'finish-level'
|
|
257
|
-
});
|
|
254
|
+
playSound('finish-level');
|
|
258
255
|
setFinished(true);
|
|
259
256
|
}
|
|
260
257
|
};
|
|
@@ -305,12 +302,5 @@ CrackerPuzzleComponent.defaultProps = {
|
|
|
305
302
|
context: {},
|
|
306
303
|
info: {}
|
|
307
304
|
};
|
|
308
|
-
CrackerPuzzleComponent.propTypes = {
|
|
309
|
-
password: _propTypes.default.string.isRequired,
|
|
310
|
-
velocity: _propTypes.default.string,
|
|
311
|
-
difficulty: _propTypes.default.string,
|
|
312
|
-
context: _propTypes.default.shape({}),
|
|
313
|
-
info: _propTypes.default.shape({})
|
|
314
|
-
};
|
|
315
305
|
var _default = CrackerPuzzleComponent;
|
|
316
306
|
exports.default = _default;
|
|
@@ -9,8 +9,6 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
12
|
var _Options = _interopRequireDefault(require("./Options"));
|
|
15
13
|
|
|
16
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -53,7 +53,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
53
53
|
|
|
54
54
|
var DecisionComponent = function DecisionComponent(_ref) {
|
|
55
55
|
var emitEvent = _ref.emitEvent,
|
|
56
|
-
|
|
56
|
+
soundActions = _ref.soundActions,
|
|
57
|
+
props = _objectWithoutProperties(_ref, ["emitEvent", "soundActions"]);
|
|
57
58
|
|
|
58
59
|
var _props$inheritProps = props.inheritProps,
|
|
59
60
|
inheritProps = _props$inheritProps === void 0 ? {} : _props$inheritProps,
|
|
@@ -77,9 +78,15 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
77
78
|
resultChoice = _useState6[0],
|
|
78
79
|
setResultChoice = _useState6[1];
|
|
79
80
|
|
|
81
|
+
var _soundActions = _slicedToArray(soundActions, 1),
|
|
82
|
+
playSound = _soundActions[0];
|
|
83
|
+
|
|
80
84
|
var failed = required && !resultChoice.right;
|
|
81
85
|
|
|
82
|
-
var playCurrentAudio = function playCurrentAudio(option) {
|
|
86
|
+
var playCurrentAudio = function playCurrentAudio(option) {
|
|
87
|
+
if (option.audio.url) {
|
|
88
|
+
playSound(option.audio.url);
|
|
89
|
+
}
|
|
83
90
|
};
|
|
84
91
|
|
|
85
92
|
var listProps = _objectSpread(_objectSpread({}, inheritProps), {}, {
|
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
var _RewardsComponent = _interopRequireDefault(require("../../rewards-component/components/RewardsComponent"));
|
|
13
11
|
|
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -74,13 +74,16 @@ var emitEvent = function emitEvent(_ref) {
|
|
|
74
74
|
|
|
75
75
|
var decisionProps = {
|
|
76
76
|
emitEvent: emitEvent,
|
|
77
|
+
soundActions: [function () {}, function () {}],
|
|
77
78
|
options: [{
|
|
78
79
|
id: 0,
|
|
79
80
|
right: false,
|
|
80
81
|
feedback: 'dfgsdfgsdfgsdfghdfgh',
|
|
81
82
|
text: 'Si',
|
|
82
83
|
rewards: [],
|
|
83
|
-
|
|
84
|
+
audio: {
|
|
85
|
+
url: ''
|
|
86
|
+
},
|
|
84
87
|
text_labelId: 'text_3_0_u4s8j5fa',
|
|
85
88
|
feedback_labelId: 'feedback_3_0_u4s8jVTv',
|
|
86
89
|
audioId_labelId: 'audioId_3_0_u4s8jyiK'
|
|
@@ -90,7 +93,9 @@ var decisionProps = {
|
|
|
90
93
|
feedback: 'fasdfasdfg',
|
|
91
94
|
text: 'No',
|
|
92
95
|
rewards: [],
|
|
93
|
-
|
|
96
|
+
audio: {
|
|
97
|
+
url: ''
|
|
98
|
+
},
|
|
94
99
|
text_labelId: 'text_3_1_u4s8jzBF',
|
|
95
100
|
feedback_labelId: 'feedback_3_1_u4s8jWNa',
|
|
96
101
|
audioId_labelId: 'audioId_3_1_u4s8jaJY'
|
|
@@ -170,7 +175,9 @@ var decisionProps = {
|
|
|
170
175
|
points: 552,
|
|
171
176
|
type: 'skill'
|
|
172
177
|
}],
|
|
173
|
-
|
|
178
|
+
audio: {
|
|
179
|
+
url: ''
|
|
180
|
+
},
|
|
174
181
|
text_labelId: 'text_3_2_u4s8jA2Z',
|
|
175
182
|
feedback_labelId: 'feedback_3_2_u4s8jBIJ',
|
|
176
183
|
audioId_labelId: 'audioId_3_2_u4s8j23g'
|
|
@@ -182,12 +189,15 @@ var decisionProps = {
|
|
|
182
189
|
exports.decisionProps = decisionProps;
|
|
183
190
|
var decisionPropsWithRadios = {
|
|
184
191
|
emitEvent: emitEvent,
|
|
192
|
+
soundActions: [function () {}, function () {}],
|
|
185
193
|
options: [{
|
|
186
194
|
id: 0,
|
|
187
195
|
right: false,
|
|
188
196
|
text: 'Si',
|
|
189
197
|
rewards: [],
|
|
190
|
-
|
|
198
|
+
audio: {
|
|
199
|
+
url: ''
|
|
200
|
+
},
|
|
191
201
|
text_labelId: 'text_3_0_u4s8j5fa',
|
|
192
202
|
audioId_labelId: 'audioId_3_0_u4s8jyiK'
|
|
193
203
|
}, {
|
|
@@ -195,7 +205,9 @@ var decisionPropsWithRadios = {
|
|
|
195
205
|
right: false,
|
|
196
206
|
text: 'No',
|
|
197
207
|
rewards: [],
|
|
198
|
-
|
|
208
|
+
audio: {
|
|
209
|
+
url: ''
|
|
210
|
+
},
|
|
199
211
|
text_labelId: 'text_3_1_u4s8jzBF',
|
|
200
212
|
audioId_labelId: 'audioId_3_1_u4s8jaJY'
|
|
201
213
|
}, {
|
|
@@ -203,7 +215,9 @@ var decisionPropsWithRadios = {
|
|
|
203
215
|
right: true,
|
|
204
216
|
text: 'Patata',
|
|
205
217
|
rewards: [],
|
|
206
|
-
|
|
218
|
+
audio: {
|
|
219
|
+
url: ''
|
|
220
|
+
},
|
|
207
221
|
text_labelId: 'text_3_2_u4s8jA2Z',
|
|
208
222
|
audioId_labelId: 'audioId_3_2_u4s8j23g'
|
|
209
223
|
}],
|
package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js
CHANGED
|
@@ -47,7 +47,6 @@ var FrameImageClickComponent = function FrameImageClickComponent(_ref) {
|
|
|
47
47
|
list = _ref.list,
|
|
48
48
|
description = _ref.description,
|
|
49
49
|
showFrames = _ref.showFrames,
|
|
50
|
-
setInfo = _ref.setInfo,
|
|
51
50
|
soundActions = _ref.soundActions,
|
|
52
51
|
disableExit = _ref.disableExit,
|
|
53
52
|
setResolveAction = _ref.setResolveAction;
|
|
@@ -25,7 +25,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "und
|
|
|
25
25
|
|
|
26
26
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var PlayButton = function PlayButton(_ref) {
|
|
29
29
|
var onClick = _ref.onClick,
|
|
30
30
|
canPlay = _ref.canPlay,
|
|
31
31
|
emitPlaying = _ref.emitPlaying;
|
|
@@ -72,5 +72,5 @@ var Playbutton = function Playbutton(_ref) {
|
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
var _default =
|
|
75
|
+
var _default = PlayButton;
|
|
76
76
|
exports.default = _default;
|
|
@@ -73,6 +73,7 @@ var themes = {
|
|
|
73
73
|
|
|
74
74
|
var HackerPuzzleComponent = function HackerPuzzleComponent(_ref) {
|
|
75
75
|
var emitEvent = _ref.emitEvent,
|
|
76
|
+
soundActions = _ref.soundActions,
|
|
76
77
|
info = _ref.info,
|
|
77
78
|
themeNumber = _ref.themeNumber,
|
|
78
79
|
type = _ref.type,
|
|
@@ -87,6 +88,9 @@ var HackerPuzzleComponent = function HackerPuzzleComponent(_ref) {
|
|
|
87
88
|
});
|
|
88
89
|
};
|
|
89
90
|
|
|
91
|
+
var _soundActions = _slicedToArray(soundActions, 1),
|
|
92
|
+
playSound = _soundActions[0];
|
|
93
|
+
|
|
90
94
|
var solution = info.solution;
|
|
91
95
|
var defaultTheme = 1;
|
|
92
96
|
var currentTheme = themes['theme' + (themeNumber || defaultTheme)];
|
|
@@ -168,10 +172,7 @@ var HackerPuzzleComponent = function HackerPuzzleComponent(_ref) {
|
|
|
168
172
|
};
|
|
169
173
|
|
|
170
174
|
var handleFinish = function handleFinish() {
|
|
171
|
-
|
|
172
|
-
type: 'playSound',
|
|
173
|
-
payload: 'click-ui'
|
|
174
|
-
});
|
|
175
|
+
playSound('click-ui');
|
|
175
176
|
var rewards = solution.right.rewards;
|
|
176
177
|
emitEvent({
|
|
177
178
|
type: 'addPoints',
|
|
@@ -213,10 +214,7 @@ var HackerPuzzleComponent = function HackerPuzzleComponent(_ref) {
|
|
|
213
214
|
|
|
214
215
|
if (currentTextEnd === letters.length) {
|
|
215
216
|
if (currentLine + 1 >= lines.length) {
|
|
216
|
-
|
|
217
|
-
type: 'playSound',
|
|
218
|
-
payload: 'finish-level'
|
|
219
|
-
});
|
|
217
|
+
playSound('finish-level');
|
|
220
218
|
setFinished(true);
|
|
221
219
|
} else {
|
|
222
220
|
setCurrentLine(currentLine + 1);
|
|
@@ -4,9 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var languages = {
|
|
8
8
|
js: ["var rows = prompt('How many rows for your multiplication table?');", "var cols = prompt('How many columns for your multiplication table?');", ' ', "if(rows == '' || rows == null)", ' rows = 10;', ' ', "if(cols== '' || cols== null)", ' cols = 10;', ' ', 'createTable(rows, cols);', ' ', 'function createTable(rows, cols)', '{', ' var j=1;', " var output = '<table border='1' width='500' cellspacing='0'cellpadding='5'>';", ' ', ' for(i=1;i<=rows;i++)', ' {', " output = output + '<tr>';", ' while(j<=cols)', ' {', " output = output + '<td>' + i*j + '</td>';", ' j = j+1;', ' }', " output = output + '</tr>';", ' j = 1;', ' }', ' ', " output = output + '</table>';", ' document.write(output);', '}'],
|
|
9
9
|
lua: ['-- Ensure that that the element at i is in the right position,', '-- and return a closure which can be used for continuing the sort.', ' ', 'function quicksorter(i, vec, low, high)', ' if low >= high then', ' return quicksorter', ' else -- low < high', ' -- partition the vector and initialize the child closures', ' local middle = partition(vec, low, high)', ' local left, right = quicksorter', ' ', '-- Create the promise', ' local function self(i, vec, low, high)', ' if i < middle then', ' left = left(i, vec, low, middle-1)', ' return self', ' elseif i > middle then', ' right = right(i, vec, middle+1, high)', ' return self', ' end', ' end', ' ', '-- Force the promise until i is in the right position', ' return self(i, vec, low, high)', ' end', 'end', ' ', 'function lazysort(vec, low, high)', ' local sorter = quicksorter', ' return function(i)', ' sorter = sorter(i, vec, low, high)', ' return vec[i]', ' end', 'end'],
|
|
10
10
|
python: ['#ask the user to enter four pieces of information', ' ', "firstname = input('Enter your first name: ')", "surname = input('Enter your surname: ')", "email = input('Enter your email: ')", "yearsteaching = input('Enter the number of years teaching: ')", ' ', "file = open('staff.csv','r') #opens the file in read mode", 'found=False #sets whether the user is found to False', ' ', 'for line in file: #reads each line in the file', " staff = line.split(',') #splits the line into the list called staff", ' if staff[2] == email: #checks if the email entered is in the list', ' found=True #if it is changes found to True', ' ', 'file.close() #closes the file', ' ', 'if found==True: #after the loop checks if the user is found', " print('Staff member already exists in the file') #displays on screen", 'else:', ' #if the email was not in the file', " writefile=open('staff.csv','a') #open the file in append mode", " writefile.write(firstname + ',' + surname + ',' + email + ',' + yearsteaching) #write the new information to the file", ' writefile.close() #close the file', " print('Staff member added to file')"]
|
|
11
11
|
};
|
|
12
|
+
var _default = languages;
|
|
12
13
|
exports.default = _default;
|
|
@@ -13,6 +13,7 @@ var mockProps = {
|
|
|
13
13
|
emitEvent: emitEvent,
|
|
14
14
|
disableExit: function disableExit() {},
|
|
15
15
|
setResolveAction: function setResolveAction() {},
|
|
16
|
+
soundActions: [function () {}, function () {}],
|
|
16
17
|
type: 'js',
|
|
17
18
|
writingSpeed: 5,
|
|
18
19
|
info: {
|
|
@@ -43,6 +44,7 @@ var mockProps2 = {
|
|
|
43
44
|
emitEvent: emitEvent,
|
|
44
45
|
disableExit: function disableExit() {},
|
|
45
46
|
setResolveAction: function setResolveAction() {},
|
|
47
|
+
soundActions: [function () {}, function () {}],
|
|
46
48
|
type: 'python',
|
|
47
49
|
writingSpeed: 5,
|
|
48
50
|
info: {
|
|
@@ -73,6 +75,7 @@ var mockProps3 = {
|
|
|
73
75
|
emitEvent: emitEvent,
|
|
74
76
|
disableExit: function disableExit() {},
|
|
75
77
|
setResolveAction: function setResolveAction() {},
|
|
78
|
+
soundActions: [function () {}, function () {}],
|
|
76
79
|
type: 'lua',
|
|
77
80
|
writingSpeed: 5,
|
|
78
81
|
info: {
|