File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414"""
1515
1616import argparse
17+ from html import escape as h
1718import json
1819from collections import defaultdict
1920from pathlib import Path
@@ -191,7 +192,7 @@ def generate_html(results, output_path):
191192 scores = [anchor_questions [l ].get (m ) for l in labels if anchor_questions [l ].get (m ) is not None ]
192193 anchor_scores [m ] = sum (scores ) / len (scores ) if scores else None
193194
194- html += f'<tr class="anchor-group"><td>{ anchor_id } </td>'
195+ html += f'<tr class="anchor-group"><td>{ h ( anchor_id ) } </td>'
195196 for m in model_names :
196197 s = anchor_scores .get (m )
197198 if s is not None :
@@ -206,7 +207,7 @@ def generate_html(results, output_path):
206207 if len (labels ) > 1 :
207208 for label in labels :
208209 short = label .split ("/" , 1 )[1 ] if "/" in label else label
209- html += f'<tr><td class="question-label">{ short } </td>'
210+ html += f'<tr><td class="question-label">{ h ( short ) } </td>'
210211 for m in model_names :
211212 s = anchor_questions [label ].get (m )
212213 if s is not None :
@@ -249,7 +250,7 @@ def generate_html(results, output_path):
249250 else :
250251 html += f'<h3>{ MODEL_DISPLAY .get (m , m )} : { len (fails )} failures</h3>\n <div class="fail-list">\n '
251252 for label , score in sorted (fails ):
252- html += f'<div class="fail-item"><span>{ label } </span><span style="color:{ score_color (score )} ;font-weight:600">{ score :.0%} </span></div>\n '
253+ html += f'<div class="fail-item"><span>{ h ( label ) } </span><span style="color:{ score_color (score )} ;font-weight:600">{ score :.0%} </span></div>\n '
253254 html += "</div>\n "
254255
255256 # Metadata
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ questions:
88 options :
99 A : Version control system that automatically tracks semantic changes in code
1010 structure and meaning across different branches
11- B : ' Version format; : incompatible api changes (breaking changes)'
11+ B : A versioning scheme using MAJOR.MINOR.PATCH where MAJOR signals breaking
12+ changes, MINOR signals new features, and PATCH signals bug fixes
1213 C : Development methodology that prioritizes meaningful variable and function
1314 naming conventions to improve code readability
1415 D : Documentation standard that requires detailed explanations of API functionality
You can’t perform that action at this time.
0 commit comments