docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
{
"context": "This criteria evaluates the engineer's ability to use koa-route's path pattern matching capabilities, including static paths, parameterized paths with parameter extraction, optional parameters, and automatic URL decoding of path parameters.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Static path routing",
"description": "Uses route.post() with static path '/shorten' to handle POST requests for creating short URLs",
"max_score": 10
},
{
"name": "Single parameter extraction",
"description": "Uses route.get() with parameterized paths like '/r/:code' and '/user/:username' to extract single parameters",
"max_score": 25
},
{
"name": "Handler parameter usage",
"description": "Route handlers correctly receive extracted parameters as arguments after ctx (e.g., function(ctx, code) or function(ctx, username)) and use them appropriately",
"max_score": 20
},
{
"name": "Optional parameter syntax",
"description": "Uses optional parameter syntax '/:code?' in the path pattern '/details/:username/:code?' to create a route that handles both presence and absence of the code parameter",
"max_score": 25
},
{
"name": "Multiple parameter paths",
"description": "Correctly defines routes with multiple parameters like '/details/:username/:code?' where both parameters are extracted in the correct order",
"max_score": 15
},
{
"name": "Automatic URL decoding",
"description": "Relies on koa-route's built-in automatic URL decoding of path parameters without manually calling decodeURIComponent() on extracted parameters",
"max_score": 5
}
]
}