Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
15f73195
Unverified
Commit
15f73195
authored
5 years ago
by
AsadAzam
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #23451 from edx/asad/prod-1369
Fixed comparison mismatch
parents
0f125e7b
fc3e6371
No related branches found
Branches containing commit
Tags
release-2021-03-23-15.07
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/xmodule/xmodule/graders.py
+1
-1
1 addition, 1 deletion
common/lib/xmodule/xmodule/graders.py
common/lib/xmodule/xmodule/tests/test_graders.py
+34
-0
34 additions, 0 deletions
common/lib/xmodule/xmodule/tests/test_graders.py
with
35 additions
and
1 deletion
common/lib/xmodule/xmodule/graders.py
+
1
−
1
View file @
15f73195
...
...
@@ -380,7 +380,7 @@ class AssignmentFormatGrader(CourseGrader):
scores
=
list
(
grade_sheet
.
get
(
self
.
type
,
{}).
values
())
breakdown
=
[]
labeler
=
get_short_labeler
(
self
.
short_label
)
for
i
in
range
(
max
(
self
.
min_count
,
len
(
scores
))):
for
i
in
range
(
max
(
int
(
float
(
self
.
min_count
))
,
len
(
scores
))):
if
i
<
len
(
scores
)
or
generate_random_scores
:
if
generate_random_scores
:
# for debugging!
earned
=
random
.
randint
(
2
,
15
)
...
...
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/tests/test_graders.py
+
34
−
0
View file @
15f73195
...
...
@@ -252,6 +252,40 @@ class GraderTest(unittest.TestCase):
self
.
assertEqual
(
len
(
graded
[
'
section_breakdown
'
]),
0
)
self
.
assertEqual
(
len
(
graded
[
'
grade_breakdown
'
]),
0
)
def
test_grade_with_string_min_count
(
self
):
"""
Test that the grading succeeds in case the min_count is set to a string
"""
weighted_grader
=
graders
.
grader_from_conf
([
{
'
type
'
:
"
Homework
"
,
'
min_count
'
:
'
12
'
,
'
drop_count
'
:
2
,
'
short_label
'
:
"
HW
"
,
'
weight
'
:
0.25
,
},
{
'
type
'
:
"
Lab
"
,
'
min_count
'
:
'
7
'
,
'
drop_count
'
:
3
,
'
category
'
:
"
Labs
"
,
'
weight
'
:
0.25
},
{
'
type
'
:
"
Midterm
"
,
'
min_count
'
:
'
0
'
,
'
drop_count
'
:
0
,
'
name
'
:
"
Midterm Exam
"
,
'
short_label
'
:
"
Midterm
"
,
'
weight
'
:
0.5
,
},
])
graded
=
weighted_grader
.
grade
(
self
.
test_gradesheet
)
self
.
assertAlmostEqual
(
graded
[
'
percent
'
],
0.50812499999999994
)
self
.
assertEqual
(
len
(
graded
[
'
section_breakdown
'
]),
(
12
+
1
)
+
(
7
+
1
)
+
1
)
self
.
assertEqual
(
len
(
graded
[
'
grade_breakdown
'
]),
3
)
def
test_grader_from_conf
(
self
):
# Confs always produce a graders.WeightedSubsectionsGrader, so we test this by repeating the test
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment