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
9e75d8fb
Commit
9e75d8fb
authored
Jun 03, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include setting the classifier set in the transaction that creates AIGradingWorkflow
parent
4f5848a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
apps/openassessment/assessment/api/ai.py
+3
-13
apps/openassessment/assessment/models/ai.py
+14
-1
No files found.
apps/openassessment/assessment/api/ai.py
View file @
9e75d8fb
...
...
@@ -14,7 +14,7 @@ from openassessment.assessment.errors import (
from
openassessment.assessment.models
import
(
Assessment
,
AITrainingWorkflow
,
AIGradingWorkflow
,
InvalidOptionSelection
,
NoTrainingExamples
,
AI
ClassifierSet
,
AI
_ASSESSMENT_TYPE
AI_ASSESSMENT_TYPE
)
from
openassessment.assessment.worker
import
training
as
training_tasks
from
openassessment.assessment.worker
import
grading
as
grading_tasks
...
...
@@ -129,18 +129,8 @@ def submit(submission_uuid, rubric, algorithm_id):
raise
AIGradingInternalError
(
msg
)
try
:
classifier_set_candidates
=
AIClassifierSet
.
objects
.
filter
(
rubric
=
workflow
.
rubric
,
algorithm_id
=
algorithm_id
)[:
1
]
# If we find classifiers for this rubric/algorithm
# then associate the classifiers with the workflow
# and schedule a grading task.
# Otherwise, the task will need to be scheduled later,
# once the classifiers have been trained.
if
len
(
classifier_set_candidates
)
>
0
:
workflow
.
classifier_set
=
classifier_set_candidates
[
0
]
workflow
.
save
()
# Schedule the grading task only if the workflow has a classifier set
if
workflow
.
classifier_set
is
not
None
:
grading_tasks
.
grade_essay
.
apply_async
(
args
=
[
workflow
.
uuid
])
logger
.
info
((
u"Scheduled grading task for AI grading workflow with UUID {workflow_uuid} "
...
...
apps/openassessment/assessment/models/ai.py
View file @
9e75d8fb
...
...
@@ -590,8 +590,21 @@ class AIGradingWorkflow(AIWorkflow):
rubric
=
rubric
)
workflow
.
_log_start_workflow
()
# Retrieve classifier set candidates
classifier_set_candidates
=
AIClassifierSet
.
objects
.
filter
(
rubric
=
rubric
,
algorithm_id
=
algorithm_id
)[:
1
]
# If we find classifiers for this rubric/algorithm
# then associate the classifiers with the workflow
# and schedule a grading task.
# Otherwise, the task will need to be scheduled later,
# once the classifiers have been trained.
if
len
(
classifier_set_candidates
)
>
0
:
workflow
.
classifier_set
=
classifier_set_candidates
[
0
]
workflow
.
save
()
workflow
.
_log_start_workflow
()
return
workflow
@transaction.commit_on_success
...
...
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