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
fc86f455
Commit
fc86f455
authored
Jul 10, 2014
by
Stephen Sanchez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better handling of duplicate training essays
parent
f4661727
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
116 additions
and
5 deletions
+116
-5
openassessment/templates/openassessmentblock/student_training/student_training_error.html
+18
-0
openassessment/xblock/student_training_mixin.py
+11
-4
openassessment/xblock/test/data/assessment_combo.json
+9
-1
openassessment/xblock/test/data/student_training_combo.json
+66
-0
openassessment/xblock/validation.py
+12
-0
No files found.
openassessment/templates/openassessmentblock/student_training/student_training_error.html
0 → 100644
View file @
fc86f455
{% extends "openassessmentblock/student_training/student_training.html" %}
{% load i18n %}
{% block body %}
<div
class=
"ui-toggle-visibility__content"
>
<div
class=
"wrapper--step__content"
>
<div
class=
"step__message message message--incomplete"
>
<h3
class=
"message__title"
>
{% trans "Error Loading Student Training Examples" %}
</h3>
<div
class=
"message__content"
>
<p>
{% trans "We couldn't load the student training step of this assignment." %}
</p>
</div>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
openassessment/xblock/student_training_mixin.py
View file @
fc86f455
...
...
@@ -6,7 +6,6 @@ from django.utils.translation import ugettext as _
from
webob
import
Response
from
xblock.core
import
XBlock
from
openassessment.assessment.api
import
student_training
import
openassessment.workflow.api
as
workflow_api
from
openassessment.workflow.errors
import
AssessmentWorkflowError
from
openassessment.xblock.data_conversion
import
convert_training_examples_list_to_dict
from
.resolve_dates
import
DISTANT_FUTURE
...
...
@@ -119,9 +118,17 @@ class StudentTrainingMixin(object):
},
examples
)
context
[
'training_essay'
]
=
example
[
'answer'
]
context
[
'training_rubric'
]
=
example
[
'rubric'
]
template
=
'openassessmentblock/student_training/student_training.html'
if
example
:
context
[
'training_essay'
]
=
example
[
'answer'
]
context
[
'training_rubric'
]
=
example
[
'rubric'
]
template
=
'openassessmentblock/student_training/student_training.html'
else
:
logger
.
error
(
"No training example was returned from the API for student "
"with Submission UUID {}"
.
format
(
self
.
submission_uuid
)
)
template
=
"openassessmentblock/student_training/student_training_error.html"
return
template
,
context
...
...
openassessment/xblock/test/data/assessment_combo.json
View file @
fc86f455
...
...
@@ -55,7 +55,15 @@
"valid"
:
true
,
"assessments"
:
[
{
"name"
:
"student-training"
"name"
:
"student-training"
,
"examples"
:
[
{
"answer"
:
"foo"
},
{
"answer"
:
"bar"
}
]
},
{
"name"
:
"self-assessment"
...
...
openassessment/xblock/test/data/student_training_combo.json
View file @
fc86f455
...
...
@@ -46,6 +46,72 @@
"is_released"
:
false
},
"training_no_examples"
:
{
"valid"
:
false
,
"assessments"
:
[
{
"name"
:
"student-training"
},
{
"name"
:
"peer-assessment"
,
"must_grade"
:
5
,
"must_be_graded_by"
:
3
},
{
"name"
:
"self-assessment"
}
],
"current_assessments"
:
null
,
"is_released"
:
false
},
"training_duplicate_examples"
:
{
"valid"
:
false
,
"assessments"
:
[
{
"name"
:
"student-training"
,
"examples"
:
[
{
"answer"
:
"тєѕт αηѕωєя"
,
"options_selected"
:
[
{
"criterion"
:
"vocabulary"
,
"option"
:
"poor"
},
{
"criterion"
:
"grammar"
,
"option"
:
"good"
}
]
},
{
"answer"
:
"тєѕт αηѕωєя"
,
"options_selected"
:
[
{
"criterion"
:
"vocabulary"
,
"option"
:
"poor"
},
{
"criterion"
:
"grammar"
,
"option"
:
"good"
}
]
}
]
},
{
"name"
:
"peer-assessment"
,
"must_grade"
:
5
,
"must_be_graded_by"
:
3
},
{
"name"
:
"self-assessment"
}
],
"current_assessments"
:
null
,
"is_released"
:
false
},
"training_peer"
:
{
"valid"
:
true
,
"assessments"
:
[
...
...
openassessment/xblock/validation.py
View file @
fc86f455
...
...
@@ -131,6 +131,18 @@ def validate_assessments(assessments, current_assessments, is_released):
if
must_grade
<
must_be_graded_by
:
return
(
False
,
_
(
'The "must_grade" value must be greater than or equal to the "must_be_graded_by" value.'
))
# Student Training must have at least one example, and all
# examples must have unique answers.
if
assessment_dict
.
get
(
'name'
)
==
'student-training'
:
answers
=
[]
examples
=
assessment_dict
.
get
(
'examples'
)
if
not
examples
:
return
False
,
_
(
'You must provide at least one example response for student training.'
)
for
example
in
examples
:
if
example
.
get
(
'answer'
)
in
answers
:
return
False
,
_
(
'Each example response for student training must be unique.'
)
answers
.
append
(
example
.
get
(
'answer'
))
# Example-based assessment MUST specify 'ease' or 'fake' as the algorithm ID,
# at least for now. Later, we may make this more flexible.
if
assessment_dict
.
get
(
'name'
)
==
'example-based-assessment'
:
...
...
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