icoa-cli 2.16.8 โ 2.16.9
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 +62 -3
- 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,69 @@ 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
|
+
console.log(chalk.white(' Nice work! Those were the theory questions.'));
|
|
604
|
+
console.log();
|
|
605
|
+
console.log(chalk.yellow(' Did you know?'));
|
|
606
|
+
console.log(chalk.gray(' CTF stands for "Capture The Flag" โ a cybersecurity'));
|
|
607
|
+
console.log(chalk.gray(' competition where you solve real hacking challenges.'));
|
|
608
|
+
console.log();
|
|
609
|
+
console.log(chalk.white(' ICOA combines CTF with AI in ') + chalk.bold('TWO') + chalk.white(' tracks:'));
|
|
610
|
+
console.log();
|
|
611
|
+
console.log(chalk.green.bold(' AI4CTF') + chalk.white(' โ Use AI to help you solve CTF challenges'));
|
|
612
|
+
console.log(chalk.gray(' AI is your teammate. Chat, ask for hints, work together.'));
|
|
613
|
+
console.log();
|
|
614
|
+
console.log(chalk.red.bold(' CTF4AI') + chalk.white(' โ Trick the AI (Prompt Injection)'));
|
|
615
|
+
console.log(chalk.gray(' Can you make the AI break its own safety rules?'));
|
|
616
|
+
console.log();
|
|
617
|
+
console.log(chalk.white(' Try them now:'));
|
|
618
|
+
console.log(chalk.green.bold(' ai4ctf') + chalk.gray(' Chat with AI teammate (start here!)'));
|
|
619
|
+
console.log(chalk.red.bold(' ctf4ai') + chalk.gray(' Trick the AI โ make it say "koala"'));
|
|
620
|
+
console.log();
|
|
621
|
+
}
|
|
622
|
+
catch { }
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
console.log(chalk.white(' Use: exam review ยท exam submit'));
|
|
626
|
+
}
|
|
568
627
|
}
|
|
569
628
|
});
|
|
570
629
|
// โโโ exam review โโโ
|