-
Notifications
You must be signed in to change notification settings - Fork 0
[5/?] feat: Add data elevator hallway and category params in get random chunks api endpoint #57
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
Merged
Saannddy
merged 4 commits into
debug-the-always-pass-condition-and-blacklist-blocked-question
from
add-data-elevator-hallway-and-category-params-in-get-random-chunks-api-endpoint
Apr 6, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a450c84
feat: add category support to chunk retrieval and implement Elevator …
Saannddy 070823e
refactor: update seeder imports to avoid circular dependency warnings…
Saannddy 85a6140
chore: remove package initialization comment from scripts module
Saannddy 8519a77
feat: add level 4 Java coding challenges and update chunk retrieval c…
Saannddy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +0,0 @@ | ||
| # This file makes the folder a Python package. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| [ | ||
| { | ||
| "title": "ELV-P4-CHUNK-001", | ||
| "difficulty": "Medium", | ||
| "category": "ELV-P4", | ||
| "templates": { | ||
| "java": { | ||
| "name": "Java Implementation", | ||
| "template_code": "// [NULL] stripped the exception handling from the ID scanner.\n// It now crashes on any non-integer input and floods the audit log with errors.\n// Restore the three blocks. Every scan must be logged, pass or fail.\n\npublic class CheckpointScanner {\n\n public static String parseStudentID(String input) {\n try {\n // TASK 1: Parse input. Return \"VALID:\" + id if 10000\u201399999, else \"INVALID:OUT_OF_RANGE\".\n {{{snippet_1}}}\n } catch (NumberFormatException e) {\n // TASK 2: Return \"INVALID:NOT_A_NUMBER\".\n {{{snippet_2}}}\n } finally {\n // TASK 3: Always print \"scan attempt logged\".\n {{{snippet_3}}}\n }\n }\n}", | ||
| "snippets": { | ||
| "snippet_1": "None to be shown here", | ||
| "snippet_2": "None to be shown here", | ||
| "snippet_3": "None to be shown here" | ||
|
Comment on lines
+11
to
+13
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There will be no code content or clue na @TeratBurami also if you want the correct answer it will exist in the chunks.lvl4.json |
||
| } | ||
| } | ||
| }, | ||
| "expectation": { | ||
| "input": "12345", | ||
| "output": "VALID:12345" | ||
| } | ||
| }, | ||
| { | ||
| "title": "ELV-P4-CHUNK-002", | ||
| "difficulty": "Medium", | ||
| "category": "ELV-P4", | ||
| "templates": { | ||
| "java": { | ||
| "name": "Java Implementation", | ||
| "template_code": "// The room code scanner is throwing unhandled exceptions on every bad input.\n// [NULL] knew exactly which lines to delete to break the audit trail.\n// Restore all three exception blocks.\n\npublic class CheckpointScanner {\n\n public static String parseRoomCode(String input) {\n try {\n // TASK 1: Parse input. Return \"ROOM:\" + code if 100\u2013999, else \"INVALID:NOT_A_ROOM\".\n {{{snippet_1}}}\n } catch (NumberFormatException e) {\n // TASK 2: Return \"INVALID:FORMAT_ERROR\".\n {{{snippet_2}}}\n } finally {\n // TASK 3: Always print \"door scan logged\".\n {{{snippet_3}}}\n }\n }\n}", | ||
| "snippets": { | ||
| "snippet_1": "None to be shown here", | ||
| "snippet_2": "None to be shown here", | ||
| "snippet_3": "None to be shown here" | ||
| } | ||
| } | ||
| }, | ||
| "expectation": { | ||
| "input": "123", | ||
| "output": "ROOM:123" | ||
| } | ||
| }, | ||
| { | ||
| "title": "ELV-P4-CHUNK-003", | ||
| "difficulty": "Medium", | ||
| "category": "ELV-P4", | ||
| "templates": { | ||
| "java": { | ||
| "name": "Java Implementation", | ||
| "template_code": "// The port scanner crashes on anything that is not a clean integer.\n// Without proper exception handling the network audit trail is blind.\n// Restore it.\n\npublic class CheckpointScanner {\n\n public static String parsePort(String input) {\n try {\n // TASK 1: Parse input. Return \"PORT:\" + number if 1\u201365535, else \"INVALID:PORT_OUT_OF_RANGE\".\n {{{snippet_1}}}\n } catch (NumberFormatException e) {\n // TASK 2: Return \"INVALID:NOT_A_PORT\".\n {{{snippet_2}}}\n } finally {\n // TASK 3: Always print \"connection attempt logged\".\n {{{snippet_3}}}\n }\n }\n}", | ||
| "snippets": { | ||
| "snippet_1": "None to be shown here", | ||
| "snippet_2": "None to be shown here", | ||
| "snippet_3": "None to be shown here" | ||
| } | ||
| } | ||
| }, | ||
| "expectation": { | ||
| "input": "80", | ||
| "output": "PORT:80" | ||
| } | ||
| }, | ||
| { | ||
| "title": "ELV-P4-CHUNK-004", | ||
| "difficulty": "Medium", | ||
| "category": "ELV-P4", | ||
| "templates": { | ||
| "java": { | ||
| "name": "Java Implementation", | ||
| "template_code": "// The elevator rejects every floor request because the parser throws on bad input.\n// [NULL] removed the safety net. Restore the exception blocks.\n// The finally block is not optional \u2014 the lift log must always write.\n\npublic class CheckpointScanner {\n\n public static String parseFloor(String input) {\n try {\n // TASK 1: Parse input. Return \"FLOOR:\" + number if 1\u201310, else \"INVALID:NO_SUCH_FLOOR\".\n {{{snippet_1}}}\n } catch (NumberFormatException e) {\n // TASK 2: Return \"INVALID:NOT_A_NUMBER\".\n {{{snippet_2}}}\n } finally {\n // TASK 3: Always print \"elevator request logged\".\n {{{snippet_3}}}\n }\n }\n}", | ||
| "snippets": { | ||
| "snippet_1": "None to be shown here", | ||
| "snippet_2": "None to be shown here", | ||
| "snippet_3": "None to be shown here" | ||
| } | ||
| } | ||
| }, | ||
| "expectation": { | ||
| "input": "5", | ||
| "output": "FLOOR:5" | ||
| } | ||
| }, | ||
| { | ||
| "title": "ELV-P5-CHUNK-001", | ||
| "difficulty": "Medium", | ||
| "category": "ELV-P5", | ||
| "templates": { | ||
| "java": { | ||
| "name": "Java Implementation", | ||
| "template_code": "// 4,847 log entries. The threat filter is gone \u2014 [NULL] deleted it first.\n// Without it the emergency system cannot assess severity.\n// Find the threats. The building needs this report before it can act.\n\nimport java.util.ArrayList;\n\npublic class ThreatAnalyser {\n\n public static String analyzeLogs(ArrayList<String> logs) {\n\n // TASK 1: Declare a counter and an ArrayList<String> for threat descriptions.\n {{{snippet_1}}}\n\n for (String entry : logs) {\n // TASK 2: If entry starts with \"THREAT:\", increment and collect the description (after 8 chars).\n {{{snippet_2}}}\n }\n\n // TASK 3: Return \"THREATS:0|none\" if clean, else \"THREATS:\" + count + \"|\" + descriptions joined by \",\".\n {{{snippet_3}}}\n }\n\n public static void main(String[] args) {\n ArrayList<String> logs1 = new ArrayList<>();\n logs1.add(\"INFO: door opened\");\n logs1.add(\"THREAT: brute force\");\n logs1.add(\"INFO: scan ok\");\n logs1.add(\"THREAT: port scan\");\n logs1.add(\"THREAT: login fail\");\n System.out.println(analyzeLogs(logs1));\n\n ArrayList<String> logs2 = new ArrayList<>();\n logs2.add(\"INFO: all clear\");\n System.out.println(analyzeLogs(logs2));\n }\n}", | ||
| "snippets": { | ||
| "snippet_1": "None to be shown here", | ||
| "snippet_2": "None to be shown here", | ||
| "snippet_3": "None to be shown here" | ||
| } | ||
| } | ||
| }, | ||
| "expectation": { | ||
| "input": "", | ||
| "output": "" | ||
| } | ||
| }, | ||
| { | ||
| "title": "ELV-P5-CHUNK-002", | ||
| "difficulty": "Medium", | ||
| "category": "ELV-P5", | ||
| "templates": { | ||
| "java": { | ||
| "name": "Java Implementation", | ||
| "template_code": "// The server error filter was wiped along with the intrusion logs.\n// Critical errors are invisible to the monitoring system.\n// Restore the filter \u2014 find every ERROR entry and report the count.\n\nimport java.util.ArrayList;\n\npublic class ThreatAnalyser {\n\n public static String filterErrors(ArrayList<String> logs) {\n\n // TASK 1: Declare a counter and an ArrayList<String> for error messages.\n {{{snippet_1}}}\n\n for (String entry : logs) {\n // TASK 2: If entry starts with \"ERROR:\", increment and collect the message (after 7 chars).\n {{{snippet_2}}}\n }\n\n // TASK 3: Return \"ERRORS:0|none\" if clean, else \"ERRORS:\" + count + \"|\" + messages joined by \",\".\n {{{snippet_3}}}\n }\n\n public static void main(String[] args) {\n ArrayList<String> logs1 = new ArrayList<>();\n logs1.add(\"INFO: server started\");\n logs1.add(\"ERROR: disk full\");\n logs1.add(\"ERROR: null pointer\");\n logs1.add(\"INFO: backup ok\");\n System.out.println(filterErrors(logs1));\n\n ArrayList<String> logs2 = new ArrayList<>();\n logs2.add(\"INFO: running\");\n System.out.println(filterErrors(logs2));\n }\n}", | ||
| "snippets": { | ||
| "snippet_1": "None to be shown here", | ||
| "snippet_2": "None to be shown here", | ||
| "snippet_3": "None to be shown here" | ||
| } | ||
| } | ||
| }, | ||
| "expectation": { | ||
| "input": "", | ||
| "output": "" | ||
| } | ||
| }, | ||
| { | ||
| "title": "ELV-P5-CHUNK-003", | ||
| "difficulty": "Medium", | ||
| "category": "ELV-P5", | ||
| "templates": { | ||
| "java": { | ||
| "name": "Java Implementation", | ||
| "template_code": "// The badge access log is full of denied entries \u2014 someone was probing every door.\n// The scanner that should have flagged them is offline.\n// Find every DENIED entry before [NULL] makes another move.\n\nimport java.util.ArrayList;\n\npublic class ThreatAnalyser {\n\n public static String findDenied(ArrayList<String> entries) {\n\n // TASK 1: Declare a counter and an ArrayList<String> for denied entries.\n {{{snippet_1}}}\n\n for (String entry : entries) {\n // TASK 2: If entry contains \"DENIED\" anywhere, increment and collect the full entry.\n {{{snippet_2}}}\n }\n\n // TASK 3: Return \"DENIED:0|none\" if none, else \"DENIED:\" + count + \"|\" + entries joined by \",\".\n {{{snippet_3}}}\n }\n\n public static void main(String[] args) {\n ArrayList<String> e1 = new ArrayList<>();\n e1.add(\"Student 001: GRANTED\");\n e1.add(\"Student 002: DENIED low clearance\");\n e1.add(\"Student 003: GRANTED\");\n e1.add(\"Visitor 01: DENIED no badge\");\n System.out.println(findDenied(e1));\n\n ArrayList<String> e2 = new ArrayList<>();\n e2.add(\"Staff 001: GRANTED\");\n System.out.println(findDenied(e2));\n }\n}", | ||
| "snippets": { | ||
| "snippet_1": "None to be shown here", | ||
| "snippet_2": "None to be shown here", | ||
| "snippet_3": "None to be shown here" | ||
| } | ||
| } | ||
| }, | ||
| "expectation": { | ||
| "input": "", | ||
| "output": "" | ||
| } | ||
| }, | ||
| { | ||
| "title": "ELV-P5-CHUNK-004", | ||
| "difficulty": "Medium", | ||
| "category": "ELV-P5", | ||
| "templates": { | ||
| "java": { | ||
| "name": "Java Implementation", | ||
| "template_code": "// Elevator requests are piling up but the floor filter is down.\n// Security needs to know exactly how many calls are going to each floor.\n// Restore the filter \u2014 match by floor number, report the count.\n\nimport java.util.ArrayList;\n\npublic class ThreatAnalyser {\n\n public static String findFloorRequests(ArrayList<String> logs, int floor) {\n\n // TASK 1: Declare a counter and an ArrayList<String> for matching requests.\n {{{snippet_1}}}\n\n for (String entry : logs) {\n // TASK 2: If entry ends with \":\" + floor, increment and collect the full entry.\n {{{snippet_2}}}\n }\n\n // TASK 3: Return \"FLOOR\" + floor + \":0|none\" if none,\n // else \"FLOOR\" + floor + \":\" + count + \"|\" + entries joined by \",\".\n {{{snippet_3}}}\n }\n\n public static void main(String[] args) {\n ArrayList<String> logs = new ArrayList<>();\n logs.add(\"User A requested floor:2\");\n logs.add(\"User B requested floor:3\");\n logs.add(\"User C requested floor:2\");\n logs.add(\"User D requested floor:1\");\n System.out.println(findFloorRequests(logs, 2));\n System.out.println(findFloorRequests(logs, 5));\n }\n}", | ||
| "snippets": { | ||
| "snippet_1": "None to be shown here", | ||
| "snippet_2": "None to be shown here", | ||
| "snippet_3": "None to be shown here" | ||
| } | ||
| } | ||
| }, | ||
| "expectation": { | ||
| "input": "", | ||
| "output": "" | ||
| } | ||
| } | ||
| ] | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add category param here na krub @TeratBurami