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
e1f5e40f
Commit
e1f5e40f
authored
Sep 21, 2016
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test: Changing assignment weight changes course grade
TNL-5465
parent
0b7ec75a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
9 deletions
+28
-9
lms/djangoapps/courseware/tests/test_submitting_problems.py
+28
-9
No files found.
lms/djangoapps/courseware/tests/test_submitting_problems.py
View file @
e1f5e40f
...
...
@@ -354,7 +354,21 @@ class TestCourseGrader(TestSubmittingProblems):
self
.
add_dropdown_to_section
(
self
.
homework
.
location
,
'p3'
,
1
)
self
.
refresh_course
()
def
weighted_setup
(
self
):
def
weighted_setup
(
self
,
hw_weight
=
0.25
,
final_weight
=
0.75
):
"""
Set up a simple course for testing weighted grading functionality.
"""
# pylint: disable=attribute-defined-outside-init
self
.
set_weighted_policy
(
hw_weight
,
final_weight
)
# set up a structure of 1 homework and 1 final
self
.
homework
=
self
.
add_graded_section_to_course
(
'homework'
)
self
.
problem
=
self
.
add_dropdown_to_section
(
self
.
homework
.
location
,
'H1P1'
)
self
.
final
=
self
.
add_graded_section_to_course
(
'Final Section'
,
'Final'
)
self
.
final_question
=
self
.
add_dropdown_to_section
(
self
.
final
.
location
,
'FinalQuestion'
)
def
set_weighted_policy
(
self
,
hw_weight
=
0.25
,
final_weight
=
0.75
):
"""
Set up a simple course for testing weighted grading functionality.
"""
...
...
@@ -366,23 +380,17 @@ class TestCourseGrader(TestSubmittingProblems):
"min_count"
:
1
,
"drop_count"
:
0
,
"short_label"
:
"HW"
,
"weight"
:
0.25
"weight"
:
hw_weight
},
{
"type"
:
"Final"
,
"name"
:
"Final Section"
,
"short_label"
:
"Final"
,
"weight"
:
0.75
"weight"
:
final_weight
}
]
}
self
.
add_grading_policy
(
grading_policy
)
# set up a structure of 1 homework and 1 final
self
.
homework
=
self
.
add_graded_section_to_course
(
'homework'
)
self
.
problem
=
self
.
add_dropdown_to_section
(
self
.
homework
.
location
,
'H1P1'
)
self
.
final
=
self
.
add_graded_section_to_course
(
'Final Section'
,
'Final'
)
self
.
final_question
=
self
.
add_dropdown_to_section
(
self
.
final
.
location
,
'FinalQuestion'
)
def
dropping_setup
(
self
):
"""
Set up a simple course for testing the dropping grading functionality.
...
...
@@ -619,6 +627,17 @@ class TestCourseGrader(TestSubmittingProblems):
self
.
submit_question_answer
(
'FinalQuestion'
,
{
'2_1'
:
'Correct'
,
'2_2'
:
'Correct'
})
self
.
check_grade_percent
(
1.0
)
def
test_grade_updates_on_weighted_change
(
self
):
"""
Test that the course grade updates when the
assignment weights change.
"""
self
.
weighted_setup
()
self
.
submit_question_answer
(
'H1P1'
,
{
'2_1'
:
'Correct'
,
'2_2'
:
'Correct'
})
self
.
check_grade_percent
(
0.25
)
self
.
set_weighted_policy
(
0.75
,
0.25
)
self
.
check_grade_percent
(
0.75
)
def
dropping_homework_stage1
(
self
):
"""
Get half the first homework correct and all of the second
...
...
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