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
795fba04
Commit
795fba04
authored
Apr 15, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got settings.GENERATE_RANDOM_PROFILE_SCORES working again. Mostly used for design previews.
parent
02e92e0b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
djangoapps/courseware/grades.py
+13
-2
No files found.
djangoapps/courseware/grades.py
View file @
795fba04
...
...
@@ -127,6 +127,17 @@ class SingleSectionGrader(CourseGrader):
percent
=
0.0
detail
=
"{name} - 0
%
(?/?)"
.
format
(
name
=
self
.
section_name
)
if
settings
.
GENERATE_PROFILE_SCORES
:
points_possible
=
random
.
randrange
(
50
,
100
)
points_earned
=
random
.
randrange
(
40
,
points_possible
)
percent
=
points_earned
/
float
(
points_possible
)
detail
=
"{name} - {percent:.0
%
} ({earned:.3n}/{possible:.3n})"
.
format
(
name
=
self
.
section_name
,
percent
=
percent
,
earned
=
float
(
points_earned
),
possible
=
float
(
points_possible
))
breakdown
=
[{
'percent'
:
percent
,
'label'
:
self
.
short_label
,
'detail'
:
detail
,
'category'
:
self
.
category
,
'prominent'
:
True
}]
...
...
@@ -206,8 +217,8 @@ class AssignmentFormatGrader(CourseGrader):
section_type
=
self
.
section_type
,
name
=
"Randomly Generated"
,
percent
=
percentage
,
earned
=
points_earned
,
possible
=
points_possible
)
earned
=
float
(
points_earned
)
,
possible
=
float
(
points_possible
)
)
short_label
=
"{short_label} {index:02d}"
.
format
(
index
=
i
+
1
,
short_label
=
self
.
short_label
)
...
...
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