Share-link generation and med math on request
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 34s
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 34s
- Visitors of class and exam links can generate NCLEX-style quizzes (default and maximum 50 questions, 25% select-all, Python-checked, optional 5 med math questions) and flashcard sets from chosen class materials, once the owner turns it on for the link. - 4 quizzes and 2 flashcard sets per link per day; failed attempts do not count; "Reset limits" in the share dialog gives a fresh allowance. - Sets are drafts tied to the link (migration 7): listed for every visitor, explainable, kept off the owner's drafts list, and reviewable or savable from the share dialog. - Generate gains "Include med math" with a count (default 5): exactly that many dosage calculation questions at the chosen difficulty, spread through the quiz, even when the material has none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
25bc03ea75
commit
e945f589ce
16 changed files with 807 additions and 44 deletions
|
|
@ -70,6 +70,7 @@ export const api = {
|
|||
upload: <T>(url: string, form: FormData) => request<T>('POST', url, form),
|
||||
/** Public (share-link) calls never trigger the login screen. */
|
||||
pub: <T>(url: string, signal?: AbortSignal) => request<T>('GET', url, undefined, { signal, publicCall: true }),
|
||||
pubPost: <T>(url: string, body?: unknown) => request<T>('POST', url, body ?? {}, { publicCall: true }),
|
||||
};
|
||||
|
||||
export function errorMessage(e: unknown, fallback = 'Something went wrong.'): string {
|
||||
|
|
|
|||
|
|
@ -82,6 +82,33 @@ export interface DueCounts {
|
|||
export interface ShareAi {
|
||||
explain: boolean;
|
||||
assistant: boolean;
|
||||
/** Visitors of a class or exam link can generate quizzes and flashcards. */
|
||||
generate?: boolean;
|
||||
}
|
||||
|
||||
/** Generations a share link has used today. */
|
||||
export interface ShareGenerateUsage {
|
||||
quiz: { used: number; limit: number };
|
||||
deck: { used: number; limit: number };
|
||||
}
|
||||
|
||||
/** A quiz or flashcard set a visitor generated on a share link. */
|
||||
export interface SharedSet {
|
||||
id: string;
|
||||
kind: 'quiz' | 'deck';
|
||||
title: string;
|
||||
status: 'generating' | 'ready' | 'failed';
|
||||
progress: number;
|
||||
progressLabel: string;
|
||||
error: string;
|
||||
count: number;
|
||||
createdAt: number;
|
||||
}
|
||||
|
||||
export interface SharedGenerated {
|
||||
sets: SharedSet[];
|
||||
usage: ShareGenerateUsage;
|
||||
limits: { quizMax: number; deckMax: number; mathQuestions: number };
|
||||
}
|
||||
|
||||
export interface Share {
|
||||
|
|
@ -344,6 +371,8 @@ export interface ShareListItem extends Share {
|
|||
classId: string | null;
|
||||
className: string;
|
||||
classColor: ClassColor;
|
||||
/** Class and exam links: what visitors generated, and today's usage. */
|
||||
generated: { usage: ShareGenerateUsage; sets: SharedSet[] } | null;
|
||||
}
|
||||
|
||||
/* ------------------------------ AI ------------------------------ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue