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
6c5db884
Commit
6c5db884
authored
Sep 16, 2017
by
Eugeny Kolpakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added `display_name` parameter to all XBlocks having student_view_data
parent
21e21468
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
16 additions
and
0 deletions
+16
-0
problem_builder/answer.py
+1
-0
problem_builder/choice.py
+2
-0
problem_builder/completion.py
+1
-0
problem_builder/mcq.py
+1
-0
problem_builder/mentoring.py
+2
-0
problem_builder/mrq.py
+1
-0
problem_builder/plot.py
+1
-0
problem_builder/slider.py
+1
-0
problem_builder/step.py
+1
-0
problem_builder/step_review.py
+4
-0
problem_builder/tip.py
+1
-0
No files found.
problem_builder/answer.py
View file @
6c5db884
...
@@ -267,6 +267,7 @@ class AnswerBlock(SubmittingXBlockMixin, AnswerMixin, QuestionMixin, StudioEdita
...
@@ -267,6 +267,7 @@ class AnswerBlock(SubmittingXBlockMixin, AnswerMixin, QuestionMixin, StudioEdita
return
{
return
{
'id'
:
self
.
name
,
'id'
:
self
.
name
,
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'display_name'
:
self
.
display_name
,
'type'
:
self
.
CATEGORY
,
'type'
:
self
.
CATEGORY
,
'weight'
:
self
.
weight
,
'weight'
:
self
.
weight
,
'question'
:
self
.
question
,
'question'
:
self
.
question
,
...
...
problem_builder/choice.py
View file @
6c5db884
...
@@ -74,8 +74,10 @@ class ChoiceBlock(
...
@@ -74,8 +74,10 @@ class ChoiceBlock(
Returns a JSON representation of the student_view of this XBlock,
Returns a JSON representation of the student_view of this XBlock,
retrievable from the Course Block API.
retrievable from the Course Block API.
"""
"""
# display_name_with_default gives out correctness - not adding it here
return
{
return
{
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'display_name'
:
self
.
_
(
u"Choice ({content})"
)
.
format
(
content
=
self
.
content
)
'value'
:
self
.
value
,
'value'
:
self
.
value
,
'content'
:
self
.
content
,
'content'
:
self
.
content
,
}
}
...
...
problem_builder/completion.py
View file @
6c5db884
...
@@ -116,6 +116,7 @@ class CompletionBlock(
...
@@ -116,6 +116,7 @@ class CompletionBlock(
return
{
return
{
'id'
:
self
.
name
,
'id'
:
self
.
name
,
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'display_name'
:
self
.
display_name_with_default
,
'type'
:
self
.
CATEGORY
,
'type'
:
self
.
CATEGORY
,
'question'
:
self
.
question
,
'question'
:
self
.
question
,
'answer'
:
self
.
answer
,
'answer'
:
self
.
answer
,
...
...
problem_builder/mcq.py
View file @
6c5db884
...
@@ -177,6 +177,7 @@ class MCQBlock(SubmittingXBlockMixin, StudentViewUserStateMixin, QuestionnaireAb
...
@@ -177,6 +177,7 @@ class MCQBlock(SubmittingXBlockMixin, StudentViewUserStateMixin, QuestionnaireAb
return
{
return
{
'id'
:
self
.
name
,
'id'
:
self
.
name
,
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'display_name'
:
self
.
display_name_with_default
,
'type'
:
self
.
CATEGORY
,
'type'
:
self
.
CATEGORY
,
'question'
:
self
.
question
,
'question'
:
self
.
question
,
'message'
:
self
.
message
,
'message'
:
self
.
message
,
...
...
problem_builder/mentoring.py
View file @
6c5db884
...
@@ -923,6 +923,7 @@ class MentoringBlock(
...
@@ -923,6 +923,7 @@ class MentoringBlock(
components
.
append
(
block
.
student_view_data
())
components
.
append
(
block
.
student_view_data
())
return
{
return
{
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'display_name'
:
self
.
display_name
,
'max_attempts'
:
self
.
max_attempts
,
'max_attempts'
:
self
.
max_attempts
,
'extended_feedback'
:
self
.
extended_feedback
,
'extended_feedback'
:
self
.
extended_feedback
,
'feedback_label'
:
self
.
feedback_label
,
'feedback_label'
:
self
.
feedback_label
,
...
@@ -1272,6 +1273,7 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes
...
@@ -1272,6 +1273,7 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes
return
{
return
{
'title'
:
self
.
display_name
,
'title'
:
self
.
display_name
,
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'display_name'
:
self
.
display_name
,
'show_title'
:
self
.
show_title
,
'show_title'
:
self
.
show_title
,
'weight'
:
self
.
weight
,
'weight'
:
self
.
weight
,
'extended_feedback'
:
self
.
extended_feedback
,
'extended_feedback'
:
self
.
extended_feedback
,
...
...
problem_builder/mrq.py
View file @
6c5db884
...
@@ -207,6 +207,7 @@ class MRQBlock(SubmittingXBlockMixin, StudentViewUserStateMixin, QuestionnaireAb
...
@@ -207,6 +207,7 @@ class MRQBlock(SubmittingXBlockMixin, StudentViewUserStateMixin, QuestionnaireAb
return
{
return
{
'id'
:
self
.
name
,
'id'
:
self
.
name
,
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'display_name'
:
self
.
display_name
,
'title'
:
self
.
display_name
,
'title'
:
self
.
display_name
,
'type'
:
self
.
CATEGORY
,
'type'
:
self
.
CATEGORY
,
'weight'
:
self
.
weight
,
'weight'
:
self
.
weight
,
...
...
problem_builder/plot.py
View file @
6c5db884
...
@@ -362,6 +362,7 @@ class PlotBlock(
...
@@ -362,6 +362,7 @@ class PlotBlock(
retrievable from the Course XBlock API.
retrievable from the Course XBlock API.
"""
"""
return
{
return
{
'display_name'
:
self
.
display_name
,
'type'
:
self
.
CATEGORY
,
'type'
:
self
.
CATEGORY
,
'title'
:
self
.
display_name
,
'title'
:
self
.
display_name
,
'q1_label'
:
self
.
q1_label
,
'q1_label'
:
self
.
q1_label
,
...
...
problem_builder/slider.py
View file @
6c5db884
...
@@ -128,6 +128,7 @@ class SliderBlock(
...
@@ -128,6 +128,7 @@ class SliderBlock(
return
{
return
{
'id'
:
self
.
name
,
'id'
:
self
.
name
,
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'display_name'
:
self
.
display_name_with_default
,
'type'
:
self
.
CATEGORY
,
'type'
:
self
.
CATEGORY
,
'question'
:
self
.
question
,
'question'
:
self
.
question
,
'min_label'
:
self
.
min_label
,
'min_label'
:
self
.
min_label
,
...
...
problem_builder/step.py
View file @
6c5db884
...
@@ -283,6 +283,7 @@ class MentoringStepBlock(
...
@@ -283,6 +283,7 @@ class MentoringStepBlock(
return
{
return
{
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'display_name'
:
self
.
display_name_with_default
,
'type'
:
self
.
CATEGORY
,
'type'
:
self
.
CATEGORY
,
'title'
:
self
.
display_name_with_default
,
'title'
:
self
.
display_name_with_default
,
'show_title'
:
self
.
show_title
,
'show_title'
:
self
.
show_title
,
...
...
problem_builder/step_review.py
View file @
6c5db884
...
@@ -112,6 +112,7 @@ class ConditionalMessageBlock(
...
@@ -112,6 +112,7 @@ class ConditionalMessageBlock(
def
student_view_data
(
self
,
context
=
None
):
def
student_view_data
(
self
,
context
=
None
):
return
{
return
{
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'display_name'
:
self
.
display_name_with_default
,
'type'
:
self
.
CATEGORY
,
'type'
:
self
.
CATEGORY
,
'content'
:
self
.
content
,
'content'
:
self
.
content
,
'score_condition'
:
self
.
score_condition
,
'score_condition'
:
self
.
score_condition
,
...
@@ -163,6 +164,7 @@ class ScoreSummaryBlock(XBlockWithTranslationServiceMixin, XBlockWithPreviewMixi
...
@@ -163,6 +164,7 @@ class ScoreSummaryBlock(XBlockWithTranslationServiceMixin, XBlockWithPreviewMixi
def
student_view_data
(
self
,
context
=
None
):
def
student_view_data
(
self
,
context
=
None
):
return
{
return
{
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'display_name'
:
self
.
display_name_with_default
,
'type'
:
self
.
CATEGORY
,
'type'
:
self
.
CATEGORY
,
}
}
...
@@ -217,6 +219,7 @@ class PerQuestionFeedbackBlock(XBlockWithTranslationServiceMixin, XBlockWithPrev
...
@@ -217,6 +219,7 @@ class PerQuestionFeedbackBlock(XBlockWithTranslationServiceMixin, XBlockWithPrev
def
student_view_data
(
self
,
context
=
None
):
def
student_view_data
(
self
,
context
=
None
):
return
{
return
{
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'display_name'
:
self
.
display_name_with_default
,
'type'
:
self
.
CATEGORY
,
'type'
:
self
.
CATEGORY
,
}
}
...
@@ -314,6 +317,7 @@ class ReviewStepBlock(
...
@@ -314,6 +317,7 @@ class ReviewStepBlock(
return
{
return
{
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'block_id'
:
unicode
(
self
.
scope_ids
.
usage_id
),
'display_name'
:
self
.
display_name
,
'type'
:
self
.
CATEGORY
,
'type'
:
self
.
CATEGORY
,
'title'
:
self
.
display_name
,
'title'
:
self
.
display_name
,
'components'
:
components
,
'components'
:
components
,
...
...
problem_builder/tip.py
View file @
6c5db884
...
@@ -97,6 +97,7 @@ class TipBlock(StudioEditableXBlockMixin, XBlockWithTranslationServiceMixin, XBl
...
@@ -97,6 +97,7 @@ class TipBlock(StudioEditableXBlockMixin, XBlockWithTranslationServiceMixin, XBl
def
student_view_data
(
self
,
context
=
None
):
def
student_view_data
(
self
,
context
=
None
):
return
{
return
{
'display_name'
:
self
.
display_name_with_default
,
'content'
:
self
.
content
,
'content'
:
self
.
content
,
'for_choices'
:
self
.
values
,
'for_choices'
:
self
.
values
,
}
}
...
...
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