icoa-cli 2.15.8 → 2.15.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.
@@ -53,6 +53,18 @@ function printTimeRemaining() {
53
53
  }
54
54
  }
55
55
  }
56
+ function printHowToPlay() {
57
+ console.log(chalk.gray(' ┌───────────────────────────────────────────────┐'));
58
+ console.log(chalk.gray(' │') + chalk.white(' How to play: ') + chalk.gray('│'));
59
+ console.log(chalk.gray(' │') + chalk.white(' ') + chalk.yellow('A/B/C/D') + chalk.white(' answer the question ') + chalk.gray('│'));
60
+ console.log(chalk.gray(' │') + chalk.white(' ') + chalk.yellow('help') + chalk.white(' remove a wrong option ') + chalk.gray('│'));
61
+ console.log(chalk.gray(' │') + chalk.white(' ') + chalk.yellow('next') + chalk.white(' / ') + chalk.yellow('prev') + chalk.white(' move between questions ') + chalk.gray('│'));
62
+ console.log(chalk.gray(' │') + chalk.white(' ') + chalk.yellow('more help') + chalk.white(' +3 bonus helps ') + chalk.gray('│'));
63
+ console.log(chalk.gray(' │') + chalk.white(' ') + chalk.yellow('back') + chalk.white(' pause and return to menu ') + chalk.gray('│'));
64
+ console.log(chalk.gray(' │') + chalk.white(' ') + chalk.yellow('lang es') + chalk.white(' switch language (15 available) ') + chalk.gray('│'));
65
+ console.log(chalk.gray(' │') + chalk.gray(' es · ko · fr · ar · zh · ja ... ') + chalk.gray('│'));
66
+ console.log(chalk.gray(' └───────────────────────────────────────────────┘'));
67
+ }
56
68
  // Australian easter eggs every 5 questions
57
69
  const EASTER_EGGS = {
58
70
  5: { emoji: '🏛️', text: 'Sydney Opera House — You\'re doing great!' },
@@ -112,12 +124,13 @@ function printQuestion(q, answer) {
112
124
  }
113
125
  }
114
126
  console.log();
115
- // Bottom navigation
127
+ // Bottom: compact nav + help status
116
128
  const remaining = help.max - help.used;
117
- const helpHint = remaining > 0
118
- ? chalk.yellow('help') + chalk.gray(` (${remaining}/${help.max})`)
119
- : (help.max < 8 ? chalk.gray('help 0/5 — type ') + chalk.yellow('more help') : chalk.gray('help 0/8'));
120
- console.log(chalk.gray(' ') + chalk.white('A') + chalk.gray('/') + chalk.white('B') + chalk.gray('/') + chalk.white('C') + chalk.gray('/') + chalk.white('D') + chalk.gray(' to answer · ') + helpHint +
129
+ const helpStatus = remaining > 0
130
+ ? chalk.yellow(`help ${remaining}/${help.max}`)
131
+ : (help.max < 8 ? chalk.gray('help 0/5 — ') + chalk.yellow('more help') : chalk.gray('help 0/8'));
132
+ console.log(chalk.gray(' ') + chalk.white('A/B/C/D') +
133
+ chalk.gray(' · ') + helpStatus +
121
134
  (q.number > 1 ? chalk.gray(' · ') + chalk.white('prev') : '') +
122
135
  (q.number < total ? chalk.gray(' · ') + chalk.white('next') : '') +
123
136
  chalk.gray(' · ') + chalk.white('back'));
@@ -819,13 +832,14 @@ export function registerExamCommand(program) {
819
832
  const existing = getExamState();
820
833
  if (existing) {
821
834
  if (existing.session.examId === 'demo-free') {
822
- printInfo('Demo exam already in progress.');
823
- printInfo('Use "exam q 1" to continue, or "exam submit" to finish.');
835
+ // Demo: always restart fresh
836
+ clearExamState();
837
+ }
838
+ else {
839
+ printWarning(`Exam "${existing.session.examName}" is in progress.`);
840
+ printInfo('Submit it first: exam submit');
824
841
  return;
825
842
  }
826
- printWarning(`Exam "${existing.session.examName}" is in progress.`);
827
- printInfo('Submit it first: exam submit');
828
- return;
829
843
  }
830
844
  console.log();
831
845
  printHeader('ICOA Demo Exam — Free Practice');
@@ -833,16 +847,7 @@ export function registerExamCommand(program) {
833
847
  console.log(chalk.white(' Free practice · No account needed · No time limit'));
834
848
  console.log(chalk.white(' 30 questions · Pick one answer per question'));
835
849
  console.log();
836
- console.log(chalk.gray(' ┌─────────────────────────────────────────────────┐'));
837
- console.log(chalk.gray(' │') + chalk.white(' How to play: ') + chalk.gray('│'));
838
- console.log(chalk.gray(' │') + chalk.white(' Type ') + chalk.yellow('A') + chalk.white(', ') + chalk.yellow('B') + chalk.white(', ') + chalk.yellow('C') + chalk.white(' or ') + chalk.yellow('D') + chalk.white(' to answer ') + chalk.gray('│'));
839
- console.log(chalk.gray(' │') + chalk.white(' Type ') + chalk.yellow('help') + chalk.white(' Remove a wrong answer (5 uses) ') + chalk.gray('│'));
840
- console.log(chalk.gray(' │') + chalk.white(' Type ') + chalk.yellow('next') + chalk.white('/') + chalk.yellow('prev') + chalk.white(' Move between questions ') + chalk.gray('│'));
841
- console.log(chalk.gray(' │') + chalk.white(' You can change answers anytime before submitting ') + chalk.gray('│'));
842
- console.log(chalk.gray(' │') + chalk.white(' Running low on help? Type ') + chalk.yellow('more help') + chalk.white(' for +3 ') + chalk.gray('│'));
843
- console.log(chalk.gray(' │') + chalk.white(' Type ') + chalk.yellow('lang') + chalk.white(' to switch language (15 supported) ') + chalk.gray('│'));
844
- console.log(chalk.gray(' │') + chalk.gray(' e.g. lang es (Español) · lang ko · lang fr ') + chalk.gray('│'));
845
- console.log(chalk.gray(' └─────────────────────────────────────────────────┘'));
850
+ printHowToPlay();
846
851
  console.log();
847
852
  const proceed = await confirm({
848
853
  message: chalk.white('Start demo exam now?'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icoa-cli",
3
- "version": "2.15.8",
3
+ "version": "2.15.10",
4
4
  "description": "ICOA CLI — The world's first CLI-native CTF competition terminal",
5
5
  "type": "module",
6
6
  "bin": {