ishan-25 commited on
Commit
2d953a3
Β·
verified Β·
1 Parent(s): e2a10b6

Further bug fix

Browse files
Files changed (1) hide show
  1. interview_coach.py +4 -4
interview_coach.py CHANGED
@@ -84,22 +84,22 @@ _HEADER_HTML = """
84
  """
85
 
86
  def _score_badge_html(score_result: dict) -> str:
87
- """Render keyword coverage badges as inline HTML."""
88
  if not score_result:
89
  return ""
90
  hit = score_result.get("hit_keywords", [])
91
  missed = score_result.get("missed_keywords", [])
92
-
93
  badge_style = "display:inline-block;padding:3px 9px;border-radius:20px;font-size:0.78rem;font-weight:600;margin:3px 3px;"
94
 
95
  hit_badges = "".join(f'<span style="{badge_style}background:rgba(16,185,129,0.15);color:#10b981;border:1px solid rgba(16,185,129,0.3);">βœ… {k}</span>' for k in hit)
96
  missed_badges = "".join(f'<span style="{badge_style}background:rgba(239,68,68,0.12);color:#ef4444;border:1px solid rgba(239,68,68,0.25);">❌ {k}</span>' for k in missed)
97
 
 
98
  return f"""
99
  <div style="background:rgba(15,15,40,0.6);border:1px solid rgba(99,102,241,0.2);border-radius:12px;padding:14px 18px;margin-top:10px;">
100
  <div style="display:flex;align-items:center;gap:10px;margin-bottom:10px;">
101
- <span style="font-size:0.85rem;font-weight:700;color:#94a3b8;">πŸ”‘ KEYWORD COVERAGE</span>
102
- <span style="background:{color};color:white;padding:3px 12px;border-radius:20px;font-size:0.82rem;font-weight:700;">{cov:.0f}%</span>
103
  </div>
104
  <div style="line-height:2.2;">{hit_badges}{missed_badges}</div>
105
  </div>
 
84
  """
85
 
86
  def _score_badge_html(score_result: dict) -> str:
87
+ """Render keyword coverage badges cleanly as inline HTML without any percentage bubbles."""
88
  if not score_result:
89
  return ""
90
  hit = score_result.get("hit_keywords", [])
91
  missed = score_result.get("missed_keywords", [])
92
+
93
  badge_style = "display:inline-block;padding:3px 9px;border-radius:20px;font-size:0.78rem;font-weight:600;margin:3px 3px;"
94
 
95
  hit_badges = "".join(f'<span style="{badge_style}background:rgba(16,185,129,0.15);color:#10b981;border:1px solid rgba(16,185,129,0.3);">βœ… {k}</span>' for k in hit)
96
  missed_badges = "".join(f'<span style="{badge_style}background:rgba(239,68,68,0.12);color:#ef4444;border:1px solid rgba(239,68,68,0.25);">❌ {k}</span>' for k in missed)
97
 
98
+ # ── FIXED: Completely stripped out {color} and {cov:.0f}% to prevent any NameErrors ──
99
  return f"""
100
  <div style="background:rgba(15,15,40,0.6);border:1px solid rgba(99,102,241,0.2);border-radius:12px;padding:14px 18px;margin-top:10px;">
101
  <div style="display:flex;align-items:center;gap:10px;margin-bottom:10px;">
102
+ <span style="font-size:0.85rem;font-weight:700;color:#94a3b8;">πŸ”‘ KEYWORD SUMMARY</span>
 
103
  </div>
104
  <div style="line-height:2.2;">{hit_badges}{missed_badges}</div>
105
  </div>