icoa-cli 2.19.69 → 2.19.70
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/dist/lib/exam-state.js +13 -1
- package/package.json +1 -1
package/dist/lib/exam-state.js
CHANGED
|
@@ -17,7 +17,19 @@ export function getRealExamState() {
|
|
|
17
17
|
if (!existsSync(f))
|
|
18
18
|
return null;
|
|
19
19
|
try {
|
|
20
|
-
|
|
20
|
+
const state = JSON.parse(readFileSync(f, 'utf-8'));
|
|
21
|
+
// Pre-v2.19.45 versions stored demo state in exam-state.json with
|
|
22
|
+
// examId='demo-free'. After v2.19.45 demo moved to demo-state.json.
|
|
23
|
+
// Ignore stale demo-tagged content found in the real-exam file —
|
|
24
|
+
// it's contamination from an old install. Also auto-clean the file.
|
|
25
|
+
if (state?.session?.examId === 'demo-free') {
|
|
26
|
+
try {
|
|
27
|
+
unlinkSync(f);
|
|
28
|
+
}
|
|
29
|
+
catch { }
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return state;
|
|
21
33
|
}
|
|
22
34
|
catch {
|
|
23
35
|
return null;
|