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
69b90275
Commit
69b90275
authored
Jul 01, 2015
by
Peter Fogg
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8690 from edx/peter-fogg/fix-passing-grades
Fix not being able to set course passing grades above 80%.
parents
36e31e10
890cd6a4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
cms/static/coffee/spec/models/settings_grading_spec.coffee
+12
-1
cms/static/js/models/settings/course_grading_policy.js
+1
-1
cms/templates/settings_graders.html
+2
-1
No files found.
cms/static/coffee/spec/models/settings_grading_spec.coffee
View file @
69b90275
define
[
"
js/models/settings/course_grading_policy"
],
(
CourseGradingPolicy
)
->
define
[
"
underscore"
,
"js/models/settings/course_grading_policy"
],
(
_
,
CourseGradingPolicy
)
->
describe
"CourseGradingPolicy"
,
->
describe
"CourseGradingPolicy"
,
->
beforeEach
->
beforeEach
->
@
model
=
new
CourseGradingPolicy
()
@
model
=
new
CourseGradingPolicy
()
...
@@ -23,3 +23,14 @@ define ["js/models/settings/course_grading_policy"], (CourseGradingPolicy) ->
...
@@ -23,3 +23,14 @@ define ["js/models/settings/course_grading_policy"], (CourseGradingPolicy) ->
expect
(
@
model
.
parseGracePeriod
(
"asdf"
)).
toBe
(
null
)
expect
(
@
model
.
parseGracePeriod
(
"asdf"
)).
toBe
(
null
)
expect
(
@
model
.
parseGracePeriod
(
"7:19"
)).
toBe
(
null
)
expect
(
@
model
.
parseGracePeriod
(
"7:19"
)).
toBe
(
null
)
expect
(
@
model
.
parseGracePeriod
(
"1000:00"
)).
toBe
(
null
)
expect
(
@
model
.
parseGracePeriod
(
"1000:00"
)).
toBe
(
null
)
describe
"validate"
,
->
it
"enforces that the passing grade is <= the minimum grade to receive credit if credit is enabled"
,
->
@
model
.
set
({
minimum_grade_credit
:
0.8
,
grace_period
:
'01:00'
,
is_credit_course
:
true
})
@
model
.
set
(
'grade_cutoffs'
,
[
0.9
],
validate
:
true
)
expect
(
_
.
keys
(
@
model
.
validationError
)).
toContain
(
'minimum_grade_credit'
)
it
"does not enforce the passing grade limit in non-credit courses"
,
->
@
model
.
set
({
minimum_grade_credit
:
0.8
,
grace_period
:
'01:00'
,
is_credit_course
:
false
})
@
model
.
set
({
grade_cutoffs
:
[
0.9
]},
validate
:
true
)
expect
(
@
model
.
validationError
).
toBe
(
null
)
cms/static/js/models/settings/course_grading_policy.js
View file @
69b90275
...
@@ -76,7 +76,7 @@ var CourseGradingPolicy = Backbone.Model.extend({
...
@@ -76,7 +76,7 @@ var CourseGradingPolicy = Backbone.Model.extend({
}
}
}
}
}
}
if
(
_
.
has
(
attrs
,
'minimum_grade_credit'
))
{
if
(
this
.
get
(
'is_credit_course'
)
&&
_
.
has
(
attrs
,
'minimum_grade_credit'
))
{
var
minimum_grade_cutoff
=
_
.
values
(
attrs
.
grade_cutoffs
).
pop
();
var
minimum_grade_cutoff
=
_
.
values
(
attrs
.
grade_cutoffs
).
pop
();
if
(
isNaN
(
attrs
.
minimum_grade_credit
)
||
attrs
.
minimum_grade_credit
===
null
||
attrs
.
minimum_grade_credit
<
minimum_grade_cutoff
)
{
if
(
isNaN
(
attrs
.
minimum_grade_credit
)
||
attrs
.
minimum_grade_credit
===
null
||
attrs
.
minimum_grade_credit
<
minimum_grade_cutoff
)
{
return
{
return
{
...
...
cms/templates/settings_graders.html
View file @
69b90275
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<
%!
<
%!
import
json
from
contentstore
import
utils
from
contentstore
import
utils
from
django
.
utils
.
translation
import
ugettext
as
_
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
%
>
...
@@ -22,7 +23,7 @@
...
@@ -22,7 +23,7 @@
</
%
block>
</
%
block>
<
%
block
name=
"requirejs"
>
<
%
block
name=
"requirejs"
>
require(["js/factories/settings_graders"], function(SettingsGradersFactory) {
require(["js/factories/settings_graders"], function(SettingsGradersFactory) {
SettingsGradersFactory(
${course_details|n}
, "${grading_url}");
SettingsGradersFactory(
_.extend(${course_details|n}, {is_credit_course: ${json.dumps(is_credit_course)}})
, "${grading_url}");
});
});
</
%
block>
</
%
block>
...
...
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