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
b7e87326
Commit
b7e87326
authored
May 08, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #319 from edx/will/assessment-package-refactor-2
Assessment app restructure (part 2)
parents
18a2a788
717140f2
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
141 additions
and
113 deletions
+141
-113
apps/openassessment/assessment/api/__init__.py
+0
-0
apps/openassessment/assessment/api/peer.py
+1
-1
apps/openassessment/assessment/api/self.py
+1
-1
apps/openassessment/assessment/errors/__init__.py
+8
-0
apps/openassessment/assessment/errors/peer.py
+2
-27
apps/openassessment/assessment/errors/self.py
+26
-0
apps/openassessment/assessment/serializers/__init__.py
+8
-0
apps/openassessment/assessment/serializers/base.py
+1
-68
apps/openassessment/assessment/serializers/peer.py
+73
-0
apps/openassessment/assessment/test/test_peer.py
+1
-1
apps/openassessment/assessment/test/test_self.py
+1
-1
apps/openassessment/assessment/views.py
+1
-1
apps/openassessment/management/commands/create_oa_submissions.py
+2
-1
apps/openassessment/management/tests/test_create_oa_submissions.py
+2
-1
apps/openassessment/workflow/api.py
+1
-1
apps/openassessment/workflow/models.py
+4
-2
apps/openassessment/xblock/grade_mixin.py
+2
-2
apps/openassessment/xblock/peer_assessment_mixin.py
+2
-2
apps/openassessment/xblock/self_assessment_mixin.py
+1
-1
apps/openassessment/xblock/test/test_grade.py
+2
-1
apps/openassessment/xblock/test/test_peer.py
+1
-1
apps/openassessment/xblock/test/test_self.py
+1
-1
No files found.
apps/openassessment/assessment/api/__init__.py
0 → 100644
View file @
b7e87326
apps/openassessment/assessment/
peer_api
.py
→
apps/openassessment/assessment/
api/peer
.py
View file @
b7e87326
...
...
@@ -24,7 +24,7 @@ from openassessment.assessment.errors import (
)
from
submissions
import
api
as
sub_api
logger
=
logging
.
getLogger
(
"openassessment.assessment.
peer_api
"
)
logger
=
logging
.
getLogger
(
"openassessment.assessment.
api.peer
"
)
PEER_TYPE
=
"PE"
...
...
apps/openassessment/assessment/
self_api
.py
→
apps/openassessment/assessment/
api/self
.py
View file @
b7e87326
...
...
@@ -22,7 +22,7 @@ from openassessment.assessment.errors import (
# Assessments are tagged as "self-evaluation"
SELF_TYPE
=
"SE"
logger
=
logging
.
getLogger
(
"openassessment.assessment.
self_api
"
)
logger
=
logging
.
getLogger
(
"openassessment.assessment.
api.self
"
)
def
create_assessment
(
submission_uuid
,
user_id
,
options_selected
,
rubric_dict
,
scored_at
=
None
):
...
...
apps/openassessment/assessment/errors/__init__.py
0 → 100644
View file @
b7e87326
"""
Export errors from all modules defined in this package.
"""
# pylint:disable=W0401
from
.peer
import
*
from
.self
import
*
apps/openassessment/assessment/errors.py
→
apps/openassessment/assessment/errors
/peer
.py
View file @
b7e87326
"""
Errors for the
assessment app
.
Errors for the
peer assessment
.
"""
import
copy
...
...
@@ -23,7 +23,7 @@ class PeerAssessmentRequestError(PeerAssessmentError):
"""
def
__init__
(
self
,
field_errors
):
Exception
.
__init__
(
self
,
repr
(
field_errors
))
super
(
PeerAssessmentRequestError
,
self
)
.
__init__
(
repr
(
field_errors
))
self
.
field_errors
=
copy
.
deepcopy
(
field_errors
)
...
...
@@ -45,28 +45,3 @@ class PeerAssessmentInternalError(PeerAssessmentError):
"""
pass
class
SelfAssessmentError
(
Exception
):
"""Generic Self Assessment Error
Raised when an error occurs while processing a request related to the
Self Assessment Workflow.
"""
pass
class
SelfAssessmentRequestError
(
SelfAssessmentError
):
"""
There was a problem with the request for a self-assessment.
"""
pass
class
SelfAssessmentInternalError
(
SelfAssessmentError
):
"""
There was an internal problem while accessing the self-assessment api.
"""
pass
apps/openassessment/assessment/errors/self.py
0 → 100644
View file @
b7e87326
"""
Errors for self-assessment
"""
class
SelfAssessmentError
(
Exception
):
"""Generic Self Assessment Error
Raised when an error occurs while processing a request related to the
Self Assessment Workflow.
"""
pass
class
SelfAssessmentRequestError
(
SelfAssessmentError
):
"""
There was a problem with the request for a self-assessment.
"""
pass
class
SelfAssessmentInternalError
(
SelfAssessmentError
):
"""
There was an internal problem while accessing the self-assessment api.
"""
pass
apps/openassessment/assessment/serializers/__init__.py
0 → 100644
View file @
b7e87326
"""
Export serializers from each module in this package.
"""
# pylint: disable=W0401
from
.base
import
*
from
.peer
import
*
apps/openassessment/assessment/serializers.py
→
apps/openassessment/assessment/serializers
/base
.py
View file @
b7e87326
# coding=utf-8
"""
Serializers are created to ensure models do not have to be accessed outside the
scope of the Tim APIs.
Serializers common to all assessment types.
"""
from
copy
import
deepcopy
import
logging
...
...
@@ -10,8 +9,6 @@ from django.core.cache import cache
from
rest_framework
import
serializers
from
openassessment.assessment.models
import
(
Assessment
,
AssessmentPart
,
Criterion
,
CriterionOption
,
Rubric
,
AssessmentFeedback
,
AssessmentFeedbackOption
,
PeerWorkflowItem
,
PeerWorkflow
)
...
...
@@ -321,67 +318,3 @@ def rubric_from_dict(rubric_dict):
rubric
=
rubric_serializer
.
save
()
return
rubric
class
AssessmentFeedbackOptionSerializer
(
serializers
.
ModelSerializer
):
"""
Serialize an `AssessmentFeedbackOption` model.
"""
class
Meta
:
model
=
AssessmentFeedbackOption
fields
=
(
'text'
,)
class
AssessmentFeedbackSerializer
(
serializers
.
ModelSerializer
):
"""
Serialize feedback in response to an assessment.
"""
assessments
=
AssessmentSerializer
(
many
=
True
,
default
=
None
,
required
=
False
)
options
=
AssessmentFeedbackOptionSerializer
(
many
=
True
,
default
=
None
,
required
=
False
)
class
Meta
:
model
=
AssessmentFeedback
fields
=
(
'submission_uuid'
,
'feedback_text'
,
'assessments'
,
'options'
)
class
PeerWorkflowSerializer
(
serializers
.
ModelSerializer
):
"""Representation of the PeerWorkflow.
A PeerWorkflow should not be exposed to the front end of any question. This
model should only be exposed externally for administrative views, in order
to visualize the Peer Workflow.
"""
class
Meta
:
model
=
PeerWorkflow
fields
=
(
'student_id'
,
'item_id'
,
'course_id'
,
'submission_uuid'
,
'created_at'
,
'completed_at'
)
class
PeerWorkflowItemSerializer
(
serializers
.
ModelSerializer
):
"""Representation of the PeerWorkflowItem
As with the PeerWorkflow, this should not be exposed to the front end. This
should only be used to visualize the Peer Workflow in an administrative
view.
"""
class
Meta
:
model
=
PeerWorkflowItem
fields
=
(
'scorer'
,
'author'
,
'submission_uuid'
,
'started_at'
,
'assessment'
,
'scored'
)
apps/openassessment/assessment/serializers/peer.py
0 → 100644
View file @
b7e87326
"""
Serializers specific to peer assessment.
"""
from
rest_framework
import
serializers
from
.base
import
AssessmentSerializer
from
openassessment.assessment.models
import
(
AssessmentFeedback
,
AssessmentFeedbackOption
,
PeerWorkflow
,
PeerWorkflowItem
)
class
AssessmentFeedbackOptionSerializer
(
serializers
.
ModelSerializer
):
"""
Serialize an `AssessmentFeedbackOption` model.
"""
class
Meta
:
model
=
AssessmentFeedbackOption
fields
=
(
'text'
,)
class
AssessmentFeedbackSerializer
(
serializers
.
ModelSerializer
):
"""
Serialize feedback in response to an assessment.
"""
assessments
=
AssessmentSerializer
(
many
=
True
,
default
=
None
,
required
=
False
)
options
=
AssessmentFeedbackOptionSerializer
(
many
=
True
,
default
=
None
,
required
=
False
)
class
Meta
:
model
=
AssessmentFeedback
fields
=
(
'submission_uuid'
,
'feedback_text'
,
'assessments'
,
'options'
)
class
PeerWorkflowSerializer
(
serializers
.
ModelSerializer
):
"""Representation of the PeerWorkflow.
A PeerWorkflow should not be exposed to the front end of any question. This
model should only be exposed externally for administrative views, in order
to visualize the Peer Workflow.
"""
class
Meta
:
model
=
PeerWorkflow
fields
=
(
'student_id'
,
'item_id'
,
'course_id'
,
'submission_uuid'
,
'created_at'
,
'completed_at'
)
class
PeerWorkflowItemSerializer
(
serializers
.
ModelSerializer
):
"""Representation of the PeerWorkflowItem
As with the PeerWorkflow, this should not be exposed to the front end. This
should only be used to visualize the Peer Workflow in an administrative
view.
"""
class
Meta
:
model
=
PeerWorkflowItem
fields
=
(
'scorer'
,
'author'
,
'submission_uuid'
,
'started_at'
,
'assessment'
,
'scored'
)
apps/openassessment/assessment/test/test_peer.py
View file @
b7e87326
...
...
@@ -9,7 +9,7 @@ from mock import patch
from
nose.tools
import
raises
from
openassessment.test_utils
import
CacheResetTest
from
openassessment.assessment
import
peer_api
from
openassessment.assessment
.api
import
peer
as
peer_api
from
openassessment.assessment.models
import
(
Assessment
,
AssessmentPart
,
AssessmentFeedback
,
PeerWorkflow
,
PeerWorkflowItem
...
...
apps/openassessment/assessment/test/test_self.py
View file @
b7e87326
...
...
@@ -8,7 +8,7 @@ import datetime
import
pytz
from
openassessment.test_utils
import
CacheResetTest
from
submissions.api
import
create_submission
from
openassessment.assessment.
self_api
import
(
from
openassessment.assessment.
api.self
import
(
create_assessment
,
submitter_is_finished
,
get_assessment
)
from
openassessment.assessment.errors
import
SelfAssessmentRequestError
...
...
apps/openassessment/assessment/views.py
View file @
b7e87326
...
...
@@ -2,7 +2,7 @@ import logging
from
django.contrib.auth.decorators
import
login_required
from
django.shortcuts
import
render_to_response
from
openassessment.assessment.
peer_api
import
get_assessments
from
openassessment.assessment.
api.peer
import
get_assessments
from
submissions.api
import
SubmissionRequestError
,
get_submissions
log
=
logging
.
getLogger
(
__name__
)
...
...
apps/openassessment/management/commands/create_oa_submissions.py
View file @
b7e87326
...
...
@@ -7,7 +7,8 @@ from django.core.management.base import BaseCommand, CommandError
import
loremipsum
from
submissions
import
api
as
sub_api
from
openassessment.workflow
import
api
as
workflow_api
from
openassessment.assessment
import
peer_api
,
self_api
from
openassessment.assessment.api
import
peer
as
peer_api
from
openassessment.assessment.api
import
self
as
self_api
STEPS
=
[
'peer'
,
'self'
]
...
...
apps/openassessment/management/tests/test_create_oa_submissions.py
View file @
b7e87326
...
...
@@ -3,7 +3,8 @@ Tests for the management command that creates dummy submissions.
"""
from
submissions
import
api
as
sub_api
from
openassessment.assessment
import
peer_api
,
self_api
from
openassessment.assessment.api
import
peer
as
peer_api
from
openassessment.assessment.api
import
self
as
self_api
from
openassessment.management.commands
import
create_oa_submissions
from
django.test
import
TestCase
...
...
apps/openassessment/workflow/api.py
View file @
b7e87326
...
...
@@ -7,7 +7,7 @@ import logging
from
django.db
import
DatabaseError
from
openassessment.assessment
import
peer_api
from
openassessment.assessment
.api
import
peer
as
peer_api
from
openassessment.assessment.errors
import
PeerAssessmentError
from
submissions
import
api
as
sub_api
from
.models
import
AssessmentWorkflow
,
AssessmentWorkflowStep
...
...
apps/openassessment/workflow/models.py
View file @
b7e87326
...
...
@@ -129,7 +129,8 @@ class AssessmentWorkflow(TimeStampedModel, StatusModel):
specific requirements in this dict.
"""
from
openassessment.assessment
import
peer_api
,
self_api
from
openassessment.assessment.api
import
peer
as
peer_api
from
openassessment.assessment.api
import
self
as
self_api
# If we're done, we're done -- it doesn't matter if requirements have
# changed because we've already written a score.
...
...
@@ -259,7 +260,8 @@ class AssessmentWorkflowStep(models.Model):
Returns an API associated with this workflow step. If no API is
associated with this workflow step, None is returned.
"""
from
openassessment.assessment
import
peer_api
,
self_api
from
openassessment.assessment.api
import
peer
as
peer_api
from
openassessment.assessment.api
import
self
as
self_api
api
=
None
if
self
.
name
==
AssessmentWorkflow
.
STATUS
.
self
:
api
=
self_api
...
...
apps/openassessment/xblock/grade_mixin.py
View file @
b7e87326
...
...
@@ -7,8 +7,8 @@ from collections import defaultdict
from
django.utils.translation
import
ugettext
as
_
from
xblock.core
import
XBlock
from
openassessment.assessment
import
peer_api
from
openassessment.assessment
import
self_api
from
openassessment.assessment
.api
import
peer
as
peer_api
from
openassessment.assessment
.api
import
self
as
self_api
from
openassessment.assessment.errors
import
SelfAssessmentError
,
PeerAssessmentError
from
submissions
import
api
as
sub_api
...
...
apps/openassessment/xblock/peer_assessment_mixin.py
View file @
b7e87326
...
...
@@ -4,8 +4,8 @@ from django.utils.translation import ugettext as _
from
webob
import
Response
from
xblock.core
import
XBlock
from
openassessment.assessment
import
peer_api
from
openassessment.assessment.
peer_api
import
(
from
openassessment.assessment
.api
import
peer
as
peer_api
from
openassessment.assessment.
errors
import
(
PeerAssessmentInternalError
,
PeerAssessmentRequestError
,
PeerAssessmentWorkflowError
)
...
...
apps/openassessment/xblock/self_assessment_mixin.py
View file @
b7e87326
...
...
@@ -4,7 +4,7 @@ from django.utils.translation import ugettext as _
from
xblock.core
import
XBlock
from
webob
import
Response
from
openassessment.assessment
import
self_api
from
openassessment.assessment
.api
import
self
as
self_api
from
openassessment.workflow
import
api
as
workflow_api
from
submissions
import
api
as
submission_api
from
.resolve_dates
import
DISTANT_FUTURE
...
...
apps/openassessment/xblock/test/test_grade.py
View file @
b7e87326
...
...
@@ -6,7 +6,8 @@ import copy
import
json
from
submissions
import
api
as
sub_api
from
openassessment.workflow
import
api
as
workflow_api
from
openassessment.assessment
import
peer_api
,
self_api
from
openassessment.assessment.api
import
peer
as
peer_api
from
openassessment.assessment.api
import
self
as
self_api
from
.base
import
XBlockHandlerTestCase
,
scenario
...
...
apps/openassessment/xblock/test/test_peer.py
View file @
b7e87326
...
...
@@ -10,7 +10,7 @@ import mock
import
datetime
as
dt
import
pytz
import
ddt
from
openassessment.assessment
import
peer_api
from
openassessment.assessment
.api
import
peer
as
peer_api
from
.base
import
XBlockHandlerTestCase
,
scenario
...
...
apps/openassessment/xblock/test/test_self.py
View file @
b7e87326
...
...
@@ -7,7 +7,7 @@ import json
import
datetime
import
mock
import
pytz
from
openassessment.assessment
import
self_api
from
openassessment.assessment
.api
import
self
as
self_api
from
openassessment.workflow
import
api
as
workflow_api
from
.base
import
XBlockHandlerTestCase
,
scenario
...
...
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