Git Product home page Git Product logo

xblock-codeeditor's Introduction

这是一个实现在线代码编辑器功能的xblock。基于codemirror实现在线代码编辑功能。

1.安装:

1.1 把xblock-coedeeditor克隆到的open edx平台中。如我克隆到/home/zyn

  cd /home/zyn
  git clone https://github.com/jennyzhang8800/xblock-codeeditor

1.2 安装xblock

  sudo -u edxapp /edx/bin/pip.edxapp install /home/zyn/xblock-codeeditor
  
  注意:/home/zyn/xblock-codeeditor是你在1.1中克隆的xblock-codeeditor所在的路径

1.3 把static文件夹复制到/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/static/

  sudo cp -r static/* /edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/static/

1.4 把codeeditor文件夹复制到 /edx/var/edxapp/staticfiles/下

  sudo cp -r codeeditor /edx/var/edxapp/staticfiles/

2.使block可用:

2.1在edx-platform/lms/envs/common.py中去掉注释:

    # from xmodule.x_module import prefer_xmodules
    # XBLOCK_SELECT_FUNCTION = prefer_xmodules

2.2 在edx-platform/cms/envs/common.py,中去掉注释:

     # from xmodule.x_module import prefer_xmodules
    # XBLOCK_SELECT_FUNCTION = prefer_xmodules

2.3 在edx-platform/cms/envs/common.py中把

     'ALLOW_ALL_ADVANCED_COMPONENTS': False,
     
   改成:
   
     'ALLOW_ALL_ADVANCED_COMPONENTS': True,

3.在Studio中把你的block添加到课程的高级设置中。

1)登录到Studio,打开你的课程

2)settings->Advanced Setting

3)把键”advanced_modules”的值改为"codeeditor".

4.在studio中,把你的block添加到课程,

1)Edit编辑一个单元

2)Advanced->codeeditor

注意:如果把codeeditor文件夹放在其他位置。记得改/static/html/下的codeeditor_view.html中的src

    <iframe src="http://192.168.1.113/static/codeeditor/codemirror.html">

 把"http://192.168.1.113/static/codeeditor/codemirror.html"换成你实际codeeditor文件夹所在位置。

xblock-codeeditor's People

Contributors

jennyzhang8800 avatar

Stargazers

不是油条 avatar

Watchers

James Cloos avatar  avatar

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.