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
db813d1e
Commit
db813d1e
authored
Dec 17, 2014
by
E. Kolpakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
List of CAPA input types + setting to choose one
parent
4d454e30
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
common/lib/xmodule/xmodule/library_content_module.py
+43
-0
No files found.
common/lib/xmodule/xmodule/library_content_module.py
View file @
db813d1e
...
...
@@ -5,6 +5,7 @@ LibraryContent: The XBlock used to include blocks from a library in a course.
from
bson.objectid
import
ObjectId
,
InvalidId
from
collections
import
namedtuple
from
copy
import
copy
from
.mako_module
import
MakoModuleDescriptor
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.locator
import
LibraryLocator
...
...
@@ -19,6 +20,7 @@ from xmodule.studio_editable import StudioEditableModule, StudioEditableDescript
from
.xml_module
import
XmlDescriptor
from
pkg_resources
import
resource_string
# Make '_' a no-op so we can scrape strings
_
=
lambda
text
:
text
...
...
@@ -28,6 +30,40 @@ def enum(**enums):
return
type
(
'Enum'
,
(),
enums
)
def
_get_capa_types
():
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'
),
}
return
sorted
([
{
'value'
:
capa_type
,
'display_name'
:
caption
}
for
capa_type
,
caption
in
capa_types
.
items
()
],
key
=
lambda
item
:
item
.
get
(
'display_name'
))
class
LibraryVersionReference
(
namedtuple
(
"LibraryVersionReference"
,
"library_id version"
)):
"""
A reference to a specific library, with an optional version.
...
...
@@ -146,6 +182,13 @@ class LibraryContentFields(object):
default
=
1
,
scope
=
Scope
.
settings
,
)
capa_type
=
String
(
display_name
=
_
(
"Problem Type"
),
help
=
_
(
"The type of components to include in this block"
),
default
=
"any"
,
values
=
[{
"display_name"
:
_
(
"Any Type"
),
"value"
:
"any"
}]
+
_get_capa_types
(),
scope
=
Scope
.
settings
,
)
filters
=
String
(
default
=
""
)
# TBD
has_score
=
Boolean
(
display_name
=
_
(
"Scored"
),
...
...
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