KVCoders fixes subtle grading bug that penalised correct Python output predictions
KVCoders, an online practice platform for CBSE Class 11–12 Computer Science students, discovered that its Output Practice mode was incorrectly marking students wrong due to minor spacing differences in predicted output. A plain string comparison flagged answers like [1,2,3] as incorrect even when the student understood the value, because Python's own print() adds spaces after commas. The fix involved building a character-by-character parser that normalises spacing only around Python container punctuation — commas and colons inside brackets — while leaving all string literal content completely unchanged. This ensures that outputs where whitespace is meaningful, such as formatted strings, are still graded strictly. The shared normalisation function is used across the web, Android API, and client-side preview endpoints to prevent inconsistent grading across platforms.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in