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
2c634d35
Commit
2c634d35
authored
Feb 17, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
93011db4
a8c32923
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
courseware/views.py
+32
-2
settings_new_askbot.py
+3
-0
No files found.
courseware/views.py
View file @
2c634d35
import
json
import
logging
import
os
import
random
import
sys
import
StringIO
import
urllib
...
...
@@ -128,9 +129,17 @@ 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
)
label
=
"HW {0:02d}"
.
format
(
i
+
1
)
homework_percentages
.
append
(
{
'percentage'
:
percentage
,
'summary'
:
summary
}
)
homework_percentages
.
append
(
{
'percentage'
:
percentage
,
'summary'
:
summary
,
'label'
:
label
}
)
homework_total
,
homework_dropped_indices
=
totalWithDrops
(
homework_percentages
,
2
)
#Figure the lab scores
...
...
@@ -143,8 +152,17 @@ 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
}
)
label
=
"Lab {0:02d}"
.
format
(
i
+
1
)
lab_percentages
.
append
(
{
'percentage'
:
percentage
,
'summary'
:
summary
,
'label'
:
label
}
)
lab_total
,
lab_dropped_indices
=
totalWithDrops
(
lab_percentages
,
2
)
...
...
@@ -155,12 +173,21 @@ 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
,
300
),
300
)
final_percentage
=
final_score
[
0
]
/
float
(
final_score
[
1
])
grade_summary
=
[
{
'category'
:
'Homework'
,
'subscores'
:
homework_percentages
,
'dropped_indices'
:
homework_dropped_indices
,
'totalscore'
:
{
'score'
:
homework_total
,
'summary'
:
"Homework Average - {0:.0
%
}"
.
format
(
homework_total
)},
'totallabel'
:
'HW Avg'
,
'weight'
:
0.15
,
},
{
...
...
@@ -168,16 +195,19 @@ def profile(request):
'subscores'
:
lab_percentages
,
'dropped_indices'
:
lab_dropped_indices
,
'totalscore'
:
{
'score'
:
lab_total
,
'summary'
:
"Lab Average - {0:.0
%
}"
.
format
(
lab_total
)},
'totallabel'
:
'Lab Avg'
,
'weight'
:
0.15
,
},
{
'category'
:
'Midterm'
,
'totalscore'
:
{
'score'
:
midterm_percentage
,
'summary'
:
"Midterm - {0:.0
%
} ({1}/{2})"
.
format
(
midterm_percentage
,
midterm_score
[
0
],
midterm_score
[
1
])},
'totallabel'
:
'Midterm'
,
'weight'
:
0.30
,
},
{
'category'
:
'Final'
,
'totalscore'
:
{
'score'
:
final_percentage
,
'summary'
:
"Final - {0:.0
%
} ({1}/{2})"
.
format
(
final_percentage
,
final_score
[
0
],
final_score
[
1
])},
'totallabel'
:
'Final'
,
'weight'
:
0.40
,
}
]
...
...
settings_new_askbot.py
View file @
2c634d35
...
...
@@ -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__
,
".."
,
".."
))
...
...
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