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
7ac8fecb
Commit
7ac8fecb
authored
Jul 02, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename XModule[Descriptor].type to .category to be parallel to Location
parent
7b78fa52
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
11 deletions
+11
-11
cms/djangoapps/contentstore/views.py
+1
-1
cms/templates/unit.html
+1
-1
common/lib/xmodule/x_module.py
+2
-2
lms/djangoapps/courseware/grades.py
+2
-2
lms/djangoapps/courseware/module_render.py
+5
-5
No files found.
cms/djangoapps/contentstore/views.py
View file @
7ac8fecb
...
...
@@ -22,7 +22,7 @@ def edit_item(request):
return
render_to_response
(
'unit.html'
,
{
'contents'
:
item
.
get_html
(),
'js_module'
:
item
.
js_module_name
(),
'
type'
:
item
.
type
,
'
category'
:
item
.
category
,
'name'
:
item
.
name
,
})
...
...
cms/templates/unit.html
View file @
7ac8fecb
...
...
@@ -2,7 +2,7 @@
<header>
<section>
<h1
class=
"editable"
>
${name}
</h1>
<p>
${
type
}
</p>
<p>
${
category
}
</p>
</section>
<div
class=
"actions"
>
...
...
common/lib/xmodule/x_module.py
View file @
7ac8fecb
...
...
@@ -95,7 +95,7 @@ class XModule(object):
self
.
shared_state
=
shared_state
self
.
id
=
self
.
location
.
url
()
self
.
name
=
self
.
location
.
name
self
.
type
=
self
.
location
.
category
self
.
category
=
self
.
location
.
category
self
.
metadata
=
kwargs
.
get
(
'metadata'
,
{})
self
.
_loaded_children
=
None
...
...
@@ -235,7 +235,7 @@ class XModuleDescriptor(Plugin):
self
.
system
=
system
self
.
definition
=
definition
if
definition
is
not
None
else
{}
self
.
name
=
Location
(
kwargs
.
get
(
'location'
))
.
name
self
.
type
=
Location
(
kwargs
.
get
(
'location'
))
.
category
self
.
category
=
Location
(
kwargs
.
get
(
'location'
))
.
category
self
.
url
=
Location
(
kwargs
.
get
(
'location'
))
.
url
()
self
.
metadata
=
kwargs
.
get
(
'metadata'
,
{})
self
.
shared_state_key
=
kwargs
.
get
(
'shared_state_key'
)
...
...
lms/djangoapps/courseware/grades.py
View file @
7ac8fecb
...
...
@@ -146,9 +146,9 @@ def get_score(user, problem, cache):
correct
=
0.0
# If the ID is not in the cache, add the item
instance_module
=
cache
.
lookup
(
problem
.
type
,
problem
.
id
)
instance_module
=
cache
.
lookup
(
problem
.
category
,
problem
.
id
)
if
instance_module
is
None
:
instance_module
=
StudentModule
(
module_type
=
problem
.
type
,
instance_module
=
StudentModule
(
module_type
=
problem
.
category
,
module_state_key
=
problem
.
id
,
student
=
user
,
state
=
None
,
...
...
lms/djangoapps/courseware/module_render.py
View file @
7ac8fecb
...
...
@@ -207,10 +207,10 @@ def get_module(user, request, location, student_module_cache, position=None):
'''
descriptor
=
keystore
()
.
get_item
(
location
)
instance_module
=
student_module_cache
.
lookup
(
descriptor
.
type
,
descriptor
.
url
)
instance_module
=
student_module_cache
.
lookup
(
descriptor
.
category
,
descriptor
.
url
)
shared_state_key
=
getattr
(
descriptor
,
'shared_state_key'
,
None
)
if
shared_state_key
is
not
None
:
shared_module
=
student_module_cache
.
lookup
(
descriptor
.
type
,
shared_state_key
)
shared_module
=
student_module_cache
.
lookup
(
descriptor
.
category
,
shared_state_key
)
else
:
shared_module
=
None
...
...
@@ -246,7 +246,7 @@ def get_module(user, request, location, student_module_cache, position=None):
if
not
instance_module
:
instance_module
=
StudentModule
(
student
=
user
,
module_type
=
descriptor
.
type
,
module_type
=
descriptor
.
category
,
module_state_key
=
module
.
id
,
state
=
module
.
get_instance_state
(),
max_grade
=
module
.
max_score
())
...
...
@@ -257,13 +257,13 @@ def get_module(user, request, location, student_module_cache, position=None):
if
not
shared_module
and
shared_state_key
is
not
None
:
shared_module
=
StudentModule
(
student
=
user
,
module_type
=
descriptor
.
type
,
module_type
=
descriptor
.
category
,
module_state_key
=
shared_state_key
,
state
=
module
.
get_shared_state
())
shared_module
.
save
()
student_module_cache
.
append
(
shared_module
)
return
(
module
,
instance_module
,
shared_module
,
descriptor
.
type
)
return
(
module
,
instance_module
,
shared_module
,
descriptor
.
category
)
def
add_histogram
(
module
):
...
...
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