or run

npx @tessl/cli init
Log in

Version

Files

tile.json

rubric.jsonevals/scenario-5/

{
  "context": "This evaluation assesses how well the engineer uses koa-route's optional parameter functionality to implement endpoints with optional path segments. The focus is on correct usage of the optional parameter syntax (`:param?`) and proper handling of cases where optional parameters are present or absent.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Optional category parameter",
      "description": "Uses koa-route with optional parameter syntax (e.g., route.get('/api/resources/:category?', ...)) to handle both /api/resources and /api/resources/:category paths in a single route definition",
      "max_score": 30
    },
    {
      "name": "Optional format parameter",
      "description": "Uses koa-route with optional parameter syntax (e.g., route.get('/api/resources/:id/details/:format?', ...)) to handle both /api/resources/:id/details and /api/resources/:id/details/:format paths in a single route definition",
      "max_score": 30
    },
    {
      "name": "Parameter presence handling",
      "description": "Correctly checks whether optional parameters are undefined/null and implements appropriate conditional logic to handle both presence and absence of optional parameters",
      "max_score": 20
    },
    {
      "name": "Route handler signature",
      "description": "Uses correct koa-route handler signature with (ctx, ...params, next) where params are passed as individual arguments after the context object",
      "max_score": 10
    },
    {
      "name": "Koa middleware integration",
      "description": "Properly registers koa-route middleware using app.use() and returns appropriate responses through the Koa context (ctx.body, ctx.status)",
      "max_score": 10
    }
  ]
}