make-mp-data 2.0.19 → 2.0.21
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/dungeons/big.js +7 -6
- package/dungeons/business.js +21 -3
- package/dungeons/experiments.js +8 -7
- package/dungeons/media.js +7 -7
- package/dungeons/sanity.js +8 -14
- package/dungeons/simple.js +1 -0
- package/dungeons/student-teacher.js +475 -0
- package/dungeons/userAgent.js +7 -7
- package/entry.js +13 -2
- package/index.js +74 -3
- package/lib/core/config-validator.js +22 -7
- package/lib/core/context.js +31 -16
- package/lib/core/storage.js +20 -19
- package/lib/generators/events.js +41 -18
- package/lib/orchestrators/worker-manager.js +5 -2
- package/lib/templates/abbreviated.d.ts +158 -0
- package/lib/{data → templates}/defaults.js +2 -2
- package/lib/templates/dungeon-template.js +110 -0
- package/lib/templates/instructions.txt +77 -0
- package/lib/templates/verbose-schema.js +311 -0
- package/lib/utils/ai.js +42 -64
- package/lib/utils/chart.js +5 -0
- package/lib/utils/utils.js +69 -45
- package/package.json +10 -11
- package/types.d.ts +134 -126
- package/lib/cloud-function.js +0 -20
- /package/lib/{utils/prompt.txt → templates/prompt (old).txt} +0 -0
package/dungeons/big.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import Chance from 'chance';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import utc from 'dayjs/plugin/utc';
|
|
4
|
+
import { uid, comma, makeName } from 'ak-tools';
|
|
5
|
+
import { pickAWinner, weighNumRange, integer, date, choose } from '../lib/utils/utils.js';
|
|
6
|
+
|
|
1
7
|
const seed = "lets go big";
|
|
2
|
-
const Chance = require('chance');
|
|
3
8
|
const chance = new Chance();
|
|
4
|
-
const dayjs = require("dayjs");
|
|
5
|
-
const utc = require("dayjs/plugin/utc");
|
|
6
9
|
dayjs.extend(utc);
|
|
7
|
-
const { uid, comma, makeName } = require('ak-tools');
|
|
8
|
-
const { pickAWinner, weighNumRange, integer, date, choose } = require('../components/utils');
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
const eventsPerQuarter = 5_000_000_000 // ~5 billion
|
|
@@ -221,4 +222,4 @@ function buildObjArrayProp(maxItems = 5) {
|
|
|
221
222
|
};
|
|
222
223
|
|
|
223
224
|
|
|
224
|
-
|
|
225
|
+
export default config;
|
package/dungeons/business.js
CHANGED
|
@@ -195,9 +195,27 @@ const config = {
|
|
|
195
195
|
|
|
196
196
|
/** each generates it's own table */
|
|
197
197
|
scdProps: {
|
|
198
|
-
plan:
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
plan: {
|
|
199
|
+
type: "user",
|
|
200
|
+
frequency: "month",
|
|
201
|
+
values: ["free", "free", "free", "free", "basic", "basic", "basic", "premium", "premium", "enterprise"],
|
|
202
|
+
timing: "fixed",
|
|
203
|
+
max: 3
|
|
204
|
+
},
|
|
205
|
+
MRR: {
|
|
206
|
+
type: "user",
|
|
207
|
+
frequency: "month",
|
|
208
|
+
values: weighNumRange(0, 10000, .15),
|
|
209
|
+
timing: "fixed",
|
|
210
|
+
max: 5
|
|
211
|
+
},
|
|
212
|
+
NPS: {
|
|
213
|
+
type: "user",
|
|
214
|
+
frequency: "month",
|
|
215
|
+
values: weighNumRange(0, 10, 2, 150),
|
|
216
|
+
timing: "fixed",
|
|
217
|
+
max: 3
|
|
218
|
+
}
|
|
201
219
|
},
|
|
202
220
|
|
|
203
221
|
mirrorProps: {
|
package/dungeons/experiments.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import utc from 'dayjs/plugin/utc';
|
|
4
|
+
import 'dotenv/config';
|
|
5
|
+
import * as u from '../lib/utils/utils.js';
|
|
6
|
+
import * as v from 'ak-tools';
|
|
7
|
+
|
|
2
8
|
const SEED = "my-seed";
|
|
3
|
-
const dayjs = require("dayjs");
|
|
4
|
-
const utc = require("dayjs/plugin/utc");
|
|
5
9
|
dayjs.extend(utc);
|
|
6
|
-
require("dotenv").config();
|
|
7
|
-
const u = require("../components/utils");
|
|
8
|
-
const v = require("ak-tools");
|
|
9
10
|
const chance = u.initChance(SEED);
|
|
10
11
|
const num_users = 5_000;
|
|
11
12
|
const days = 100;
|
|
12
13
|
|
|
13
|
-
/** @typedef {import("../types").Dungeon} Config */
|
|
14
|
+
/** @typedef {import("../types.js").Dungeon} Config */
|
|
14
15
|
|
|
15
16
|
/** @type {Config} */
|
|
16
17
|
const config = {
|
|
@@ -121,4 +122,4 @@ const config = {
|
|
|
121
122
|
}
|
|
122
123
|
};
|
|
123
124
|
|
|
124
|
-
|
|
125
|
+
export default config;
|
package/dungeons/media.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
const SEED = "my-seed";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import dayjs from 'dayjs';
|
|
4
|
+
import utc from 'dayjs/plugin/utc';
|
|
5
5
|
dayjs.extend(utc);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import 'dotenv/config';
|
|
7
|
+
import * as u from '../lib/utils/utils.js';
|
|
8
|
+
import * as v from 'ak-tools';
|
|
9
9
|
const chance = u.initChance(SEED);
|
|
10
10
|
const num_users = 10_000;
|
|
11
11
|
const days = 125;
|
|
12
12
|
|
|
13
|
-
/** @typedef {import("../types").Dungeon} Config */
|
|
13
|
+
/** @typedef {import("../types.js").Dungeon} Config */
|
|
14
14
|
|
|
15
15
|
function genIds(numIds = 1000) {
|
|
16
16
|
const ids = [];
|
|
@@ -368,4 +368,4 @@ const config = {
|
|
|
368
368
|
}
|
|
369
369
|
};
|
|
370
370
|
|
|
371
|
-
|
|
371
|
+
export default config;
|
package/dungeons/sanity.js
CHANGED
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import Chance from 'chance';
|
|
12
12
|
const chance = new Chance();
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
import dayjs from 'dayjs';
|
|
14
|
+
import utc from 'dayjs/plugin/utc.js';
|
|
15
15
|
dayjs.extend(utc);
|
|
16
|
-
|
|
16
|
+
import { weighNumRange, integer } from '../lib/utils/utils.js';
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
/** @type {import('../types').Dungeon} */
|
|
19
|
+
/** @type {import('../types.js').Dungeon} */
|
|
20
20
|
const config = {
|
|
21
21
|
token: "",
|
|
22
22
|
seed: "foo bar",
|
|
@@ -29,7 +29,8 @@ const config = {
|
|
|
29
29
|
hasSessionIds: false, //if true, hasSessionIds are created for each user
|
|
30
30
|
alsoInferFunnels: true, //if true, infer funnels from events
|
|
31
31
|
makeChart: true,
|
|
32
|
-
|
|
32
|
+
writeToDisk: true,
|
|
33
|
+
concurrency: 25,
|
|
33
34
|
funnels: [
|
|
34
35
|
{
|
|
35
36
|
sequence: ["qux", "garply", "durtle", "linny", "fonk", "crumn", "yak"],
|
|
@@ -102,13 +103,6 @@ const config = {
|
|
|
102
103
|
luckyNumber: weighNumRange(42, 420),
|
|
103
104
|
spiritAnimal: ["duck", "dog", "otter", "penguin", "cat", "elephant", "lion", "cheetah", "giraffe", "zebra", "rhino", "hippo", "whale", "dolphin", "shark", "octopus", "squid", "jellyfish", "starfish", "seahorse", "crab", "lobster", "shrimp", "clam", "snail", "slug", "butterfly", "moth", "bee", "wasp", "ant", "beetle", "ladybug", "caterpillar", "centipede", "millipede", "scorpion", "spider", "tarantula", "tick", "mite", "mosquito", "fly", "dragonfly", "damselfly", "grasshopper", "cricket", "locust", "mantis", "cockroach", "termite", "praying mantis", "walking stick", "stick bug", "leaf insect", "lacewing", "aphid", "cicada", "thrips", "psyllid", "scale insect", "whitefly", "mealybug", "planthopper", "leafhopper", "treehopper", "flea", "louse", "bedbug", "flea beetle", "weevil", "longhorn beetle", "leaf beetle", "tiger beetle", "ground beetle", "lady beetle", "firefly", "click beetle", "rove beetle", "scarab beetle", "dung beetle", "stag beetle", "rhinoceros beetle", "hercules beetle", "goliath beetle", "jewel beetle", "tortoise beetle"]
|
|
104
105
|
},
|
|
105
|
-
|
|
106
|
-
scdProps: {},
|
|
107
|
-
mirrorProps: {},
|
|
108
|
-
lookupTables: [],
|
|
109
|
-
groupKeys: [],
|
|
110
|
-
groupProps: {},
|
|
111
|
-
|
|
112
106
|
hook: function (record, type, meta) {
|
|
113
107
|
return record;
|
|
114
108
|
}
|
|
@@ -116,4 +110,4 @@ const config = {
|
|
|
116
110
|
|
|
117
111
|
|
|
118
112
|
|
|
119
|
-
|
|
113
|
+
export default config;
|
package/dungeons/simple.js
CHANGED
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
// Generated from prompt: Create a digital classroom data set where we have two types of users students and teachers and students do student actions like reading writing arithmetic homework tests and teachers do teaching actions like teach grade take attendance etc. importantly each event done by each persona should have a 'student:' or teacher: prefix to indicate that this is an event on by students or this is not done by teachers... make many unique events + funnels.
|
|
2
|
+
|
|
3
|
+
import dayjs from "dayjs";
|
|
4
|
+
import utc from "dayjs/plugin/utc.js";
|
|
5
|
+
import "dotenv/config";
|
|
6
|
+
import * as u from "../lib/utils/utils.js";
|
|
7
|
+
import * as v from "ak-tools";
|
|
8
|
+
|
|
9
|
+
const SEED = "ai-generated-1754199343300";
|
|
10
|
+
dayjs.extend(utc);
|
|
11
|
+
const chance = u.initChance(SEED);
|
|
12
|
+
const num_users = 1_000;
|
|
13
|
+
const days = 100;
|
|
14
|
+
|
|
15
|
+
/** @typedef {import("../types.js").Dungeon} Config */
|
|
16
|
+
|
|
17
|
+
/** @type {Config} */
|
|
18
|
+
const config = {
|
|
19
|
+
token: "",
|
|
20
|
+
seed: SEED,
|
|
21
|
+
numDays: days,
|
|
22
|
+
numEvents: num_users * 100,
|
|
23
|
+
numUsers: num_users,
|
|
24
|
+
hasAnonIds: false,
|
|
25
|
+
hasSessionIds: false,
|
|
26
|
+
format: "json",
|
|
27
|
+
alsoInferFunnels: true,
|
|
28
|
+
hasLocation: true,
|
|
29
|
+
hasAndroidDevices: true,
|
|
30
|
+
hasIOSDevices: true,
|
|
31
|
+
hasDesktopDevices: true,
|
|
32
|
+
hasBrowser: true,
|
|
33
|
+
hasCampaigns: true,
|
|
34
|
+
isAnonymous: false,
|
|
35
|
+
hasAdSpend: true,
|
|
36
|
+
|
|
37
|
+
hasAvatar: true,
|
|
38
|
+
makeChart: false,
|
|
39
|
+
|
|
40
|
+
batchSize: 1_500_000,
|
|
41
|
+
concurrency: 1,
|
|
42
|
+
writeToDisk: false,
|
|
43
|
+
|
|
44
|
+
// AI-generated schema content:
|
|
45
|
+
|
|
46
|
+
"funnels": [
|
|
47
|
+
{
|
|
48
|
+
"name": "Student Onboarding",
|
|
49
|
+
"sequence": [
|
|
50
|
+
"student: login",
|
|
51
|
+
"student: join class"
|
|
52
|
+
],
|
|
53
|
+
"isFirstFunnel": true,
|
|
54
|
+
"conversionRate": 95,
|
|
55
|
+
"timeToConvert": 0.1,
|
|
56
|
+
"order": "sequential",
|
|
57
|
+
"props": {
|
|
58
|
+
"onboarding_source": [
|
|
59
|
+
"email_invite",
|
|
60
|
+
"class_code",
|
|
61
|
+
"school_roster"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "Teacher Creates Class",
|
|
67
|
+
"sequence": [
|
|
68
|
+
"teacher: login",
|
|
69
|
+
"teacher: create class",
|
|
70
|
+
"teacher: post announcement"
|
|
71
|
+
],
|
|
72
|
+
"isFirstFunnel": true,
|
|
73
|
+
"conversionRate": 98,
|
|
74
|
+
"timeToConvert": 0.2,
|
|
75
|
+
"order": "sequential"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "Student Completes Homework",
|
|
79
|
+
"sequence": [
|
|
80
|
+
"student: view assignment",
|
|
81
|
+
"student: start assignment",
|
|
82
|
+
"student: submit assignment",
|
|
83
|
+
"student: view grade"
|
|
84
|
+
],
|
|
85
|
+
"isFirstFunnel": false,
|
|
86
|
+
"conversionRate": 70,
|
|
87
|
+
"timeToConvert": 48,
|
|
88
|
+
"order": "first-and-last-fixed",
|
|
89
|
+
"props": {
|
|
90
|
+
"assignment_type": "homework"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "Student Takes Test",
|
|
95
|
+
"sequence": [
|
|
96
|
+
"student: view assignment",
|
|
97
|
+
"student: start test",
|
|
98
|
+
"student: answer question",
|
|
99
|
+
"student: submit test",
|
|
100
|
+
"student: view grade"
|
|
101
|
+
],
|
|
102
|
+
"isFirstFunnel": false,
|
|
103
|
+
"conversionRate": 85,
|
|
104
|
+
"timeToConvert": 2,
|
|
105
|
+
"order": "sequential",
|
|
106
|
+
"props": {
|
|
107
|
+
"assignment_type": "test"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "Teacher Grades Assignment",
|
|
112
|
+
"sequence": [
|
|
113
|
+
"teacher: create assignment",
|
|
114
|
+
"teacher: assign homework",
|
|
115
|
+
"teacher: grade submission"
|
|
116
|
+
],
|
|
117
|
+
"isFirstFunnel": false,
|
|
118
|
+
"conversionRate": 90,
|
|
119
|
+
"timeToConvert": 72,
|
|
120
|
+
"order": "sequential"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "Teacher Daily Lesson",
|
|
124
|
+
"sequence": [
|
|
125
|
+
"teacher: take attendance",
|
|
126
|
+
"teacher: start lesson",
|
|
127
|
+
"teacher: end lesson"
|
|
128
|
+
],
|
|
129
|
+
"isFirstFunnel": false,
|
|
130
|
+
"conversionRate": 99,
|
|
131
|
+
"timeToConvert": 1,
|
|
132
|
+
"order": "sequential"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"events": [
|
|
136
|
+
{
|
|
137
|
+
"event": "student: login",
|
|
138
|
+
"weight": 10,
|
|
139
|
+
"isFirstEvent": true
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"event": "teacher: login",
|
|
143
|
+
"weight": 2,
|
|
144
|
+
"isFirstEvent": true
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"event": "student: join class",
|
|
148
|
+
"weight": 5,
|
|
149
|
+
"properties": {
|
|
150
|
+
"join_method": [
|
|
151
|
+
"class_code",
|
|
152
|
+
"email_invite",
|
|
153
|
+
"admin_added"
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"event": "teacher: create class",
|
|
159
|
+
"weight": 1
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"event": "student: view assignment",
|
|
163
|
+
"weight": 15,
|
|
164
|
+
"properties": {
|
|
165
|
+
"assignment_id": "range(1, 500)",
|
|
166
|
+
"subject_id": "range(1, 20)"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"event": "student: start assignment",
|
|
171
|
+
"weight": 12,
|
|
172
|
+
"properties": {
|
|
173
|
+
"assignment_id": "range(1, 500)"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"event": "student: submit assignment",
|
|
178
|
+
"weight": 10,
|
|
179
|
+
"properties": {
|
|
180
|
+
"assignment_id": "range(1, 500)",
|
|
181
|
+
"time_spent_minutes": "weighNumRange(5, 120, 0.4)",
|
|
182
|
+
"is_late": [
|
|
183
|
+
true,
|
|
184
|
+
false,
|
|
185
|
+
false,
|
|
186
|
+
false,
|
|
187
|
+
false
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"event": "student: start test",
|
|
193
|
+
"weight": 8,
|
|
194
|
+
"properties": {
|
|
195
|
+
"assignment_id": "range(1, 500)",
|
|
196
|
+
"subject_id": "range(1, 20)"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"event": "student: answer question",
|
|
201
|
+
"weight": 40,
|
|
202
|
+
"properties": {
|
|
203
|
+
"assignment_id": "range(1, 500)",
|
|
204
|
+
"is_correct": [
|
|
205
|
+
true,
|
|
206
|
+
true,
|
|
207
|
+
true,
|
|
208
|
+
false
|
|
209
|
+
],
|
|
210
|
+
"time_to_answer_sec": "weighNumRange(10, 300, 0.6)"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"event": "student: submit test",
|
|
215
|
+
"weight": 7,
|
|
216
|
+
"properties": {
|
|
217
|
+
"assignment_id": "range(1, 500)",
|
|
218
|
+
"time_spent_minutes": "weighNumRange(20, 90, 0.5)"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"event": "student: view grade",
|
|
223
|
+
"weight": 9,
|
|
224
|
+
"properties": {
|
|
225
|
+
"assignment_id": "range(1, 500)",
|
|
226
|
+
"score_percent": "weighNumRange(40, 100, 1.5)"
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"event": "teacher: take attendance",
|
|
231
|
+
"weight": 3,
|
|
232
|
+
"properties": {
|
|
233
|
+
"absent_students": "weighNumRange(0, 5, 0.2)"
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"event": "teacher: start lesson",
|
|
238
|
+
"weight": 4,
|
|
239
|
+
"properties": {
|
|
240
|
+
"subject_id": "range(1, 20)",
|
|
241
|
+
"lesson_topic": [
|
|
242
|
+
"Review",
|
|
243
|
+
"New Material",
|
|
244
|
+
"Group Work",
|
|
245
|
+
"Lab",
|
|
246
|
+
"Presentation"
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"event": "teacher: end lesson",
|
|
252
|
+
"weight": 4
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"event": "teacher: create assignment",
|
|
256
|
+
"weight": 2,
|
|
257
|
+
"properties": {
|
|
258
|
+
"assignment_id": "range(1, 500)",
|
|
259
|
+
"subject_id": "range(1, 20)"
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"event": "teacher: assign homework",
|
|
264
|
+
"weight": 2,
|
|
265
|
+
"properties": {
|
|
266
|
+
"assignment_id": "range(1, 500)",
|
|
267
|
+
"due_date": "date(14, false, 'YYYY-MM-DD')"
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"event": "teacher: grade submission",
|
|
272
|
+
"weight": 6,
|
|
273
|
+
"properties": {
|
|
274
|
+
"assignment_id": "range(1, 500)",
|
|
275
|
+
"score_percent": "weighNumRange(40, 100, 1.5)",
|
|
276
|
+
"feedback_provided": [
|
|
277
|
+
true,
|
|
278
|
+
true,
|
|
279
|
+
false
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"event": "teacher: post announcement",
|
|
285
|
+
"weight": 1,
|
|
286
|
+
"properties": {
|
|
287
|
+
"category": [
|
|
288
|
+
"General",
|
|
289
|
+
"Reminder",
|
|
290
|
+
"Kudos",
|
|
291
|
+
"Event"
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
"superProps": {
|
|
297
|
+
"device_type": [
|
|
298
|
+
"desktop",
|
|
299
|
+
"tablet",
|
|
300
|
+
"desktop",
|
|
301
|
+
"chromebook"
|
|
302
|
+
],
|
|
303
|
+
"browser": [
|
|
304
|
+
"Chrome",
|
|
305
|
+
"Chrome",
|
|
306
|
+
"Chrome",
|
|
307
|
+
"Safari",
|
|
308
|
+
"Edge"
|
|
309
|
+
],
|
|
310
|
+
"connection_type": [
|
|
311
|
+
"wifi",
|
|
312
|
+
"wifi",
|
|
313
|
+
"ethernet"
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
"userProps": {
|
|
317
|
+
"role": [
|
|
318
|
+
"student",
|
|
319
|
+
"student",
|
|
320
|
+
"student",
|
|
321
|
+
"student",
|
|
322
|
+
"student",
|
|
323
|
+
"student",
|
|
324
|
+
"student",
|
|
325
|
+
"student",
|
|
326
|
+
"student",
|
|
327
|
+
"teacher"
|
|
328
|
+
],
|
|
329
|
+
"first_name": "chance.first.bind(chance)",
|
|
330
|
+
"last_name": "chance.last.bind(chance)"
|
|
331
|
+
},
|
|
332
|
+
"scdProps": {
|
|
333
|
+
"gpa": {
|
|
334
|
+
"type": "user",
|
|
335
|
+
"frequency": "month",
|
|
336
|
+
"values": "weighNumRange(1.0, 4.0, 1.2)",
|
|
337
|
+
"timing": "fuzzy",
|
|
338
|
+
"max": 12
|
|
339
|
+
},
|
|
340
|
+
"grade_level": {
|
|
341
|
+
"type": "user",
|
|
342
|
+
"frequency": "year",
|
|
343
|
+
"values": [
|
|
344
|
+
"1st",
|
|
345
|
+
"2nd",
|
|
346
|
+
"3rd",
|
|
347
|
+
"4th",
|
|
348
|
+
"5th",
|
|
349
|
+
"6th",
|
|
350
|
+
"7th",
|
|
351
|
+
"8th",
|
|
352
|
+
"9th",
|
|
353
|
+
"10th",
|
|
354
|
+
"11th",
|
|
355
|
+
"12th"
|
|
356
|
+
],
|
|
357
|
+
"timing": "fixed",
|
|
358
|
+
"max": 12
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
"groupKeys": [
|
|
362
|
+
[
|
|
363
|
+
"class_id",
|
|
364
|
+
100
|
|
365
|
+
]
|
|
366
|
+
],
|
|
367
|
+
"groupProps": {
|
|
368
|
+
"class_id": {
|
|
369
|
+
"teacher_name": "() => `Mrs. ${chance.last()}`",
|
|
370
|
+
"school_name": "() => `${chance.city()} ${chance.pickone(['Elementary', 'Middle School', 'High School'])}`",
|
|
371
|
+
"class_size": "weighNumRange(15, 35, 0.5)",
|
|
372
|
+
"subject_id": "range(1, 20)"
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
"lookupTables": [
|
|
376
|
+
{
|
|
377
|
+
"key": "assignment_id",
|
|
378
|
+
"entries": 500,
|
|
379
|
+
"attributes": {
|
|
380
|
+
"type": [
|
|
381
|
+
"homework",
|
|
382
|
+
"test",
|
|
383
|
+
"quiz",
|
|
384
|
+
"project",
|
|
385
|
+
"reading"
|
|
386
|
+
],
|
|
387
|
+
"difficulty": [
|
|
388
|
+
"easy",
|
|
389
|
+
"medium",
|
|
390
|
+
"hard"
|
|
391
|
+
],
|
|
392
|
+
"max_points": [
|
|
393
|
+
10,
|
|
394
|
+
20,
|
|
395
|
+
25,
|
|
396
|
+
50,
|
|
397
|
+
100
|
|
398
|
+
],
|
|
399
|
+
"subject_id": "range(1, 20)"
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"key": "subject_id",
|
|
404
|
+
"entries": 20,
|
|
405
|
+
"attributes": {
|
|
406
|
+
"subject_name": [
|
|
407
|
+
"Mathematics",
|
|
408
|
+
"English Language Arts",
|
|
409
|
+
"Science",
|
|
410
|
+
"Social Studies",
|
|
411
|
+
"History",
|
|
412
|
+
"Art",
|
|
413
|
+
"Music",
|
|
414
|
+
"Physical Education",
|
|
415
|
+
"Computer Science",
|
|
416
|
+
"Spanish",
|
|
417
|
+
"French",
|
|
418
|
+
"German",
|
|
419
|
+
"Biology",
|
|
420
|
+
"Chemistry",
|
|
421
|
+
"Physics",
|
|
422
|
+
"Algebra",
|
|
423
|
+
"Geometry",
|
|
424
|
+
"Calculus",
|
|
425
|
+
"Literature",
|
|
426
|
+
"World History"
|
|
427
|
+
],
|
|
428
|
+
"department": [
|
|
429
|
+
"STEM",
|
|
430
|
+
"Humanities",
|
|
431
|
+
"Arts",
|
|
432
|
+
"Foreign Language"
|
|
433
|
+
],
|
|
434
|
+
"is_core_subject": [
|
|
435
|
+
true,
|
|
436
|
+
true,
|
|
437
|
+
false
|
|
438
|
+
]
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
]
|
|
442
|
+
,
|
|
443
|
+
|
|
444
|
+
hook: function (record, type, meta) {
|
|
445
|
+
const NOW = dayjs();
|
|
446
|
+
|
|
447
|
+
if (type === "event") {
|
|
448
|
+
const EVENT_TIME = dayjs(record.time);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
if (type === "user") {
|
|
452
|
+
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
if (type === "funnel-post") {
|
|
456
|
+
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
if (type === "funnel-pre") {
|
|
460
|
+
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
if (type === "scd") {
|
|
464
|
+
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
if (type === "everything") {
|
|
468
|
+
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
return record;
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
export default config;
|
package/dungeons/userAgent.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
const SEED = "my-seed";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import dayjs from 'dayjs';
|
|
4
|
+
import utc from 'dayjs/plugin/utc';
|
|
5
5
|
dayjs.extend(utc);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import 'dotenv/config';
|
|
7
|
+
import * as u from '../lib/utils/utils.js';
|
|
8
|
+
import * as v from 'ak-tools';
|
|
9
9
|
const chance = u.initChance(SEED);
|
|
10
10
|
const num_users = 1000;
|
|
11
11
|
const days = 30;
|
|
12
12
|
|
|
13
|
-
/** @typedef {import("../types").Dungeon} Config */
|
|
13
|
+
/** @typedef {import("../types.js").Dungeon} Config */
|
|
14
14
|
|
|
15
15
|
/** @type {Config} */
|
|
16
16
|
const config = {
|
|
@@ -187,4 +187,4 @@ const config = {
|
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
|
|
190
|
-
|
|
190
|
+
export default config;
|