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
1031cbb1
Commit
1031cbb1
authored
Sep 26, 2014
by
dragonfi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix errors when context in None
parent
2444c16a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
mentoring/html.py
+2
-1
mentoring/questionnaire.py
+1
-1
No files found.
mentoring/html.py
View file @
1031cbb1
...
@@ -56,7 +56,8 @@ class HTMLBlock(LightChild):
...
@@ -56,7 +56,8 @@ class HTMLBlock(LightChild):
return
block
return
block
def
student_view
(
self
,
context
=
None
):
def
student_view
(
self
,
context
=
None
):
if
context
.
get
(
'as_template'
,
True
):
as_template
=
context
.
get
(
'as_template'
,
True
)
if
context
is
not
None
else
True
if
as_template
:
return
Fragment
(
u"<script type='text/template' id='{}'>
\n
{}
\n
</script>"
.
format
(
return
Fragment
(
u"<script type='text/template' id='{}'>
\n
{}
\n
</script>"
.
format
(
'light-child-template'
,
'light-child-template'
,
self
.
content
self
.
content
...
...
mentoring/questionnaire.py
View file @
1031cbb1
...
@@ -75,7 +75,7 @@ class QuestionnaireAbstractBlock(LightChild, StepMixin):
...
@@ -75,7 +75,7 @@ class QuestionnaireAbstractBlock(LightChild, StepMixin):
def
student_view
(
self
,
context
=
None
):
def
student_view
(
self
,
context
=
None
):
name
=
self
.
__class__
.
__name__
name
=
self
.
__class__
.
__name__
as_template
=
context
.
get
(
'as_template'
,
True
)
as_template
=
context
.
get
(
'as_template'
,
True
)
if
context
is
not
None
else
True
if
str
(
self
.
type
)
not
in
self
.
valid_types
:
if
str
(
self
.
type
)
not
in
self
.
valid_types
:
raise
ValueError
(
u'Invalid value for {}.type: `{}`'
.
format
(
name
,
self
.
type
))
raise
ValueError
(
u'Invalid value for {}.type: `{}`'
.
format
(
name
,
self
.
type
))
...
...
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