Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Challenge generator for Hackademy

NotificationsYou must be signed in to change notification settings

roeeyn/challenge-generator

Repository files navigation

npm version

Demo GIF

Table of Contents

This CLI generates a challenge folder based on thechallenge-generator-backend API. The content of the folder is described in thechallenge content section.

The usual flow is the following:

graph LR    A((START)) --> B{Select Type}    B --> |Custom| E[\Answer all the questions\]    B --> |Completely Random| F[(Fetch Challenge from the API)]    E --> F    F --> G[/Create the Files/]    G --> H((END))
Loading

Getting Started

For further customization, go to theAdvanced Usage section.If you want to take a look at the modules documentation, clickhere.

To get general help

npx @roeeyn/challenge-generator --help

Generate a coding challenge selecting each parameter

# To skip a parameter just press Enternpx @roeeyn/challenge-generator

Generate apython3 coding challenge

npx @roeeyn/challenge-generator --programming-language python3 -s

Generate ajavascript coding challenge

npx @roeeyn/challenge-generator --programming-language javascript -s

Generate ajava coding challenge

⚠️ Even if we can create a challenge for Java, we haven't tested it yet on Jude0 so the submission tools may not work correctly as the testframework and run file are not yet implemented.

npx @roeeyn/challenge-generator --programming-language java -s

Coding Challenge Contents

The created coding challenge folder contains the following files:

README File

This is the file which contains the coding challenge description, and some of the examples provided. This is usually provided as a markdown file, so the formatted is done automatically.

Index File

The index file contains the initial function of the coding challenge, which should be given to the user directly.

Test File

This is the file which contains all the unit tests for the coding challenge. This usually make use of the custom testing framework provided, but see theTest Framework File for the details.

Test Framework File

This file contains ourminified custom testing framework, to validate that the code uploaded from the user is correct. To see the original framework, see thetemplates folder.

⚠️ We have include the most used functions, but there are coding challenges that contains specific testing for that specific coding challenge and our test framework may not work on that.This is not usual, though.

Run File

This file contains the execution script to run whenever this coding challenge is uploaded to Judge0.

Advanced Usage

We can filter most of the params we want the coding challenge to contain. These are the following:

FlagRequires Value?DescriptionExample
-V, --versionPrints the CLI version0.0.1
-t, --titleTitle regex to searchort$ e.g. Titles which ends with 'ort'
--edabit-idIf you know the value of the edabit id, you can set it directly6vSZmN66xhMRDX8YT
-a, --authorAuthor regex to search^M e.g Author which starts with 'M'
-t, --tagsTags to serch separated by commasstrings,loops
-d, --min-difficultyThe minimum difficulty the challenge should have from 0 (easiest) to 5 (hardest)2.5
-q, --min-qualityThe minimum quality the challenge should have from 0 (lowest) to 5 (highest)2.5
--programming-languageThe challenge programming language. Onlyjava,javascript, andpython3 is supported.javascript
-s, --skip-confirmationIf the confirmation message should be skipped, and if the other parametrs should be discardedN/A
-v, --verbosePrints debugging informationN/A
-h, --helpPrints this informationN/A

Judge0 Submission

We created a script (judge0-submissioner) that can help you testing the submissions into judge0 easily, you can find it in theexamples folder. The basic usage of this script is the following:

# Maybe you need to give execution accesschmod +x ./examples/judge0-submissioner.sh# Set the judge0 token (auth, not user)export JUDGE0_AUTH_TOKEN='YOUR_AUTH_TOKEN'# Submit the coding challenge solution and the extension (py or js)./examples/judge0-submissioner.sh your_challenge_directory your_lang_extension# Real example./examples/judge0-submissioner.sh ./challenge-proper-modulo-operator js

Future Roadmap

  • Improve Judge0 submissioner to a better CLI.
  • Warn the user if some unexpected element is present in the tests.

[8]ページ先頭

©2009-2025 Movatter.jp