Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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
edx
edx-ora2
Commits
246cdeec
Commit
246cdeec
authored
Feb 06, 2017
by
Dmitry Viskov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New OraAggregateData.collect_ora2_responses method
parent
4abd0ef8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
2 deletions
+97
-2
AUTHORS
+1
-0
openassessment/data.py
+40
-0
openassessment/tests/test_data.py
+56
-2
No files found.
AUTHORS
View file @
246cdeec
...
...
@@ -25,3 +25,4 @@ Eric Fischer <efischer@edx.org>
Andy Armstrong <andya@edx.org>
Christina Roberts <christina@edx.org>
Mushtaq Ali <mushtaak@gmail.com>
Dmitry Viskov <dmitry.viskov@webenterprise.ru>
openassessment/data.py
View file @
246cdeec
...
...
@@ -495,3 +495,43 @@ class OraAggregateData(object):
'Feedback on Peer Assessments'
]
return
header
,
rows
@classmethod
def
collect_ora2_responses
(
cls
,
course_id
):
"""
Get information about all ora2 blocks in the course with response count for each step
Args:
course_id (string) - the course id of the course whose data we would like to return
Returns:
A dict in the format:
{
'block-v1:test-org+cs101+2017_TEST+type@openassessment+block@fb668396b505470e914bad8b3178e9e7:
{'training': 0, 'self': 0, 'done': 2, 'peer': 1, 'staff': 0, 'total': 3},
'block-v1:test-org+cs101+2017_TEST+type@openassessment+block@90b4edff50bc47d9ba037a3180c44e97:
{'training': 0, 'self': 2, 'done': 0, 'peer': 0, 'staff': 2, 'total': 4},
...
}
"""
except_statuses
=
[
'ai'
,
'cancelled'
]
statuses
=
[
st
for
st
in
AssessmentWorkflow
()
.
STATUS_VALUES
if
st
not
in
except_statuses
]
statuses
.
append
(
'total'
)
items
=
AssessmentWorkflow
.
objects
.
filter
(
course_id
=
course_id
)
.
values
(
'item_id'
,
'status'
)
result
=
{}
for
item
in
items
:
item_id
=
item
[
'item_id'
]
status
=
item
[
'status'
]
if
item_id
not
in
result
:
result
[
item_id
]
=
{}
for
st
in
statuses
:
result
[
item_id
][
st
]
=
0
if
status
in
statuses
:
result
[
item_id
][
status
]
+=
1
result
[
item_id
][
'total'
]
+=
1
return
result
openassessment/tests/test_data.py
View file @
246cdeec
...
...
@@ -20,10 +20,14 @@ import openassessment.assessment.api.peer as peer_api
COURSE_ID
=
"Test_Course"
STUDENT_ID
=
"Student"
STUDENT_ID2
=
"Student2"
STUDENT_ID3
=
"Student3"
SCORER_ID
=
"Scorer"
ITEM_ID
=
"item_one"
ITEM_ID2
=
"item_two"
ITEM_ID3
=
"item_three"
STUDENT_ITEM
=
dict
(
student_id
=
STUDENT_ID
,
...
...
@@ -376,14 +380,14 @@ class TestOraAggregateDataIntegration(TransactionCacheResetTest):
peer_api
.
get_score
(
self
.
submission
[
'uuid'
],
{
'must_be_graded_by'
:
1
,
'must_grade'
:
0
})
self
.
_create_assessment_feedback
(
self
.
submission
[
'uuid'
])
def
_create_submission
(
self
,
student_item_dict
):
def
_create_submission
(
self
,
student_item_dict
,
steps
=
None
):
"""
Creates a submission and initializes a peer grading workflow.
"""
submission
=
sub_api
.
create_submission
(
student_item_dict
,
ANSWER
)
submission_uuid
=
submission
[
'uuid'
]
peer_api
.
on_start
(
submission_uuid
)
workflow_api
.
create_workflow
(
submission_uuid
,
STEPS
)
workflow_api
.
create_workflow
(
submission_uuid
,
steps
if
steps
else
STEPS
)
return
submission
def
_create_assessment
(
self
,
submission_uuid
):
...
...
@@ -474,3 +478,53 @@ class TestOraAggregateDataIntegration(TransactionCacheResetTest):
FEEDBACK_OPTIONS
[
'options'
][
0
]
+
'
\n
'
+
FEEDBACK_OPTIONS
[
'options'
][
1
]
+
'
\n
'
,
FEEDBACK_TEXT
,
])
def
test_collect_ora2_responses
(
self
):
self
.
_create_submission
(
dict
(
student_id
=
STUDENT_ID
,
course_id
=
COURSE_ID
,
item_id
=
ITEM_ID2
,
item_type
=
"openassessment"
),
[
'self'
])
self
.
_create_submission
(
dict
(
student_id
=
STUDENT_ID2
,
course_id
=
COURSE_ID
,
item_id
=
ITEM_ID2
,
item_type
=
"openassessment"
),
STEPS
)
self
.
_create_submission
(
dict
(
student_id
=
STUDENT_ID
,
course_id
=
COURSE_ID
,
item_id
=
ITEM_ID3
,
item_type
=
"openassessment"
),
[
'self'
])
self
.
_create_submission
(
dict
(
student_id
=
STUDENT_ID2
,
course_id
=
COURSE_ID
,
item_id
=
ITEM_ID3
,
item_type
=
"openassessment"
),
[
'self'
])
self
.
_create_submission
(
dict
(
student_id
=
STUDENT_ID3
,
course_id
=
COURSE_ID
,
item_id
=
ITEM_ID3
,
item_type
=
"openassessment"
),
STEPS
)
data
=
OraAggregateData
.
collect_ora2_responses
(
COURSE_ID
)
self
.
assertIn
(
ITEM_ID
,
data
)
self
.
assertIn
(
ITEM_ID2
,
data
)
self
.
assertIn
(
ITEM_ID3
,
data
)
for
item
in
[
ITEM_ID
,
ITEM_ID2
,
ITEM_ID3
]:
self
.
assertEqual
({
'total'
,
'training'
,
'peer'
,
'self'
,
'staff'
,
'waiting'
,
'done'
},
set
(
data
[
item
]
.
keys
()))
self
.
assertEqual
(
data
[
ITEM_ID
],
{
'total'
:
2
,
'training'
:
0
,
'peer'
:
2
,
'self'
:
0
,
'staff'
:
0
,
'waiting'
:
0
,
'done'
:
0
})
self
.
assertEqual
(
data
[
ITEM_ID2
],
{
'total'
:
2
,
'training'
:
0
,
'peer'
:
1
,
'self'
:
1
,
'staff'
:
0
,
'waiting'
:
0
,
'done'
:
0
})
self
.
assertEqual
(
data
[
ITEM_ID3
],
{
'total'
:
3
,
'training'
:
0
,
'peer'
:
1
,
'self'
:
2
,
'staff'
:
0
,
'waiting'
:
0
,
'done'
:
0
})
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