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
89ea8b31
Commit
89ea8b31
authored
May 26, 2015
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MA-725 responsive_ui indication on responsive xBlocks.
parent
4921ec48
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
0 deletions
+25
-0
common/lib/capa/capa/capa_problem.py
+7
-0
common/lib/capa/capa/responsetypes.py
+10
-0
common/lib/xmodule/xmodule/capa_module.py
+7
-0
common/lib/xmodule/xmodule/html_module.py
+1
-0
No files found.
common/lib/capa/capa/capa_problem.py
View file @
89ea8b31
...
@@ -527,6 +527,13 @@ class LoncapaProblem(object):
...
@@ -527,6 +527,13 @@ class LoncapaProblem(object):
log
.
warning
(
"Could not find matching input for id:
%
s"
,
input_id
)
log
.
warning
(
"Could not find matching input for id:
%
s"
,
input_id
)
return
{}
return
{}
@property
def
has_responsive_ui
(
self
):
"""
Returns whether this capa problem has support for responsive UI.
"""
return
all
(
responder
.
has_responsive_ui
for
responder
in
self
.
responders
.
values
())
# ======= Private Methods Below ========
# ======= Private Methods Below ========
def
_process_includes
(
self
):
def
_process_includes
(
self
):
...
...
common/lib/capa/capa/responsetypes.py
View file @
89ea8b31
...
@@ -138,6 +138,11 @@ class LoncapaResponse(object):
...
@@ -138,6 +138,11 @@ class LoncapaResponse(object):
allowed_inputfields
=
[]
allowed_inputfields
=
[]
required_attributes
=
[]
required_attributes
=
[]
# Overridable field that specifies whether this capa response type has support for
# responsive UI, for rendering on devices of different sizes and shapes.
# By default, we set this to False, allowing subclasses to override as appropriate.
has_responsive_ui
=
False
def
__init__
(
self
,
xml
,
inputfields
,
context
,
system
):
def
__init__
(
self
,
xml
,
inputfields
,
context
,
system
):
"""
"""
Init is passed the following arguments:
Init is passed the following arguments:
...
@@ -692,6 +697,7 @@ class ChoiceResponse(LoncapaResponse):
...
@@ -692,6 +697,7 @@ class ChoiceResponse(LoncapaResponse):
max_inputfields
=
1
max_inputfields
=
1
allowed_inputfields
=
[
'checkboxgroup'
,
'radiogroup'
]
allowed_inputfields
=
[
'checkboxgroup'
,
'radiogroup'
]
correct_choices
=
None
correct_choices
=
None
has_responsive_ui
=
True
def
setup_response
(
self
):
def
setup_response
(
self
):
...
@@ -763,6 +769,7 @@ class MultipleChoiceResponse(LoncapaResponse):
...
@@ -763,6 +769,7 @@ class MultipleChoiceResponse(LoncapaResponse):
max_inputfields
=
1
max_inputfields
=
1
allowed_inputfields
=
[
'choicegroup'
]
allowed_inputfields
=
[
'choicegroup'
]
correct_choices
=
None
correct_choices
=
None
has_responsive_ui
=
True
def
setup_response
(
self
):
def
setup_response
(
self
):
# call secondary setup for MultipleChoice questions, to set name
# call secondary setup for MultipleChoice questions, to set name
...
@@ -1084,6 +1091,7 @@ class OptionResponse(LoncapaResponse):
...
@@ -1084,6 +1091,7 @@ class OptionResponse(LoncapaResponse):
hint_tag
=
'optionhint'
hint_tag
=
'optionhint'
allowed_inputfields
=
[
'optioninput'
]
allowed_inputfields
=
[
'optioninput'
]
answer_fields
=
None
answer_fields
=
None
has_responsive_ui
=
True
def
setup_response
(
self
):
def
setup_response
(
self
):
self
.
answer_fields
=
self
.
inputfields
self
.
answer_fields
=
self
.
inputfields
...
@@ -1136,6 +1144,7 @@ class NumericalResponse(LoncapaResponse):
...
@@ -1136,6 +1144,7 @@ class NumericalResponse(LoncapaResponse):
allowed_inputfields
=
[
'textline'
,
'formulaequationinput'
]
allowed_inputfields
=
[
'textline'
,
'formulaequationinput'
]
required_attributes
=
[
'answer'
]
required_attributes
=
[
'answer'
]
max_inputfields
=
1
max_inputfields
=
1
has_responsive_ui
=
True
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
correct_answer
=
''
self
.
correct_answer
=
''
...
@@ -1338,6 +1347,7 @@ class StringResponse(LoncapaResponse):
...
@@ -1338,6 +1347,7 @@ class StringResponse(LoncapaResponse):
required_attributes
=
[
'answer'
]
required_attributes
=
[
'answer'
]
max_inputfields
=
1
max_inputfields
=
1
correct_answer
=
[]
correct_answer
=
[]
has_responsive_ui
=
True
def
setup_response_backward
(
self
):
def
setup_response_backward
(
self
):
self
.
correct_answer
=
[
self
.
correct_answer
=
[
...
...
common/lib/xmodule/xmodule/capa_module.py
View file @
89ea8b31
...
@@ -187,6 +187,13 @@ class CapaDescriptor(CapaFields, RawDescriptor):
...
@@ -187,6 +187,13 @@ class CapaDescriptor(CapaFields, RawDescriptor):
registered_tags
=
responsetypes
.
registry
.
registered_tags
()
registered_tags
=
responsetypes
.
registry
.
registered_tags
()
return
set
([
node
.
tag
for
node
in
tree
.
iter
()
if
node
.
tag
in
registered_tags
])
return
set
([
node
.
tag
for
node
in
tree
.
iter
()
if
node
.
tag
in
registered_tags
])
@property
def
has_responsive_ui
(
self
):
"""
Returns whether this module has support for responsive UI.
"""
return
self
.
lcp
.
has_responsive_ui
def
index_dictionary
(
self
):
def
index_dictionary
(
self
):
"""
"""
Return dictionary prepared with module content and type for indexing.
Return dictionary prepared with module content and type for indexing.
...
...
common/lib/xmodule/xmodule/html_module.py
View file @
89ea8b31
...
@@ -95,6 +95,7 @@ class HtmlDescriptor(HtmlFields, XmlDescriptor, EditingDescriptor): # pylint: d
...
@@ -95,6 +95,7 @@ class HtmlDescriptor(HtmlFields, XmlDescriptor, EditingDescriptor): # pylint: d
module_class
=
HtmlModule
module_class
=
HtmlModule
filename_extension
=
"xml"
filename_extension
=
"xml"
template_dir_name
=
"html"
template_dir_name
=
"html"
has_responsive_ui
=
True
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/html/edit.coffee'
)]}
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/html/edit.coffee'
)]}
js_module_name
=
"HTMLEditingDescriptor"
js_module_name
=
"HTMLEditingDescriptor"
...
...
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