dce-crosstypes 1.0.0 → 1.0.1
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/README +31 -0
- package/lib/Engagement/EngagementBundle/EngagementSource.d.ts +3 -1
- package/lib/Engagement/EngagementBundle/EngagementSource.js +10 -0
- package/lib/Engagement/EngagementBundle/EngagementSource.js.map +1 -1
- package/lib/Engagement/EngagementBundle/SimpleWatchTraceAnalytics.d.ts +14 -0
- package/lib/Engagement/EngagementBundle/SimpleWatchTraceAnalytics.js +3 -0
- package/lib/Engagement/EngagementBundle/SimpleWatchTraceAnalytics.js.map +1 -0
- package/lib/Engagement/EngagementBundle/UserEngagement.d.ts +6 -0
- package/lib/Engagement/EngagementBundle/index.d.ts +1 -0
- package/lib/Engagement/InferredEngagementSchedule/AttendanceMethod.d.ts +12 -0
- package/lib/Engagement/InferredEngagementSchedule/AttendanceMethod.js +21 -0
- package/lib/Engagement/InferredEngagementSchedule/AttendanceMethod.js.map +1 -0
- package/lib/Engagement/InferredEngagementSchedule/AverageUserEngagement.d.ts +14 -5
- package/lib/Engagement/InferredEngagementSchedule/AverageUserEngagement.js +2 -0
- package/lib/Engagement/InferredEngagementSchedule/AverageUserEngagement.js.map +1 -1
- package/lib/Engagement/InferredEngagementSchedule/AverageWatchAnalytics.d.ts +14 -0
- package/lib/Engagement/InferredEngagementSchedule/AverageWatchAnalytics.js +3 -0
- package/lib/Engagement/InferredEngagementSchedule/AverageWatchAnalytics.js.map +1 -0
- package/lib/Engagement/InferredEngagementSchedule/InferredWeekSchedule.d.ts +3 -1
- package/lib/Engagement/InferredEngagementSchedule/InferredWeekSchedule.js +1 -1
- package/lib/Engagement/InferredEngagementSchedule/InferredWeekSchedule.js.map +1 -1
- package/package.json +1 -1
- package/src/Engagement/EngagementBundle/EngagementSource.ts +11 -0
- package/src/Engagement/EngagementBundle/SimpleWatchTraceAnalytics.ts +22 -0
- package/src/Engagement/EngagementBundle/UserEngagement.ts +12 -0
- package/src/Engagement/EngagementBundle/index.ts +2 -0
- package/src/Engagement/InferredEngagementSchedule/AttendanceMethod.ts +18 -0
- package/src/Engagement/InferredEngagementSchedule/AverageUserEngagement.ts +14 -6
- package/src/Engagement/InferredEngagementSchedule/AverageWatchAnalytics.ts +22 -0
- package/src/Engagement/InferredEngagementSchedule/InferredWeekSchedule.ts +5 -1
package/README
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# dce-crosstypes
|
|
2
|
+
A collection of shared types across apps that a component or feature uses. Shared
|
|
3
|
+
types are organized by specific projects/features rather than entire apps.
|
|
4
|
+
|
|
5
|
+
## Adding New Types
|
|
6
|
+
When adding new shared types to this library, add them under a folder that is named
|
|
7
|
+
after the intended feature. For example, for a project that is called `Engagement`:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
/src/Engagement/{your-type-here}.ts
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Usual EdTech typing rules apply, with types that contain subtypes being bundled in the
|
|
14
|
+
same folder (e.g. `/src/Engagement/{your-main-type}/{your-subtype}.ts`)
|
|
15
|
+
|
|
16
|
+
After adding all of your types, be sure to import and export in the `index.ts`
|
|
17
|
+
file in `src`.
|
|
18
|
+
|
|
19
|
+
## Quickstart
|
|
20
|
+
|
|
21
|
+
1. Install `dce-crosstypes` into your project:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install dce-crosstypes --save
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
2. Import `dce-crosstypes` components into your file:
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import { ComplianceBundle } from 'dce-crosstypes';
|
|
31
|
+
```
|
|
@@ -6,14 +6,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
*/
|
|
7
7
|
var EngagementSource;
|
|
8
8
|
(function (EngagementSource) {
|
|
9
|
+
/*----------------------------------------*/
|
|
10
|
+
/* IC Sources */
|
|
11
|
+
/*----------------------------------------*/
|
|
9
12
|
// Engagement from IC activities (PairUp, Respond, Poll)
|
|
10
13
|
EngagementSource["Activity"] = "Activity";
|
|
11
14
|
// Engagement from Zoom Chat+
|
|
12
15
|
EngagementSource["ZoomChatPlus"] = "ZoomChatPlus";
|
|
16
|
+
// Video watching
|
|
17
|
+
EngagementSource["WatchVideo"] = "WatchVideo";
|
|
18
|
+
/*----------------------------------------*/
|
|
19
|
+
/* Gather Sources */
|
|
20
|
+
/*----------------------------------------*/
|
|
13
21
|
// Attended physically in-person
|
|
14
22
|
EngagementSource["InPerson"] = "in-person";
|
|
15
23
|
// Attended synchronously online (Zoom, for example)
|
|
16
24
|
EngagementSource["Live"] = "live";
|
|
25
|
+
// Did not attend, but was excused and gets full credit
|
|
26
|
+
EngagementSource["Excused"] = "excused";
|
|
17
27
|
})(EngagementSource || (EngagementSource = {}));
|
|
18
28
|
exports.default = EngagementSource;
|
|
19
29
|
//# sourceMappingURL=EngagementSource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EngagementSource.js","sourceRoot":"","sources":["../../../src/Engagement/EngagementBundle/EngagementSource.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,IAAK,
|
|
1
|
+
{"version":3,"file":"EngagementSource.js","sourceRoot":"","sources":["../../../src/Engagement/EngagementBundle/EngagementSource.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,IAAK,gBAoBJ;AApBD,WAAK,gBAAgB;IACnB,4CAA4C;IAC5C,4CAA4C;IAC5C,4CAA4C;IAC5C,wDAAwD;IACxD,yCAAqB,CAAA;IACrB,6BAA6B;IAC7B,iDAA6B,CAAA;IAC7B,iBAAiB;IACjB,6CAAyB,CAAA;IAEzB,4CAA4C;IAC5C,4CAA4C;IAC5C,4CAA4C;IAC5C,gCAAgC;IAChC,0CAAsB,CAAA;IACtB,oDAAoD;IACpD,iCAAa,CAAA;IACb,uDAAuD;IACvD,uCAAmB,CAAA;AACrB,CAAC,EApBI,gBAAgB,KAAhB,gBAAgB,QAoBpB;AAED,kBAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analytics for a single student's watch trace for a specific video
|
|
3
|
+
* @author Allison Zhang
|
|
4
|
+
*/
|
|
5
|
+
type SimpleWatchTraceAnalytics = {
|
|
6
|
+
videoSecsWatchedTotal: number;
|
|
7
|
+
uniqueVideoSecsWatchedTotal: number;
|
|
8
|
+
videoDurationSecs: number;
|
|
9
|
+
percentWatched: number;
|
|
10
|
+
videoSecsRewatchedTotal: number;
|
|
11
|
+
timeSpentTotal: number;
|
|
12
|
+
avgMultiplier: number;
|
|
13
|
+
};
|
|
14
|
+
export default SimpleWatchTraceAnalytics;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleWatchTraceAnalytics.js","sourceRoot":"","sources":["../../../src/Engagement/EngagementBundle/SimpleWatchTraceAnalytics.ts"],"names":[],"mappings":""}
|
|
@@ -2,6 +2,7 @@ import ActivityId from '../ActivityId';
|
|
|
2
2
|
import EngagementSource from './EngagementSource';
|
|
3
3
|
import ActivityEngagementData from './ActivityEngagementData';
|
|
4
4
|
import EngagementPlatform from './EngagementPlatform';
|
|
5
|
+
import SimpleWatchTraceAnalytics from './SimpleWatchTraceAnalytics';
|
|
5
6
|
/**
|
|
6
7
|
* An engagement record for a user for the Universal Attendance Component.
|
|
7
8
|
* Records by video.
|
|
@@ -13,6 +14,9 @@ type UserEngagement = ({
|
|
|
13
14
|
platform: EngagementPlatform.IC;
|
|
14
15
|
videoSecs?: number;
|
|
15
16
|
} & ({
|
|
17
|
+
source: EngagementSource.WatchVideo;
|
|
18
|
+
watchTraceAnalytics: SimpleWatchTraceAnalytics;
|
|
19
|
+
} | {
|
|
16
20
|
source: EngagementSource.Activity;
|
|
17
21
|
activityId: ActivityId;
|
|
18
22
|
activityEngagementData: ActivityEngagementData;
|
|
@@ -25,5 +29,7 @@ type UserEngagement = ({
|
|
|
25
29
|
groupNum?: number;
|
|
26
30
|
} | {
|
|
27
31
|
source: EngagementSource.Live;
|
|
32
|
+
} | {
|
|
33
|
+
source: EngagementSource.Excused;
|
|
28
34
|
}))));
|
|
29
35
|
export default UserEngagement;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Enum for the attendance method
|
|
5
|
+
* @author Gabe Abrams
|
|
6
|
+
*/
|
|
7
|
+
var AttendanceMethod;
|
|
8
|
+
(function (AttendanceMethod) {
|
|
9
|
+
// Attended physically in-person
|
|
10
|
+
AttendanceMethod["InPerson"] = "in-person";
|
|
11
|
+
// Attended synchronously online (Zoom, for example)
|
|
12
|
+
AttendanceMethod["Live"] = "live";
|
|
13
|
+
// Watched a recorded version of the event after the fact
|
|
14
|
+
AttendanceMethod["Async"] = "async";
|
|
15
|
+
// Did not attend, but was excused and gets full credit
|
|
16
|
+
AttendanceMethod["Excused"] = "excused";
|
|
17
|
+
// Did not attend, was not excused
|
|
18
|
+
AttendanceMethod["Absent"] = "absent";
|
|
19
|
+
})(AttendanceMethod || (AttendanceMethod = {}));
|
|
20
|
+
exports.default = AttendanceMethod;
|
|
21
|
+
//# sourceMappingURL=AttendanceMethod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttendanceMethod.js","sourceRoot":"","sources":["../../../src/Engagement/InferredEngagementSchedule/AttendanceMethod.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,IAAK,gBAWJ;AAXD,WAAK,gBAAgB;IACnB,gCAAgC;IAChC,0CAAsB,CAAA;IACtB,oDAAoD;IACpD,iCAAa,CAAA;IACb,yDAAyD;IACzD,mCAAe,CAAA;IACf,uDAAuD;IACvD,uCAAmB,CAAA;IACnB,kCAAkC;IAClC,qCAAiB,CAAA;AACnB,CAAC,EAXI,gBAAgB,KAAhB,gBAAgB,QAWpB;AAED,kBAAe,gBAAgB,CAAC"}
|
|
@@ -2,14 +2,23 @@ import ActivityId from '../ActivityId';
|
|
|
2
2
|
import EngagementSource from '../EngagementBundle/EngagementSource';
|
|
3
3
|
import ActivityEngagementDataType from '../ActivityEngagementDataType';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* Records by video.
|
|
5
|
+
* Average user engagement for each activity and engagement type.
|
|
7
6
|
* @author Allison Zhang
|
|
8
7
|
*/
|
|
9
8
|
type AverageUserEngagement = {
|
|
10
|
-
[EngagementSource.Activity]
|
|
11
|
-
[
|
|
12
|
-
[
|
|
9
|
+
[EngagementSource.Activity]: {
|
|
10
|
+
[ActivityId.Respond]: {
|
|
11
|
+
[ActivityEngagementDataType.ShareoutPost]: number;
|
|
12
|
+
[ActivityEngagementDataType.Reply]: number;
|
|
13
|
+
[ActivityEngagementDataType.Vote]?: undefined;
|
|
14
|
+
};
|
|
15
|
+
[ActivityId.PairUp]: {
|
|
16
|
+
[ActivityEngagementDataType.ShareoutPost]: number;
|
|
17
|
+
[ActivityEngagementDataType.Reply]: number;
|
|
18
|
+
[ActivityEngagementDataType.Vote]?: undefined;
|
|
19
|
+
};
|
|
20
|
+
[ActivityId.Poll]: {
|
|
21
|
+
[engagementType in ActivityEngagementDataType]: number;
|
|
13
22
|
};
|
|
14
23
|
};
|
|
15
24
|
[EngagementSource.ZoomChatPlus]?: {};
|
|
@@ -3,5 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const ActivityId_1 = __importDefault(require("../ActivityId"));
|
|
6
7
|
const EngagementSource_1 = __importDefault(require("../EngagementBundle/EngagementSource"));
|
|
8
|
+
const ActivityEngagementDataType_1 = __importDefault(require("../ActivityEngagementDataType"));
|
|
7
9
|
//# sourceMappingURL=AverageUserEngagement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AverageUserEngagement.js","sourceRoot":"","sources":["../../../src/Engagement/InferredEngagementSchedule/AverageUserEngagement.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"AverageUserEngagement.js","sourceRoot":"","sources":["../../../src/Engagement/InferredEngagementSchedule/AverageUserEngagement.ts"],"names":[],"mappings":";;;;;AAAA,+DAAuC;AACvC,4FAAoE;AACpE,+FAAuE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Average watch analytics for each activity and engagement type.
|
|
3
|
+
* @author Allison Zhang
|
|
4
|
+
*/
|
|
5
|
+
type AverageWatchAnalytics = {
|
|
6
|
+
avgVideoSecsWatchedTotal: number;
|
|
7
|
+
avgUniqueVideoSecsWatchedTotal: number;
|
|
8
|
+
avgVideoDurationSecs: number;
|
|
9
|
+
avgPercentWatched: number;
|
|
10
|
+
avgVideoSecsRewatchedTotal: number;
|
|
11
|
+
avgTimeSpentTotal: number;
|
|
12
|
+
avgMultiplier: number;
|
|
13
|
+
};
|
|
14
|
+
export default AverageWatchAnalytics;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AverageWatchAnalytics.js","sourceRoot":"","sources":["../../../src/Engagement/InferredEngagementSchedule/AverageWatchAnalytics.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import AttendanceMethod from '
|
|
1
|
+
import AttendanceMethod from './AttendanceMethod';
|
|
2
2
|
import AverageUserEngagement from './AverageUserEngagement';
|
|
3
|
+
import AverageWatchAnalytics from './AverageWatchAnalytics';
|
|
3
4
|
/**
|
|
4
5
|
* Information that is contained in the inferred engagement schedule for a week.
|
|
5
6
|
* @author Allison Zhang
|
|
@@ -7,6 +8,7 @@ import AverageUserEngagement from './AverageUserEngagement';
|
|
|
7
8
|
type InferredWeekSchedule = {
|
|
8
9
|
ic?: {
|
|
9
10
|
averageUserEngagement: AverageUserEngagement;
|
|
11
|
+
averageWatchAnalytics: AverageWatchAnalytics;
|
|
10
12
|
};
|
|
11
13
|
gather?: {
|
|
12
14
|
attendanceMethodMap: {
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const AttendanceMethod_1 = __importDefault(require("
|
|
6
|
+
const AttendanceMethod_1 = __importDefault(require("./AttendanceMethod"));
|
|
7
7
|
//# sourceMappingURL=InferredWeekSchedule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InferredWeekSchedule.js","sourceRoot":"","sources":["../../../src/Engagement/InferredEngagementSchedule/InferredWeekSchedule.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"InferredWeekSchedule.js","sourceRoot":"","sources":["../../../src/Engagement/InferredEngagementSchedule/InferredWeekSchedule.ts"],"names":[],"mappings":";;;;;AAAA,0EAAkD"}
|
package/package.json
CHANGED
|
@@ -3,14 +3,25 @@
|
|
|
3
3
|
* @author Allison Zhang
|
|
4
4
|
*/
|
|
5
5
|
enum EngagementSource {
|
|
6
|
+
/*----------------------------------------*/
|
|
7
|
+
/* IC Sources */
|
|
8
|
+
/*----------------------------------------*/
|
|
6
9
|
// Engagement from IC activities (PairUp, Respond, Poll)
|
|
7
10
|
Activity = 'Activity',
|
|
8
11
|
// Engagement from Zoom Chat+
|
|
9
12
|
ZoomChatPlus = 'ZoomChatPlus',
|
|
13
|
+
// Video watching
|
|
14
|
+
WatchVideo = 'WatchVideo',
|
|
15
|
+
|
|
16
|
+
/*----------------------------------------*/
|
|
17
|
+
/* Gather Sources */
|
|
18
|
+
/*----------------------------------------*/
|
|
10
19
|
// Attended physically in-person
|
|
11
20
|
InPerson = 'in-person',
|
|
12
21
|
// Attended synchronously online (Zoom, for example)
|
|
13
22
|
Live = 'live',
|
|
23
|
+
// Did not attend, but was excused and gets full credit
|
|
24
|
+
Excused = 'excused',
|
|
14
25
|
}
|
|
15
26
|
|
|
16
27
|
export default EngagementSource;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analytics for a single student's watch trace for a specific video
|
|
3
|
+
* @author Allison Zhang
|
|
4
|
+
*/
|
|
5
|
+
type SimpleWatchTraceAnalytics = {
|
|
6
|
+
// Total duration of the video watched in seconds
|
|
7
|
+
videoSecsWatchedTotal: number,
|
|
8
|
+
// Total duration of the video watched in seconds (only counts unique seconds)
|
|
9
|
+
uniqueVideoSecsWatchedTotal: number,
|
|
10
|
+
// Total duration of the video in seconds
|
|
11
|
+
videoDurationSecs: number,
|
|
12
|
+
// Percentage of video watched (0-100)
|
|
13
|
+
percentWatched: number,
|
|
14
|
+
// Total number of secs rewatched
|
|
15
|
+
videoSecsRewatchedTotal: number,
|
|
16
|
+
// Total amount of time spent on the video
|
|
17
|
+
timeSpentTotal: number,
|
|
18
|
+
// Average Multiplier
|
|
19
|
+
avgMultiplier: number,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default SimpleWatchTraceAnalytics;
|
|
@@ -2,6 +2,7 @@ import ActivityId from '../ActivityId';
|
|
|
2
2
|
import EngagementSource from './EngagementSource';
|
|
3
3
|
import ActivityEngagementData from './ActivityEngagementData';
|
|
4
4
|
import EngagementPlatform from './EngagementPlatform';
|
|
5
|
+
import SimpleWatchTraceAnalytics from './SimpleWatchTraceAnalytics';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* An engagement record for a user for the Universal Attendance Component.
|
|
@@ -26,6 +27,13 @@ type UserEngagement = (
|
|
|
26
27
|
}
|
|
27
28
|
// Activity engagement
|
|
28
29
|
& (
|
|
30
|
+
// Watch trace engagement from IC
|
|
31
|
+
| {
|
|
32
|
+
// Source of the engagement
|
|
33
|
+
source: EngagementSource.WatchVideo,
|
|
34
|
+
// Watch trace analytics for the engagement
|
|
35
|
+
watchTraceAnalytics: SimpleWatchTraceAnalytics,
|
|
36
|
+
}
|
|
29
37
|
// Engagement from IC
|
|
30
38
|
| {
|
|
31
39
|
// Source of the engagement
|
|
@@ -59,6 +67,10 @@ type UserEngagement = (
|
|
|
59
67
|
| {
|
|
60
68
|
source: EngagementSource.Live,
|
|
61
69
|
}
|
|
70
|
+
// Excused engagement
|
|
71
|
+
| {
|
|
72
|
+
source: EngagementSource.Excused,
|
|
73
|
+
}
|
|
62
74
|
)
|
|
63
75
|
)
|
|
64
76
|
)
|
|
@@ -22,6 +22,8 @@ type EngagementBundle = {
|
|
|
22
22
|
// `${Month}/${Day}/${Year}` format
|
|
23
23
|
[weekStart: string]: UserEngagement[],
|
|
24
24
|
},
|
|
25
|
+
// undated engagement records that do not have a date associated with them
|
|
26
|
+
undatedEngagements: UserEngagement[],
|
|
25
27
|
};
|
|
26
28
|
|
|
27
29
|
export default EngagementBundle;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum for the attendance method
|
|
3
|
+
* @author Gabe Abrams
|
|
4
|
+
*/
|
|
5
|
+
enum AttendanceMethod {
|
|
6
|
+
// Attended physically in-person
|
|
7
|
+
InPerson = 'in-person',
|
|
8
|
+
// Attended synchronously online (Zoom, for example)
|
|
9
|
+
Live = 'live',
|
|
10
|
+
// Watched a recorded version of the event after the fact
|
|
11
|
+
Async = 'async',
|
|
12
|
+
// Did not attend, but was excused and gets full credit
|
|
13
|
+
Excused = 'excused',
|
|
14
|
+
// Did not attend, was not excused
|
|
15
|
+
Absent = 'absent',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default AttendanceMethod;
|
|
@@ -3,16 +3,24 @@ import EngagementSource from '../EngagementBundle/EngagementSource';
|
|
|
3
3
|
import ActivityEngagementDataType from '../ActivityEngagementDataType';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* Records by video.
|
|
6
|
+
* Average user engagement for each activity and engagement type.
|
|
8
7
|
* @author Allison Zhang
|
|
9
8
|
*/
|
|
10
9
|
type AverageUserEngagement = {
|
|
11
10
|
// Activity source
|
|
12
|
-
[EngagementSource.Activity]
|
|
13
|
-
[
|
|
14
|
-
|
|
15
|
-
[
|
|
11
|
+
[EngagementSource.Activity]: {
|
|
12
|
+
[ActivityId.Respond]: {
|
|
13
|
+
[ActivityEngagementDataType.ShareoutPost]: number,
|
|
14
|
+
[ActivityEngagementDataType.Reply]: number,
|
|
15
|
+
[ActivityEngagementDataType.Vote]?: undefined,
|
|
16
|
+
},
|
|
17
|
+
[ActivityId.PairUp]: {
|
|
18
|
+
[ActivityEngagementDataType.ShareoutPost]: number,
|
|
19
|
+
[ActivityEngagementDataType.Reply]: number,
|
|
20
|
+
[ActivityEngagementDataType.Vote]?: undefined,
|
|
21
|
+
},
|
|
22
|
+
[ActivityId.Poll]: {
|
|
23
|
+
[engagementType in ActivityEngagementDataType]: number
|
|
16
24
|
}
|
|
17
25
|
},
|
|
18
26
|
// TODO: determine what data to include when implemented
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Average watch analytics for each activity and engagement type.
|
|
3
|
+
* @author Allison Zhang
|
|
4
|
+
*/
|
|
5
|
+
type AverageWatchAnalytics = {
|
|
6
|
+
// Average duration of video watched in seconds
|
|
7
|
+
avgVideoSecsWatchedTotal: number,
|
|
8
|
+
// Average duration of video watched in seconds (only counts unique)
|
|
9
|
+
avgUniqueVideoSecsWatchedTotal: number,
|
|
10
|
+
// Average duration of video in seconds
|
|
11
|
+
avgVideoDurationSecs: number,
|
|
12
|
+
// Average percentage of video watched (0-100)
|
|
13
|
+
avgPercentWatched: number,
|
|
14
|
+
// Average number of secs rewatched
|
|
15
|
+
avgVideoSecsRewatchedTotal: number,
|
|
16
|
+
// Average amount of time spent on video
|
|
17
|
+
avgTimeSpentTotal: number,
|
|
18
|
+
// Average effective playback multiplier (realtime secs / video secs watched)
|
|
19
|
+
avgMultiplier: number,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default AverageWatchAnalytics;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import AttendanceMethod from '
|
|
1
|
+
import AttendanceMethod from './AttendanceMethod';
|
|
2
2
|
import AverageUserEngagement from './AverageUserEngagement';
|
|
3
|
+
import AverageWatchAnalytics from './AverageWatchAnalytics';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Information that is contained in the inferred engagement schedule for a week.
|
|
@@ -8,7 +9,10 @@ import AverageUserEngagement from './AverageUserEngagement';
|
|
|
8
9
|
type InferredWeekSchedule = {
|
|
9
10
|
// Average user engagement for the week (IC)
|
|
10
11
|
ic?: {
|
|
12
|
+
// Average user engagement for each activity and engagement type
|
|
11
13
|
averageUserEngagement: AverageUserEngagement,
|
|
14
|
+
// Average watch analytics for each activity and engagement type
|
|
15
|
+
averageWatchAnalytics: AverageWatchAnalytics,
|
|
12
16
|
},
|
|
13
17
|
// Attendance method information for the week (Gather)
|
|
14
18
|
gather?: {
|