Commit e338c740 by Braden MacDonald Committed by GitHub

Merge pull request #156 from open-craft/mtyaka/native-api-docs

Add docs about API methods which can be used form native apps
parents 4c5efa34 79a29c9d
...@@ -116,9 +116,8 @@ class CompletionBlock( ...@@ -116,9 +116,8 @@ class CompletionBlock(
'type': self.CATEGORY, 'type': self.CATEGORY,
'question': self.question, 'question': self.question,
'answer': self.answer, 'answer': self.answer,
'checked': self.student_value if self.student_value is not None else False,
'title': self.display_name_with_default, 'title': self.display_name_with_default,
'hide_header': self.show_title, 'hide_header': not self.show_title,
} }
def get_last_result(self): def get_last_result(self):
......
...@@ -1262,9 +1262,6 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes ...@@ -1262,9 +1262,6 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes
'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,
'active_step': self.active_step_safe,
'max_attempts': self.max_attempts, 'max_attempts': self.max_attempts,
'num_attempts': self.num_attempts,
'hide_prev_answer': True,
'components': components, 'components': components,
} }
...@@ -358,13 +358,12 @@ class PlotBlock(StudioEditableXBlockMixin, StudioContainerWithNestedXBlocksMixin ...@@ -358,13 +358,12 @@ class PlotBlock(StudioEditableXBlockMixin, StudioContainerWithNestedXBlocksMixin
'q2_label': self.q2_label, 'q2_label': self.q2_label,
'q3_label': self.q3_label, 'q3_label': self.q3_label,
'q4_label': self.q4_label, 'q4_label': self.q4_label,
'default_claims_json': self.default_claims_json(),
'point_color_default': self.point_color_default, 'point_color_default': self.point_color_default,
'plot_label': self.plot_label, 'plot_label': self.plot_label,
'average_claims_json': self.average_claims_json(),
'point_color_average': self.point_color_average, 'point_color_average': self.point_color_average,
'overlay_data': self.overlay_data, 'overlay_data': self.overlay_data,
'hide_header': True, 'hide_header': True,
'claims': self.claims,
} }
def author_edit_view(self, context): def author_edit_view(self, context):
......
...@@ -127,7 +127,6 @@ class SliderBlock( ...@@ -127,7 +127,6 @@ class SliderBlock(
'id': self.name, 'id': self.name,
'type': self.CATEGORY, 'type': self.CATEGORY,
'question': self.question, 'question': self.question,
'initial_value': int(self.student_value*100) if self.student_value is not None else 50,
'min_label': self.min_label, 'min_label': self.min_label,
'max_label': self.max_label, 'max_label': self.max_label,
'title': self.display_name_with_default, 'title': self.display_name_with_default,
......
...@@ -164,7 +164,6 @@ class ScoreSummaryBlock(XBlockWithTranslationServiceMixin, XBlockWithPreviewMixi ...@@ -164,7 +164,6 @@ class ScoreSummaryBlock(XBlockWithTranslationServiceMixin, XBlockWithPreviewMixi
return { return {
'type': self.CATEGORY, 'type': self.CATEGORY,
'score_summary': context.get('score_summary', {}),
} }
embedded_student_view = student_view embedded_student_view = student_view
...@@ -216,12 +215,8 @@ class PerQuestionFeedbackBlock(XBlockWithTranslationServiceMixin, XBlockWithPrev ...@@ -216,12 +215,8 @@ class PerQuestionFeedbackBlock(XBlockWithTranslationServiceMixin, XBlockWithPrev
return Fragment(html) return Fragment(html)
def student_view_data(self, context=None): def student_view_data(self, context=None):
context = context or {}
review_tips = context.get('score_summary', {}).get('review_tips')
return { return {
'type': self.CATEGORY, 'type': self.CATEGORY,
'tips': review_tips
} }
embedded_student_view = student_view embedded_student_view = student_view
......
...@@ -48,9 +48,7 @@ class TestMentoringBlock(BlockWithChildrenTestMixin, unittest.TestCase): ...@@ -48,9 +48,7 @@ class TestMentoringBlock(BlockWithChildrenTestMixin, unittest.TestCase):
'show_title': False, 'show_title': False,
'weight': 5.0, 'weight': 5.0,
'max_attempts': 3, 'max_attempts': 3,
'num_attempts': 2,
'extended_feedback': True, 'extended_feedback': True,
'active_step': 0,
} }
step_builder = make_block(MentoringWithExplicitStepsBlock, step_builder_data) step_builder = make_block(MentoringWithExplicitStepsBlock, step_builder_data)
...@@ -96,10 +94,7 @@ class TestMentoringBlock(BlockWithChildrenTestMixin, unittest.TestCase): ...@@ -96,10 +94,7 @@ class TestMentoringBlock(BlockWithChildrenTestMixin, unittest.TestCase):
'show_title': step_builder_data['show_title'], 'show_title': step_builder_data['show_title'],
'weight': step_builder_data['weight'], 'weight': step_builder_data['weight'],
'max_attempts': step_builder_data['max_attempts'], 'max_attempts': step_builder_data['max_attempts'],
'num_attempts': step_builder_data['num_attempts'],
'extended_feedback': step_builder_data['extended_feedback'], 'extended_feedback': step_builder_data['extended_feedback'],
'active_step': step_builder_data['active_step'],
'hide_prev_answer': True,
'components': [ 'components': [
{ {
'type': 'sb-step', 'type': 'sb-step',
...@@ -115,7 +110,6 @@ class TestMentoringBlock(BlockWithChildrenTestMixin, unittest.TestCase): ...@@ -115,7 +110,6 @@ class TestMentoringBlock(BlockWithChildrenTestMixin, unittest.TestCase):
'components': [ 'components': [
{ {
'type': 'sb-review-score', 'type': 'sb-review-score',
'score_summary': {},
}, },
{ {
'type': 'sb-conditional-message', 'type': 'sb-conditional-message',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment