icoa-cli 2.16.8 โ 2.16.10
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/commands/exam.js +82 -3
- package/dist/repl.js +23 -2
- package/package.json +1 -1
package/dist/commands/exam.js
CHANGED
|
@@ -516,7 +516,7 @@ export function registerExamCommand(program) {
|
|
|
516
516
|
exam
|
|
517
517
|
.command('answer <n> <choice>')
|
|
518
518
|
.description('Answer question N with choice A/B/C/D')
|
|
519
|
-
.action((n, choice) => {
|
|
519
|
+
.action(async (n, choice) => {
|
|
520
520
|
logCommand(`exam answer ${n} ${choice}`);
|
|
521
521
|
const state = getExamState();
|
|
522
522
|
if (!state) {
|
|
@@ -561,10 +561,89 @@ export function registerExamCommand(program) {
|
|
|
561
561
|
saveExamState(state);
|
|
562
562
|
printQuestion(nextQ, state.answers[nextQ.number]);
|
|
563
563
|
}
|
|
564
|
-
else if (answered
|
|
564
|
+
else if (answered >= state.questions.length) {
|
|
565
565
|
console.log();
|
|
566
566
|
console.log(chalk.green.bold(' ๐ All questions answered!'));
|
|
567
|
-
console.log(
|
|
567
|
+
console.log();
|
|
568
|
+
if (state.session.examId === 'demo-free') {
|
|
569
|
+
console.log(chalk.white(' Auto-submitting your demo...'));
|
|
570
|
+
console.log();
|
|
571
|
+
// Auto-submit demo
|
|
572
|
+
try {
|
|
573
|
+
const { DEMO_ANSWERS } = await import('../lib/demo-exam.js');
|
|
574
|
+
drawProgress(0, 'Grading...');
|
|
575
|
+
await sleep(300);
|
|
576
|
+
let score = 0;
|
|
577
|
+
for (const [qn, ans] of Object.entries(state.answers)) {
|
|
578
|
+
if (DEMO_ANSWERS[Number(qn)] === ans)
|
|
579
|
+
score++;
|
|
580
|
+
}
|
|
581
|
+
drawProgress(100, 'Complete!');
|
|
582
|
+
console.log();
|
|
583
|
+
clearExamState();
|
|
584
|
+
const pct = Math.round(score / state.questions.length * 100);
|
|
585
|
+
console.log();
|
|
586
|
+
console.log(chalk.cyan(' โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ'));
|
|
587
|
+
console.log();
|
|
588
|
+
console.log(chalk.bold.white(' โโโ โโโโโโโ โโโโโโโ โโโโโโ'));
|
|
589
|
+
console.log(chalk.bold.white(' โโโโโโโโโโโโโโโโโโโโโโโโโโโโ'));
|
|
590
|
+
console.log(chalk.bold.white(' โโโโโโ โโโ โโโโโโโโโโโ'));
|
|
591
|
+
console.log(chalk.bold.white(' โโโโโโ โโโ โโโโโโโโโโโ'));
|
|
592
|
+
console.log(chalk.bold.white(' โโโโโโโโโโโโโโโโโโโโโโโ โโโ'));
|
|
593
|
+
console.log(chalk.bold.white(' โโโ โโโโโโโ โโโโโโโ โโโ โโโ'));
|
|
594
|
+
console.log();
|
|
595
|
+
console.log(chalk.bold(` Score: ${score}/${state.questions.length} (${pct}%)`));
|
|
596
|
+
console.log(chalk.bold(` ${pct >= 60 ? chalk.green('โ PASSED') : chalk.red('โ NOT PASSED')}`));
|
|
597
|
+
console.log();
|
|
598
|
+
console.log(chalk.yellow(' International Cyber Olympiad in AI 2026'));
|
|
599
|
+
console.log(chalk.gray(' Sydney, Australia ยท Jun 27 - Jul 2, 2026'));
|
|
600
|
+
console.log();
|
|
601
|
+
console.log(chalk.cyan(' โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ'));
|
|
602
|
+
console.log();
|
|
603
|
+
// Show wrong answers
|
|
604
|
+
const wrong = state.questions.filter((q) => state.answers[q.number] !== DEMO_ANSWERS[q.number]);
|
|
605
|
+
if (wrong.length > 0) {
|
|
606
|
+
console.log(chalk.white(` ${wrong.length} incorrect โ here are the corrections:`));
|
|
607
|
+
console.log();
|
|
608
|
+
for (const q of wrong) {
|
|
609
|
+
const yours = state.answers[q.number];
|
|
610
|
+
const correct = DEMO_ANSWERS[q.number];
|
|
611
|
+
console.log(chalk.red(` Q${q.number}. ${q.text}`));
|
|
612
|
+
console.log(chalk.red(` Your answer: ${yours}. ${q.options[yours]}`));
|
|
613
|
+
console.log(chalk.green(` Correct: ${correct}. ${q.options[correct]}`));
|
|
614
|
+
console.log();
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
else {
|
|
618
|
+
console.log(chalk.green.bold(' Perfect score! All answers correct! ๐'));
|
|
619
|
+
console.log();
|
|
620
|
+
}
|
|
621
|
+
console.log(chalk.gray(' โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ'));
|
|
622
|
+
console.log();
|
|
623
|
+
console.log(chalk.white(' These were theory questions. In the real ICOA competition,'));
|
|
624
|
+
console.log(chalk.white(' everything happens inside this terminal โ no other tools allowed.'));
|
|
625
|
+
console.log();
|
|
626
|
+
console.log(chalk.yellow(' Did you know?'));
|
|
627
|
+
console.log(chalk.gray(' CTF stands for "Capture The Flag" โ a cybersecurity'));
|
|
628
|
+
console.log(chalk.gray(' competition where you solve real hacking challenges.'));
|
|
629
|
+
console.log();
|
|
630
|
+
console.log(chalk.white(' ICOA uses ') + chalk.bold('TWO') + chalk.white(' competition tracks:'));
|
|
631
|
+
console.log();
|
|
632
|
+
console.log(chalk.green.bold(' AI4CTF') + chalk.white(' โ Use AI to help you solve CTF challenges'));
|
|
633
|
+
console.log(chalk.gray(' AI is your teammate. Chat, ask for hints, work together.'));
|
|
634
|
+
console.log();
|
|
635
|
+
console.log(chalk.red.bold(' CTF4AI') + chalk.white(' โ Trick the AI (Prompt Injection)'));
|
|
636
|
+
console.log(chalk.gray(' Can you make the AI break its own safety rules?'));
|
|
637
|
+
console.log();
|
|
638
|
+
console.log(chalk.white(' Want to experience both? Type ') + chalk.bold.cyan('continue'));
|
|
639
|
+
console.log(chalk.gray(' Or type "back" to return to the main menu.'));
|
|
640
|
+
console.log();
|
|
641
|
+
}
|
|
642
|
+
catch { }
|
|
643
|
+
}
|
|
644
|
+
else {
|
|
645
|
+
console.log(chalk.white(' Use: exam review ยท exam submit'));
|
|
646
|
+
}
|
|
568
647
|
}
|
|
569
648
|
});
|
|
570
649
|
// โโโ exam review โโโ
|
package/dist/repl.js
CHANGED
|
@@ -379,6 +379,27 @@ export async function startRepl(program, resumeMode) {
|
|
|
379
379
|
return;
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
+
// "continue" โ after demo, guide to ai4ctf then ctf4ai
|
|
383
|
+
if (input.toLowerCase() === 'continue') {
|
|
384
|
+
console.log();
|
|
385
|
+
console.log(chalk.green.bold(' โโโ AI4CTF โ AI as Your Teammate โโโ'));
|
|
386
|
+
console.log();
|
|
387
|
+
console.log(chalk.white(' In AI4CTF, you solve cybersecurity challenges'));
|
|
388
|
+
console.log(chalk.white(' with AI by your side.'));
|
|
389
|
+
console.log();
|
|
390
|
+
console.log(chalk.white(' In competition, you get AI help at 3 levels:'));
|
|
391
|
+
console.log(chalk.yellow(' hint a') + chalk.gray(' General guidance (50 uses)'));
|
|
392
|
+
console.log(chalk.yellow(' hint b') + chalk.gray(' Deep analysis (10 uses)'));
|
|
393
|
+
console.log(chalk.yellow(' hint c') + chalk.gray(' Critical assist (2 uses)'));
|
|
394
|
+
console.log();
|
|
395
|
+
console.log(chalk.white(' Try it now! Type: ') + chalk.bold.green('ai4ctf'));
|
|
396
|
+
console.log(chalk.gray(' Chat freely with your AI teammate. Type "exit" when done.'));
|
|
397
|
+
console.log();
|
|
398
|
+
console.log(chalk.gray(' After ai4ctf, try: ') + chalk.bold.red('ctf4ai') + chalk.gray(' โ trick the AI into saying "koala"'));
|
|
399
|
+
console.log();
|
|
400
|
+
rl.prompt();
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
382
403
|
// ICOA exam token detection (e.g., "ICOA-PE-001")
|
|
383
404
|
if (/^ICOA-[A-Z]{2,3}-\d{1,6}$/i.test(input.trim())) {
|
|
384
405
|
processing = true;
|
|
@@ -464,7 +485,7 @@ export async function startRepl(program, resumeMode) {
|
|
|
464
485
|
}
|
|
465
486
|
const cmd = input.split(/\s+/)[0].toLowerCase();
|
|
466
487
|
// โโโ Mode-based command filtering โโโ
|
|
467
|
-
const selectionCommands = ['exam', 'demo', 'nations', 'next', 'prev', 'setup', 'lang', 'ref', 'ai4ctf', 'ctf4ai'];
|
|
488
|
+
const selectionCommands = ['exam', 'demo', 'nations', 'next', 'prev', 'continue', 'setup', 'lang', 'ref', 'ai4ctf', 'ctf4ai'];
|
|
468
489
|
const organizerCommands = ['join', 'exam', 'demo', 'next', 'prev', 'logout', 'setup', 'lang', 'ref', 'ctf'];
|
|
469
490
|
if (mode === 'selection' && !selectionCommands.includes(cmd)) {
|
|
470
491
|
console.log(chalk.gray(' Not available in Selection mode.'));
|
|
@@ -501,7 +522,7 @@ export async function startRepl(program, resumeMode) {
|
|
|
501
522
|
'scoreboard', 'sb', 'status', 'time', 'hint', 'hint-b', 'hint-c',
|
|
502
523
|
'hint-budget', 'ref', 'shell', 'files', 'connect', 'note',
|
|
503
524
|
'log', 'lang', 'setup', 'env', 'ai4ctf', 'model', 'ctf',
|
|
504
|
-
'exam', 'demo', 'nations', 'next', 'prev', 'logout', 'ctf4ai',
|
|
525
|
+
'exam', 'demo', 'nations', 'next', 'prev', 'continue', 'logout', 'ctf4ai',
|
|
505
526
|
];
|
|
506
527
|
if (!knownCommands.includes(cmd)) {
|
|
507
528
|
// Block dangerous commands
|