@@ -2363,13 +2363,12 @@ <h1><span class="brand-simp">Simpatico</span><span class="brand-hr">HR</span></h
23632363 else if ( q <= 1 ) { this . phase = 'intro' ; }
23642364 else {
23652365 const uncovered = this . skillsToProbe . filter ( s => ! this . skillsCovered [ s ] || this . skillsCovered [ s ] . depth < 1 ) ;
2366- if ( uncovered . length > 0 && q < max - 2 ) {
2366+ if ( uncovered . length > 0 && q < max - 1 ) {
23672367 this . phase = 'skill_probe' ;
2368- } else if ( q >= max - 3 && q < max - 1 ) {
2368+ } else if ( q >= max - 2 && q < max ) {
23692369 this . phase = Math . random ( ) > 0.5 ? 'scenario' : 'behavioral' ;
2370- } else if ( q >= max - 1 ) {
2371- this . phase = 'closing' ;
23722370 }
2371+ // Only enter closing when q >= max (handled above)
23732372 }
23742373
23752374 const pill = document . getElementById ( 'phasePill' ) ;
@@ -2649,7 +2648,15 @@ <h1><span class="brand-simp">Simpatico</span><span class="brand-hr">HR</span></h
26492648 else if ( avgExp <= 10 ) engine . level = 'senior (6-10 years)' ;
26502649 else engine . level = 'staff/lead (10+ years)' ;
26512650
2652- engine . maxQuestions = Math . min ( Math . max ( engine . skillsToProbe . length + 3 , 6 ) , 12 ) ;
2651+ // Use configured question_count from dashboard, or calculate from skills
2652+ const configuredCount = state . meta . interview ?. question_count ;
2653+ if ( configuredCount && configuredCount >= 3 ) {
2654+ engine . maxQuestions = Math . min ( configuredCount , 20 ) ;
2655+ console . log ( '[Engine] Using configured question count:' , engine . maxQuestions ) ;
2656+ } else {
2657+ engine . maxQuestions = Math . min ( Math . max ( engine . skillsToProbe . length + 3 , 6 ) , 12 ) ;
2658+ console . log ( '[Engine] Calculated question count:' , engine . maxQuestions , '(skills:' , engine . skillsToProbe . length , ')' ) ;
2659+ }
26532660 document . getElementById ( 'qTrackerMax' ) . textContent = engine . maxQuestions ;
26542661 } else if ( state . meta . interview ) {
26552662 document . getElementById ( 'sjcTitle' ) . textContent = state . meta . interview . job_title || 'Interview' ;
0 commit comments