Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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-platform
Commits
112fb453
Commit
112fb453
authored
Apr 09, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly calculate score for combinedopenended and peer assessment
parent
45a3dd4e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
11 deletions
+27
-11
common/lib/xmodule/xmodule/combined_open_ended_module.py
+1
-1
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
+10
-5
common/lib/xmodule/xmodule/peer_grading_module.py
+16
-5
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
112fb453
...
...
@@ -14,7 +14,7 @@ from xmodule.open_ended_grading_classes.xblock_field_types import StringyFloat
log
=
logging
.
getLogger
(
"mitx.courseware"
)
V1_SETTINGS_ATTRIBUTES
=
[
"display_name"
,
"attempts"
,
"is_graded"
,
"accept_file_upload"
,
"skip_spelling_checks"
,
"due"
,
"graceperiod"
]
"skip_spelling_checks"
,
"due"
,
"graceperiod"
,
"weight"
]
V1_STUDENT_ATTRIBUTES
=
[
"current_task_number"
,
"task_states"
,
"state"
,
"student_attempts"
,
"ready_to_reset"
]
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
View file @
112fb453
...
...
@@ -131,6 +131,7 @@ class CombinedOpenEndedV1Module():
self
.
state
=
instance_state
.
get
(
'state'
,
self
.
INITIAL
)
self
.
student_attempts
=
instance_state
.
get
(
'student_attempts'
,
0
)
self
.
weight
=
instance_state
.
get
(
'weight'
,
1
)
#Allow reset is true if student has failed the criteria to move to the next child task
self
.
ready_to_reset
=
instance_state
.
get
(
'ready_to_reset'
,
False
)
...
...
@@ -736,13 +737,17 @@ class CombinedOpenEndedV1Module():
max_score
=
None
score
=
None
if
self
.
check_if_done_and_scored
():
last_response
=
self
.
get_last_response
(
self
.
current_task_number
)
max_score
=
last_response
[
'max_score'
]
score
=
last_response
[
'score'
]
scores
=
[]
for
i
in
xrange
(
0
,
self
.
current_task_number
):
last_response
=
self
.
get_last_response
(
i
)
max_score
=
last_response
[
'max_score'
]
*
float
(
self
.
weight
)
score
=
last_response
[
'score'
]
*
float
(
self
.
weight
)
scores
.
append
(
score
)
score
=
max
(
scores
)
score_dict
=
{
'score'
:
score
,
'total'
:
max_score
,
'score'
:
score
,
'total'
:
max_score
,
}
return
score_dict
...
...
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
112fb453
...
...
@@ -178,8 +178,16 @@ class PeerGradingModule(PeerGradingFields, XModule):
pass
def
get_score
(
self
):
max_score
=
None
score
=
None
score_dict
=
{
'score'
:
score
,
'total'
:
max_score
,
}
if
self
.
use_for_single_location
not
in
TRUE_DICT
or
self
.
is_graded
not
in
TRUE_DICT
:
return
None
return
score_dict
try
:
count_graded
=
self
.
student_data_for_location
[
'count_graded'
]
...
...
@@ -198,10 +206,13 @@ class PeerGradingModule(PeerGradingFields, XModule):
#Ensures that once a student receives a final score for peer grading, that it does not change.
self
.
student_data_for_location
=
response
score_dict
=
{
'score'
:
int
(
count_graded
>=
count_required
and
count_graded
>
0
)
*
int
(
self
.
weight
),
'total'
:
self
.
max_grade
*
int
(
self
.
weight
),
}
try
:
score
=
int
(
count_graded
>=
count_required
and
count_graded
>
0
)
*
float
(
self
.
weight
)
total
=
self
.
max_grade
*
float
(
self
.
weight
)
score_dict
[
'score'
]
=
score
score_dict
[
'total'
]
=
total
except
:
pass
return
score_dict
...
...
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