formatting
This commit is contained in:
parent
35e54014b3
commit
4f47e18ad9
7 changed files with 119 additions and 124 deletions
|
|
@ -84,7 +84,10 @@ Rejected because: for user-owned resources identified by opaque IDs, confirming
|
|||
2. `GameSessionStore.ts` — add `userId` to `GameSessionData`:
|
||||
|
||||
```ts
|
||||
export type GameSessionData = { answers: Map<string, number>; userId: string };
|
||||
export type GameSessionData = {
|
||||
answers: Map<string, number>;
|
||||
userId: string;
|
||||
};
|
||||
```
|
||||
|
||||
3. `gameService.ts` — add `userId` to both function signatures:
|
||||
|
|
@ -100,7 +103,11 @@ Rejected because: for user-owned resources identified by opaque IDs, confirming
|
|||
Store it on create:
|
||||
|
||||
```ts
|
||||
await store.create(sessionId, { answers: answerKey, userId }, 30 * 60 * 1000);
|
||||
await store.create(
|
||||
sessionId,
|
||||
{ answers: answerKey, userId },
|
||||
30 * 60 * 1000,
|
||||
);
|
||||
```
|
||||
|
||||
Assert on evaluate:
|
||||
|
|
@ -114,7 +121,7 @@ Rejected because: for user-owned resources identified by opaque IDs, confirming
|
|||
4. `gameController.ts` — extract from authenticated request:
|
||||
|
||||
```ts
|
||||
req.session.user.id
|
||||
req.session.user.id;
|
||||
```
|
||||
|
||||
5. `gameRouter.ts` — cast at registration:
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@ Not chosen for this ticket — the database query is in `@lila/db` and is a sepa
|
|||
- Filter distractors against the correct answer before building options:
|
||||
|
||||
```ts
|
||||
const uniqueDistractors = distractorTexts.filter((t) => t !== term.targetText);
|
||||
const uniqueDistractors = distractorTexts.filter(
|
||||
(t) => t !== term.targetText,
|
||||
);
|
||||
const optionTexts = [term.targetText, ...uniqueDistractors.slice(0, 3)];
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue