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
f58f08ed
Commit
f58f08ed
authored
Mar 06, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed hoverling labels of profile graph to give real name of homework or lab section
--HG-- branch : bridger-dev
parent
2c5bd99f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
courseware/views.py
+7
-9
No files found.
courseware/views.py
View file @
f58f08ed
...
@@ -127,7 +127,7 @@ def profile(request):
...
@@ -127,7 +127,7 @@ def profile(request):
subtitle
=
s
.
get
(
'subtitle'
)
if
s
.
get
(
'subtitle'
)
else
format
subtitle
=
s
.
get
(
'subtitle'
)
if
s
.
get
(
'subtitle'
)
else
format
if
format
and
graded_total
[
1
]
>
0
:
if
format
and
graded_total
[
1
]
>
0
:
format_scores
=
total_scores
[
format
]
if
format
in
total_scores
else
[]
format_scores
=
total_scores
[
format
]
if
format
in
total_scores
else
[]
format_scores
.
append
(
graded_total
)
format_scores
.
append
(
graded_total
+
(
s
.
get
(
"name"
),)
)
total_scores
[
format
]
=
format_scores
total_scores
[
format
]
=
format_scores
score
=
{
'section'
:
s
.
get
(
"name"
),
score
=
{
'section'
:
s
.
get
(
"name"
),
...
@@ -165,18 +165,17 @@ def profile(request):
...
@@ -165,18 +165,17 @@ def profile(request):
for
i
in
range
(
12
):
for
i
in
range
(
12
):
if
i
<
len
(
homework_scores
):
if
i
<
len
(
homework_scores
):
percentage
=
homework_scores
[
i
][
0
]
/
float
(
homework_scores
[
i
][
1
])
percentage
=
homework_scores
[
i
][
0
]
/
float
(
homework_scores
[
i
][
1
])
summary
=
"
{0:.0
%
} ({1:g}/{2:g})"
.
format
(
percentage
,
homework_scores
[
i
][
0
],
homework_scores
[
i
][
1
]
)
summary
=
"
Homework {0} - {1} - {2:.0
%
} ({3:g}/{4:g})"
.
format
(
i
+
1
,
homework_scores
[
i
][
2
]
,
percentage
,
homework_scores
[
i
][
0
],
homework_scores
[
i
][
1
]
)
else
:
else
:
percentage
=
0
percentage
=
0
summary
=
"
0
%
(?/?)"
summary
=
"
Unreleased Homework {0} - 0
%
(?/?)"
.
format
(
i
+
1
)
if
settings
.
GENERATE_PROFILE_SCORES
:
if
settings
.
GENERATE_PROFILE_SCORES
:
points_possible
=
random
.
randrange
(
10
,
50
)
points_possible
=
random
.
randrange
(
10
,
50
)
points_earned
=
random
.
randrange
(
5
,
points_possible
)
points_earned
=
random
.
randrange
(
5
,
points_possible
)
percentage
=
points_earned
/
float
(
points_possible
)
percentage
=
points_earned
/
float
(
points_possible
)
summary
=
"{0:.0
%
} ({1:g}/{2:g})"
.
format
(
percentage
,
points_earned
,
points_possible
)
summary
=
"
Random Homework -
{0:.0
%
} ({1:g}/{2:g})"
.
format
(
percentage
,
points_earned
,
points_possible
)
summary
=
"Homework {0} - {1}"
.
format
(
i
+
1
,
summary
)
label
=
"HW {0:02d}"
.
format
(
i
+
1
)
label
=
"HW {0:02d}"
.
format
(
i
+
1
)
homework_percentages
.
append
(
{
'percentage'
:
percentage
,
'summary'
:
summary
,
'label'
:
label
}
)
homework_percentages
.
append
(
{
'percentage'
:
percentage
,
'summary'
:
summary
,
'label'
:
label
}
)
...
@@ -189,18 +188,17 @@ def profile(request):
...
@@ -189,18 +188,17 @@ def profile(request):
for
i
in
range
(
12
):
for
i
in
range
(
12
):
if
i
<
len
(
lab_scores
):
if
i
<
len
(
lab_scores
):
percentage
=
lab_scores
[
i
][
0
]
/
float
(
lab_scores
[
i
][
1
])
percentage
=
lab_scores
[
i
][
0
]
/
float
(
lab_scores
[
i
][
1
])
summary
=
"
{0:.0
%
} ({1:g}/{2:g})"
.
format
(
percentage
,
lab_scores
[
i
][
0
],
lab_scores
[
i
][
1
]
)
summary
=
"
Lab {0} - {1} - {2:.0
%
} ({3:g}/{4:g})"
.
format
(
i
+
1
,
lab_scores
[
i
][
2
]
,
percentage
,
lab_scores
[
i
][
0
],
lab_scores
[
i
][
1
]
)
else
:
else
:
percentage
=
0
percentage
=
0
summary
=
"
0
%
(?/?)"
summary
=
"
Unreleased Lab {0} - 0
%
(?/?)"
.
format
(
i
+
1
)
if
settings
.
GENERATE_PROFILE_SCORES
:
if
settings
.
GENERATE_PROFILE_SCORES
:
points_possible
=
random
.
randrange
(
10
,
50
)
points_possible
=
random
.
randrange
(
10
,
50
)
points_earned
=
random
.
randrange
(
5
,
points_possible
)
points_earned
=
random
.
randrange
(
5
,
points_possible
)
percentage
=
points_earned
/
float
(
points_possible
)
percentage
=
points_earned
/
float
(
points_possible
)
summary
=
"{0:.0
%
} ({1:g}/{2:g})"
.
format
(
percentage
,
points_earned
,
points_possible
)
summary
=
"
Random Lab -
{0:.0
%
} ({1:g}/{2:g})"
.
format
(
percentage
,
points_earned
,
points_possible
)
summary
=
"Lab {0} - {1}"
.
format
(
i
+
1
,
summary
)
label
=
"Lab {0:02d}"
.
format
(
i
+
1
)
label
=
"Lab {0:02d}"
.
format
(
i
+
1
)
lab_percentages
.
append
(
{
'percentage'
:
percentage
,
'summary'
:
summary
,
'label'
:
label
}
)
lab_percentages
.
append
(
{
'percentage'
:
percentage
,
'summary'
:
summary
,
'label'
:
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