husseinelsaadi commited on
Commit
cb47676
·
1 Parent(s): e69177d

check up done

Browse files
app.py CHANGED
@@ -272,7 +272,7 @@ def post_job():
272
  # Validate number of questions; must be a positive integer. Store
273
  # errors if the input is provided but invalid. Missing values will
274
  # fall back to the default of 3.
275
- num_questions = 3
276
  if num_questions_raw:
277
  try:
278
  parsed_nq = int(num_questions_raw)
 
272
  # Validate number of questions; must be a positive integer. Store
273
  # errors if the input is provided but invalid. Missing values will
274
  # fall back to the default of 3.
275
+ num_questions = 4
276
  if num_questions_raw:
277
  try:
278
  parsed_nq = int(num_questions_raw)
backend/routes/interview_api.py CHANGED
@@ -242,7 +242,7 @@ def process_answer():
242
  logging.error(f"Error saving interview log: {log_err}")
243
 
244
  # Determine the number of questions configured for this job
245
- total_questions = 3
246
  if job_id is not None:
247
  try:
248
  job = Job.query.get(int(job_id))
 
242
  logging.error(f"Error saving interview log: {log_err}")
243
 
244
  # Determine the number of questions configured for this job
245
+ total_questions = 4
246
  if job_id is not None:
247
  try:
248
  job = Job.query.get(int(job_id))
backend/services/report_generator.py CHANGED
@@ -304,18 +304,29 @@ def create_pdf_report(report_text: str) -> BytesIO:
304
  y_pos -= 0.8
305
 
306
  # Skills details (simplified)
307
- ax.text(LEFT_MARGIN, y_pos, f"Required Skills: {skills_data['required'][:80]}{'...' if len(skills_data['required']) > 80 else ''}",
308
- fontsize=10, color=TEXT_COLOR, fontfamily='sans-serif')
 
 
 
309
 
310
  y_pos -= 0.3
311
 
312
- ax.text(LEFT_MARGIN, y_pos, f"Candidate Skills: {skills_data['candidate'][:80]}{'...' if len(skills_data['candidate']) > 80 else ''}",
313
- fontsize=10, color=TEXT_COLOR, fontfamily='sans-serif')
 
 
 
 
314
 
315
  y_pos -= 0.3
316
 
317
- ax.text(LEFT_MARGIN, y_pos, f"Matching Skills: {skills_data['common'][:80]}{'...' if len(skills_data['common']) > 80 else ''}",
318
- fontsize=10, color=TEXT_COLOR, fontfamily='sans-serif')
 
 
 
 
319
 
320
  y_pos -= 0.8
321
 
@@ -341,10 +352,13 @@ def create_pdf_report(report_text: str) -> BytesIO:
341
  break
342
 
343
  # Question
344
- ax.text(LEFT_MARGIN, y_pos, f"Q{i+1}: {qa['question'][:90]}{'...' if len(qa['question']) > 90 else ''}",
345
- fontsize=11, fontweight='bold', color=ACCENT_COLOR, fontfamily='sans-serif')
346
-
347
- y_pos -= 0.4
 
 
 
348
 
349
  # Answer
350
  answer_text = qa['answer']
 
304
  y_pos -= 0.8
305
 
306
  # Skills details (simplified)
307
+ required_text = f"Required Skills: {skills_data['required']}"
308
+ for line in textwrap.wrap(required_text, width=85):
309
+ ax.text(LEFT_MARGIN, y_pos, line,
310
+ fontsize=10, color=TEXT_COLOR, fontfamily='sans-serif')
311
+ y_pos -= 0.3
312
 
313
  y_pos -= 0.3
314
 
315
+ candidate_text = f"Candidate Skills: {skills_data['candidate']}"
316
+ for line in textwrap.wrap(candidate_text, width=85):
317
+ ax.text(LEFT_MARGIN, y_pos, line,
318
+ fontsize=10, color=TEXT_COLOR, fontfamily='sans-serif')
319
+ y_pos -= 0.3
320
+
321
 
