这是你如何创建一个过程:
from xmodule.modulestore.django import modulestore
from datetime import datetime
store.create_course(
"org", "num", "run", # course ID
1, # course creator user ID
# Set the start date of the course to the start of the year
fields={"start": datetime(2016, 1, 1)}
)
见fields
说法?这是新课程的属性可以定义。可以定义的属性列表可在common.lib.xmodule.xmodule.course_module:CourseFields中找到。在上面的例子中,我们定义了start
属性,但其他字段可以使用相同的方法定义。
如果您希望修改课程属性您已经创建后,如start
属性,这是你会怎么做:
from opaque_keys.edx.keys import CourseKey
course = store.get_course(CourseKey.from_string("course-v1:org+num+run"))
course.start = datetime.now()
course.save()
注意,这并不包括界定每门课的评估。以编程方式定义这个更复杂。通过查看grading_handler
view from the contentstore views,您可以更好地了解如何定义等级设置。我们可以看到,所有的评分信息都存储在CourseGradingModel
中。您需要的方法是update_from_json
。
你能指定你想改变的参数吗?你有没有尝试以编程方式更改这些细节?如果是的话,你尝试了什么? –
详细信息,如edX课程将具有的评估类型,各自的权重,课程开始日期和结束日期除了强制课程显示名称,缩写,组织和课程运行 –