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
25eef348
Commit
25eef348
authored
Nov 19, 2015
by
Eric Fischer
Committed by
Andy Armstrong
Dec 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move initialization code to __init__
parent
7d599598
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
20 deletions
+13
-20
openassessment/workflow/models.py
+13
-20
No files found.
openassessment/workflow/models.py
View file @
25eef348
...
@@ -96,29 +96,24 @@ class AssessmentWorkflow(TimeStampedModel, StatusModel):
...
@@ -96,29 +96,24 @@ class AssessmentWorkflow(TimeStampedModel, StatusModel):
ordering
=
[
"-created"
]
ordering
=
[
"-created"
]
# TODO: In migration, need a non-unique index on (course_id, item_id, status)
# TODO: In migration, need a non-unique index on (course_id, item_id, status)
@classmethod
def
__init__
(
self
,
*
args
,
**
kwargs
):
@transaction.atomic
super
(
AssessmentWorkflow
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
def
include_staff_in_class
(
cls
):
if
'staff'
not
in
AssessmentWorkflow
.
STEPS
:
if
'staff'
not
in
cls
.
STEPS
:
new_list
=
[
'staff'
]
new_list
=
[
'staff'
]
new_list
.
extend
(
cls
.
STEPS
)
new_list
.
extend
(
AssessmentWorkflow
.
STEPS
)
cls
.
STEPS
=
new_list
AssessmentWorkflow
.
STEPS
=
new_list
cls
.
STATUS_VALUES
=
cls
.
STEPS
+
cls
.
STATUSES
AssessmentWorkflow
.
STATUS_VALUES
=
AssessmentWorkflow
.
STEPS
+
AssessmentWorkflow
.
STATUSES
cls
.
STATUS
=
Choices
(
*
cls
.
STATUS_VALUES
)
AssessmentWorkflow
.
STATUS
=
Choices
(
*
AssessmentWorkflow
.
STATUS_VALUES
)
if
'staff'
not
in
cls
.
ASSESSMENT_SCORE_PRIORITY
:
if
'staff'
not
in
AssessmentWorkflow
.
ASSESSMENT_SCORE_PRIORITY
:
new_list
=
[
'staff'
]
new_list
=
[
'staff'
]
new_list
.
extend
(
cls
.
ASSESSMENT_SCORE_PRIORITY
)
new_list
.
extend
(
AssessmentWorkflow
.
ASSESSMENT_SCORE_PRIORITY
)
cls
.
ASSESSMENT_SCORE_PRIORITY
=
new_list
AssessmentWorkflow
.
ASSESSMENT_SCORE_PRIORITY
=
new_list
@classmethod
def
from_db
(
cls
,
db
,
field_names
,
values
):
cls
.
include_staff_in_class
()
super
(
AssessmentWorkflow
)
.
from_db
(
db
,
field_names
,
values
)
@classmethod
@classmethod
@transaction.commit_on_success
@transaction.atomic
>>>>>>>
Include
staff
in
class
def
include_staff_in_class
(
cls
):
if
'staff'
not
in
cls
.
STEPS
:
def
start_workflow
(
cls
,
submission_uuid
,
step_names
,
on_init_params
):
def
start_workflow
(
cls
,
submission_uuid
,
step_names
,
on_init_params
):
"""
"""
Start a new workflow.
Start a new workflow.
...
@@ -146,8 +141,6 @@ class AssessmentWorkflow(TimeStampedModel, StatusModel):
...
@@ -146,8 +141,6 @@ class AssessmentWorkflow(TimeStampedModel, StatusModel):
new_list
.
extend
(
step_names
)
new_list
.
extend
(
step_names
)
step_names
=
new_list
step_names
=
new_list
cls
.
include_staff_in_class
()
# Create the workflow and step models in the database
# Create the workflow and step models in the database
# For now, set the status to waiting; we'll modify it later
# For now, set the status to waiting; we'll modify it later
# based on the first step in the workflow.
# based on the first step in the workflow.
...
...
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