2015-06-03 25 views
1

我已經在本地機器上安裝了devstack。 我打算爲edx平臺添加聊天功能,讓學生可以聯繫課程的講師。 (只是一個簡單的頁面,列出了課程的所有教師與鏈接聊天) 我嘗試使用xblock併成功創建一個。但看起來xblock是用於課件內容的自定義課程內容。 我想要的是添加一個課程選項卡,該選項卡將顯示每個課程,列出所有教師可以通過聊天進行諮詢。 它可能通過xblock?如果不是,你能否建議其他選擇來達到我想要的?如何在edx平臺中添加xblock作爲課程選項卡

+0

請向郵件列表:HTTPS:/ /groups.google.com/forum/#!forum/edx-code –

回答

1

完全教程:https://openedx.atlassian.net/wiki/display/AC/Adding+a+new+course+tab

添加一個切入點這樣你的Python庫的setup.py。請注意,new_tab是您的選項卡的ID,而example.NewTab是您的新選項卡類的完全限定名稱。

entry_points={ 
    "openedx.course_tab": [ 
     "new_tab = example.NewTab", 
    } 
} 

定義新的標籤類爲CourseTab子類,並聲明其屬性:

from courseware.tabs import CourseTab 


class NewTab(CourseTab): 
    """A new course tab.""" 

    name = "new_tab" 
    title = ugettext_noop("New Tab") # We don't have the user in this context, so we don't want to translate it at this level. 
    view_name = "new_tab_view" 

    @classmethod 
    def is_enabled(cls, course, user=None): 
     """Returns true if this tab is enabled.""" 
     return settings.FEATURES.get('NEW_TAB_ENABLED', False) 

相關:https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/edx-code/sE63D12V4Xc/78VRqMipBwAJ

https://groups.google.com/forum/#!topic/edx-code/ji-_w-nbu7c

相關問題