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
5afc5007
Commit
5afc5007
authored
Jan 28, 2015
by
Usman Khalid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TraningExamples should accept answers with multiple parts.
TNL-708
parent
be92b732
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
openassessment/assessment/api/ai_worker.py
+2
-7
openassessment/assessment/serializers/training.py
+9
-1
No files found.
openassessment/assessment/api/ai_worker.py
View file @
5afc5007
...
@@ -6,6 +6,7 @@ from httplib import HTTPException
...
@@ -6,6 +6,7 @@ from httplib import HTTPException
from
django.db
import
DatabaseError
from
django.db
import
DatabaseError
from
dogapi
import
dog_stats_api
from
dogapi
import
dog_stats_api
from
openassessment.assessment.models
import
(
from
openassessment.assessment.models
import
(
essay_text_from_submission
,
AITrainingWorkflow
,
AIGradingWorkflow
,
AITrainingWorkflow
,
AIGradingWorkflow
,
ClassifierUploadError
,
ClassifierSerializeError
,
ClassifierUploadError
,
ClassifierSerializeError
,
IncompleteClassifierSet
,
NoTrainingExamples
,
IncompleteClassifierSet
,
NoTrainingExamples
,
...
@@ -197,19 +198,13 @@ def get_training_task_params(training_workflow_uuid):
...
@@ -197,19 +198,13 @@ def get_training_task_params(training_workflow_uuid):
returned_examples
=
[]
returned_examples
=
[]
for
example
in
workflow
.
training_examples
.
all
():
for
example
in
workflow
.
training_examples
.
all
():
answer
=
example
.
answer
if
isinstance
(
answer
,
dict
):
text
=
answer
.
get
(
'answer'
,
''
)
else
:
text
=
answer
scores
=
{
scores
=
{
option
.
criterion
.
name
:
option
.
points
option
.
criterion
.
name
:
option
.
points
for
option
in
example
.
options_selected
.
all
()
for
option
in
example
.
options_selected
.
all
()
}
}
returned_examples
.
append
({
returned_examples
.
append
({
'text'
:
text
,
'text'
:
essay_text_from_submission
({
'answer'
:
example
.
answer
})
,
'scores'
:
scores
'scores'
:
scores
})
})
...
...
openassessment/assessment/serializers/training.py
View file @
5afc5007
...
@@ -126,7 +126,15 @@ def deserialize_training_examples(examples, rubric_dict):
...
@@ -126,7 +126,15 @@ def deserialize_training_examples(examples, rubric_dict):
>>>
>>>
>>> examples = [
>>> examples = [
>>> {
>>> {
>>> 'answer': u'Lorem ipsum',
>>> 'answer': {
>>> 'parts': {
>>> [
>>> {'text:' 'Answer part 1'},
>>> {'text:' 'Answer part 2'},
>>> {'text:' 'Answer part 3'}
>>> ]
>>> }
>>> },
>>> 'options_selected': {
>>> 'options_selected': {
>>> 'vocabulary': 'good',
>>> 'vocabulary': 'good',
>>> 'grammar': 'excellent'
>>> 'grammar': 'excellent'
...
...
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