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
b53159df
Commit
b53159df
authored
Feb 24, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixes
parent
6de92395
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
mentoring/components/public/css/answer.css
+2
-1
mentoring/components/questionnaire.py
+26
-1
No files found.
mentoring/components/public/css/answer.css
View file @
b53159df
...
@@ -4,9 +4,10 @@
...
@@ -4,9 +4,10 @@
margin-bottom
:
10px
;
margin-bottom
:
10px
;
}
}
.mentoring
.answer-checkmark
{
.mentoring
.
xblock-answer
.
answer-checkmark
{
display
:
inline-block
;
display
:
inline-block
;
margin-bottom
:
20px
;
margin-bottom
:
20px
;
float
:
none
;
}
}
.mentoring
.answer.read_only
{
.mentoring
.answer.read_only
{
...
...
mentoring/components/questionnaire.py
View file @
b53159df
...
@@ -60,6 +60,12 @@ class QuestionnaireAbstractBlock(StudioEditableXBlockMixin, StudioContainerXBloc
...
@@ -60,6 +60,12 @@ class QuestionnaireAbstractBlock(StudioEditableXBlockMixin, StudioContainerXBloc
values entered by the student, and supports multiple types of multiple-choice
values entered by the student, and supports multiple types of multiple-choice
set, with preset choices and author-defined values.
set, with preset choices and author-defined values.
"""
"""
name
=
String
(
display_name
=
"Question ID (name)"
,
help
=
"The ID of this question (required). Should be unique within this mentoring component."
,
default
=
""
,
scope
=
Scope
.
content
)
question
=
String
(
question
=
String
(
display_name
=
"Question"
,
display_name
=
"Question"
,
help
=
"Question to ask the student"
,
help
=
"Question to ask the student"
,
...
@@ -79,7 +85,7 @@ class QuestionnaireAbstractBlock(StudioEditableXBlockMixin, StudioContainerXBloc
...
@@ -79,7 +85,7 @@ class QuestionnaireAbstractBlock(StudioEditableXBlockMixin, StudioContainerXBloc
scope
=
Scope
.
content
,
scope
=
Scope
.
content
,
enforce_type
=
True
enforce_type
=
True
)
)
editable_fields
=
(
'question'
,
'message'
,
'weight'
)
editable_fields
=
(
'
name'
,
'
question'
,
'message'
,
'weight'
)
has_children
=
True
has_children
=
True
@classmethod
@classmethod
...
@@ -169,6 +175,25 @@ class QuestionnaireAbstractBlock(StudioEditableXBlockMixin, StudioContainerXBloc
...
@@ -169,6 +175,25 @@ class QuestionnaireAbstractBlock(StudioEditableXBlockMixin, StudioContainerXBloc
fragment
.
add_css_url
(
self
.
runtime
.
local_resource_url
(
self
,
'public/css/questionnaire-edit.css'
))
fragment
.
add_css_url
(
self
.
runtime
.
local_resource_url
(
self
,
'public/css/questionnaire-edit.css'
))
return
fragment
return
fragment
def
validate_field_data
(
self
,
validation
,
data
):
"""
Validate this block's field data. Instead of checking fields like self.name, check the
fields set on data, e.g. data.name. This allows the same validation method to be re-used
for the studio editor. Any errors found should be added to "validation".
This method should not return any value or raise any exceptions.
All of this XBlock's fields should be found in "data", even if they aren't being changed
or aren't even set (i.e. are defaults).
"""
super
(
QuestionnaireAbstractBlock
,
self
)
.
validate_field_data
(
validation
,
data
)
def
add_error
(
msg
):
validation
.
add
(
ValidationMessage
(
ValidationMessage
.
ERROR
,
msg
))
if
not
data
.
name
:
add_error
(
u"A unique Question ID is required."
)
elif
' '
in
data
.
name
:
add_error
(
u"Question ID should not contain spaces."
)
def
validate
(
self
):
def
validate
(
self
):
"""
"""
Validates the state of this XBlock.
Validates the state of this XBlock.
...
...
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