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
7977491d
Commit
7977491d
authored
Dec 14, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: LMS Courseware appears to be working
parent
b1c9b2ca
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
31 deletions
+39
-31
common/lib/xmodule/xmodule/course_module.py
+5
-0
common/lib/xmodule/xmodule/discussion_module.py
+6
-0
lms/djangoapps/django_comment_client/utils.py
+3
-5
lms/templates/staff_problem_info.html
+25
-26
No files found.
common/lib/xmodule/xmodule/course_module.py
View file @
7977491d
...
...
@@ -36,6 +36,11 @@ class CourseDescriptor(SequenceDescriptor):
tabs
=
List
(
help
=
"List of tabs to enable in this course"
,
scope
=
Scope
.
settings
)
end_of_course_survey_url
=
String
(
help
=
"Url for the end-of-course survey"
,
scope
=
Scope
.
settings
)
discussion_blackouts
=
List
(
help
=
"List of pairs of start/end dates for discussion blackouts"
,
scope
=
Scope
.
settings
,
default
=
[])
discussion_topics
=
Object
(
help
=
"Map of topics names to ids"
,
scope
=
Scope
.
settings
,
computed_default
=
lambda
c
:
{
'General'
:
{
'id'
:
c
.
location
.
html_id
()}},
)
has_children
=
True
info_sidebar_name
=
String
(
scope
=
Scope
.
settings
,
default
=
'Course Handouts'
)
...
...
common/lib/xmodule/xmodule/discussion_module.py
View file @
7977491d
...
...
@@ -15,6 +15,7 @@ class DiscussionModule(XModule):
discussion_id
=
String
(
scope
=
Scope
.
settings
)
discussion_category
=
String
(
scope
=
Scope
.
settings
)
discussion_target
=
String
(
scope
=
Scope
.
settings
)
sort_key
=
String
(
scope
=
Scope
.
settings
)
data
=
String
(
help
=
"XML definition of inline discussion"
,
scope
=
Scope
.
content
)
...
...
@@ -42,3 +43,8 @@ class DiscussionDescriptor(RawDescriptor):
metadata_translations
=
dict
(
RawDescriptor
.
metadata_translations
)
metadata_translations
[
'id'
]
=
'discussion_id'
metadata_translations
[
'for'
]
=
'discussion_target'
discussion_id
=
String
(
scope
=
Scope
.
settings
)
discussion_category
=
String
(
scope
=
Scope
.
settings
)
discussion_target
=
String
(
scope
=
Scope
.
settings
)
sort_key
=
String
(
scope
=
Scope
.
settings
)
lms/djangoapps/django_comment_client/utils.py
View file @
7977491d
...
...
@@ -145,12 +145,12 @@ def initialize_discussion_info(course):
id
=
module
.
discussion_id
category
=
module
.
discussion_category
title
=
module
.
discussion_target
sort_key
=
module
.
metadata
.
get
(
'sort_key'
,
title
)
sort_key
=
module
.
sort_key
category
=
" / "
.
join
([
x
.
strip
()
for
x
in
category
.
split
(
"/"
)])
last_category
=
category
.
split
(
"/"
)[
-
1
]
discussion_id_map
[
id
]
=
{
"location"
:
location
,
"title"
:
last_category
+
" / "
+
title
}
unexpanded_category_map
[
category
]
.
append
({
"title"
:
title
,
"id"
:
id
,
"sort_key"
:
sort_key
,
"start_date"
:
module
.
start
})
"sort_key"
:
sort_key
,
"start_date"
:
module
.
lms
.
start
})
category_map
=
{
"entries"
:
defaultdict
(
dict
),
"subcategories"
:
defaultdict
(
dict
)}
for
category_path
,
entries
in
unexpanded_category_map
.
items
():
...
...
@@ -189,9 +189,7 @@ def initialize_discussion_info(course):
"sort_key"
:
entry
[
"sort_key"
],
"start_date"
:
entry
[
"start_date"
]}
default_topics
=
{
'General'
:
{
'id'
:
course
.
location
.
html_id
()}}
discussion_topics
=
course
.
metadata
.
get
(
'discussion_topics'
,
default_topics
)
for
topic
,
entry
in
discussion_topics
.
items
():
for
topic
,
entry
in
course
.
discussion_topics
.
items
():
category_map
[
'entries'
][
topic
]
=
{
"id"
:
entry
[
"id"
],
"sort_key"
:
entry
.
get
(
"sort_key"
,
topic
),
"start_date"
:
time
.
gmtime
()}
...
...
lms/templates/staff_problem_info.html
View file @
7977491d
...
...
@@ -46,22 +46,18 @@ github = <a href="${edit_link}">${edit_link | h}</a>
%if source_file:
source_url =
<a
href=
"${source_url}"
>
${source_file | h}
</a>
%endif
<
div
>
<
header><h3>
Module Fields
</h3></heade
r>
<
table
>
<
tr><th>
Module Fields
</th></t
r>
%for name, field in fields:
<div>
${name} =
<pre
style=
"display:inline-block"
>
${field | h}
</pre>
</div>
<tr><td>
${name}
</td><td><pre
style=
"display:inline-block; margin: 0;"
>
${field | h}
</pre></td></tr>
%endfor
</
div
>
<
div
>
<
header><h3>
edX Fields
</h3></heade
r>
</
table
>
<
table
>
<
tr><th>
edX Fields
</th></t
r>
%for name, field in lms_fields:
<div>
${name} =
<pre
style=
"display:inline-block"
>
${field | h}
</pre>
</div>
<tr><td>
${name}
</td><td><pre
style=
"display:inline-block; margin: 0;"
>
${field | h}
</pre></td></tr>
%endfor
</
div
>
</
table
>
category = ${category | h}
</div>
%if render_histogram:
...
...
@@ -75,18 +71,21 @@ category = ${category | h}
<script
type=
"text/javascript"
>
// assumes courseware.html's loaded this method.
%
if
staff_access
:
setup_debug
(
'${element_id}'
,
%
if
edit_link
:
'${edit_link}'
,
%
else
:
null
,
%
endif
{
'location'
:
'${location}'
,
'xqa_key'
:
'${xqa_key}'
,
'category'
:
'${category}'
,
'user'
:
'${user}'
});
%
endif
%
if
staff_access
:
$
(
function
()
{
setup_debug
(
'${element_id}'
,
%
if
edit_link
:
'${edit_link}'
,
%
else
:
null
,
%
endif
{
'location'
:
'${location}'
,
'xqa_key'
:
'${xqa_key}'
,
'category'
:
'${category}'
,
'user'
:
'${user}'
}
);
});
%
endif
</script>
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