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
20f23e1e
Commit
20f23e1e
authored
Feb 06, 2014
by
Stephen Sanchez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated the API so it now returns the proper points earned, and updates rows.
parent
9766cf2c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
10 deletions
+32
-10
apps/openassessment/peer/api.py
+19
-3
apps/openassessment/peer/templates/evaluations.html
+2
-0
apps/openassessment/xblock/openassessmentblock.py
+9
-5
apps/openassessment/xblock/static/js/src/oa_assessment.js
+2
-2
No files found.
apps/openassessment/peer/api.py
View file @
20f23e1e
...
@@ -279,12 +279,27 @@ def get_submission_to_evaluate(student_item_dict):
...
@@ -279,12 +279,27 @@ def get_submission_to_evaluate(student_item_dict):
item_id
=
student_item_dict
[
"item_id"
],
item_id
=
student_item_dict
[
"item_id"
],
)
.
exclude
(
student_id
=
student_item_dict
[
"student_id"
])
)
.
exclude
(
student_id
=
student_item_dict
[
"student_id"
])
student_evaluations
=
PeerEvaluation
.
objects
.
filter
(
scorer_id
=
student_item_dict
[
"student_id"
]
)
# TODO: We need a priority queue.
# TODO: We need a priority queue.
submission
=
Submission
.
objects
.
filter
(
student_item__in
=
student_items
)
.
order_by
(
submission
s
=
Submission
.
objects
.
filter
(
student_item__in
=
student_items
)
.
order_by
(
"submitted_at"
,
"submitted_at"
,
"-attempt_number"
)[:
1
]
"-attempt_number"
)
submission
=
_get_first_submission_not_evaluated
(
submissions
,
student_evaluations
)
if
not
submission
:
if
not
submission
:
raise
PeerEvaluationWorkflowError
(
raise
PeerEvaluationWorkflowError
(
"There are no submissions available for evaluation."
"There are no submissions available for evaluation."
)
)
return
SubmissionSerializer
(
submission
[
0
])
.
data
return
SubmissionSerializer
(
submission
)
.
data
def
_get_first_submission_not_evaluated
(
submissions
,
student_evaluations
):
for
submission
in
submissions
:
already_evaluated
=
False
for
evaluation
in
student_evaluations
:
already_evaluated
=
already_evaluated
or
submission
==
evaluation
.
submission
if
not
already_evaluated
:
return
submission
\ No newline at end of file
apps/openassessment/peer/templates/evaluations.html
View file @
20f23e1e
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
<th>
Submission UUID
</th>
<th>
Submission UUID
</th>
<th>
Points Earned
</th>
<th>
Points Earned
</th>
<th>
Points Possible
</th>
<th>
Points Possible
</th>
<th>
Scored By
</th>
<th>
Scored At
</th>
<th>
Scored At
</th>
<th>
Score Type
</th>
<th>
Score Type
</th>
<th>
Feedback
</th>
<th>
Feedback
</th>
...
@@ -15,6 +16,7 @@
...
@@ -15,6 +16,7 @@
<td>
{{ evaluation.points_earned }}
</td>
<td>
{{ evaluation.points_earned }}
</td>
<td>
{{ evaluation.points_possible }}
</td>
<td>
{{ evaluation.points_possible }}
</td>
<td>
{{ evaluation.scorer_id }}
</td>
<td>
{{ evaluation.scorer_id }}
</td>
<td>
{{ evaluation.scored_at }}
</td>
<td>
{{ evaluation.score_type }}
</td>
<td>
{{ evaluation.score_type }}
</td>
<td>
{{ evaluation.feedback }}
</td>
<td>
{{ evaluation.feedback }}
</td>
</tr>
</tr>
...
...
apps/openassessment/xblock/openassessmentblock.py
View file @
20f23e1e
...
@@ -109,13 +109,17 @@ class OpenAssessmentBlock(XBlock):
...
@@ -109,13 +109,17 @@ class OpenAssessmentBlock(XBlock):
# TODO: We're not doing points possible, right way to do points possible
# TODO: We're not doing points possible, right way to do points possible
# is to refactor the rubric criteria type, Joe has thoughts on this.
# is to refactor the rubric criteria type, Joe has thoughts on this.
student_item_dict
=
self
.
_get_student_item_dict
()
student_item_dict
=
self
.
_get_student_item_dict
()
assessment_dict
=
{
"points_earned"
:
data
[
"points_earned"
],
assessment_dict
=
{
"points_earned"
:
map
(
int
,
data
[
"points_earned"
]),
"points_possible"
:
12
,
"points_possible"
:
12
,
"feedback"
:
"
"
,
"feedback"
:
"Not yet implemented.
"
,
}
}
evaluation
=
peer_api
.
create_evaluation
(
data
[
"submission_uuid"
],
student_item_dict
[
"student_id"
],
assessment_dict
)
evaluation
=
peer_api
.
create_evaluation
(
print
"DEBUG: {}"
.
format
(
evaluation
)
data
[
"submission_uuid"
],
return
(
evaluation
,
"Assessment handler is not implemented yet."
)
student_item_dict
[
"student_id"
],
assessment_dict
)
return
evaluation
,
"Success"
@XBlock.json_handler
@XBlock.json_handler
def
submit
(
self
,
data
,
suffix
=
''
):
def
submit
(
self
,
data
,
suffix
=
''
):
...
...
apps/openassessment/xblock/static/js/src/oa_assessment.js
View file @
20f23e1e
...
@@ -10,8 +10,8 @@ function OpenAssessmentBlock(runtime, element) {
...
@@ -10,8 +10,8 @@ function OpenAssessmentBlock(runtime, element) {
function
prepare_assessment_post
(
element
)
{
function
prepare_assessment_post
(
element
)
{
selector
=
$
(
"input[type=radio]:checked"
,
element
);
selector
=
$
(
"input[type=radio]:checked"
,
element
);
values
=
[];
values
=
[];
for
(
i
=
0
;
selector
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
selector
.
length
;
i
++
)
{
values
.
concat
(
selector
[
0
].
value
)
;
values
[
i
]
=
selector
[
i
].
value
;
}
}
return
{
"submission_uuid"
:
$
(
"div#peer_submission_uuid"
)[
0
].
innerText
,
"points_earned"
:
values
};
return
{
"submission_uuid"
:
$
(
"div#peer_submission_uuid"
)[
0
].
innerText
,
"points_earned"
:
values
};
}
}
...
...
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