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
883016d3
Commit
883016d3
authored
Nov 15, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add way to pass back prompt overlap and punish essays that overlap too much.
parent
8a7ea7ec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
feature_extractor.py
+5
-1
grade.py
+19
-4
No files found.
feature_extractor.py
View file @
883016d3
...
...
@@ -213,7 +213,7 @@ class FeatureExtractor(object):
#Iterate through essays and create a feedback dict for each
all_feedback
=
[]
for
m
in
xrange
(
0
,
len
(
e_set
.
_text
)):
individual_feedback
=
{
'grammar'
:
"Ok."
,
'spelling'
:
"Ok."
,
'topicality'
:
"Ok."
,
'markup_text'
:
""
}
individual_feedback
=
{
'grammar'
:
"Ok."
,
'spelling'
:
"Ok."
,
'topicality'
:
"Ok."
,
'markup_text'
:
""
,
'prompt_overlap'
:
"Ok."
}
markup_tokens
=
e_set
.
_markup_text
[
m
]
.
split
(
" "
)
#This loop ensures that sequences of bad grammar get put together into one sequence instead of staying
...
...
@@ -243,6 +243,10 @@ class FeatureExtractor(object):
if
f_row_prop
<
(
self
.
_mean_f_prop
/
1.5
)
or
len
(
e_set
.
_text
[
m
])
<
20
:
individual_feedback
[
'topicality'
]
=
"Essay may be off topic."
if
(
features
[
m
,
9
]
>.
5
):
individual_feedback
[
'prompt_overlap'
]
=
"Too much overlap with prompt."
log
.
debug
(
features
[
m
,
9
])
#Create string representation of markup text
markup_string
=
" "
.
join
(
markup_tokens
)
individual_feedback
[
'markup_text'
]
=
markup_string
...
...
grade.py
View file @
883016d3
...
...
@@ -31,7 +31,8 @@ feedback_template = u"""
<header>Feedback</header>
<div class="shortform">
<div class="result-output">
Number of potential problem areas identified: {problem_areas}
<p>Score: {score}</p>
<p>Number of potential problem areas identified: {problem_areas}</p>
</div>
</div>
<div class="longform">
...
...
@@ -39,6 +40,9 @@ feedback_template = u"""
<div class="topicality">
Topicality: {topicality}
</div>
<div class="prompt_overlap">
Prompt Overlap : {prompt_overlap}
</div>
<div class="spelling">
Spelling: {spelling}
</div>
...
...
@@ -115,6 +119,10 @@ def grade(grader_path,grader_config,submission,sandbox=None):
else
:
results
[
'correct'
]
=
False
if
(
len
(
feedback
[
'prompt_overlap'
])
>
4
):
results
[
'score'
]
=
0
results
[
'correct'
]
=
False
results
[
'success'
]
=
True
#Generate short form output--number of problem areas identified in feedback
...
...
@@ -124,9 +132,16 @@ def grade(grader_path,grader_config,submission,sandbox=None):
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
)
results
[
'feedback'
]
=
feedback_template
.
format
(
topicality
=
feedback
[
'topicality'
],
spelling
=
feedback
[
'spelling'
],
grammar
=
feedback
[
'grammar'
],
markup_text
=
feedback
[
'markup_text'
],
problem_areas
=
problem_areas
,
score
=
results
[
'score'
],
prompt_overlap
=
feedback
[
'prompt_overlap'
],
)
else
:
#If error, add errors to template.
results
[
'feedback'
]
=
error_template
.
format
(
errors
=
' '
.
join
(
results
[
'errors'
]))
...
...
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