最近折腾edx遇到些怪异的问题,于是去edx-code寻求帮助,看到Armando Fox分享的这个hack方法挺有意思,分享过来给大家,也许有人用得着

详细内容见module-level import/export from edx - a hack

大体内容如下

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
:::text
i successfully did the following to append the contents of course B into course A: 

1.  exported dumps of A and B from Studio 
2.  un-tar each dump 
3.  copy all the leaf-level assets of course B into the correpsonding leaf folders of A, *except* i avoided assets where there was a filename collision (like course.xml).  i did this partly manually, partly using find, partly using 'cp -i'. 
4.  in course A, edit the file course/*.xml (there will be only one): you will see it contains a line per "chapter", which is a single flippy-triangle unit in the left-hand navbar.  into that file, copy all the <chapter> element lines from the course/*.xml file in course B. 
5.  tar up the result 
6.  import the result into Studio. 

voila, a course that is the append of A and B. 

需求大概是:楼主需要将课程B导入到课程A中

解决方案的大体思路就是,导出课程>解包>直接操控解压文件,合并内容>打包>导入。合并内容的时候注意3,4两点提到的具体合并细节

楼主进一步说道, 只导入某些章节应该也是可能的,不过引用文件依赖可能比较琐碎麻烦,应该可以写个脚本来做。(很常见的需求)

this should be a simple script to write if someone wants to take a whack at it. (ideally this should be in the Studio GUI, but it’s not.)

我觉得完成这个工作,可以要参考这篇文章。关于我们如何不通过studio来操作课程内容

edX Open Learning XML Guide

###关于edX Open Learning XML(OLX)

The edX Open Learning XML Guide provides the information you need to build an edX course through Open Learning XML (OLX) and supporting files, without using edX Studio.

就是说我们可以不用依赖Studio,自己来写制作课程的工具,当然前提是熟悉OLX(edX Open Learning XML Guide).这里边有极大的发挥空间