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
8c080b6f
Commit
8c080b6f
authored
11 years ago
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Acceptance test for fixing rounding error on weight.
parent
3ed2fcbb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletions
+28
-1
cms/djangoapps/contentstore/features/grading.feature
+11
-0
cms/djangoapps/contentstore/features/grading.py
+16
-0
cms/static/js/models/settings/course_grading_policy.js
+1
-1
No files found.
cms/djangoapps/contentstore/features/grading.feature
View file @
8c080b6f
...
...
@@ -59,6 +59,17 @@ Feature: CMS.Course Grading
And
I go back to the main course page
Then
I do see the assignment name
"New Type"
# Note that "7" is a special weight because it revealed rounding errors (STUD-826).
Scenario
:
Users can set weight to Assignment types
Given
I have opened a new course in Studio
And
I am viewing the grading settings
When
I add a new assignment type
"New Type"
And
I set the assignment weight to
"7"
And
I press the
"Save"
notification button
Then
the assignment weight is displayed as
"7"
And
I reload the page
Then
the assignment weight is displayed as
"7"
Scenario
:
Settings are only persisted when saved
Given
I have opened a new course in Studio
And
I have populated the course
...
...
This diff is collapsed.
Click to expand it.
cms/djangoapps/contentstore/features/grading.py
View file @
8c080b6f
...
...
@@ -106,6 +106,22 @@ def add_assignment_type(step, new_name):
new_assignment
.
_element
.
send_keys
(
new_name
)
@step
(
u'I set the assignment weight to "([^"]*)"$'
)
def
set_weight
(
step
,
weight
):
weight_id
=
'#course-grading-assignment-gradeweight'
weight_field
=
world
.
css_find
(
weight_id
)[
-
1
]
old_weight
=
world
.
css_value
(
weight_id
,
-
1
)
for
count
in
range
(
len
(
old_weight
)):
weight_field
.
_element
.
send_keys
(
Keys
.
END
,
Keys
.
BACK_SPACE
)
weight_field
.
_element
.
send_keys
(
weight
)
@step
(
u'the assignment weight is displayed as "([^"]*)"$'
)
def
verify_weight
(
step
,
weight
):
weight_id
=
'#course-grading-assignment-gradeweight'
assert_equal
(
world
.
css_value
(
weight_id
,
-
1
),
weight
)
@step
(
u'I have populated the course'
)
def
populate_course
(
step
):
step
.
given
(
'I have added a new section'
)
...
...
This diff is collapsed.
Click to expand it.
cms/static/js/models/settings/course_grading_policy.js
View file @
8c080b6f
...
...
@@ -17,7 +17,7 @@ var CourseGradingPolicy = Backbone.Model.extend({
// interesting race condition: if {parse:true} when newing, then parse called before .attributes created
if
(
this
.
attributes
&&
this
.
has
(
'graders'
))
{
graderCollection
=
this
.
get
(
'graders'
);
graderCollection
.
reset
(
attributes
.
graders
);
graderCollection
.
reset
(
attributes
.
graders
,
{
parse
:
true
}
);
}
else
{
graderCollection
=
new
CourseGraderCollection
(
attributes
.
graders
,
{
parse
:
true
});
...
...
This diff is collapsed.
Click to expand it.
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