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
3bb5617a
Commit
3bb5617a
authored
Nov 21, 2016
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! review comments
parent
2aac2b9d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
13 deletions
+12
-13
common/lib/xmodule/xmodule/graders.py
+1
-1
common/lib/xmodule/xmodule/tests/test_graders.py
+3
-3
lms/djangoapps/certificates/management/commands/fix_ungraded_certs.py
+8
-9
No files found.
common/lib/xmodule/xmodule/graders.py
View file @
3bb5617a
...
@@ -120,7 +120,7 @@ def grader_from_conf(conf):
...
@@ -120,7 +120,7 @@ def grader_from_conf(conf):
This creates a CourseGrader from a configuration (such as in course_settings.py).
This creates a CourseGrader from a configuration (such as in course_settings.py).
The conf can simply be an instance of CourseGrader, in which case no work is done.
The conf can simply be an instance of CourseGrader, in which case no work is done.
More commonly, the conf is a list of dictionaries. A WeightedSubsectionsGrader
More commonly, the conf is a list of dictionaries. A WeightedSubsectionsGrader
with AssignmentFormatGrader
'
s will be generated. Every dictionary should contain
with AssignmentFormatGraders will be generated. Every dictionary should contain
the parameters for making an AssignmentFormatGrader, in addition to a 'weight' key.
the parameters for making an AssignmentFormatGrader, in addition to a 'weight' key.
"""
"""
if
isinstance
(
conf
,
CourseGrader
):
if
isinstance
(
conf
,
CourseGrader
):
...
...
common/lib/xmodule/xmodule/tests/test_graders.py
View file @
3bb5617a
...
@@ -282,18 +282,18 @@ class GraderTest(unittest.TestCase):
...
@@ -282,18 +282,18 @@ class GraderTest(unittest.TestCase):
self
.
assertEqual
(
len
(
graded
[
'section_breakdown'
]),
12
+
1
)
self
.
assertEqual
(
len
(
graded
[
'section_breakdown'
]),
12
+
1
)
@ddt.data
(
@ddt.data
(
# empty
(
(
# empty
{},
{},
u"Configuration has no appropriate grader class."
u"Configuration has no appropriate grader class."
),
),
# no min_count
(
(
# no min_count
{
'type'
:
"Homework"
,
'drop_count'
:
0
},
{
'type'
:
"Homework"
,
'drop_count'
:
0
},
u"Configuration has no appropriate grader class."
u"Configuration has no appropriate grader class."
),
),
# no drop_count
(
(
# no drop_count
{
'type'
:
"Homework"
,
'min_count'
:
0
},
{
'type'
:
"Homework"
,
'min_count'
:
0
},
u"__init__() takes at least 4 arguments (3 given)"
u"__init__() takes at least 4 arguments (3 given)"
),
),
...
...
lms/djangoapps/certificates/management/commands/fix_ungraded_certs.py
View file @
3bb5617a
"""
"""
Management command which fixes ungraded certificates for students
Management command which fixes ungraded certificates for students
"""
"""
from
django.core.management.base
import
BaseCommand
import
logging
from
optparse
import
make_option
from
certificates.models
import
GeneratedCertificate
from
certificates.models
import
GeneratedCertificate
from
courseware
import
courses
from
courseware
import
courses
from
lms.djangoapps.grades.new.course_grade
import
CourseGradeFactory
from
lms.djangoapps.grades.new.course_grade
import
CourseGradeFactory
from
django.test.client
import
RequestFactory
from
django.core.management.base
import
BaseCommand
from
optparse
import
make_option
log
=
logging
.
getLogger
(
__name__
)
class
Command
(
BaseCommand
):
class
Command
(
BaseCommand
):
...
@@ -42,18 +44,15 @@ class Command(BaseCommand):
...
@@ -42,18 +44,15 @@ class Command(BaseCommand):
def
handle
(
self
,
*
args
,
**
options
):
def
handle
(
self
,
*
args
,
**
options
):
course_id
=
options
[
'course'
]
course_id
=
options
[
'course'
]
print
"Fetching ungraded students for {0}"
.
format
(
course_id
)
log
.
info
(
'Fetching ungraded students for
%
s.'
,
course_id
)
ungraded
=
GeneratedCertificate
.
objects
.
filter
(
# pylint: disable=no-member
ungraded
=
GeneratedCertificate
.
objects
.
filter
(
# pylint: disable=no-member
course_id__exact
=
course_id
course_id__exact
=
course_id
)
.
filter
(
grade__exact
=
''
)
)
.
filter
(
grade__exact
=
''
)
course
=
courses
.
get_course_by_id
(
course_id
)
course
=
courses
.
get_course_by_id
(
course_id
)
factory
=
RequestFactory
()
request
=
factory
.
get
(
'/'
)
for
cert
in
ungraded
:
for
cert
in
ungraded
:
# grade the student
# grade the student
grade
=
CourseGradeFactory
()
.
create
(
cert
.
user
,
course
)
grade
=
CourseGradeFactory
()
.
create
(
cert
.
user
,
course
)
print
"grading {0} - {1}"
.
format
(
cert
.
user
,
grade
.
percent
)
log
.
info
(
'grading
%
s -
%
s'
,
cert
.
user
,
grade
.
percent
)
cert
.
grade
=
grade
.
percent
cert
.
grade
=
grade
.
percent
if
not
options
[
'noop'
]:
if
not
options
[
'noop'
]:
cert
.
save
()
cert
.
save
()
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