您的位置:首页 > 其它

edx 题库编辑xblock的安装

2016-12-23 22:54 176 查看
1. 把xblock从 github仓库clone到edx机器,将所有者设为edxapp

 git clone https://github.com/Heaven1881/mooc-ExerciseMdf.git sudo chown -R edxapp:edxapp mooc-ExerciseMdf
2. 把exercisemdf/static/index.html 文件中的iframe的src改为你的edx 域名

<iframe src="http://crl.ptopenlab.com:8811/static/exercisemdf/index.html" frameBorder=0 id="exercisemdf" width="100%" height="1000px" ></iframe>



改为
<iframe src="http://cherry.cs.tsinghua.edu.cn/static/exercisemdf/index.html" frameBorder=0 id="exercisemdf" width="100%" height="1000px" ></iframe>

3. 安装xblock
cd mooc-ExerciseMdf
sudo -u edxapp /edx/bin/pip.edxapp install .

4. 在文件夹/edx/var/edxapp/staticfiles/下新建文件夹exercisemdf/,并将文件夹staticfiles/下的文件夹拷贝到/edx/var/edxapp/staticfiles/中,同时增加所有人对其的读权限

$ sudo mkdir -p /edx/var/edxapp/staticfiles/exercisemdf
$ sudo cp -r staticfiles/* /edx/var/edxapp/staticfiles/exercisemdf/
$ sudo chmod a+r -R /edx/var/edxapp/staticfiles/exercisemdf/

5. 将github上的题库仓库clone到 /var/www/data/目录下。

注意:首先要把ssh key添加到github

添加ssh-key的方法为:

(1)首先切换到www-data用户
sudo -u www-data bash

(2)生成公钥私钥
ssh-keygen -t rsa -C "teacher@example.com"上面的邮箱可以换成自己的

(3)把生成的rsa_pub文件内容复制到github,添加ssh key

rsa_pub文件的路径在/var/www/.ssh/rsa_pub

ssh key添加好之后,接下来把github上的题库仓库clone到 /var/www/data/目录下

git clone git@github.com:chyyuu/os_course_exercise_library.git

6. 重启edx
sudo /edx/bin/supervisorctl restart edxapp:



7. 把该xblock添加到edx高级设置里。

登录到Studio,打开你的课程

settings->Advanced Setting

在"advanced_modules"的值后添加"exercisemdf"

8. 在课程的单元里可以添加“题库编辑组件”

  如果输入题号,点“载入”能正常载入题目。

点保存,能正常保存修改,说明该xblock能正常工作



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  edx 题库编辑 xblock