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
c111e009
Commit
c111e009
authored
Feb 10, 2015
by
muzaffaryousaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing the bugs and UI/texts.
TNL-1354
parent
26025e0c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
14 deletions
+32
-14
openassessment/assessment/api/peer.py
+3
-2
openassessment/assessment/test/test_peer.py
+12
-0
openassessment/templates/openassessmentblock/grade/oa_grade_cancelled.html
+10
-5
openassessment/templates/openassessmentblock/staff_debug/student_info.html
+2
-2
openassessment/xblock/staff_info_mixin.py
+4
-4
openassessment/xblock/test/test_staff_info.py
+1
-1
No files found.
openassessment/assessment/api/peer.py
View file @
c111e009
...
...
@@ -985,8 +985,9 @@ def on_cancel(submission_uuid):
"""
try
:
workflow
=
PeerWorkflow
.
get_by_submission_uuid
(
submission_uuid
)
workflow
.
cancelled_at
=
timezone
.
now
()
workflow
.
save
()
if
workflow
:
workflow
.
cancelled_at
=
timezone
.
now
()
workflow
.
save
()
except
(
PeerAssessmentWorkflowError
,
DatabaseError
):
error_message
=
(
u"An internal error occurred while cancelling the peer"
...
...
openassessment/assessment/test/test_peer.py
View file @
c111e009
...
...
@@ -965,6 +965,18 @@ class TestPeerApi(CacheResetTest):
workflow
=
PeerWorkflow
.
get_by_submission_uuid
(
buffy_sub
[
"uuid"
])
self
.
assertTrue
(
workflow
.
is_cancelled
)
def
test_cancel_submission_when_peerworkflow_does_not_exist
(
self
):
new_student_item
=
STUDENT_ITEM
.
copy
()
new_student_item
[
"student_id"
]
=
"Buffy"
submission
=
sub_api
.
create_submission
(
new_student_item
,
"Buffy Answer"
)
peer_api
.
on_cancel
(
submission
[
'uuid'
])
# Check for a workflow for Buffy.
# It should be None
buffy_workflow
=
PeerWorkflow
.
get_by_submission_uuid
(
submission
[
'uuid'
])
self
.
assertIsNone
(
buffy_workflow
)
def
test_get_workflow_by_uuid
(
self
):
buffy_answer
,
_
=
self
.
_create_student_and_submission
(
"Buffy"
,
"Buffy's answer"
)
self
.
_create_student_and_submission
(
"Xander"
,
"Xander's answer"
)
...
...
openassessment/templates/openassessmentblock/grade/oa_grade_cancelled.html
View file @
c111e009
...
...
@@ -7,11 +7,16 @@
<span
class=
"step__label"
>
{% trans "Your Grade" %}:
</span>
<span
class=
"grade__value"
>
<span
class=
"grade__value__title"
>
{% with points_earned_string=score.points_earned|stringformat:"s" points_possible_string=score.points_possible|stringformat:"s" %}
{% blocktrans with points_earned='
<span
class=
"grade__value__earned"
>
'|safe|add:points_earned_string|add:'
</span>
'|safe points_possible='
<span
class=
"grade__value__potential"
>
'|safe|add:points_possible_string|add:'
</span>
'|safe %}
{{ points_earned }} out of {{ points_possible }}
{% endblocktrans %}
{% endwith %}
{% if score %}
{% with points_earned_string=score.points_earned|stringformat:"s" points_possible_string=score.points_possible|stringformat:"s" %}
{% blocktrans with points_earned='
<span
class=
"grade__value__earned"
>
'|safe|add:points_earned_string|add:'
</span>
'|safe points_possible='
<span
class=
"grade__value__potential"
>
'|safe|add:points_possible_string|add:'
</span>
'|safe %}
{{ points_earned }} out of {{ points_possible }}
{% endblocktrans %}
{% endwith %}
{% else %}
<!--When submission is cancelled right after the response submitted, the score would be 0.-->
0
{% endif %}
</span>
</span>
</span>
...
...
openassessment/templates/openassessmentblock/staff_debug/student_info.html
View file @
c111e009
...
...
@@ -41,7 +41,7 @@
<div
class=
"ui-staff ui-toggle-visibility is--collapsed"
>
<h2
class=
"staff-info__title ui-staff__title ui-toggle-visibility__control"
>
<i
class=
"ico icon-caret-right"
></i>
<span
class=
"staff-info__title__copy"
>
{% trans "Remove submission from peer grading" %}
</span>
<span>
{% trans "Remove submission from peer grading" %}
</span>
</h2>
<div
class=
"staff-info__cancel-submission__content ui-toggle-visibility__content"
>
...
...
@@ -55,7 +55,7 @@
<li>
<div
class=
"has--warnings"
>
<div
class=
"warning"
>
{% trans "Caution: Removing a student's submission
is irreversible. It should only be used in cases where the student's submission was inappropriat
e." %}
{% trans "Caution: Removing a student's submission
cannot be undon
e." %}
</div>
</div>
</li>
...
...
openassessment/xblock/staff_info_mixin.py
View file @
c111e009
...
...
@@ -375,10 +375,10 @@ class StaffInfoMixin(object):
cancelled_by_id
=
student_item_dict
[
'student_id'
],
assessment_requirements
=
assessment_requirements
)
return
{
"success"
:
True
,
'msg'
:
self
.
_
(
u"
Student submission was removed from the peer grading pool.
"
u"
If you'd like to allow the student to submit a new response,
"
u"
please also reset the student state of the problem from
"
u"
the Instructor Dashboard
."
)}
return
{
"success"
:
True
,
'msg'
:
self
.
_
(
u"
The student submission has been removed from peer assessment.
"
u"
The student receives a grade of zero unless you reset
"
u"
the student's attempts for the problem to allow them to
"
u"
resubmit a response
."
)}
except
(
AssessmentWorkflowError
,
AssessmentWorkflowInternalError
...
...
openassessment/xblock/test/test_staff_info.py
View file @
c111e009
...
...
@@ -615,7 +615,7 @@ class TestCourseStaff(XBlockHandlerTestCase):
# Verify that we can render without error
params
=
{
"submission_uuid"
:
submission
[
"uuid"
],
"comments"
:
"Inappropriate language."
}
resp
=
self
.
request
(
xblock
,
'cancel_submission'
,
json
.
dumps
(
params
),
response_format
=
'json'
)
self
.
assertIn
(
"
Student submission was removed from the
"
,
resp
[
'msg'
])
self
.
assertIn
(
"
The student submission has been removed from peer
"
,
resp
[
'msg'
])
self
.
assertEqual
(
True
,
resp
[
'success'
])
def
_create_mock_runtime
(
self
,
item_id
,
is_staff
,
is_admin
,
anonymous_user_id
):
...
...
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