dce-crosstypes 1.0.1 → 1.0.3

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.
@@ -27,9 +27,14 @@ type UserEngagement = ({
27
27
  } & ({
28
28
  source: EngagementSource.InPerson;
29
29
  groupNum?: number;
30
+ ihid: string;
30
31
  } | {
31
32
  source: EngagementSource.Live;
33
+ groupNum: undefined;
34
+ ihid: string;
32
35
  } | {
33
36
  source: EngagementSource.Excused;
37
+ groupNum: undefined;
38
+ ihid: undefined;
34
39
  }))));
35
40
  export default UserEngagement;
@@ -1,19 +1,23 @@
1
1
  import AttendanceMethod from './AttendanceMethod';
2
2
  import AverageUserEngagement from './AverageUserEngagement';
3
3
  import AverageWatchAnalytics from './AverageWatchAnalytics';
4
+ import WeekScheduleStatus from './WeekScheduleStatus';
4
5
  /**
5
6
  * Information that is contained in the inferred engagement schedule for a week.
6
7
  * @author Allison Zhang
7
8
  */
8
9
  type InferredWeekSchedule = {
9
- ic?: {
10
- averageUserEngagement: AverageUserEngagement;
11
- averageWatchAnalytics: AverageWatchAnalytics;
12
- };
13
- gather?: {
14
- attendanceMethodMap: {
15
- [AttendanceMethod.InPerson]?: boolean;
16
- [AttendanceMethod.Live]?: boolean;
10
+ attendanceMethodMap: {
11
+ [AttendanceMethod.InPerson]?: {
12
+ status: WeekScheduleStatus.Yes;
13
+ };
14
+ [AttendanceMethod.Live]?: {
15
+ status: WeekScheduleStatus;
16
+ };
17
+ [AttendanceMethod.Async]?: {
18
+ status: WeekScheduleStatus.Yes;
19
+ averageUserEngagement: AverageUserEngagement;
20
+ averageWatchAnalytics: AverageWatchAnalytics;
17
21
  };
18
22
  };
19
23
  };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Enum for the week schedule status
3
+ * @author Allison Zhang
4
+ */
5
+ declare enum WeekScheduleStatus {
6
+ Yes = "Yes",
7
+ Maybe = "Maybe"
8
+ }
9
+ export default WeekScheduleStatus;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Enum for the week schedule status
5
+ * @author Allison Zhang
6
+ */
7
+ var WeekScheduleStatus;
8
+ (function (WeekScheduleStatus) {
9
+ WeekScheduleStatus["Yes"] = "Yes";
10
+ WeekScheduleStatus["Maybe"] = "Maybe";
11
+ })(WeekScheduleStatus || (WeekScheduleStatus = {}));
12
+ exports.default = WeekScheduleStatus;
13
+ //# sourceMappingURL=WeekScheduleStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WeekScheduleStatus.js","sourceRoot":"","sources":["../../../src/Engagement/InferredEngagementSchedule/WeekScheduleStatus.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,IAAK,kBAGJ;AAHD,WAAK,kBAAkB;IACrB,iCAAW,CAAA;IACX,qCAAe,CAAA;AACjB,CAAC,EAHI,kBAAkB,KAAlB,kBAAkB,QAGtB;AAED,kBAAe,kBAAkB,CAAC"}
package/lib/index.d.ts CHANGED
@@ -15,4 +15,5 @@ import ProgrammingLanguage from './Engagement/ProgrammingLanguage';
15
15
  import ResponsePack from './Engagement/ResponsePack';
16
16
  import ShareoutPostPollResult from './Engagement/ShareoutPostPollResult';
17
17
  import UserEngagement from './Engagement/EngagementBundle/UserEngagement';
18
- export { ActivityId, ActivityEngagementData, ActivityEngagementDataType, AverageUserEngagement, AttendanceMethod, ComplianceBundle, CodeSnippet, Drawing, EngagementBundle, EngagementPlatform, EngagementSource, InferredEngagementSchedule, InferredWeekSchedule, ProgrammingLanguage, ResponsePack, ShareoutPostPollResult, UserEngagement, };
18
+ import WeekScheduleStatus from './Engagement/InferredEngagementSchedule/WeekScheduleStatus';
19
+ export { ActivityId, ActivityEngagementData, ActivityEngagementDataType, AverageUserEngagement, AttendanceMethod, ComplianceBundle, CodeSnippet, Drawing, EngagementBundle, EngagementPlatform, EngagementSource, InferredEngagementSchedule, InferredWeekSchedule, ProgrammingLanguage, ResponsePack, ShareoutPostPollResult, UserEngagement, WeekScheduleStatus, };
package/lib/index.js CHANGED
@@ -3,7 +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
- exports.ProgrammingLanguage = exports.EngagementSource = exports.EngagementPlatform = exports.AttendanceMethod = exports.ActivityEngagementDataType = exports.ActivityId = void 0;
6
+ exports.WeekScheduleStatus = exports.ProgrammingLanguage = exports.EngagementSource = exports.EngagementPlatform = exports.AttendanceMethod = exports.ActivityEngagementDataType = exports.ActivityId = void 0;
7
7
  // import types
8
8
  const ActivityId_1 = __importDefault(require("./Engagement/ActivityId"));
9
9
  exports.ActivityId = ActivityId_1.default;
@@ -17,4 +17,6 @@ const EngagementSource_1 = __importDefault(require("./Engagement/EngagementBundl
17
17
  exports.EngagementSource = EngagementSource_1.default;
18
18
  const ProgrammingLanguage_1 = __importDefault(require("./Engagement/ProgrammingLanguage"));
19
19
  exports.ProgrammingLanguage = ProgrammingLanguage_1.default;
20
+ const WeekScheduleStatus_1 = __importDefault(require("./Engagement/InferredEngagementSchedule/WeekScheduleStatus"));
21
+ exports.WeekScheduleStatus = WeekScheduleStatus_1.default;
20
22
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,eAAe;AACf,yEAAiD;AAoB/C,qBApBK,oBAAU,CAoBL;AAlBZ,yGAAiF;AAoB/E,qCApBK,oCAA0B,CAoBL;AAlB5B,qFAA6D;AAoB3D,2BApBK,0BAAgB,CAoBL;AAflB,0GAAkF;AAoBhF,6BApBK,4BAAkB,CAoBL;AAnBpB,sGAA8E;AAoB5E,2BApBK,0BAAgB,CAoBL;AAjBlB,2FAAmE;AAoBjE,8BApBK,6BAAmB,CAoBL"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,eAAe;AACf,yEAAiD;AAqB/C,qBArBK,oBAAU,CAqBL;AAnBZ,yGAAiF;AAqB/E,qCArBK,oCAA0B,CAqBL;AAnB5B,qFAA6D;AAqB3D,2BArBK,0BAAgB,CAqBL;AAhBlB,0GAAkF;AAqBhF,6BArBK,4BAAkB,CAqBL;AApBpB,sGAA8E;AAqB5E,2BArBK,0BAAgB,CAqBL;AAlBlB,2FAAmE;AAqBjE,8BArBK,6BAAmB,CAqBL;AAjBrB,oHAA4F;AAqB1F,6BArBK,4BAAkB,CAqBL"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-crosstypes",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Types shared across Harvard EdTech projects",
5
5
  "keywords": [
6
6
  "DCE",
@@ -1,3 +1,4 @@
1
+ // Import types
1
2
  import ActivityId from '../ActivityId';
2
3
  import EngagementSource from './EngagementSource';
3
4
  import ActivityEngagementData from './ActivityEngagementData';
@@ -61,15 +62,26 @@ type UserEngagement = (
61
62
  // In-person engagement
62
63
  | {
63
64
  source: EngagementSource.InPerson,
65
+ // Group number for the in-person engagement
64
66
  groupNum?: number,
67
+ // IHID for the in-person engagement
68
+ ihid: string,
65
69
  }
66
70
  // Live engagement
67
71
  | {
68
72
  source: EngagementSource.Live,
73
+ // Group number for the live engagement (always undefined)
74
+ groupNum: undefined,
75
+ // IHID for the live engagement
76
+ ihid: string,
69
77
  }
70
78
  // Excused engagement
71
79
  | {
72
80
  source: EngagementSource.Excused,
81
+ // Group number for the excused engagement (always undefined)
82
+ groupNum: undefined,
83
+ // IHID for the excused engagement (always undefined)
84
+ ihid: undefined,
73
85
  }
74
86
  )
75
87
  )
@@ -1,24 +1,28 @@
1
1
  import AttendanceMethod from './AttendanceMethod';
2
2
  import AverageUserEngagement from './AverageUserEngagement';
3
3
  import AverageWatchAnalytics from './AverageWatchAnalytics';
4
+ import WeekScheduleStatus from './WeekScheduleStatus';
4
5
 
5
6
  /**
6
7
  * Information that is contained in the inferred engagement schedule for a week.
7
8
  * @author Allison Zhang
8
9
  */
9
10
  type InferredWeekSchedule = {
10
- // Average user engagement for the week (IC)
11
- ic?: {
12
- // Average user engagement for each activity and engagement type
13
- averageUserEngagement: AverageUserEngagement,
14
- // Average watch analytics for each activity and engagement type
15
- averageWatchAnalytics: AverageWatchAnalytics,
16
- },
17
- // Attendance method information for the week (Gather)
18
- gather?: {
19
- attendanceMethodMap: {
20
- [AttendanceMethod.InPerson]?: boolean,
21
- [AttendanceMethod.Live]?: boolean,
11
+ // Inferred schedule by attendance method
12
+ attendanceMethodMap: {
13
+ [AttendanceMethod.InPerson]?: {
14
+ status: WeekScheduleStatus.Yes,
15
+ },
16
+ [AttendanceMethod.Live]?: {
17
+ status: WeekScheduleStatus,
18
+ },
19
+ [AttendanceMethod.Async]?: {
20
+ // Schedule status
21
+ status: WeekScheduleStatus.Yes,
22
+ // Average user engagement for each activity and engagement type
23
+ averageUserEngagement: AverageUserEngagement,
24
+ // Average watch analytics for each activity and engagement type
25
+ averageWatchAnalytics: AverageWatchAnalytics,
22
26
  },
23
27
  },
24
28
  };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Enum for the week schedule status
3
+ * @author Allison Zhang
4
+ */
5
+ enum WeekScheduleStatus {
6
+ Yes = 'Yes',
7
+ Maybe = 'Maybe',
8
+ }
9
+
10
+ export default WeekScheduleStatus;
package/src/index.ts CHANGED
@@ -16,6 +16,7 @@ import ProgrammingLanguage from './Engagement/ProgrammingLanguage';
16
16
  import ResponsePack from './Engagement/ResponsePack';
17
17
  import ShareoutPostPollResult from './Engagement/ShareoutPostPollResult';
18
18
  import UserEngagement from './Engagement/EngagementBundle/UserEngagement';
19
+ import WeekScheduleStatus from './Engagement/InferredEngagementSchedule/WeekScheduleStatus';
19
20
 
20
21
  // export types
21
22
  export {
@@ -36,4 +37,5 @@ export {
36
37
  ResponsePack,
37
38
  ShareoutPostPollResult,
38
39
  UserEngagement,
40
+ WeekScheduleStatus,
39
41
  };