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
95b7f9b6
Commit
95b7f9b6
authored
Jun 03, 2014
by
Stephen Sanchez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing the ai step from staff debug, as well as exampl-based deadlines
parent
fe534349
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
12 deletions
+54
-12
apps/openassessment/workflow/api.py
+5
-1
apps/openassessment/workflow/test/test_api.py
+27
-4
apps/openassessment/xblock/staff_info_mixin.py
+3
-0
apps/openassessment/xblock/test/data/staff_dates_scenario.xml
+8
-0
apps/openassessment/xblock/test/test_staff_info.py
+11
-7
No files found.
apps/openassessment/workflow/api.py
View file @
95b7f9b6
...
...
@@ -387,6 +387,10 @@ def get_status_counts(course_id, item_id, steps):
]
"""
# The AI status exists for workflow logic, but no student will ever be in
# the AI status, so we should never return it.
statuses
=
steps
+
AssessmentWorkflow
.
STATUSES
if
'ai'
in
statuses
:
statuses
.
remove
(
'ai'
)
return
[
{
"status"
:
status
,
...
...
@@ -396,7 +400,7 @@ def get_status_counts(course_id, item_id, steps):
item_id
=
item_id
,
)
.
count
()
}
for
status
in
st
eps
+
AssessmentWorkflow
.
STATUSES
for
status
in
st
atuses
]
...
...
apps/openassessment/workflow/test/test_api.py
View file @
95b7f9b6
...
...
@@ -197,17 +197,25 @@ class TestAssessmentWorkflowApi(CacheResetTest):
def
test_get_status_counts
(
self
):
# Initially, the counts should all be zero
counts
=
workflow_api
.
get_status_counts
(
"test/1/1"
,
"peer-problem"
,
[
"peer"
,
"self"
])
counts
=
workflow_api
.
get_status_counts
(
"test/1/1"
,
"peer-problem"
,
[
"ai"
,
"training"
,
"peer"
,
"self"
]
)
self
.
assertEqual
(
counts
,
[
{
"status"
:
"training"
,
"count"
:
0
},
{
"status"
:
"peer"
,
"count"
:
0
},
{
"status"
:
"self"
,
"count"
:
0
},
{
"status"
:
"waiting"
,
"count"
:
0
},
{
"status"
:
"done"
,
"count"
:
0
},
])
self
.
assertFalse
(
"ai"
in
[
count
[
'status'
]
for
count
in
counts
])
# Create assessments with each status
# We're going to cheat a little bit by using the model objects
# directly, since the API does not provide access to the status directly.
self
.
_create_workflow_with_status
(
"user 1"
,
"test/1/1"
,
"peer-problem"
,
"training"
)
self
.
_create_workflow_with_status
(
"user 1"
,
"test/1/1"
,
"peer-problem"
,
"peer"
)
self
.
_create_workflow_with_status
(
"user 2"
,
"test/1/1"
,
"peer-problem"
,
"self"
)
self
.
_create_workflow_with_status
(
"user 3"
,
"test/1/1"
,
"peer-problem"
,
"self"
)
...
...
@@ -220,24 +228,39 @@ class TestAssessmentWorkflowApi(CacheResetTest):
self
.
_create_workflow_with_status
(
"user 10"
,
"test/1/1"
,
"peer-problem"
,
"done"
)
# Now the counts should be updated
counts
=
workflow_api
.
get_status_counts
(
"test/1/1"
,
"peer-problem"
,
[
"peer"
,
"self"
])
counts
=
workflow_api
.
get_status_counts
(
"test/1/1"
,
"peer-problem"
,
[
"ai"
,
"training"
,
"peer"
,
"self"
]
)
self
.
assertEqual
(
counts
,
[
{
"status"
:
"training"
,
"count"
:
1
},
{
"status"
:
"peer"
,
"count"
:
1
},
{
"status"
:
"self"
,
"count"
:
2
},
{
"status"
:
"waiting"
,
"count"
:
3
},
{
"status"
:
"done"
,
"count"
:
4
},
])
self
.
assertFalse
(
"ai"
in
[
count
[
'status'
]
for
count
in
counts
])
# Create a workflow in a different course, same user and item
# Counts should be the same
self
.
_create_workflow_with_status
(
"user 1"
,
"other_course"
,
"peer-problem"
,
"peer"
)
updated_counts
=
workflow_api
.
get_status_counts
(
"test/1/1"
,
"peer-problem"
,
[
"peer"
,
"self"
])
updated_counts
=
workflow_api
.
get_status_counts
(
"test/1/1"
,
"peer-problem"
,
[
"ai"
,
"training"
,
"peer"
,
"self"
]
)
self
.
assertEqual
(
counts
,
updated_counts
)
# Create a workflow in the same course, different item
# Counts should be the same
self
.
_create_workflow_with_status
(
"user 1"
,
"test/1/1"
,
"other problem"
,
"peer"
)
updated_counts
=
workflow_api
.
get_status_counts
(
"test/1/1"
,
"peer-problem"
,
[
"peer"
,
"self"
])
updated_counts
=
workflow_api
.
get_status_counts
(
"test/1/1"
,
"peer-problem"
,
[
"ai"
,
"training"
,
"peer"
,
"self"
]
)
self
.
assertEqual
(
counts
,
updated_counts
)
def
_create_workflow_with_status
(
self
,
student_id
,
course_id
,
item_id
,
status
,
answer
=
"answer"
):
...
...
apps/openassessment/xblock/staff_info_mixin.py
View file @
95b7f9b6
...
...
@@ -68,6 +68,9 @@ class StaffInfoMixin(object):
steps
=
[
'submission'
]
+
self
.
assessment_steps
for
step
in
steps
:
if
step
==
'example-based-assessment'
:
continue
# Get the dates as a student would see them
__
,
__
,
start_date
,
due_date
=
self
.
is_closed
(
step
=
step
,
course_staff
=
False
)
...
...
apps/openassessment/xblock/test/data/staff_dates_scenario.xml
View file @
95b7f9b6
...
...
@@ -84,6 +84,14 @@
</criterion>
</rubric>
<assessments>
<assessment
name=
"example-based-assessment"
algorithm_id=
"fake"
>
<example>
<answer>
Example Answer One
</answer>
<select
criterion=
"Form"
option=
"Reddit"
/>
<select
criterion=
"Clear-headed"
option=
"Yogi Berra"
/>
<select
criterion=
"Concise"
option=
"HP Lovecraft"
/>
</example>
</assessment>
<assessment
name=
"peer-assessment"
must_grade=
"5"
must_be_graded_by=
"3"
start=
"2015-01-02"
due=
"2015-04-01"
/>
<assessment
name=
"self-assessment"
start=
"2016-01-02"
due=
"2016-04-01"
/>
</assessments>
...
...
apps/openassessment/xblock/test/test_staff_info.py
View file @
95b7f9b6
...
...
@@ -147,17 +147,21 @@ class TestCourseStaff(XBlockHandlerTestCase):
# Verify that we can render without error
resp
=
self
.
request
(
xblock
,
'render_staff_info'
,
json
.
dumps
({}))
self
.
assertIn
(
"course staff information"
,
resp
.
decode
(
'utf-8'
)
.
lower
())
decoded_response
=
resp
.
decode
(
'utf-8'
)
.
lower
()
self
.
assertIn
(
"course staff information"
,
decoded_response
)
# Confirm example-based-assessment does not show up; it is not date
# driven so its start / due dates are not relevant
self
.
assertNotIn
(
"example-based-assessment"
,
decoded_response
)
# Check all release dates.
self
.
assertIn
(
"march 1, 2014"
,
resp
.
decode
(
'utf-8'
)
.
lower
()
)
self
.
assertIn
(
"jan. 2, 2015"
,
resp
.
decode
(
'utf-8'
)
.
lower
()
)
self
.
assertIn
(
"jan. 2, 2016"
,
resp
.
decode
(
'utf-8'
)
.
lower
()
)
self
.
assertIn
(
"march 1, 2014"
,
decoded_response
)
self
.
assertIn
(
"jan. 2, 2015"
,
decoded_response
)
self
.
assertIn
(
"jan. 2, 2016"
,
decoded_response
)
# Check all due dates.
self
.
assertIn
(
"april 1, 2014"
,
resp
.
decode
(
'utf-8'
)
.
lower
()
)
self
.
assertIn
(
"april 1, 2015"
,
resp
.
decode
(
'utf-8'
)
.
lower
()
)
self
.
assertIn
(
"april 1, 2016"
,
resp
.
decode
(
'utf-8'
)
.
lower
()
)
self
.
assertIn
(
"april 1, 2014"
,
decoded_response
)
self
.
assertIn
(
"april 1, 2015"
,
decoded_response
)
self
.
assertIn
(
"april 1, 2016"
,
decoded_response
)
@scenario
(
'data/basic_scenario.xml'
,
user_id
=
'Bob'
)
def
test_staff_debug_dates_distant_past_and_future
(
self
,
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