Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
4f65d73c
Commit
4f65d73c
authored
Oct 10, 2014
by
dragonfi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unittests after rebase
parent
57e6b421
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
mentoring/light_children.py
+8
-1
mentoring/mentoring.py
+5
-4
No files found.
mentoring/light_children.py
View file @
4f65d73c
...
...
@@ -85,7 +85,14 @@ class LightChildrenMixin(XBlockWithChildrenFragmentsMixin):
log
.
debug
(
'parse_xml called'
)
block
=
runtime
.
construct_xblock_from_class
(
cls
,
keys
)
cls
.
init_block_from_node
(
block
,
node
,
node
.
items
())
block
.
xml_content
=
getattr
(
block
,
'xml_content'
,
''
)
or
etree
.
tostring
(
node
)
xml_content_value
=
getattr
(
block
,
'xml_content'
,
None
)
xml_content_field
=
getattr
(
block
.
__class__
,
'xml_content'
,
None
)
default_xml_content
=
getattr
(
xml_content_field
,
'default'
,
None
)
if
xml_content_value
==
default_xml_content
:
block
.
xml_content
=
etree
.
tostring
(
node
)
return
block
@classmethod
...
...
mentoring/mentoring.py
View file @
4f65d73c
...
...
@@ -49,9 +49,9 @@ log = logging.getLogger(__name__)
def
default_xml_content
():
return
render_template
(
'templates/xml/mentoring_default.xml'
,
{
'url_name'
:
'mentoring-{}'
.
format
(
uuid
.
uuid4
())})
return
loader
.
render_template
(
'templates/xml/mentoring_default.xml'
,
{
'url_name'
:
'mentoring-{}'
.
format
(
uuid
.
uuid4
())})
# Classes ###########################################################
...
...
@@ -66,6 +66,7 @@ class MentoringBlock(XBlockWithLightChildren, StepParentMixin):
student is a) provided mentoring advices and asked to alter his answer, or b) is given the
ok to continue.
"""
attempted
=
Boolean
(
help
=
"Has the student attempted this mentoring step?"
,
default
=
False
,
scope
=
Scope
.
user_state
)
completed
=
Boolean
(
help
=
"Has the student completed this mentoring step?"
,
...
...
@@ -79,7 +80,7 @@ class MentoringBlock(XBlockWithLightChildren, StepParentMixin):
enforce_dependency
=
Boolean
(
help
=
"Should the next step be the current block to complete?"
,
default
=
False
,
scope
=
Scope
.
content
,
enforce_type
=
True
)
display_submit
=
Boolean
(
help
=
"Allow to submit current block?"
,
default
=
True
,
scope
=
Scope
.
content
)
xml_content
=
String
(
help
=
"XML content"
,
default
=
default_xml_content
,
scope
=
Scope
.
content
)
xml_content
=
String
(
help
=
"XML content"
,
default
=
default_xml_content
()
,
scope
=
Scope
.
content
)
weight
=
Float
(
help
=
"Defines the maximum total grade of the block."
,
default
=
1
,
scope
=
Scope
.
content
,
enforce_type
=
True
)
num_attempts
=
Integer
(
help
=
"Number of attempts a user has answered for this questions"
,
...
...
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