Socket
Book a DemoSign in
Socket

react-python-editor

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-python-editor

A Python editor and interpreter with interactive console

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Moocfi Python Editor

NPM version Cypress End-2-End Tests

Moocfi Python Editor is a React component that provides an in-browser editing, running and testing environment for TestMyCode python courses. The editor is based on Pyodide python runtime environment that is run using webworkers.

Usage

Install with npm install moocfi-python-editor.

The editor component can be used in a following way:

import { ProgrammingExercise } from "moocfi-python-editor"

const App = () => {
  // ...

  return (
    <ProgrammingExercise
      organization="organization-slug"
      course="course-name"
      exercise="exercise-name"
      userId="user-id"
      token="user-token"
    />
  )
}

Required properties:

  • organization, course and exercise Define which TMC exercise will be loaded.
  • userId and token are used to identify the current user.

Optional properties:

  • debug Show and log debug information if set to true.
  • language Editor's localization. Currently supports en (default) and fi.
  • height Height of the editor. Defaults to 400px.
  • outputHeight Maximum height of the output content in pixels.
  • onExerciseDetailsChange Callback function that provides details about the exercise. These details vary by user.

Setting up the project

  • Clone the project on GitHub
  • Go to the project root directory and run npm ci & npm run encode:worker
  • Go to the example directory and run npm ci

Running the project

To run the project in example environment, go to the example directory and run npm start.

If you make any changes to the worker, you will always need to run the encode:worker command again.

License

This project is licensed under either of

at your option.

FAQs

Package last updated on 28 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts