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
8ba19555
Commit
8ba19555
authored
Nov 13, 2015
by
cahrens
Committed by
Andy Armstrong
Nov 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bok choy test for removing student response.
parent
145c8c16
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
8 deletions
+65
-8
test/acceptance/pages.py
+19
-2
test/acceptance/tests.py
+46
-6
No files found.
test/acceptance/pages.py
View file @
8ba19555
...
...
@@ -465,19 +465,36 @@ class StaffAreaPage(OpenAssessmentPage, AssessmentMixin):
"""
Returns the final score displayed in the learner report.
"""
return
int
(
self
.
q
(
css
=
self
.
_bounded_selector
(
".grade__value__earned"
))
.
text
[
0
])
score
=
self
.
q
(
css
=
self
.
_bounded_selector
(
".staff-info__student__grade .ui-toggle-visibility__content"
))
if
len
(
score
)
==
0
:
return
None
return
score
.
text
[
0
]
def
verify_learner_final_score
(
self
,
expected_score
):
"""
Verifies that the final score in the learner report is equal to the expected
_scor
e.
Verifies that the final score in the learner report is equal to the expected
valu
e.
"""
EmptyPromise
(
lambda
:
self
.
learner_final_score
==
expected_score
,
"Learner score is updated"
)
.
fulfill
()
@property
def
learner_response
(
self
):
return
self
.
q
(
css
=
self
.
_bounded_selector
(
".staff-info__student__response .ui-toggle-visibility__content"
)
)
.
text
[
0
]
def
submit_assessment
(
self
):
"""
Submit a staff assessment of the problem.
"""
self
.
submit
(
button_css
=
".wrapper--staff-assessment .action--submit"
)
def
cancel_submission
(
self
):
"""
Cancel a learner's assessment.
"""
# Must put a comment to enable the submit button.
self
.
q
(
css
=
self
.
_bounded_selector
(
"textarea.cancel_submission_comments"
))
.
fill
(
"comment"
)
self
.
submit
(
button_css
=
".action--submit-cancel-submission"
)
test/acceptance/tests.py
View file @
8ba19555
...
...
@@ -341,7 +341,6 @@ class StaffAreaTest(OpenAssessmentTest):
self
.
staff_area_page
.
show_learner
(
'no-submission-learner'
)
self
.
staff_area_page
.
verify_learner_report_text
(
'A response was not found for this learner.'
)
@retry
()
@attr
(
'acceptance'
)
def
test_staff_override
(
self
):
...
...
@@ -360,18 +359,59 @@ class StaffAreaTest(OpenAssessmentTest):
# Click on staff tools and search for user
self
.
staff_area_page
.
show_learner
(
username
)
self
.
staff_area_page
.
expand_learner_report_sections
()
# Check the learner's current score.
self
.
assertEqual
(
self
.
staff_area_page
.
learner_final_score
,
self
.
EXPECTED_SCORE
)
self
.
staff_area_page
.
expand_learner_report_sections
()
self
.
staff_area_page
.
verify_learner_final_score
(
"Final grade: 6 out of 8"
)
# Do staff override and wait for final score to change.
self
.
staff_area_page
.
assess
([
0
,
1
])
# Verify that the new student score is different from the original one.
self
.
assertNotEqual
(
1
,
self
.
EXPECTED_SCORE
)
# TODO: this is expected to fail until the regrading API is hooked up.
# self.staff_area_page.verify_learner_final_score(1)
# TODO: uncomment this after hooked up to the API. Also verify other state if appropriate.
# self.staff_area_page.verify_learner_final_score("Final grade: 1 out of 8")
@retry
()
@attr
(
'acceptance'
)
def
test_cancel_submission
(
self
):
"""
Scenario: staff can cancel a learner's submission
Given I am viewing the staff area of an ORA problem
When I search for a learner in staff tools
And the learner has submitted a response to an ORA problem with self-assessment
Then I can cancel the learner's submission
And I see an updated message indicating that the submission has been canceled.
"""
username
=
self
.
do_self_assessment
()
self
.
staff_area_page
.
visit
()
# Click on staff tools and search for user
self
.
staff_area_page
.
show_learner
(
username
)
# Check the learner's current score.
self
.
staff_area_page
.
expand_learner_report_sections
()
self
.
staff_area_page
.
verify_learner_final_score
(
"Final grade: 6 out of 8"
)
# Cancel the student submission
self
.
staff_area_page
.
cancel_submission
()
self
.
staff_area_page
.
verify_learner_final_score
(
"The learner's submission has been removed from peer assessment. "
"The learner receives a grade of zero unless you reset the learner's attempts for the "
"problem to allow them to resubmit a response."
)
# Verify that the staff override and submission removal sections are now gone.
self
.
assertEqual
(
[
u'Learner Response'
,
u"Learner's Self Assessment"
,
u"Learner's Final Grade"
],
self
.
staff_area_page
.
learner_report_sections
)
# Verify that the Learner Response has been replaced with a message about the removal
self
.
staff_area_page
.
expand_learner_report_sections
()
self
.
assertIn
(
"Learner submission removed"
,
self
.
staff_area_page
.
learner_response
)
class
FileUploadTest
(
OpenAssessmentTest
):
...
...
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