Skip to content

Commit 6e27e1b

Browse files
committed
fix(interview): read question_count from config, fix early closing, add configurable question count selector
1 parent 9e5e1e2 commit 6e27e1b

2 files changed

Lines changed: 31 additions & 6 deletions

File tree

dashboard/hr.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2649,6 +2649,24 @@ <h5 class="modal-title"><i class="fas fa-calendar-plus me-2" style="color:var(--
26492649
</div>
26502650
</div>
26512651

2652+
<div class="row">
2653+
<div class="col-md-6">
2654+
<div class="form-group">
2655+
<label><i class="fas fa-list-ol" style="color:var(--primary)"></i> Number of Questions</label>
2656+
<select class="form-control-custom" id="intQuestionCount">
2657+
<option value="3">3 Questions (Quick Screen)</option>
2658+
<option value="5">5 Questions (Standard)</option>
2659+
<option value="6" selected>6 Questions (Recommended)</option>
2660+
<option value="8">8 Questions (Thorough)</option>
2661+
<option value="10">10 Questions (Deep Dive)</option>
2662+
<option value="12">12 Questions (Comprehensive)</option>
2663+
<option value="15">15 Questions (Extended)</option>
2664+
</select>
2665+
<small style="color:var(--text-secondary);font-size:0.75rem;margin-top:4px;display:block;">AI will ask exactly this many questions before wrapping up</small>
2666+
</div>
2667+
</div>
2668+
</div>
2669+
26522670
<div class="proctored-settings" id="proctoredSettings">
26532671
<h6><i class="fas fa-shield-halved"></i> Proctored Interview Settings <span class="ai-badge">AI Proctoring</span></h6>
26542672
<div class="row mt-3">
@@ -4706,7 +4724,7 @@ <h3>${stats.tokenLinksGenerated}</h3>
47064724
company_id: user.company_id || user.tenant_id || null,
47074725
created_at: new Date().toISOString(),
47084726
expires_at: new Date(new Date().getTime() + 7 * 24 * 60 * 60 * 1000).toISOString(),
4709-
question_count: 5,
4727+
question_count: parseInt(document.getElementById('intQuestionCount')?.value) || 6,
47104728
max_attempts: 1,
47114729
interview_language: language,
47124730
experience_level: experienceLevel

interview/proctored-room.html

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)