icoa-cli 2.15.9 → 2.15.11
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 +22 -19
- package/package.json +1 -1
package/dist/commands/exam.js
CHANGED
|
@@ -12,7 +12,7 @@ function drawProgress(percent, label) {
|
|
|
12
12
|
const empty = width - filled;
|
|
13
13
|
const bar = chalk.green('█'.repeat(filled)) + chalk.gray('░'.repeat(empty));
|
|
14
14
|
const pct = String(percent).padStart(3) + '%';
|
|
15
|
-
process.stdout.write(`\r ${bar} ${pct} ${chalk.gray(label)}`);
|
|
15
|
+
process.stdout.write(`\r\x1b[2K ${bar} ${pct} ${chalk.gray(label)}`);
|
|
16
16
|
}
|
|
17
17
|
function requireExamConnection() {
|
|
18
18
|
const config = getConfig();
|
|
@@ -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
|
|
127
|
+
// Bottom: compact nav + help status
|
|
116
128
|
const remaining = help.max - help.used;
|
|
117
|
-
const
|
|
118
|
-
? chalk.yellow(
|
|
119
|
-
: (help.max < 8 ? chalk.gray('help 0/5 —
|
|
120
|
-
console.log(chalk.gray(' ') + chalk.white('A
|
|
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'));
|
|
@@ -834,16 +847,7 @@ export function registerExamCommand(program) {
|
|
|
834
847
|
console.log(chalk.white(' Free practice · No account needed · No time limit'));
|
|
835
848
|
console.log(chalk.white(' 30 questions · Pick one answer per question'));
|
|
836
849
|
console.log();
|
|
837
|
-
|
|
838
|
-
console.log(chalk.gray(' │') + chalk.white(' How to play: ') + chalk.gray('│'));
|
|
839
|
-
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('│'));
|
|
840
|
-
console.log(chalk.gray(' │') + chalk.white(' Type ') + chalk.yellow('help') + chalk.white(' Remove a wrong answer (5 uses) ') + chalk.gray('│'));
|
|
841
|
-
console.log(chalk.gray(' │') + chalk.white(' Type ') + chalk.yellow('next') + chalk.white('/') + chalk.yellow('prev') + chalk.white(' Move between questions ') + chalk.gray('│'));
|
|
842
|
-
console.log(chalk.gray(' │') + chalk.white(' You can change answers anytime before submitting ') + chalk.gray('│'));
|
|
843
|
-
console.log(chalk.gray(' │') + chalk.white(' Running low on help? Type ') + chalk.yellow('more help') + chalk.white(' for +3 ') + chalk.gray('│'));
|
|
844
|
-
console.log(chalk.gray(' │') + chalk.white(' Type ') + chalk.yellow('lang') + chalk.white(' to switch language (15 supported) ') + chalk.gray('│'));
|
|
845
|
-
console.log(chalk.gray(' │') + chalk.gray(' e.g. lang es (Español) · lang ko · lang fr ') + chalk.gray('│'));
|
|
846
|
-
console.log(chalk.gray(' └─────────────────────────────────────────────────┘'));
|
|
850
|
+
printHowToPlay();
|
|
847
851
|
console.log();
|
|
848
852
|
const proceed = await confirm({
|
|
849
853
|
message: chalk.white('Start demo exam now?'),
|
|
@@ -862,11 +866,10 @@ export function registerExamCommand(program) {
|
|
|
862
866
|
await sleep(150);
|
|
863
867
|
drawProgress(100, 'Ready!');
|
|
864
868
|
console.log();
|
|
865
|
-
saveExamState({ session, questions: DEMO_QUESTIONS, answers: {} });
|
|
866
869
|
console.log();
|
|
870
|
+
saveExamState({ session, questions: DEMO_QUESTIONS, answers: {} });
|
|
867
871
|
printKeyValue('Questions', '30');
|
|
868
|
-
printKeyValue('Duration', '
|
|
869
|
-
printTimeRemaining();
|
|
872
|
+
printKeyValue('Duration', 'No time limit');
|
|
870
873
|
// Show first question
|
|
871
874
|
printQuestion(DEMO_QUESTIONS[0]);
|
|
872
875
|
console.log(chalk.gray(' Commands: exam q <n> | exam answer <n> <A-D> | exam review | exam submit'));
|