Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
5e4cf500
Commit
5e4cf500
authored
Jul 30, 2013
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure that all tab types used by the default for the course.tabs field work correctly
parent
e6039c02
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletions
+16
-1
lms/djangoapps/courseware/tabs.py
+16
-1
No files found.
lms/djangoapps/courseware/tabs.py
View file @
5e4cf500
...
...
@@ -91,6 +91,13 @@ def _discussion(tab, user, course, active_page):
return
[]
def
_external_discussion
(
tab
,
user
,
course
,
active_page
):
"""
This returns a tab that links to an external discussion service
"""
return
[
CourseTab
(
'Discussion'
,
tab
[
'link'
],
active_page
==
'discussion'
)]
def
_external_link
(
tab
,
user
,
course
,
active_page
):
# external links are never active
return
[
CourseTab
(
tab
[
'name'
],
tab
[
'link'
],
False
)]
...
...
@@ -150,6 +157,12 @@ def _staff_grading(tab, user, course, active_page):
return
[]
def
_syllabus
(
tab
,
user
,
course
,
active_page
):
"""Display the syllabus tab"""
link
=
reverse
(
'syllabus'
,
args
=
[
course
.
id
])
return
[
CourseTab
(
'Syllabus'
,
link
,
active_page
==
'syllabus'
)]
def
_peer_grading
(
tab
,
user
,
course
,
active_page
):
if
user
.
is_authenticated
():
...
...
@@ -216,6 +229,7 @@ VALID_TAB_TYPES = {
'course_info'
:
TabImpl
(
need_name
,
_course_info
),
'wiki'
:
TabImpl
(
need_name
,
_wiki
),
'discussion'
:
TabImpl
(
need_name
,
_discussion
),
'external_discussion'
:
TabImpl
(
key_checker
([
'link'
]),
_external_discussion
),
'external_link'
:
TabImpl
(
key_checker
([
'name'
,
'link'
]),
_external_link
),
'textbooks'
:
TabImpl
(
null_validator
,
_textbooks
),
'pdf_textbooks'
:
TabImpl
(
null_validator
,
_pdf_textbooks
),
...
...
@@ -225,7 +239,8 @@ VALID_TAB_TYPES = {
'peer_grading'
:
TabImpl
(
null_validator
,
_peer_grading
),
'staff_grading'
:
TabImpl
(
null_validator
,
_staff_grading
),
'open_ended'
:
TabImpl
(
null_validator
,
_combined_open_ended_grading
),
'notes'
:
TabImpl
(
null_validator
,
_notes_tab
)
'notes'
:
TabImpl
(
null_validator
,
_notes_tab
),
'syllabus'
:
TabImpl
(
null_validator
,
_syllabus
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment