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
ab6de5d9
Commit
ab6de5d9
authored
Nov 08, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorder code so that errors will return error template instead of crashing process
parent
91013c9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
grade.py
+15
-14
No files found.
grade.py
View file @
ab6de5d9
...
...
@@ -107,25 +107,26 @@ def grade(grader_path,grader_config,submission,sandbox=None):
results
[
'errors'
]
.
append
(
"Could not extract features and score essay."
)
has_error
=
True
#Generate short form output--number of problem areas identified in feedback
problem_areas
=
0
for
tag
in
feedback
:
if
tag
is
not
'markup_text'
:
problem_areas
+=
len
(
feedback
[
tag
])
>
5
#Determine maximum score and correctness of response
max_score
=
numpy
.
max
(
grader_data
[
'model'
]
.
classes_
)
if
results
[
'score'
]
/
float
(
max_score
)
>=
.
66
:
results
[
'correct'
]
=
True
else
:
results
[
'correct'
]
=
False
#Add feedback template to results
if
not
has_error
:
#Determine maximum score and correctness of response
max_score
=
numpy
.
max
(
grader_data
[
'model'
]
.
classes_
)
if
results
[
'score'
]
/
float
(
max_score
)
>=
.
66
:
results
[
'correct'
]
=
True
else
:
results
[
'correct'
]
=
False
#Generate short form output--number of problem areas identified in feedback
problem_areas
=
0
for
tag
in
feedback
:
if
tag
is
not
'markup_text'
:
problem_areas
+=
len
(
feedback
[
tag
])
>
5
#Add feedback template to results
results
[
'feedback'
]
=
feedback_template
.
format
(
topicality
=
feedback
[
'topicality'
],
spelling
=
feedback
[
'spelling'
],
grammar
=
feedback
[
'grammar'
],
markup_text
=
feedback
[
'markup_text'
],
problem_areas
=
problem_areas
)
else
:
#If error, add errors to template.
results
[
'feedback'
]
=
error_template
.
format
(
errors
=
' '
.
join
(
results
[
'errors'
]))
return
results
...
...
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