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
944c4336
Commit
944c4336
authored
Oct 31, 2013
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release'
parents
e3cef4e2
6aa5d2cc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
13 deletions
+17
-13
common/lib/xmodule/xmodule/conditional_module.py
+6
-3
common/lib/xmodule/xmodule/lti_module.py
+1
-1
common/lib/xmodule/xmodule/peer_grading_module.py
+3
-3
common/lib/xmodule/xmodule/x_module.py
+5
-0
lms/templates/conditional_module.html
+2
-6
No files found.
common/lib/xmodule/xmodule/conditional_module.py
View file @
944c4336
...
@@ -4,6 +4,7 @@ some xmodules by conditions.
...
@@ -4,6 +4,7 @@ some xmodules by conditions.
import
json
import
json
import
logging
import
logging
from
lazy
import
lazy
from
lxml
import
etree
from
lxml
import
etree
from
pkg_resources
import
resource_string
from
pkg_resources
import
resource_string
...
@@ -97,10 +98,12 @@ class ConditionalModule(ConditionalFields, XModule):
...
@@ -97,10 +98,12 @@ class ConditionalModule(ConditionalFields, XModule):
return
xml_value
,
attr_name
return
xml_value
,
attr_name
raise
Exception
(
'Error in conditional module: unknown condition "
%
s"'
%
xml_attr
)
raise
Exception
(
'Error in conditional module: unknown condition "
%
s"'
%
xml_attr
)
def
is_condition_satisfied
(
self
):
@lazy
self
.
required_modules
=
[
self
.
system
.
get_module
(
descriptor
)
for
def
required_modules
(
self
):
descriptor
in
self
.
descriptor
.
get_required_module_descriptors
()]
return
[
self
.
system
.
get_module
(
descriptor
)
for
descriptor
in
self
.
descriptor
.
get_required_module_descriptors
()]
def
is_condition_satisfied
(
self
):
xml_value
,
attr_name
=
self
.
_get_condition
()
xml_value
,
attr_name
=
self
.
_get_condition
()
if
xml_value
and
self
.
required_modules
:
if
xml_value
and
self
.
required_modules
:
...
...
common/lib/xmodule/xmodule/lti_module.py
View file @
944c4336
...
@@ -181,7 +181,7 @@ class LTIModule(LTIFields, XModule):
...
@@ -181,7 +181,7 @@ class LTIModule(LTIFields, XModule):
]
]
# Obtains client_key and client_secret credentials from current course:
# Obtains client_key and client_secret credentials from current course:
course_id
=
self
.
runtime
.
course_id
course_id
=
self
.
course_id
course_location
=
CourseDescriptor
.
id_to_location
(
course_id
)
course_location
=
CourseDescriptor
.
id_to_location
(
course_id
)
course
=
self
.
descriptor
.
runtime
.
modulestore
.
get_item
(
course_location
)
course
=
self
.
descriptor
.
runtime
.
modulestore
.
get_item
(
course_location
)
client_key
=
client_secret
=
''
client_key
=
client_secret
=
''
...
...
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
944c4336
...
@@ -519,7 +519,7 @@ class PeerGradingModule(PeerGradingFields, XModule):
...
@@ -519,7 +519,7 @@ class PeerGradingModule(PeerGradingFields, XModule):
error_text
=
""
error_text
=
""
problem_list
=
[]
problem_list
=
[]
try
:
try
:
problem_list_json
=
self
.
peer_gs
.
get_problem_list
(
self
.
system
.
course_id
,
self
.
system
.
anonymous_student_id
)
problem_list_json
=
self
.
peer_gs
.
get_problem_list
(
self
.
course_id
,
self
.
system
.
anonymous_student_id
)
problem_list_dict
=
problem_list_json
problem_list_dict
=
problem_list_json
success
=
problem_list_dict
[
'success'
]
success
=
problem_list_dict
[
'success'
]
if
'error'
in
problem_list_dict
:
if
'error'
in
problem_list_dict
:
...
@@ -569,7 +569,7 @@ class PeerGradingModule(PeerGradingFields, XModule):
...
@@ -569,7 +569,7 @@ class PeerGradingModule(PeerGradingFields, XModule):
ajax_url
=
self
.
ajax_url
ajax_url
=
self
.
ajax_url
html
=
self
.
system
.
render_template
(
'peer_grading/peer_grading.html'
,
{
html
=
self
.
system
.
render_template
(
'peer_grading/peer_grading.html'
,
{
'course_id'
:
self
.
system
.
course_id
,
'course_id'
:
self
.
course_id
,
'ajax_url'
:
ajax_url
,
'ajax_url'
:
ajax_url
,
'success'
:
success
,
'success'
:
success
,
'problem_list'
:
good_problem_list
,
'problem_list'
:
good_problem_list
,
...
@@ -603,7 +603,7 @@ class PeerGradingModule(PeerGradingFields, XModule):
...
@@ -603,7 +603,7 @@ class PeerGradingModule(PeerGradingFields, XModule):
html
=
self
.
system
.
render_template
(
'peer_grading/peer_grading_problem.html'
,
{
html
=
self
.
system
.
render_template
(
'peer_grading/peer_grading_problem.html'
,
{
'view_html'
:
''
,
'view_html'
:
''
,
'problem_location'
:
problem_location
,
'problem_location'
:
problem_location
,
'course_id'
:
self
.
system
.
course_id
,
'course_id'
:
self
.
course_id
,
'ajax_url'
:
ajax_url
,
'ajax_url'
:
ajax_url
,
# Checked above
# Checked above
'staff_access'
:
False
,
'staff_access'
:
False
,
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
944c4336
...
@@ -134,6 +134,10 @@ class XModuleMixin(XBlockMixin):
...
@@ -134,6 +134,10 @@ class XModuleMixin(XBlockMixin):
)
)
@property
@property
def
course_id
(
self
):
return
self
.
runtime
.
course_id
@property
def
id
(
self
):
def
id
(
self
):
return
self
.
location
.
url
()
return
self
.
location
.
url
()
...
@@ -743,6 +747,7 @@ class XModuleDescriptor(XModuleMixin, HTMLSnippet, ResourceTemplates, XBlock):
...
@@ -743,6 +747,7 @@ class XModuleDescriptor(XModuleMixin, HTMLSnippet, ResourceTemplates, XBlock):
self
.
xmodule_runtime
.
xmodule_instance
=
descriptor
.
_xmodule
# pylint: disable=protected-access
self
.
xmodule_runtime
.
xmodule_instance
=
descriptor
.
_xmodule
# pylint: disable=protected-access
return
self
.
xmodule_runtime
.
xmodule_instance
return
self
.
xmodule_runtime
.
xmodule_instance
course_id
=
module_attr
(
'course_id'
)
displayable_items
=
module_attr
(
'displayable_items'
)
displayable_items
=
module_attr
(
'displayable_items'
)
get_display_items
=
module_attr
(
'get_display_items'
)
get_display_items
=
module_attr
(
'get_display_items'
)
get_icon_class
=
module_attr
(
'get_icon_class'
)
get_icon_class
=
module_attr
(
'get_icon_class'
)
...
...
lms/templates/conditional_module.html
View file @
944c4336
<
%
<
%
from
django
.
core
.
urlresolvers
import
reverse
#
course_id =
module.location.course_id
from
django
.
core
.
urlresolvers
import
reverse
def
get_course_id
(
module
)
:
return
module
.
location
.
org
+'/'
+
module
.
location
.
course
+'/'
+
\
module
.
system
.
ajax_url
.
split
('/')[
4
]
def
_message
(
reqm
,
message
)
:
def
_message
(
reqm
,
message
)
:
return
message
.
format
(
link=
"<a href={url}>{url_name}</a>"
.
format
(
return
message
.
format
(
link=
"<a href={url}>{url_name}</a>"
.
format
(
url =
reverse('jump_to',
kwargs=
dict(course_id=
get_course_id(reqm)
,
url =
reverse('jump_to',
kwargs=
dict(course_id=
reqm.course_id
,
location=
reqm.location.url())),
location=
reqm.location.url())),
url_name =
reqm.display_name_with_default))
url_name =
reqm.display_name_with_default))
%
>
%
>
...
...
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