Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
1b6f0588
Commit
1b6f0588
authored
13 years ago
by
Bridger Maxwell
Browse files
Options
Downloads
Patches
Plain Diff
Added bar on progress graph to show overall grade.
--HG-- branch : bridger-dev
parent
b2c89cff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
courseware/views.py
+23
-0
23 additions, 0 deletions
courseware/views.py
settings_new_askbot.py
+3
-0
3 additions, 0 deletions
settings_new_askbot.py
with
26 additions
and
0 deletions
courseware/views.py
+
23
−
0
View file @
1b6f0588
import
json
import
logging
import
os
import
random
import
sys
import
StringIO
import
urllib
...
...
@@ -125,6 +126,13 @@ def profile(request):
else
:
percentage
=
0
summary
=
"
0% (?/?)
"
if
settings
.
GENERATE_PROFILE_SCORES
:
points_possible
=
random
.
randrange
(
10
,
50
)
points_earned
=
random
.
randrange
(
5
,
points_possible
)
percentage
=
points_earned
/
float
(
points_possible
)
summary
=
"
{0:.0%} ({1}/{2})
"
.
format
(
percentage
,
points_earned
,
points_possible
)
summary
=
"
Homework {0} - {1}
"
.
format
(
i
+
1
,
summary
)
homework_percentages
.
append
(
{
'
percentage
'
:
percentage
,
'
summary
'
:
summary
}
)
...
...
@@ -140,6 +148,13 @@ def profile(request):
else
:
percentage
=
0
summary
=
"
0% (?/?)
"
if
settings
.
GENERATE_PROFILE_SCORES
:
points_possible
=
random
.
randrange
(
10
,
50
)
points_earned
=
random
.
randrange
(
5
,
points_possible
)
percentage
=
points_earned
/
float
(
points_possible
)
summary
=
"
{0:.0%} ({1}/{2})
"
.
format
(
percentage
,
points_earned
,
points_possible
)
summary
=
"
Lab {0} - {1}
"
.
format
(
i
+
1
,
summary
)
lab_percentages
.
append
(
{
'
percentage
'
:
percentage
,
'
summary
'
:
summary
}
)
lab_total
,
lab_dropped_indices
=
totalWithDrops
(
lab_percentages
,
2
)
...
...
@@ -152,6 +167,14 @@ def profile(request):
final_score
=
(
'
?
'
,
'
?
'
)
final_percentage
=
0
if
settings
.
GENERATE_PROFILE_SCORES
:
midterm_score
=
(
random
.
randrange
(
50
,
150
),
150
)
midterm_percentage
=
midterm_score
[
0
]
/
float
(
midterm_score
[
1
])
final_score
=
(
random
.
randrange
(
100
,
250
),
300
)
final_percentage
=
final_score
[
0
]
/
float
(
final_score
[
1
])
grade_summary
=
[
{
'
category
'
:
'
Homework
'
,
...
...
This diff is collapsed.
Click to expand it.
settings_new_askbot.py
+
3
−
0
View file @
1b6f0588
...
...
@@ -14,6 +14,9 @@ LIB_URL = 'https://mitxstatic.s3.amazonaws.com/js/'
BOOK_URL
=
'
/static/book/
'
BOOK_URL
=
'
https://mitxstatic.s3.amazonaws.com/book_images/
'
# Feature Flags. These should be set to false until they are ready to deploy, and then eventually flag mechanisms removed
GENERATE_PROFILE_SCORES
=
False
# If this is true, random scores will be generated for the purpose of debugging the profile graphs
# Our parent dir (mitx_all) is the BASE_DIR
BASE_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
__file__
,
"
..
"
,
"
..
"
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment