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
3fc5e74f
Commit
3fc5e74f
authored
Jun 09, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #419 from edx/will/workflow-settings-defaults
Provide defaults for Workflow API settings
parents
b0476980
5a8da0e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
openassessment/workflow/models.py
+21
-3
No files found.
openassessment/workflow/models.py
View file @
3fc5e74f
...
...
@@ -28,7 +28,16 @@ logger = logging.getLogger('openassessment.workflow.models')
# we use dependency injection. The Django settings define
# a dictionary mapping assessment step names to the Python module path
# that implements the corresponding assessment API.
ASSESSMENT_API_DICT
=
getattr
(
settings
,
'ORA2_ASSESSMENTS'
,
{})
# For backwards compatibility, we provide a default configuration as well
DEFAULT_ASSESSMENT_API_DICT
=
{
'peer'
:
'openassessment.assessment.api.peer'
,
'self'
:
'openassessment.assessment.api.self'
,
'training'
:
'openassessment.assessment.api.student_training'
,
}
ASSESSMENT_API_DICT
=
getattr
(
settings
,
'ORA2_ASSESSMENTS'
,
DEFAULT_ASSESSMENT_API_DICT
)
# For now, we use a simple scoring mechanism:
# Once a student has completed all assessments,
...
...
@@ -37,7 +46,11 @@ ASSESSMENT_API_DICT = getattr(settings, 'ORA2_ASSESSMENTS', {})
# We then use that score as the student's overall score.
# This Django setting is a list of assessment steps (defined in `settings.ORA2_ASSESSMENTS`)
# in descending priority order.
ASSESSMENT_SCORE_PRIORITY
=
getattr
(
settings
,
'ORA2_ASSESSMENT_SCORE_PRIORITY'
,
[])
DEFAULT_ASSESSMENT_SCORE_PRIORITY
=
[
'peer'
,
'self'
]
ASSESSMENT_SCORE_PRIORITY
=
getattr
(
settings
,
'ORA2_ASSESSMENT_SCORE_PRIORITY'
,
DEFAULT_ASSESSMENT_SCORE_PRIORITY
)
class
AssessmentWorkflow
(
TimeStampedModel
,
StatusModel
):
...
...
@@ -259,7 +272,12 @@ class AssessmentWorkflowStep(models.Model):
This relies on Django settings to map step names to
the assessment API implementation.
"""
api_path
=
getattr
(
settings
,
'ORA2_ASSESSMENTS'
,
{})
.
get
(
self
.
name
)
# We retrieve the settings in-line here (rather than using the
# top-level constant), so that @override_settings will work
# in the test suite.
api_path
=
getattr
(
settings
,
'ORA2_ASSESSMENTS'
,
DEFAULT_ASSESSMENT_API_DICT
)
.
get
(
self
.
name
)
if
api_path
is
not
None
:
try
:
return
importlib
.
import_module
(
api_path
)
...
...
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