SShortSingh.
Back to feed

KVCoders fixes subtle grading bug that penalised correct Python output predictions

0
·1 views

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.

Read the full story at DEV Community

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

Related stories

0
ProgrammingDEV Community ·

How to Safely Deliver Buyer Images While Preserving Unmodified Originals

A software architecture guide outlines best practices for delivering purchased images to buyers while keeping original files immutable and privately stored. The approach recommends serving only moderated, processed renditions by default, releasing originals solely when a buyer's order explicitly grants that entitlement. Every delivered image must be traceable to a specific source revision, crop specification, and moderation decision to prevent unreviewed content from reaching paying customers. Alerting systems should trigger on confirmed policy bypasses rather than every failed crop, and dashboards must identify failures by ratio and transform version to avoid masking localized errors. The guide also stresses that authorization decisions must precede byte-range handling, and that changing source files or crop algorithms silently invalidates prior moderation coverage.

0
ProgrammingDEV Community ·

TypeSafe AI Launches Jev, a Model Built for Structured Decisions Over Text Generation

TypeSafe AI has released Jev, its first public 'System One' model, designed to make fast, structured decisions that software can consume directly rather than generating natural language responses. The model is inspired by Daniel Kahneman's System 1 and System 2 thinking framework, positioning Jev as a quick, intuitive decision-maker suited for backend applications. Instead of parsing generated text into booleans or scores, developers define typed questions and receive structured outputs such as yes/no answers, categorical choices, or scored evaluations in parallel. Jev uses a new architecture combining a parallel sampler and a training method called Reinforcement Learning for Calibrated Decisions (RLCD) to deliver calibrated probabilities alongside each decision. The model targets use cases like routing support tickets, flagging sensitive prompts, approving agent actions, and triaging transactions where structured outputs matter more than human-readable explanations.

0
ProgrammingDEV Community ·

Tutorial: Build an Adaptive Python Tutoring API Using FastAPI and SQLite

A developer tutorial published on DEV Community walks readers through building PyMentor, a lightweight adaptive tutoring API for Python learners. The API, built with FastAPI and SQLite, accepts a learner's code submission along with their identifier and topic, then queries an OpenAI model for structured teaching feedback. It tracks topic mastery scores in a local SQLite database and returns validated responses to the client. The project is intentionally scoped — it does not execute submitted code or replace human instructors, focusing solely on repeatable feedback workflows. Developers need Python 3.10 or later, an OpenAI API key, and basic familiarity with Python, JSON, and HTTP requests to follow along.

0
ProgrammingDEV Community ·

Tutorial: Enforce Beauty AR Device Policies in CI Before They Reach Users

A new developer tutorial demonstrates how to build a policy gate for Tencent RTC Beauty AR integrations that prevents expensive effects like GAN and 3D segmentation from running on low-end devices. The approach encodes rollout decisions — such as which effects are permitted per device tier and what fallback profiles apply — directly as versioned, testable code. A lightweight Node.js project structure validates profile configurations, detects cyclic or incomplete fallback chains, and exposes runtime states including applying, degraded, and blocked. The validation runs entirely within GitHub Actions CI without requiring a camera or any live Beauty AR asset. The tutorial positions device classification as an application-specific input, encouraging teams to base tier assignments on measurements from their own supported hardware rather than generic benchmarks.