Giter VIP home page Giter VIP logo

evaluator's Introduction

Evaluator

The objective of this project is to create a website with computer science problems. (Reference: hackerrank, leetcode, pbinfo, infoarena) The user must be able to run the code and display the output / error. When the user thinks that he has a correct solution, he must be able to publish his code and it will be analyzed, then displaying its correctness. Back-end will use Django and for front-end React.

For now, the goal is for the user to be able to run Python code. For now, I need to find a way to run the Python code from the user in a safe way.

Ideas for running Python safely

In-built functions

exec, eval: too unsafe, takes too much time to implement something decent

Python sandboxed

Really good article about the available options

To check the realiability of the sandbox, check this

  • pysandbox - deprecated

  • PyPy sandbox - unmaintained

  • Docker - very good idea, hard to set up, could use multiple coding languages

  • epicbox really good combination with Docker

Python in the browser

Really good article about the available options

They run in the browser, meaning that security is not concern and the execution is handled on the user's machine.

  • PyPyJS - python 2.7, unmaintained, 12mb script import

  • Brython - python 3.9.0, no imports, good idea

  • Brython Runner - Brython module, great idea

  • Skulpt - python 2.7, limited imports(?)

  • Anvil - python 2.7(?), website builder, pay to remove sponsor header

Conclusion

Currently using Brython, will switch to Docker.

Other

Using React-Ace for a code editor with multiple features (syntax highlighting, autocompletion, themes).

Contributing

Pull requests, ideas, anything is welcome.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.