Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ease
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
ease
Commits
f5df42e6
Commit
f5df42e6
authored
Nov 06, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add logging to grade
parent
b19ce60c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
grade.py
+5
-1
No files found.
grade.py
View file @
f5df42e6
...
...
@@ -9,6 +9,7 @@ import sys
import
pickle
import
os
import
numpy
import
logging
base_path
=
os
.
path
.
dirname
(
__file__
)
sys
.
path
.
append
(
base_path
)
...
...
@@ -19,7 +20,10 @@ from essay_set import EssaySet
import
feature_extractor
import
sklearn.ensemble
log
=
logging
.
getLogger
(
__name__
)
def
grade
(
grader_path
,
submission
,
sandbox
=
None
):
log
.
debug
(
"Grader path: {0}
\n
Submission: {1}"
.
format
(
grader_path
,
submission
))
results
=
{
'errors'
:
[],
'tests'
:
[],
'correct'
:
False
,
'score'
:
0
,
'feedback'
:
[]}
#Try to find and load the model file
...
...
@@ -42,7 +46,7 @@ def grade(grader_path,submission,sandbox=None):
grader_feats
=
grader_data
[
'extractor'
]
.
gen_feats
(
grader_set
)
results
[
'feedback'
]
=
grader_data
[
'extractor'
]
.
gen_feedback
(
grader_set
)
results
[
'score'
]
=
int
(
grader_data
[
'model'
]
.
predict
(
grader_feats
)[
0
])
except
:
except
:
results
[
'errors'
]
.
append
(
"Could not extract features and score essay."
)
#Determine maximum score and correctness of response
...
...
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