Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to the schema to include difficulty and hint features #469

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
Binary file added validation/.DS_Store
Binary file not shown.
20 changes: 17 additions & 3 deletions validation/schemas/code-assessment.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,29 @@ module.exports = {
errorMessage: {
type: "The expected should be an array",
},
}
},
"difficulty": {
type: "string",
enum: ["beginner", "intermediate", "advanced"],
errorMessage: {
enum: "Difficulty can only be: beginner, intermediate or advanced"
}
},
"hint": {
type: "string",
errorMessage: {
type: "The hint should be a string",
},
},
},
required: ["problem name", "description", "inputs", "expected"],
required: ["problem name", "description", "inputs", "expected", "difficulty"],
errorMessage: {
required: {
"problem name": "The name of the problem field is required",
"description": "The description is required",
"inputs": "The inputs field is required",
"expected": "The expected field is required"
"expected": "The expected field is required",
"difficulty": "The difficulty field is required"
}
},
},
Expand Down