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
2e422b2c
Commit
2e422b2c
authored
Feb 26, 2016
by
David Ormsbee
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11492 from edx/ormsbee/inline_capa
Move rendering of capa problems inline
parents
890d1bfd
13682e46
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
3 deletions
+14
-3
common/djangoapps/edxmako/middleware.py
+10
-0
common/djangoapps/edxmako/shortcuts.py
+0
-1
common/lib/xmodule/xmodule/capa_base.py
+1
-0
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+2
-1
lms/templates/problem_ajax.html
+1
-1
No files found.
common/djangoapps/edxmako/middleware.py
View file @
2e422b2c
...
@@ -19,6 +19,8 @@ from django.template.context import _builtin_context_processors
...
@@ -19,6 +19,8 @@ from django.template.context import _builtin_context_processors
from
django.utils.module_loading
import
import_string
from
django.utils.module_loading
import
import_string
from
util.request
import
safe_get_host
from
util.request
import
safe_get_host
from
request_cache.middleware
import
RequestCache
REQUEST_CONTEXT
=
threading
.
local
()
REQUEST_CONTEXT
=
threading
.
local
()
...
@@ -51,6 +53,12 @@ def get_template_request_context():
...
@@ -51,6 +53,12 @@ def get_template_request_context():
request
=
getattr
(
REQUEST_CONTEXT
,
"request"
,
None
)
request
=
getattr
(
REQUEST_CONTEXT
,
"request"
,
None
)
if
not
request
:
if
not
request
:
return
None
return
None
request_cache_dict
=
RequestCache
.
get_request_cache
()
.
data
cache_key
=
"edxmako_request_context"
if
cache_key
in
request_cache_dict
:
return
request_cache_dict
[
cache_key
]
context
=
RequestContext
(
request
)
context
=
RequestContext
(
request
)
context
[
'is_secure'
]
=
request
.
is_secure
()
context
[
'is_secure'
]
=
request
.
is_secure
()
context
[
'site'
]
=
safe_get_host
(
request
)
context
[
'site'
]
=
safe_get_host
(
request
)
...
@@ -62,4 +70,6 @@ def get_template_request_context():
...
@@ -62,4 +70,6 @@ def get_template_request_context():
for
processor
in
get_template_context_processors
():
for
processor
in
get_template_context_processors
():
context
.
update
(
processor
(
request
))
context
.
update
(
processor
(
request
))
request_cache_dict
[
cache_key
]
=
context
return
context
return
context
common/djangoapps/edxmako/shortcuts.py
View file @
2e422b2c
...
@@ -33,7 +33,6 @@ def marketing_link(name):
...
@@ -33,7 +33,6 @@ def marketing_link(name):
possible URLs for certain links. This function is to decides
possible URLs for certain links. This function is to decides
which URL should be provided.
which URL should be provided.
"""
"""
# link_map maps URLs from the marketing site to the old equivalent on
# link_map maps URLs from the marketing site to the old equivalent on
# the Django site
# the Django site
link_map
=
settings
.
MKTG_URL_LINK_MAP
link_map
=
settings
.
MKTG_URL_LINK_MAP
...
...
common/lib/xmodule/xmodule/capa_base.py
View file @
2e422b2c
...
@@ -399,6 +399,7 @@ class CapaMixin(CapaFields):
...
@@ -399,6 +399,7 @@ class CapaMixin(CapaFields):
'ajax_url'
:
self
.
runtime
.
ajax_url
,
'ajax_url'
:
self
.
runtime
.
ajax_url
,
'progress_status'
:
Progress
.
to_js_status_str
(
progress
),
'progress_status'
:
Progress
.
to_js_status_str
(
progress
),
'progress_detail'
:
Progress
.
to_js_detail_str
(
progress
),
'progress_detail'
:
Progress
.
to_js_detail_str
(
progress
),
'content'
:
self
.
get_problem_html
(
encapsulate
=
False
)
})
})
def
check_button_name
(
self
):
def
check_button_name
(
self
):
...
...
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
2e422b2c
...
@@ -5,6 +5,7 @@ class @Problem
...
@@ -5,6 +5,7 @@ class @Problem
@
id
=
@
el
.
data
(
'problem-id'
)
@
id
=
@
el
.
data
(
'problem-id'
)
@
element_id
=
@
el
.
attr
(
'id'
)
@
element_id
=
@
el
.
attr
(
'id'
)
@
url
=
@
el
.
data
(
'url'
)
@
url
=
@
el
.
data
(
'url'
)
@
content
=
@
el
.
data
(
'content'
)
# has_timed_out and has_response are used to ensure that are used to
# has_timed_out and has_response are used to ensure that are used to
# ensure that we wait a minimum of ~ 1s before transitioning the check
# ensure that we wait a minimum of ~ 1s before transitioning the check
...
@@ -12,7 +13,7 @@ class @Problem
...
@@ -12,7 +13,7 @@ class @Problem
@
has_timed_out
=
false
@
has_timed_out
=
false
@
has_response
=
false
@
has_response
=
false
@
render
()
@
render
(
@
content
)
$
:
(
selector
)
->
$
:
(
selector
)
->
$
(
selector
,
@
el
)
$
(
selector
,
@
el
)
...
...
lms/templates/problem_ajax.html
View file @
2e422b2c
<div
id=
"problem_${element_id}"
class=
"problems-wrapper"
data-problem-id=
"${id}"
data-url=
"${ajax_url}"
data-progress_status=
"${progress_status}"
data-progress_detail=
"${progress_detail}"
></div>
<div
id=
"problem_${element_id}"
class=
"problems-wrapper"
data-problem-id=
"${id}"
data-url=
"${ajax_url}"
data-progress_status=
"${progress_status}"
data-progress_detail=
"${progress_detail}"
data-content=
"${content | h}"
></div>
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