Skip to content

Commit de4b102

Browse files
committed
Add CT-AI syllabus v2.0 (40 questions, 4 two-point items) with version selector
1 parent 848e5d2 commit de4b102

3 files changed

Lines changed: 108 additions & 13 deletions

File tree

app.js

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ function attemptFormFields(att){
454454

455455
if (att.type === 'exam'){
456456
fields[ENTRY_ACTIVITY] = 'Exam';
457-
fields[ENTRY_FAMILY] = att.mode === 'ctai' ? 'CT-AI' : att.mode === 'ctfl' ? 'CTFL' : 'CT-GenAI';
457+
fields[ENTRY_FAMILY] = att.mode === 'ctai' ? ('CT-AI v' + (att.ctaiVersion === 2 ? '2.0' : '1.0')) : att.mode === 'ctfl' ? 'CTFL' : 'CT-GenAI';
458458
fields[ENTRY_PACK_ROUND] = 'Pack #' + att.pack;
459459
fields[ENTRY_CORRECT] = att.correct;
460460
fields[ENTRY_WRONG] = att.wrong;
@@ -510,7 +510,8 @@ function showResults(){
510510
var sp=document.getElementById('score-pct');sp.textContent=pct+'%';sp.style.color=color;
511511
var vd=document.getElementById('verdict');
512512
vd.textContent=passed?'PASSED':'FAILED';vd.className='verdict '+(passed?'pass':'fail');
513-
var subText='Pack #'+currentPack+' \u00b7 '+earned+'/'+total+' points \u00b7 '+correct+'/'+TOTAL_Q+' correct \u00b7 Pass mark 65%';
513+
var resFam = currentMode==='ctai' ? ('CT-AI v' + (currentCtaiVersion===2?'2.0':'1.0')) : currentMode==='ctfl' ? 'CTFL' : 'CT-GenAI';
514+
var subText=resFam+' \u00b7 Pack #'+currentPack+' \u00b7 '+earned+'/'+total+' points \u00b7 '+correct+'/'+TOTAL_Q+' correct \u00b7 Pass mark 65%';
514515
document.getElementById('result-sub').textContent=subText;
515516
var autoBadge=document.getElementById('auto-submit-badge');
516517
if(autoBadge)autoBadge.style.display=_autoSubmitted?'':'none';
@@ -526,6 +527,7 @@ function showResults(){
526527
type: 'exam',
527528
mode: currentMode,
528529
pack: currentPack,
530+
ctaiVersion: (currentMode === 'ctai' ? currentCtaiVersion : undefined),
529531
correct: correct, wrong: wrong, unanswered: unanswered,
530532
total: TOTAL_Q, pct: pct, passed: passed,
531533
earnedPoints: earned, totalPoints: total,
@@ -616,6 +618,7 @@ function downloadResultsPdf(){
616618
var pct=Math.round(earned/total*100);
617619
var passed=pct>=65;
618620
var fam = currentMode==='ctai' ? 'CT-AI' : currentMode==='ctfl' ? 'CTFL' : 'CT-GenAI';
621+
if (currentMode === 'ctai') fam += ' v' + (currentCtaiVersion === 2 ? '2.0' : '1.0');
619622
var examTitle = fam + ' Exam · Pack #' + currentPack;
620623
var now = new Date();
621624
var pad = function(n){ return n<10?'0'+n:''+n; };
@@ -723,15 +726,18 @@ startExam = function(pack) {
723726
_origStartExam(pack);
724727
};
725728

726-
function startExamCtai(pack) {
729+
var currentCtaiVersion = 1;
730+
function startExamCtai(pack, version) {
727731
currentMode = 'ctai';
732+
currentCtaiVersion = (version === 2) ? 2 : 1;
728733
currentPack = pack;
729-
questions = CTAI_PACKS[String(pack)];
734+
var pool = (currentCtaiVersion === 2) ? CTAI_PACKS_V2 : CTAI_PACKS;
735+
questions = pool[String(pack)];
730736
userAnswers = {}; flagged = {}; currentQ = 0; secondsLeft = EXAM_SECS;
731737
_autoSubmitted=false;_oneMinuteWarned=false;
732738
if(_timesUpInterval){clearInterval(_timesUpInterval);_timesUpInterval=null;}
733739
clearInterval(timerInterval);
734-
document.getElementById('exam-title').textContent = 'CT-AI \u2014 Pack #' + pack;
740+
document.getElementById('exam-title').textContent = 'CT-AI v' + (currentCtaiVersion===2?'2.0':'1.0') + ' \u2014 Pack #' + pack;
735741
showScreen('screen-exam');
736742
buildNavGrid();
737743
renderQuestion();
@@ -761,12 +767,14 @@ doLeave = function() {
761767
closeModals();
762768
clearInterval(timerInterval);
763769
if (wasPendingProfile) { openProfile(); return; }
764-
showScreen(currentMode === 'ctai' ? 'screen-ctai-home' : currentMode === 'ctfl' ? 'screen-ctfl-home' : 'screen-genai-home');
770+
var ctaiHome = (currentCtaiVersion === 2) ? 'screen-ctai-home-v2' : 'screen-ctai-home';
771+
showScreen(currentMode === 'ctai' ? ctaiHome : currentMode === 'ctfl' ? 'screen-ctfl-home' : 'screen-genai-home');
765772
};
766773

767774
var _origDoSubmit = doSubmit;
768775
doSubmit = function() {
769-
var backScreen = currentMode === 'ctai' ? 'screen-ctai-home' : currentMode === 'ctfl' ? 'screen-ctfl-home' : 'screen-genai-home';
776+
var ctaiHomeSubmit = (currentCtaiVersion === 2) ? 'screen-ctai-home-v2' : 'screen-ctai-home';
777+
var backScreen = currentMode === 'ctai' ? ctaiHomeSubmit : currentMode === 'ctfl' ? 'screen-ctfl-home' : 'screen-genai-home';
770778
var backBtn = document.getElementById('back-after-results');
771779
if (backBtn) backBtn.setAttribute('data-screen', backScreen);
772780
_origDoSubmit();
@@ -1230,6 +1238,7 @@ function formatAttemptDate(iso){
12301238
function attemptLabel(att){
12311239
if (att.type === 'exam') {
12321240
var fam = att.mode === 'ctai' ? 'CT-AI' : att.mode === 'ctfl' ? 'CTFL' : 'CT-GenAI';
1241+
if (att.mode === 'ctai') fam += ' v' + (att.ctaiVersion === 2 ? '2.0' : '1.0');
12331242
return fam + ' Exam · Pack #' + att.pack;
12341243
}
12351244
if (att.type === 'blitz') {
@@ -1292,7 +1301,9 @@ function reopenAttempt(id){
12921301

12931302
currentMode = att.mode;
12941303
currentPack = att.pack;
1295-
questions = (att.mode === 'ctai' ? CTAI_PACKS : att.mode === 'ctfl' ? CTFL_PACKS : PACKS)[String(att.pack)];
1304+
currentCtaiVersion = (att.mode === 'ctai' && att.ctaiVersion === 2) ? 2 : 1;
1305+
var ctaiPool = (currentCtaiVersion === 2) ? CTAI_PACKS_V2 : CTAI_PACKS;
1306+
questions = (att.mode === 'ctai' ? ctaiPool : att.mode === 'ctfl' ? CTFL_PACKS : PACKS)[String(att.pack)];
12961307
if (!questions) return;
12971308
userAnswers = att.userAnswers;
12981309
_skipSaveAttempt = true;

0 commit comments

Comments
 (0)