@100mslive/roomkit-react 0.2.1-alpha.0 → 0.2.1-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -2227,7 +2227,7 @@
2227
2227
  "format": "esm"
2228
2228
  },
2229
2229
  "src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx": {
2230
- "bytes": 3097,
2230
+ "bytes": 3098,
2231
2231
  "imports": [
2232
2232
  {
2233
2233
  "path": "react",
@@ -4478,7 +4478,7 @@
4478
4478
  "format": "cjs"
4479
4479
  },
4480
4480
  "../hms-video-store/dist/index.js": {
4481
- "bytes": 320473,
4481
+ "bytes": 320481,
4482
4482
  "imports": [
4483
4483
  {
4484
4484
  "path": "../../node_modules/reselect/es/index.js",
@@ -6728,7 +6728,7 @@
6728
6728
  "format": "esm"
6729
6729
  },
6730
6730
  "src/Prebuilt/components/Polls/Voting/StatisticBox.tsx": {
6731
- "bytes": 540,
6731
+ "bytes": 624,
6732
6732
  "imports": [
6733
6733
  {
6734
6734
  "path": "react",
@@ -6753,8 +6753,8 @@
6753
6753
  ],
6754
6754
  "format": "esm"
6755
6755
  },
6756
- "src/Prebuilt/components/Polls/Voting/LeaderboardSummary.tsx": {
6757
- "bytes": 5842,
6756
+ "src/Prebuilt/components/Polls/Voting/useQuizSummary.tsx": {
6757
+ "bytes": 1684,
6758
6758
  "imports": [
6759
6759
  {
6760
6760
  "path": "react",
@@ -6767,70 +6767,61 @@
6767
6767
  "external": true
6768
6768
  },
6769
6769
  {
6770
- "path": "@100mslive/react-icons",
6770
+ "path": "<define:process.env>",
6771
6771
  "kind": "import-statement",
6772
6772
  "external": true
6773
6773
  },
6774
6774
  {
6775
- "path": "src/Layout/index.tsx",
6776
- "kind": "import-statement",
6777
- "original": "../../../../Layout"
6778
- },
6779
- {
6780
- "path": "src/Loading/index.ts",
6781
- "kind": "import-statement",
6782
- "original": "../../../../Loading"
6783
- },
6784
- {
6785
- "path": "src/Text/index.tsx",
6775
+ "path": "<runtime>",
6786
6776
  "kind": "import-statement",
6787
- "original": "../../../../Text"
6788
- },
6777
+ "external": true
6778
+ }
6779
+ ],
6780
+ "format": "esm"
6781
+ },
6782
+ "src/Prebuilt/components/Polls/Voting/PeerParticipationSummary.tsx": {
6783
+ "bytes": 2098,
6784
+ "imports": [
6789
6785
  {
6790
- "path": "src/Prebuilt/components/Polls/Voting/LeaderboardEntry.tsx",
6786
+ "path": "react",
6791
6787
  "kind": "import-statement",
6792
- "original": "./LeaderboardEntry"
6788
+ "external": true
6793
6789
  },
6794
6790
  {
6795
- "path": "src/Prebuilt/components/Polls/Voting/StatisticBox.tsx",
6791
+ "path": "@100mslive/react-sdk",
6796
6792
  "kind": "import-statement",
6797
- "original": "./StatisticBox"
6793
+ "external": true
6798
6794
  },
6799
6795
  {
6800
- "path": "src/Prebuilt/components/AppData/useSidepane.js",
6796
+ "path": "src/Layout/index.tsx",
6801
6797
  "kind": "import-statement",
6802
- "original": "../../AppData/useSidepane"
6798
+ "original": "../../../../Layout"
6803
6799
  },
6804
6800
  {
6805
- "path": "src/Prebuilt/components/AppData/useUISettings.js",
6801
+ "path": "src/Text/index.tsx",
6806
6802
  "kind": "import-statement",
6807
- "original": "../../AppData/useUISettings"
6803
+ "original": "../../../../Text"
6808
6804
  },
6809
6805
  {
6810
- "path": "src/Prebuilt/components/Polls/common/StatusIndicator.tsx",
6806
+ "path": "src/Prebuilt/components/Polls/Voting/StatisticBox.tsx",
6811
6807
  "kind": "import-statement",
6812
- "original": "../common/StatusIndicator"
6808
+ "original": "./StatisticBox"
6813
6809
  },
6814
6810
  {
6815
- "path": "src/Prebuilt/common/constants.ts",
6811
+ "path": "src/Prebuilt/components/Polls/Voting/useQuizSummary.tsx",
6816
6812
  "kind": "import-statement",
6817
- "original": "../../../common/constants"
6813
+ "original": "./useQuizSummary"
6818
6814
  },
6819
6815
  {
6820
6816
  "path": "<define:process.env>",
6821
6817
  "kind": "import-statement",
6822
6818
  "external": true
6823
- },
6824
- {
6825
- "path": "<runtime>",
6826
- "kind": "import-statement",
6827
- "external": true
6828
6819
  }
6829
6820
  ],
6830
6821
  "format": "esm"
6831
6822
  },
6832
- "src/Prebuilt/components/Polls/Voting/PeerParticipationSummary.tsx": {
6833
- "bytes": 1075,
6823
+ "src/Prebuilt/components/Polls/Voting/LeaderboardSummary.tsx": {
6824
+ "bytes": 4039,
6834
6825
  "imports": [
6835
6826
  {
6836
6827
  "path": "react",
@@ -6842,25 +6833,60 @@
6842
6833
  "kind": "import-statement",
6843
6834
  "external": true
6844
6835
  },
6836
+ {
6837
+ "path": "@100mslive/react-icons",
6838
+ "kind": "import-statement",
6839
+ "external": true
6840
+ },
6845
6841
  {
6846
6842
  "path": "src/Layout/index.tsx",
6847
6843
  "kind": "import-statement",
6848
6844
  "original": "../../../../Layout"
6849
6845
  },
6846
+ {
6847
+ "path": "src/Loading/index.ts",
6848
+ "kind": "import-statement",
6849
+ "original": "../../../../Loading"
6850
+ },
6850
6851
  {
6851
6852
  "path": "src/Text/index.tsx",
6852
6853
  "kind": "import-statement",
6853
6854
  "original": "../../../../Text"
6854
6855
  },
6855
6856
  {
6856
- "path": "src/Prebuilt/components/Polls/Voting/StatisticBox.tsx",
6857
+ "path": "src/Prebuilt/components/Polls/Voting/LeaderboardEntry.tsx",
6857
6858
  "kind": "import-statement",
6858
- "original": "./StatisticBox"
6859
+ "original": "./LeaderboardEntry"
6859
6860
  },
6860
6861
  {
6861
- "path": "src/Prebuilt/common/utils.js",
6862
+ "path": "src/Prebuilt/components/Polls/Voting/PeerParticipationSummary.tsx",
6862
6863
  "kind": "import-statement",
6863
- "original": "../../../common/utils"
6864
+ "original": "./PeerParticipationSummary"
6865
+ },
6866
+ {
6867
+ "path": "src/Prebuilt/components/AppData/useSidepane.js",
6868
+ "kind": "import-statement",
6869
+ "original": "../../AppData/useSidepane"
6870
+ },
6871
+ {
6872
+ "path": "src/Prebuilt/components/AppData/useUISettings.js",
6873
+ "kind": "import-statement",
6874
+ "original": "../../AppData/useUISettings"
6875
+ },
6876
+ {
6877
+ "path": "src/Prebuilt/components/Polls/Voting/useQuizSummary.tsx",
6878
+ "kind": "import-statement",
6879
+ "original": "./useQuizSummary"
6880
+ },
6881
+ {
6882
+ "path": "src/Prebuilt/components/Polls/common/StatusIndicator.tsx",
6883
+ "kind": "import-statement",
6884
+ "original": "../common/StatusIndicator"
6885
+ },
6886
+ {
6887
+ "path": "src/Prebuilt/common/constants.ts",
6888
+ "kind": "import-statement",
6889
+ "original": "../../../common/constants"
6864
6890
  },
6865
6891
  {
6866
6892
  "path": "<define:process.env>",
@@ -6984,7 +7010,7 @@
6984
7010
  "format": "esm"
6985
7011
  },
6986
7012
  "src/Prebuilt/components/Polls/Voting/Voting.tsx": {
6987
- "bytes": 3244,
7013
+ "bytes": 3192,
6988
7014
  "imports": [
6989
7015
  {
6990
7016
  "path": "react",
@@ -10077,13 +10103,18 @@
10077
10103
  "format": "esm"
10078
10104
  },
10079
10105
  "src/Prebuilt/layouts/WhiteboardView.tsx": {
10080
- "bytes": 1906,
10106
+ "bytes": 2047,
10081
10107
  "imports": [
10082
10108
  {
10083
10109
  "path": "react",
10084
10110
  "kind": "import-statement",
10085
10111
  "external": true
10086
10112
  },
10113
+ {
10114
+ "path": "react-use",
10115
+ "kind": "import-statement",
10116
+ "external": true
10117
+ },
10087
10118
  {
10088
10119
  "path": "@100mslive/react-sdk",
10089
10120
  "kind": "import-statement",
@@ -10099,6 +10130,11 @@
10099
10130
  "kind": "import-statement",
10100
10131
  "original": "../components/VideoLayouts/ProminenceLayout"
10101
10132
  },
10133
+ {
10134
+ "path": "src/index.ts",
10135
+ "kind": "import-statement",
10136
+ "original": "../../"
10137
+ },
10102
10138
  {
10103
10139
  "path": "src/Layout/index.tsx",
10104
10140
  "kind": "import-statement",
@@ -12541,7 +12577,7 @@
12541
12577
  "dist/index.js": {
12542
12578
  "imports": [
12543
12579
  {
12544
- "path": "dist/chunk-FTOP3RHP.js",
12580
+ "path": "dist/chunk-LRZEFY46.js",
12545
12581
  "kind": "import-statement"
12546
12582
  }
12547
12583
  ],
@@ -12614,16 +12650,16 @@
12614
12650
  "inputs": {},
12615
12651
  "bytes": 1822
12616
12652
  },
12617
- "dist/HLSView-GKCGIZ5F.js.map": {
12653
+ "dist/HLSView-QPKBRL74.js.map": {
12618
12654
  "imports": [],
12619
12655
  "exports": [],
12620
12656
  "inputs": {},
12621
12657
  "bytes": 58021
12622
12658
  },
12623
- "dist/HLSView-GKCGIZ5F.js": {
12659
+ "dist/HLSView-QPKBRL74.js": {
12624
12660
  "imports": [
12625
12661
  {
12626
- "path": "dist/chunk-FTOP3RHP.js",
12662
+ "path": "dist/chunk-LRZEFY46.js",
12627
12663
  "kind": "import-statement"
12628
12664
  },
12629
12665
  {
@@ -12787,13 +12823,13 @@
12787
12823
  },
12788
12824
  "bytes": 36449
12789
12825
  },
12790
- "dist/chunk-FTOP3RHP.js.map": {
12826
+ "dist/chunk-LRZEFY46.js.map": {
12791
12827
  "imports": [],
12792
12828
  "exports": [],
12793
12829
  "inputs": {},
12794
- "bytes": 3003490
12830
+ "bytes": 3004449
12795
12831
  },
12796
- "dist/chunk-FTOP3RHP.js": {
12832
+ "dist/chunk-LRZEFY46.js": {
12797
12833
  "imports": [
12798
12834
  {
12799
12835
  "path": "react",
@@ -14231,22 +14267,22 @@
14231
14267
  "external": true
14232
14268
  },
14233
14269
  {
14234
- "path": "react",
14270
+ "path": "@100mslive/react-sdk",
14235
14271
  "kind": "import-statement",
14236
14272
  "external": true
14237
14273
  },
14238
14274
  {
14239
- "path": "@100mslive/react-sdk",
14275
+ "path": "react",
14240
14276
  "kind": "import-statement",
14241
14277
  "external": true
14242
14278
  },
14243
14279
  {
14244
- "path": "@100mslive/react-icons",
14280
+ "path": "react",
14245
14281
  "kind": "import-statement",
14246
14282
  "external": true
14247
14283
  },
14248
14284
  {
14249
- "path": "react",
14285
+ "path": "@100mslive/react-sdk",
14250
14286
  "kind": "import-statement",
14251
14287
  "external": true
14252
14288
  },
@@ -14260,6 +14296,16 @@
14260
14296
  "kind": "import-statement",
14261
14297
  "external": true
14262
14298
  },
14299
+ {
14300
+ "path": "@100mslive/react-icons",
14301
+ "kind": "import-statement",
14302
+ "external": true
14303
+ },
14304
+ {
14305
+ "path": "react",
14306
+ "kind": "import-statement",
14307
+ "external": true
14308
+ },
14263
14309
  {
14264
14310
  "path": "react",
14265
14311
  "kind": "import-statement",
@@ -14975,6 +15021,11 @@
14975
15021
  "kind": "import-statement",
14976
15022
  "external": true
14977
15023
  },
15024
+ {
15025
+ "path": "react-use",
15026
+ "kind": "import-statement",
15027
+ "external": true
15028
+ },
14978
15029
  {
14979
15030
  "path": "@100mslive/react-sdk",
14980
15031
  "kind": "import-statement",
@@ -14996,7 +15047,7 @@
14996
15047
  "external": true
14997
15048
  },
14998
15049
  {
14999
- "path": "dist/HLSView-GKCGIZ5F.js",
15050
+ "path": "dist/HLSView-QPKBRL74.js",
15000
15051
  "kind": "dynamic-import"
15001
15052
  },
15002
15053
  {
@@ -15418,7 +15469,7 @@
15418
15469
  ],
15419
15470
  "inputs": {
15420
15471
  "<define:process.env>": {
15421
- "bytesInOutput": 18388
15472
+ "bytesInOutput": 17933
15422
15473
  },
15423
15474
  "../../node_modules/lodash/lodash.js": {
15424
15475
  "bytesInOutput": 224265
@@ -15700,7 +15751,7 @@
15700
15751
  "bytesInOutput": 5480
15701
15752
  },
15702
15753
  "src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx": {
15703
- "bytesInOutput": 2865
15754
+ "bytesInOutput": 2866
15704
15755
  },
15705
15756
  "src/Prebuilt/IconButton.jsx": {
15706
15757
  "bytesInOutput": 573
@@ -15889,7 +15940,7 @@
15889
15940
  "bytesInOutput": 907
15890
15941
  },
15891
15942
  "src/Prebuilt/common/utils.js": {
15892
- "bytesInOutput": 3731
15943
+ "bytesInOutput": 2426
15893
15944
  },
15894
15945
  "src/Prebuilt/components/MoreSettings/ActionTile.jsx": {
15895
15946
  "bytesInOutput": 1390
@@ -16021,25 +16072,28 @@
16021
16072
  "bytesInOutput": 2116
16022
16073
  },
16023
16074
  "src/Prebuilt/components/Polls/Voting/LeaderboardSummary.tsx": {
16024
- "bytesInOutput": 6216
16075
+ "bytesInOutput": 3973
16025
16076
  },
16026
16077
  "src/Prebuilt/components/Polls/Voting/LeaderboardEntry.tsx": {
16027
16078
  "bytesInOutput": 1683
16028
16079
  },
16080
+ "src/Prebuilt/components/Polls/Voting/PeerParticipationSummary.tsx": {
16081
+ "bytesInOutput": 2194
16082
+ },
16029
16083
  "src/Prebuilt/components/Polls/Voting/StatisticBox.tsx": {
16030
- "bytesInOutput": 512
16084
+ "bytesInOutput": 634
16085
+ },
16086
+ "src/Prebuilt/components/Polls/Voting/useQuizSummary.tsx": {
16087
+ "bytesInOutput": 1874
16031
16088
  },
16032
16089
  "src/Prebuilt/components/Polls/Voting/Voting.tsx": {
16033
- "bytesInOutput": 3216
16090
+ "bytesInOutput": 3113
16034
16091
  },
16035
16092
  "src/Prebuilt/components/Polls/Voting/StandardVoting.tsx": {
16036
- "bytesInOutput": 1254
16037
- },
16038
- "src/Prebuilt/components/Polls/Voting/PeerParticipationSummary.tsx": {
16039
- "bytesInOutput": 1013
16093
+ "bytesInOutput": 1260
16040
16094
  },
16041
16095
  "src/Prebuilt/components/Polls/Voting/QuestionCard.jsx": {
16042
- "bytesInOutput": 8548
16096
+ "bytesInOutput": 8527
16043
16097
  },
16044
16098
  "src/Prebuilt/components/Polls/Voting/TimedVoting.tsx": {
16045
16099
  "bytesInOutput": 1101
@@ -16051,7 +16105,7 @@
16051
16105
  "bytesInOutput": 3444
16052
16106
  },
16053
16107
  "src/Prebuilt/components/Chat/ChatBody.tsx": {
16054
- "bytesInOutput": 14276
16108
+ "bytesInOutput": 14278
16055
16109
  },
16056
16110
  "src/Prebuilt/components/Chat/ChatActions.tsx": {
16057
16111
  "bytesInOutput": 9777
@@ -16162,7 +16216,7 @@
16162
16216
  "bytesInOutput": 3871
16163
16217
  },
16164
16218
  "src/Prebuilt/components/VideoLayouts/EqualProminence.tsx": {
16165
- "bytesInOutput": 2021
16219
+ "bytesInOutput": 2019
16166
16220
  },
16167
16221
  "src/Prebuilt/components/InsetTile.tsx": {
16168
16222
  "bytesInOutput": 4035
@@ -16213,7 +16267,7 @@
16213
16267
  "bytesInOutput": 1415
16214
16268
  },
16215
16269
  "src/Prebuilt/layouts/WhiteboardView.tsx": {
16216
- "bytesInOutput": 1967
16270
+ "bytesInOutput": 2075
16217
16271
  },
16218
16272
  "src/Prebuilt/components/hooks/useCloseScreenshareWhiteboard.tsx": {
16219
16273
  "bytesInOutput": 997
@@ -16330,7 +16384,7 @@
16330
16384
  "bytesInOutput": 651
16331
16385
  }
16332
16386
  },
16333
- "bytes": 1221347
16387
+ "bytes": 1220642
16334
16388
  }
16335
16389
  }
16336
16390
  }
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.2.1-alpha.0",
13
+ "version": "0.2.1-alpha.1",
14
14
  "author": "100ms",
15
15
  "license": "MIT",
16
16
  "files": [
@@ -65,6 +65,7 @@
65
65
  "@types/react-window": "^1.8.5",
66
66
  "babel-loader": "^8.2.5",
67
67
  "babel-plugin-react-require": "3.1.3",
68
+ "esbuild-loader": "^4.0.2",
68
69
  "react": "^18.1.0",
69
70
  "rollup": "^2.70.1",
70
71
  "rollup-plugin-esbuild": "^5.0.0",
@@ -76,10 +77,10 @@
76
77
  "react": ">=17.0.2 <19.0.0"
77
78
  },
78
79
  "dependencies": {
79
- "@100mslive/hls-player": "0.2.1-alpha.0",
80
- "@100mslive/hms-virtual-background": "1.12.1-alpha.0",
81
- "@100mslive/react-icons": "0.9.1-alpha.0",
82
- "@100mslive/react-sdk": "0.9.1-alpha.0",
80
+ "@100mslive/hls-player": "0.2.1-alpha.1",
81
+ "@100mslive/hms-virtual-background": "1.12.1-alpha.1",
82
+ "@100mslive/react-icons": "0.9.1-alpha.1",
83
+ "@100mslive/react-sdk": "0.9.1-alpha.1",
83
84
  "@100mslive/types-prebuilt": "0.12.5",
84
85
  "@emoji-mart/data": "^1.0.6",
85
86
  "@emoji-mart/react": "^1.0.1",
@@ -114,5 +115,5 @@
114
115
  "uuid": "^8.3.2",
115
116
  "worker-timers": "^7.0.40"
116
117
  },
117
- "gitHead": "37788eb004f63672aae22043c6ad6b2debaff74c"
118
+ "gitHead": "8e59b80ba249933faedfafd0c9fef523a07dc74c"
118
119
  }
@@ -8,7 +8,7 @@ You can use either npm or yarn to install the dependencies. Please install the r
8
8
  you're planning to use with react or other framework/plain JavaScript.
9
9
 
10
10
  ```bash
11
- npm install --save @100mslive/hms-video @100mslive/hms-video-store
11
+ npm install --save @100mslive/hms-video-store
12
12
  ```
13
13
 
14
14
  ```bash
@@ -12,7 +12,7 @@ const IconSection = styled(IconButton, {
12
12
  p: '$4',
13
13
  r: '$1',
14
14
  borderTopRightRadius: 0,
15
- borderColor: '$border_default',
15
+ borderColor: '$border_bright',
16
16
  borderBottomRightRadius: 0,
17
17
  position: 'relative',
18
18
  '&:not([disabled]):focus-visible': {
@@ -28,10 +28,10 @@ const IconSection = styled(IconButton, {
28
28
  const OptionsSection = styled(IconButton, {
29
29
  w: 'unset',
30
30
  h: '$14',
31
- p: '$4',
31
+ p: '$4 $2',
32
32
  r: '$1',
33
33
  borderTopLeftRadius: 0,
34
- borderColor: '$border_default',
34
+ borderColor: '$border_bright',
35
35
  borderBottomLeftRadius: 0,
36
36
  borderLeftWidth: 0,
37
37
  position: 'relative',
@@ -1,51 +1,27 @@
1
- import React, { useEffect, useState } from 'react';
2
- import {
3
- HMSQuizLeaderboardResponse,
4
- HMSQuizLeaderboardSummary,
5
- selectPollByID,
6
- useHMSActions,
7
- useHMSStore,
8
- } from '@100mslive/react-sdk';
1
+ import React, { useState } from 'react';
2
+ import { selectPollByID, useHMSStore } from '@100mslive/react-sdk';
9
3
  import { ChevronLeftIcon, ChevronRightIcon, CrossIcon } from '@100mslive/react-icons';
10
4
  import { Box, Flex } from '../../../../Layout';
11
5
  import { Loading } from '../../../../Loading';
12
6
  import { Text } from '../../../../Text';
13
7
  import { LeaderboardEntry } from './LeaderboardEntry';
14
- import { StatisticBox } from './StatisticBox';
8
+ import { PeerParticipationSummary } from './PeerParticipationSummary';
15
9
  // @ts-ignore
16
10
  import { useSidepaneToggle } from '../../AppData/useSidepane';
17
11
  // @ts-ignore
18
12
  import { usePollViewState } from '../../AppData/useUISettings';
13
+ import { useQuizSummary } from './useQuizSummary';
19
14
  // @ts-ignore
20
15
  import { StatusIndicator } from '../common/StatusIndicator';
21
16
  import { POLL_VIEWS } from '../../../common/constants';
22
17
 
23
18
  export const LeaderboardSummary = ({ pollID }: { pollID: string }) => {
24
- const hmsActions = useHMSActions();
25
19
  const quiz = useHMSStore(selectPollByID(pollID));
26
- const [quizLeaderboard, setQuizLeaderboard] = useState<HMSQuizLeaderboardResponse | undefined>();
20
+ const { quizLeaderboard, maxPossibleScore } = useQuizSummary(pollID);
27
21
  const [viewAllEntries, setViewAllEntries] = useState(false);
28
- const summary: HMSQuizLeaderboardSummary = quizLeaderboard?.summary || {
29
- totalUsers: 0,
30
- votedUsers: 0,
31
- avgScore: 0,
32
- avgTime: 0,
33
- correctAnswers: 0,
34
- };
35
-
36
22
  const { setPollView } = usePollViewState();
37
23
  const toggleSidepane = useSidepaneToggle();
38
24
 
39
- useEffect(() => {
40
- const fetchLeaderboardData = async () => {
41
- if (!quizLeaderboard && quiz) {
42
- const leaderboardData = await hmsActions.interactivityCenter.fetchLeaderboard(quiz.id, 0, 50);
43
- setQuizLeaderboard(leaderboardData);
44
- }
45
- };
46
- fetchLeaderboardData();
47
- }, [quiz, hmsActions.interactivityCenter, quizLeaderboard]);
48
-
49
25
  if (!quiz || !quizLeaderboard)
50
26
  return (
51
27
  <Flex align="center" justify="center" css={{ size: '100%' }}>
@@ -53,14 +29,6 @@ export const LeaderboardSummary = ({ pollID }: { pollID: string }) => {
53
29
  </Flex>
54
30
  );
55
31
 
56
- const defaultCalculations = { maxPossibleScore: 0, totalResponses: 0 };
57
- const { maxPossibleScore, totalResponses } =
58
- quiz.questions?.reduce((accumulator, question) => {
59
- accumulator.maxPossibleScore += question.weight || 0;
60
- accumulator.totalResponses += question?.responses?.length || 0;
61
- return accumulator;
62
- }, defaultCalculations) || defaultCalculations;
63
-
64
32
  const questionCount = quiz.questions?.length || 0;
65
33
 
66
34
  return (
@@ -86,29 +54,9 @@ export const LeaderboardSummary = ({ pollID }: { pollID: string }) => {
86
54
  </Flex>
87
55
  </Flex>
88
56
 
89
- {!viewAllEntries ? (
90
- <Box css={{ py: '$4' }}>
91
- <Text variant="sm" css={{ fontWeight: '$semiBold' }}>
92
- Participation Summary
93
- </Text>
94
-
95
- <Box css={{ my: '$4' }}>
96
- <Flex css={{ w: '100%', gap: '$4' }}>
97
- <StatisticBox
98
- title="Voted"
99
- value={`${summary?.totalUsers ? (100 * summary?.votedUsers) / summary?.totalUsers : 0}%`}
100
- />
101
- <StatisticBox title="Correct Answers" value={`${summary?.correctAnswers}/${totalResponses}`} />
102
- </Flex>
103
- <Flex css={{ w: '100%', gap: '$4', mt: '$4' }}>
104
- {summary?.avgTime > 0 ? <StatisticBox title="Avg. Time" value={summary?.avgTime} /> : null}
105
- <StatisticBox title="Avg. Score" value={summary?.avgScore} />
106
- </Flex>
107
- </Box>
108
- </Box>
109
- ) : null}
57
+ {!viewAllEntries ? <PeerParticipationSummary quiz={quiz} /> : null}
110
58
 
111
- <Text variant="sm" css={{ fontWeight: '$semiBold' }}>
59
+ <Text variant="sm" css={{ fontWeight: '$semiBold', mt: '$4' }}>
112
60
  Leaderboard
113
61
  </Text>
114
62
  <Text variant="xs" css={{ color: '$on_surface_medium' }}>