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
d27e5702
Commit
d27e5702
authored
Oct 05, 2017
by
Jillian Vogel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MCKIN-6092 Adds score_summary (and review_tips)
to the data returned by Step Builder student_view_user_state
parent
df221117
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
doc/Native APIs.md
+16
-0
problem_builder/mentoring.py
+1
-0
problem_builder/mixins.py
+2
-3
No files found.
doc/Native APIs.md
View file @
d27e5702
...
@@ -124,6 +124,22 @@ contains these additional fields:
...
@@ -124,6 +124,22 @@ contains these additional fields:
- `active_step`: (integer) The index of the step which is currently
- `active_step`: (integer) The index of the step which is currently
active. Starts at zero.
active. Starts at zero.
- `score_summary`: (object) Contains the user's score information for their completed attempts.
If no attempts have been completed yet, then this object will be empty (`{}`).
If one or more attempts have been made, then this object will contain:
- `correct`: (array) list of questions that were answered correctly.
- `correct_answers`: (integer) Number of questions answered correctly.
- `incorrect`: (array) list of questions that were answered incorrectly.
- `incorrect_answers`: (integer) Number of questions answered incorrectly.
- `partial`: (array) list of questions that were answered partially correctly.
- `partially_correct_answers`: (integer) Number of questions answered partially correctly.
- `review_tips`: (array) List of review tips for each question answered incorrectly, where provided.
- `score`: (integer) Total points earned for the problems in the step builder, weighted for each step.
- `complete`: (boolean) True if all problems were answered correctly.
- `max_attempts_reached`: (boolean) True if the maximum number of attempts has been reached.
- `show_extended_review`: (boolean) True if extended feedback is configured, and the maximum
number of attempts has been reached.
### Custom Handlers
### Custom Handlers
...
...
problem_builder/mentoring.py
View file @
d27e5702
...
@@ -974,6 +974,7 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes
...
@@ -974,6 +974,7 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes
def
build_user_state_data
(
self
,
context
=
None
):
def
build_user_state_data
(
self
,
context
=
None
):
user_state_data
=
super
(
MentoringWithExplicitStepsBlock
,
self
)
.
build_user_state_data
()
user_state_data
=
super
(
MentoringWithExplicitStepsBlock
,
self
)
.
build_user_state_data
()
user_state_data
[
'active_step'
]
=
self
.
active_step_safe
user_state_data
[
'active_step'
]
=
self
.
active_step_safe
user_state_data
[
'score_summary'
]
=
self
.
get_score_summary
()
return
user_state_data
return
user_state_data
@lazy
@lazy
...
...
problem_builder/mixins.py
View file @
d27e5702
...
@@ -206,7 +206,7 @@ class StudentViewUserStateMixin(object):
...
@@ -206,7 +206,7 @@ class StudentViewUserStateMixin(object):
def
build_user_state_data
(
self
,
context
=
None
):
def
build_user_state_data
(
self
,
context
=
None
):
"""
"""
Returns a dictionary of the student data of this XBlock,
Returns a dictionary of the student data of this XBlock,
retrievable from the
Course Block API
.
retrievable from the
student_view_user_state XBlock handler
.
"""
"""
result
=
{}
result
=
{}
...
@@ -231,8 +231,7 @@ class StudentViewUserStateMixin(object):
...
@@ -231,8 +231,7 @@ class StudentViewUserStateMixin(object):
@XBlock.handler
@XBlock.handler
def
student_view_user_state
(
self
,
context
=
None
,
suffix
=
''
):
def
student_view_user_state
(
self
,
context
=
None
,
suffix
=
''
):
"""
"""
Returns a JSON representation of the student data of this XBlock,
Returns a JSON representation of the student data of this XBlock.
retrievable from the Course Block API.
"""
"""
result
=
self
.
build_user_state_data
(
context
)
result
=
self
.
build_user_state_data
(
context
)
json_result
=
json
.
dumps
(
result
,
cls
=
DateTimeEncoder
)
json_result
=
json
.
dumps
(
result
,
cls
=
DateTimeEncoder
)
...
...
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