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
ea428273
Commit
ea428273
authored
Dec 29, 2014
by
E. Kolpakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switched to filtering by response type rather than input type
parent
fcbc8446
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
31 deletions
+29
-31
common/lib/xmodule/xmodule/capa_module.py
+3
-3
common/lib/xmodule/xmodule/library_content_module.py
+22
-24
common/lib/xmodule/xmodule/library_tools.py
+1
-1
common/test/acceptance/tests/lms/test_library.py
+3
-3
No files found.
common/lib/xmodule/xmodule/capa_module.py
View file @
ea428273
...
...
@@ -7,7 +7,7 @@ from lxml import etree
from
pkg_resources
import
resource_string
from
.capa_base
import
CapaMixin
,
CapaFields
,
ComplexEncoder
from
capa
import
input
types
from
capa
import
response
types
from
.progress
import
Progress
from
xmodule.x_module
import
XModule
,
module_attr
from
xmodule.raw_module
import
RawDescriptor
...
...
@@ -178,8 +178,8 @@ class CapaDescriptor(CapaFields, RawDescriptor):
def
problem_types
(
self
):
""" Low-level problem type introspection for content libraries filtering by problem type """
tree
=
etree
.
XML
(
self
.
data
)
registered_ta
s
=
input
types
.
registry
.
registered_tags
()
return
set
([
node
.
tag
for
node
in
tree
.
iter
()
if
node
.
tag
in
registered_tas
])
registered_ta
gs
=
response
types
.
registry
.
registered_tags
()
return
set
([
node
.
tag
for
node
in
tree
.
iter
()
if
node
.
tag
in
registered_ta
g
s
])
# Proxy to CapaModule for access to any of its attributes
answer_available
=
module_attr
(
'answer_available'
)
...
...
common/lib/xmodule/xmodule/library_content_module.py
View file @
ea428273
...
...
@@ -39,30 +39,28 @@ def _get_capa_types():
Gets capa types tags and labels
"""
capa_types
=
{
'annotationinput'
:
_
(
'Annotation'
),
'checkboxgroup'
:
_
(
'Checkbox Group'
),
'checkboxtextgroup'
:
_
(
'Checkbox Text Group'
),
'chemicalequationinput'
:
_
(
'Chemical Equation'
),
'choicegroup'
:
_
(
'Choice Group'
),
'codeinput'
:
_
(
'Code Input'
),
'crystallography'
:
_
(
'Crystallography'
),
'designprotein2dinput'
:
_
(
'Design Protein 2D'
),
'drag_and_drop_input'
:
_
(
'Drag and Drop'
),
'editageneinput'
:
_
(
'Edit A Gene'
),
'editamoleculeinput'
:
_
(
'Edit A Molecule'
),
'filesubmission'
:
_
(
'File Submission'
),
'formulaequationinput'
:
_
(
'Formula Equation'
),
'imageinput'
:
_
(
'Image'
),
'javascriptinput'
:
_
(
'Javascript Input'
),
'jsinput'
:
_
(
'JS Input'
),
'matlabinput'
:
_
(
'Matlab'
),
'optioninput'
:
_
(
'Select Option'
),
'radiogroup'
:
_
(
'Radio Group'
),
'radiotextgroup'
:
_
(
'Radio Text Group'
),
'schematic'
:
_
(
'Schematic'
),
'textbox'
:
_
(
'Code Text Input'
),
'textline'
:
_
(
'Text Line'
),
'vsepr_input'
:
_
(
'VSEPR'
),
# basic tab
'choiceresponse'
:
_
(
'Checkboxes'
),
'optionresponse'
:
_
(
'Dropdown'
),
'multiplechoiceresponse'
:
_
(
'Multiple Choice'
),
'truefalseresponse'
:
_
(
'True/False Choice'
),
'numericalresponse'
:
_
(
'Numerical Input'
),
'stringresponse'
:
_
(
'Text Input'
),
# advanced tab
'schematicresponse'
:
_
(
'Circuit Schematic Builder'
),
'customresponse'
:
_
(
'Custom Evaluated Script'
),
'imageresponse'
:
_
(
'Image Mapped Input'
),
'formularesponse'
:
_
(
'Math Expression Input'
),
'jsmeresponse'
:
_
(
'Molecular Structure'
),
# not in "Add Component" menu
'javascriptresponse'
:
_
(
'Javascript Input'
),
'symbolicresponse'
:
_
(
'Symbolic Math Input'
),
'coderesponse'
:
_
(
'Code Input'
),
'externalresponse'
:
_
(
'External Grader'
),
'annotationresponse'
:
_
(
'Annotation Input'
),
'choicetextresponse'
:
_
(
'Checkboxes With Text Input'
),
}
return
[{
'value'
:
ANY_CAPA_TYPE_VALUE
,
'display_name'
:
_
(
'Any Type'
)}]
+
sorted
([
...
...
common/lib/xmodule/xmodule/library_tools.py
View file @
ea428273
...
...
@@ -104,7 +104,7 @@ class LibraryToolsService(object):
new_libraries
=
[]
for
library_key
,
library
in
libraries
:
def
copy_children_recursively
(
from_block
,
filter_problem_type
=
Tru
e
):
def
copy_children_recursively
(
from_block
,
filter_problem_type
=
Fals
e
):
"""
Internal method to copy blocks from the library recursively
"""
...
...
common/test/acceptance/tests/lms/test_library.py
View file @
ea428273
...
...
@@ -277,7 +277,7 @@ class StudioLibraryContainerCapaFilterTest(LibraryContentTestBase):
self
.
assertLessEqual
(
children_headers
,
self
.
_problem_headers
)
# Choice group test
children_headers
=
self
.
_set_library_content_settings
(
count
=
1
,
capa_type
=
"
Choice Group
"
)
children_headers
=
self
.
_set_library_content_settings
(
count
=
1
,
capa_type
=
"
Multiple Choice
"
)
self
.
assertEqual
(
len
(
children_headers
),
1
)
self
.
assertLessEqual
(
children_headers
,
...
...
@@ -285,7 +285,7 @@ class StudioLibraryContainerCapaFilterTest(LibraryContentTestBase):
)
# Choice group test
children_headers
=
self
.
_set_library_content_settings
(
count
=
2
,
capa_type
=
"
Select Optio
n"
)
children_headers
=
self
.
_set_library_content_settings
(
count
=
2
,
capa_type
=
"
Dropdow
n"
)
self
.
assertEqual
(
len
(
children_headers
),
2
)
self
.
assertLessEqual
(
children_headers
,
...
...
@@ -293,5 +293,5 @@ class StudioLibraryContainerCapaFilterTest(LibraryContentTestBase):
)
# Missing problem type test
children_headers
=
self
.
_set_library_content_settings
(
count
=
2
,
capa_type
=
"
Matlab
"
)
children_headers
=
self
.
_set_library_content_settings
(
count
=
2
,
capa_type
=
"
Custom Evaluated Script
"
)
self
.
assertEqual
(
children_headers
,
set
())
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