322
  y_pos -= 0.3
323
 
324
+ matching_text = f"Matching Skills: {skills_data['common']}"
325
+ for line in textwrap.wrap(matching_text, width=85):
326
+ ax.text(LEFT_MARGIN, y_pos, line,
327
+ fontsize=10, color=TEXT_COLOR, fontfamily='sans-serif')
328
+ y_pos -= 0.3
329
+
330
 
331
  y_pos -= 0.8
332
 
 
352
  break
353
 
354
  # Question
355
+ question_text = f"Q{i+1}: {qa['question']}"
356
+ for line in textwrap.wrap(question_text, width=85):
357
+ ax.text(LEFT_MARGIN, y_pos, line,
358
+ fontsize=11, fontweight='bold', color=ACCENT_COLOR, fontfamily='sans-serif')
359
+ y_pos -= 0.25
360
+ y_pos -= 0.15 # extra spacing after question block
361
+
362
 
363
  # Answer
364
  answer_text = qa['answer']
backend/templates/closing.html CHANGED
@@ -14,6 +14,9 @@
14
  </div>
15
  </div>
16
  <h2 style="margin-top: 1rem;">Thank you for your time,<br>we will get back to you if shortlisted.</h2>
 
 
 
17
  </div>
18
  </div>
19
  </section>
 
14
  </div>
15
  </div>
16
  <h2 style="margin-top: 1rem;">Thank you for your time,<br>we will get back to you if shortlisted.</h2>
17
+ <p style="margin-top: 0.5rem; font-size: 1rem;">
18
+ Overall performance: {{ score }} ({{ feedback_summary }})
19
+ </p>
20
  </div>
21
  </div>
22
  </section>
backend/templates/interview.html CHANGED
@@ -499,7 +499,7 @@
499
  // has been populated server‑side using ``job.num_questions``.
500
  const totalSpan = document.getElementById('totalQuestions');
501
  const parsedTotal = parseInt(totalSpan && totalSpan.textContent);
502
- this.totalQuestions = Number.isNaN(parsedTotal) || parsedTotal <= 0 ? 3 : parsedTotal;
503
  // Ensure the counter display shows the correct total number of
504
  // questions. Without this update the span would retain the
505
  // server‑rendered value even if the fallback above changed
 
499
  // has been populated server‑side using ``job.num_questions``.
500
  const totalSpan = document.getElementById('totalQuestions');
501
  const parsedTotal = parseInt(totalSpan && totalSpan.textContent);
502
+ this.totalQuestions = Number.isNaN(parsedTotal) || parsedTotal <= 0 ? 4 : parsedTotal;
503
  // Ensure the counter display shows the correct total number of
504
  // questions. Without this update the span would retain the
505
  // server‑rendered value even if the fallback above changed
backend/templates/post_job.html CHANGED
@@ -47,7 +47,7 @@
47
  </div>
48
  <div class="form-group">
49
  <label for="num_questions">Number of Interview Questions</label>
50
- <input type="number" name="num_questions" id="num_questions" class="form-control" min="1" value="3" required placeholder="e.g. 5">
51
  <small style="color: #666; display: block; margin-top: 0.25rem;">Specify how many questions the AI interview should ask (minimum 1).</small>
52
  </div>
53
  <div class="application-actions" style="margin-top: 2rem; text-align: center;">
 
47
  </div>
48
  <div class="form-group">
49
  <label for="num_questions">Number of Interview Questions</label>
50
+ <input type="number" name="num_questions" id="num_questions" class="form-control" min="1" value="4" required placeholder="e.g. 5">
51
  <small style="color: #666; display: block; margin-top: 0.25rem;">Specify how many questions the AI interview should ask (minimum 1).</small>
52
  </div>
53
  <div class="application-actions" style="margin-top: 2rem; text-align: center;">