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
90650231
Commit
90650231
authored
Aug 20, 2013
by
Peter Fogg
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #749 from edx/peter-fogg/fix-rename-fail-grade
Fix failing grade label being editable but not saved.
parents
a35a2fd3
533e0da1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
5 deletions
+27
-5
cms/djangoapps/contentstore/features/grading.feature
+6
-0
cms/djangoapps/contentstore/features/grading.py
+13
-0
cms/static/js/views/settings/settings_grading_view.js
+8
-5
No files found.
cms/djangoapps/contentstore/features/grading.feature
View file @
90650231
...
...
@@ -93,3 +93,9 @@ Feature: Course Grading
And
I press the
"Save"
notification button
And
I reload the page
Then
I see the highest grade range is
"Good"
Scenario
:
User cannot edit failing grade range name
Given
I have opened a new course in Studio
And
I have populated the course
And
I am viewing the grading settings
Then
I cannot edit the
"Fail"
grade range
cms/djangoapps/contentstore/features/grading.py
View file @
90650231
...
...
@@ -4,6 +4,7 @@
from
lettuce
import
world
,
step
from
common
import
*
from
terrain.steps
import
reload_the_page
from
selenium.common.exceptions
import
InvalidElementStateException
@step
(
u'I am viewing the grading settings'
)
...
...
@@ -130,6 +131,18 @@ def i_see_highest_grade_range(_step, range_name):
grade
=
world
.
css_find
(
range_css
)
.
first
assert
grade
.
value
==
range_name
@step
(
u'I cannot edit the "Fail" grade range$'
)
def
cannot_edit_fail
(
_step
):
range_css
=
'span.letter-grade'
ranges
=
world
.
css_find
(
range_css
)
assert
len
(
ranges
)
==
2
try
:
ranges
.
last
.
value
=
'Failure'
assert
False
,
"Should not be able to edit failing range"
except
InvalidElementStateException
:
pass
# We should get this exception on failing to edit the element
def
get_type_index
(
name
):
name_id
=
'#course-grading-assignment-name'
all_types
=
world
.
css_find
(
name_id
)
...
...
cms/static/js/views/settings/settings_grading_view.js
View file @
90650231
...
...
@@ -8,7 +8,7 @@ CMS.Views.Settings.Grading = CMS.Views.ValidatingView.extend({
// Leaving change in as fallback for older browsers
"change input"
:
"updateModel"
,
"change textarea"
:
"updateModel"
,
"input span[contenteditable]"
:
"updateDesignation"
,
"input span[contenteditable
=true
]"
:
"updateDesignation"
,
"click .settings-extra header"
:
"showSettingsExtras"
,
"click .new-grade-button"
:
"addNewGrade"
,
"click .remove-button"
:
"removeGrade"
,
...
...
@@ -20,7 +20,7 @@ CMS.Views.Settings.Grading = CMS.Views.ValidatingView.extend({
initialize
:
function
()
{
// load template for grading view
var
self
=
this
;
this
.
gradeCutoffTemplate
=
_
.
template
(
'<li class="grade-specific-bar" style="width:<%= width %>%"><span class="letter-grade" contenteditable>'
+
this
.
gradeCutoffTemplate
=
_
.
template
(
'<li class="grade-specific-bar" style="width:<%= width %>%"><span class="letter-grade" contenteditable
="true"
>'
+
'<%= descriptor %>'
+
'</span><span class="range"></span>'
+
'<% if (removable) {%><a href="#" class="remove-button">remove</a><% ;} %>'
+
...
...
@@ -168,9 +168,12 @@ CMS.Views.Settings.Grading = CMS.Views.ValidatingView.extend({
},
this
);
// add fail which is not in data
var
failBar
=
this
.
gradeCutoffTemplate
({
descriptor
:
this
.
failLabel
(),
width
:
nextWidth
,
removable
:
false
});
$
(
failBar
).
find
(
"span[contenteditable=true]"
).
attr
(
"contenteditable"
,
false
);
var
failBar
=
$
(
this
.
gradeCutoffTemplate
({
descriptor
:
this
.
failLabel
(),
width
:
nextWidth
,
removable
:
false
}));
failBar
.
find
(
"span[contenteditable=true]"
).
attr
(
"contenteditable"
,
false
);
gradelist
.
append
(
failBar
);
gradelist
.
children
().
last
().
resizable
({
handles
:
"e"
,
...
...
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