Remove inter-session waiting period for immediate sequential access

- Set SESSION_UNLOCK_INTERVAL_MS to 0 in backend and frontend.
- Allow immediate access to next eligible session upon completing previous sessions.
- Preserve all session prerequisites, assignment unlock logic, and participant progress.
- Update tests to verify immediate session unlock and assignment availability.
This commit is contained in:
ar.badiei
2026-10-14 19:42:54 +03:30
parent 8c37c15697
commit a3a9f2664b
5 changed files with 294 additions and 40 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import { PROGRAM_SESSION_COUNT } from '@/data/program/sessions';
/** Minimum wait after completing session N before session N+1 unlocks (sessions 3–10). */
export const SESSION_UNLOCK_INTERVAL_MS = 24 * 60 * 60 * 1000;
/** Minimum wait after completing session N before session N+1 unlocks. Set to 0 so next session unlocks immediately. */
export const SESSION_UNLOCK_INTERVAL_MS = 0;
export type SessionCompletionTimes = Record<number, string>;
+1 -2
View File
@@ -334,8 +334,7 @@ export async function submitHomeworkReport(
/**
* Check if a specific session is unlocked for a user.
* Session N unlocks when sessions 1…N-1 are complete and at least 1 hour has passed
* since session N-1 was completed.
* Session N unlocks immediately when previous sessions 1…N-1 are complete.
*/
export function isSessionUnlocked(userId: string, sessionOrder: number): boolean {
const cachedSessions = getSessions(userId);