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
ef9cf87b
Commit
ef9cf87b
authored
Jul 31, 2014
by
Tim Babych
Committed by
cahrens
Aug 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compute graders just once per Course.
parent
bba03a51
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
cms/djangoapps/contentstore/views/item.py
+9
-5
No files found.
cms/djangoapps/contentstore/views/item.py
View file @
ef9cf87b
...
...
@@ -589,7 +589,7 @@ def _get_module_info(xblock, rewrite_static_links=True):
def
create_xblock_info
(
xblock
,
data
=
None
,
metadata
=
None
,
include_ancestor_info
=
False
,
include_child_info
=
False
,
course_outline
=
False
,
include_children_predicate
=
NEVER
,
parent_xblock
=
None
):
course_outline
=
False
,
include_children_predicate
=
NEVER
,
parent_xblock
=
None
,
graders
=
None
):
"""
Creates the information needed for client-side XBlockInfo.
...
...
@@ -626,13 +626,17 @@ def create_xblock_info(xblock, data=None, metadata=None, include_ancestor_info=F
is_xblock_unit
=
is_unit
(
xblock
,
parent_xblock
)
is_unit_with_changes
=
is_xblock_unit
and
modulestore
()
.
has_changes
(
xblock
.
location
)
if
graders
is
None
:
graders
=
CourseGradingModel
.
fetch
(
xblock
.
location
.
course_key
)
.
graders
# Compute the child info first so it can be included in aggregate information for the parent
should_visit_children
=
include_child_info
and
(
course_outline
and
not
is_xblock_unit
or
not
course_outline
)
if
should_visit_children
and
xblock
.
has_children
:
child_info
=
_create_xblock_child_info
(
xblock
,
course_outline
,
include_children_predicate
=
include_children_predicate
graders
,
include_children_predicate
=
include_children_predicate
,
)
else
:
child_info
=
None
...
...
@@ -641,7 +645,6 @@ def create_xblock_info(xblock, data=None, metadata=None, include_ancestor_info=F
release_date
=
get_default_time_display
(
xblock
.
start
)
if
xblock
.
start
!=
DEFAULT_START_DATE
else
None
published
=
modulestore
()
.
has_item
(
xblock
.
location
,
revision
=
ModuleStoreEnum
.
RevisionOption
.
published_only
)
graders
=
CourseGradingModel
.
fetch
(
xblock
.
location
.
course_key
)
.
graders
xblock_info
=
{
"id"
:
unicode
(
xblock
.
location
),
"display_name"
:
xblock
.
display_name_with_default
,
...
...
@@ -777,7 +780,7 @@ def _create_xblock_ancestor_info(xblock, course_outline):
}
def
_create_xblock_child_info
(
xblock
,
course_outline
,
include_children_predicate
=
NEVER
):
def
_create_xblock_child_info
(
xblock
,
course_outline
,
graders
,
include_children_predicate
=
NEVER
):
"""
Returns information about the children of an xblock, as well as about the primary category
of xblock expected as children.
...
...
@@ -794,7 +797,8 @@ def _create_xblock_child_info(xblock, course_outline, include_children_predicate
create_xblock_info
(
child
,
include_child_info
=
True
,
course_outline
=
course_outline
,
include_children_predicate
=
include_children_predicate
,
parent_xblock
=
xblock
parent_xblock
=
xblock
,
graders
=
graders
)
for
child
in
xblock
.
get_children
()
]
return
child_info
...
...
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