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
0600de35
Commit
0600de35
authored
Mar 08, 2012
by
Kyle Fiedler
Browse files
Options
Browse Files
Download
Plain Diff
Merged with default
--HG-- branch : kf-sequence-nav
parents
2cd1b353
df15b6bd
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
251 additions
and
104 deletions
+251
-104
main.html
+1
-0
profile.html
+7
-8
profile_graphs.js
+72
-90
sass/_profile.scss
+26
-0
sass/courseware/_courseware.scss
+9
-0
sass/discussion/_answers.scss
+10
-0
sass/discussion/_forms.scss
+28
-0
sass/discussion/_question-view.scss
+15
-0
simplewiki_revision_feed.html
+63
-0
video_init.js
+20
-6
No files found.
main.html
View file @
0600de35
...
...
@@ -97,6 +97,7 @@
<script
type=
"text/javascript"
src=
"${ settings.LIB_URL }jquery.treeview.js"
></script>
<script
type=
"text/javascript"
src=
"/static/js/jquery.leanModal.min.js"
></script>
<script
type=
"text/javascript"
src=
"/static/js/jquery.cookie.js"
></script>
<script
type=
"text/javascript"
src=
"/static/js/video_player.js"
></script>
<script
type=
"text/javascript"
src=
"/static/js/schematic.js"
></script>
<script
type=
"text/javascript"
src=
"/static/js/cktsim.js"
></script>
...
...
profile.html
View file @
0600de35
...
...
@@ -29,8 +29,9 @@ $(function() {
loc
=
false
;
$
(
"#location_sub"
).
html
(
'<input id="id_loc_text" type="text" name="loc_text" />'
+
'<input type="button" id="change_loc_button" value="Change" />'
);
$
(
"#location_sub"
).
html
(
'<form>'
+
'<input id="id_loc_text" type="text" name="loc_text" />'
+
'<input type="submit" id="change_loc_button" value="Save" />'
+
'</form>'
);
$
(
"#change_loc_button"
).
click
(
function
()
{
$
(
"#change_location"
).
show
();
...
...
@@ -50,8 +51,8 @@ $(function() {
if
(
lang
)
{
lang
=
false
;
$
(
"#language_sub"
).
html
(
'<input id="id_lang_text" type="text" name="lang_text" />'
+
'<input type="button" id="change_lang_button" value="Change" /
>'
);
$
(
"#language_sub"
).
html
(
'<
form>'
+
'<
input id="id_lang_text" type="text" name="lang_text" />'
+
'<input type="submit" id="change_lang_button" value="Save" />'
+
'</form
>'
);
$
(
"#change_lang_button"
).
click
(
function
()
{
$
(
"#change_language"
).
show
();
postJSON
(
'/change_setting'
,
{
'language'
:
$
(
"#id_lang_text"
).
attr
(
"value"
)},
function
(
json
)
{
...
...
@@ -140,15 +141,13 @@ $(function() {
<li>
Forum name:
<strong>
${username}
</strong></li>
<li>
E-mail:
<strong>
${email}
</strong></li>
<li>
Location:
<div
id=
"location_sub"
>
${location}
</div><div
id=
"description"
></div>
<a
href=
"#"
id=
"change_location"
>
Change
</a>
Location:
<div
id=
"location_sub"
>
${location}
</div><div
id=
"description"
></div>
<a
href=
"#"
id=
"change_location"
>
Edit
</a>
</li>
<li>
Language:
<div
id=
"language_sub"
>
${language}
</div>
<a
href=
"#"
id=
"change_language"
>
Change
</a>
Language:
<div
id=
"language_sub"
>
${language}
</div>
<a
href=
"#"
id=
"change_language"
>
Edit
</a>
</li>
</ul>
<!-- <div><a class="modal" href="#change_password_pop">Reset password</a></div> -->
<div
id=
"change_password_pop"
>
<h2>
Password change
</h2>
<p>
We'll e-mail a password reset link to ${email}.
</p>
...
...
profile_graphs.js
View file @
0600de35
...
...
@@ -18,100 +18,103 @@ $(function () {
}
/* -------------------------------- Grade detail bars -------------------------------- */
var
colors
=
[
$
.
color
.
parse
(
"#b72121"
),
$
.
color
.
parse
(
"#600101"
),
$
.
color
.
parse
(
"#666666"
),
$
.
color
.
parse
(
"#333333"
)];
// var colors = [ $.color.parse("#2e80ce"), $.color.parse("#14518b"), $.color.parse("#599535"), $.color.parse("#3d731c")];
// var colors = [ $.color.parse("#3f80be"), $.color.parse("#128251"), $.color.parse("#e1b900"), $.color.parse("#d10404")];
//var colors = [$.color.parse("#1B2045"), $.color.parse("#557a00"), $.color.parse("#F5600"), $.color.parse("#FEBA2C")];
//var colors = [$.color.parse("#E7C856"), $.color.parse("#CD462E"), $.color.parse("#B01732"), $.color.parse("#41192A")];
//var colors = [$.color.parse("#434F5E"), $.color.parse("#BEF731"), $.color.parse("#FB5455"), $.color.parse("#44C4B7")];
//var colors = [$.color.parse("#147A7D"), $.color.parse("#C0C900"), $.color.parse("#C9005B"), $.color.parse("#FCF9A5")];
var
series
=
[];
var
ticks
=
[];
//These are the indices and x-axis labels for the data
var
bottomTicks
=
[];
//Labels on the bottom
var
detail_tooltips
=
{};
//This an dictionary mapping from 'section' -> array of detail_tooltips
var
droppedScores
=
[];
//These are the datapoints to indicate assignments which aren't factored into the total score
detail_tooltips
[
'Dropped Scores'
]
=
[];
<%
colors
=
[
"#b72121"
,
"#600101"
,
"#666666"
,
"#333333"
]
tickIndex
=
1
sectionSpacer
=
0.5
sectionIndex
=
0
%>
%
for
section
in
grade_summary
:
%
if
'subscores'
in
section
:
##
This
is
for
sections
like
labs
or
homeworks
,
with
several
smaller
components
and
a
total
series
.
push
({
label
:
"${section['category']}"
,
data
:
$
{
json
.
dumps
(
[[
i
+
tickIndex
,
score
[
'percentage'
]]
for
i
,
score
in
enumerate
(
section
[
'subscores'
])]
)
},
color
:
colors
[
$
{
sectionIndex
}].
toString
(),
});
ticks
=
ticks
.
concat
(
$
{
json
.
dumps
(
[[
i
+
tickIndex
,
score
[
'label'
]
]
for
i
,
score
in
enumerate
(
section
[
'subscores'
])]
)
}
);
bottomTicks
.
push
(
[
$
{
tickIndex
+
len
(
section
[
'subscores'
])
/
2
},
"${section['category']}"
]
);
detail_tooltips
[
"${section['category']}"
]
=
$
{
json
.
dumps
([
score
[
'summary'
]
for
score
in
section
[
'subscores'
]]
)
};
droppedScores
=
droppedScores
.
concat
(
$
{
json
.
dumps
(
[[
tickIndex
+
index
,
0.05
]
for
index
in
section
[
'dropped_indices'
]])
});
<%
dropExplanation
=
"The lowest {0} {1} scores are dropped"
.
format
(
len
(
section
[
'dropped_indices'
]),
section
[
'category'
]
)
%>
detail_tooltips
[
'Dropped Scores'
]
=
detail_tooltips
[
'Dropped Scores'
].
concat
(
$
{
json
.
dumps
(
[
dropExplanation
]
*
len
(
section
[
'dropped_indices'
])
)}
);
series
=
[]
ticks
=
[]
#
These
are
the
indices
and
x
-
axis
labels
for
the
data
bottomTicks
=
[]
#
Labels
on
the
bottom
detail_tooltips
=
{}
#
This
an
dictionary
mapping
from
'section'
->
array
of
detail_tooltips
droppedScores
=
[]
#
These
are
the
datapoints
to
indicate
assignments
which
aren
't factored into the total score
dropped_score_tooltips = []
<%
tickIndex
+=
len
(
section
[
'subscores'
])
+
sectionSpacer
%>
for section in grade_summary:
if '
subscores
' in section: ##This is for sections like labs or homeworks, with several smaller components and a total
series.append({
'
label
' : section['
category
'],
'
data
' : [[i + tickIndex, score['
percentage
']] for i,score in enumerate(section['
subscores
'])],
'
color
' : colors[sectionIndex]
})
##
Now
put
on
the
aggregate
score
series
.
push
({
label
:
"${section['category']} Total"
,
data
:
[[
$
{
tickIndex
},
$
{
section
[
'totalscore'
][
'score'
]}]],
color
:
colors
[
$
{
sectionIndex
}].
toString
(),
});
ticks
=
ticks
.
concat
(
[
[
$
{
tickIndex
},
"${section['totallabel']}"
]
]
);
detail_tooltips
[
"${section['category']} Total"
]
=
[
"${section['totalscore']['summary']}"
];
<%
tickIndex
+=
1
+
sectionSpacer
%>
%
else
:
##
This
is
for
sections
like
midterm
or
final
,
which
have
no
smaller
components
series
.
push
({
label
:
"${section['category']}"
,
data
:
[[
$
{
tickIndex
},
$
{
section
[
'totalscore'
][
'score'
]}]],
color
:
colors
[
$
{
sectionIndex
}].
toString
(),
});
ticks
=
ticks
.
concat
(
[
[
$
{
tickIndex
},
" ${section['totallabel']}"
]
]
);
ticks += [[i + tickIndex, score['
label
'] ] for i,score in enumerate(section['
subscores
'])]
bottomTicks.append( [tickIndex + len(section['
subscores
'])/2, section['
category
']] )
detail_tooltips[ section['
category
'] ] = [score['
summary
'] for score in section['
subscores
']]
detail_tooltips
[
"${section['category']}"
]
=
[
"${section['totalscore']['summary']}"
];
droppedScores += [[tickIndex + index, 0.05] for index in section['
dropped_indices
']]
<%
tickIndex
+=
1
+
sectionSpacer
%>
%
endif
<%
sectionIndex
+=
1
%>
%
endfor
dropExplanation = "The lowest {0} {1} scores are dropped".format( len(section['
dropped_indices
']), section['
category
'] )
dropped_score_tooltips += [dropExplanation] * len(section['
dropped_indices
'])
//Alwasy be sure that one series has the xaxis set to 2, or the second xaxis labels won't show up
series
.
push
(
{
label
:
'Dropped Scores'
,
data
:
droppedScores
,
points
:
{
symbol
:
"cross"
,
show
:
true
,
radius
:
3
},
bars
:
{
show
:
false
},
color
:
"#333"
}
);
tickIndex += len(section['
subscores
']) + sectionSpacer
/* ----------------------------- Grade overviewew bar -------------------------*/
<%
category_total_label = section['
category
'] + " Total"
series.append({
'
label
' : category_total_label,
'
data
' : [ [tickIndex, section['
totalscore
']['
score
']] ],
'
color
' : colors[sectionIndex]
})
ticks.append( [tickIndex, section['
totallabel
']] )
detail_tooltips[category_total_label] = [section['
totalscore
']['
summary
']]
else:
series.append({
'
label
' : section['
category
'],
'
data
' : [ [tickIndex, section['
totalscore
']['
score
']] ],
'
color
' : colors[sectionIndex]
})
ticks.append( [tickIndex, section['
totallabel
']] )
detail_tooltips[section['
category
']] = [section['
totalscore
']['
summary
']]
tickIndex += 1 + sectionSpacer
sectionIndex += 1
detail_tooltips['
Dropped
Scores
'] = dropped_score_tooltips
## ----------------------------- Grade overviewew bar ------------------------- ##
totalWeight = 0.0
sectionIndex = 0
totalScore = 0.0
overviewBarX = tickIndex
%>
%
for
section
in
grade_summary
:
<%
for section in grade_summary:
weighted_score = section['
totalscore
']['
score
'] * section['
weight
']
summary_text = "{0} - {1:.1%} of a possible {2:.0%}".format(section['
category
'], weighted_score, section['
weight
'])
%>
%
if
section
[
'totalscore'
][
'score'
]
>
0
:
series
.
push
({
label
:
"${section['category']} - Weighted"
,
data
:
[[
$
{
overviewBarX
},
$
{
weighted_score
}]],
color
:
colors
[
$
{
sectionIndex
}].
toString
(),
});
%
endif
detail_tooltips
[
"${section['category']} - Weighted"
]
=
[
"${summary_text}"
];
<%
weighted_category_label = section['
category
'] + " - Weighted"
if section['
totalscore
']['
score
'] > 0:
series.append({
'
label
' : weighted_category_label,
'
data
' : [ [overviewBarX, weighted_score] ],
'
color
' : colors[sectionIndex]
})
detail_tooltips[weighted_category_label] = [ summary_text ]
sectionIndex += 1
totalWeight += section['
weight
']
totalScore += section['
totalscore
']['
score
'] * section['
weight
']
ticks += [ [overviewBarX, "Total"] ]
tickIndex += 1 + sectionSpacer
%>
%
endfor
ticks
=
ticks
.
concat
(
[
[
$
{
overviewBarX
},
"Total"
]
]
);
<%
tickIndex
+=
1
+
sectionSpacer
%>
var series = ${ json.dumps(series) };
var ticks = ${ json.dumps(ticks) };
var bottomTicks = ${ json.dumps(bottomTicks) };
var detail_tooltips = ${ json.dumps(detail_tooltips) };
var droppedScores = ${ json.dumps(droppedScores) };
//Alwasy be sure that one series has the xaxis set to 2, or the second xaxis labels won'
t
show
up
series
.
push
(
{
label
:
'Dropped Scores'
,
data
:
droppedScores
,
points
:
{
symbol
:
"cross"
,
show
:
true
,
radius
:
3
},
bars
:
{
show
:
false
},
color
:
"#333"
}
);
var
options
=
{
series
:
{
stack
:
true
,
...
...
@@ -131,29 +134,8 @@ $(function () {
var
o
=
plot
.
pointOffset
({
x
:
$
{
overviewBarX
}
,
y
:
$
{
totalScore
}});
$grade_detail_graph
.
append
(
'<div style="position:absolute;left:'
+
(
o
.
left
-
12
)
+
'px;top:'
+
(
o
.
top
-
20
)
+
'px">${"{totalscore:.0%}".format(totalscore=totalScore)}</div>'
);
// //Rotate the x-axis labels
// var rotateValue = "rotate(-60deg)";
// var rotateOrigin = "bottom left";
// $("#grade-detail-graph .x1Axis .tickLabel").css( {
// '-webkit-transform': rotateValue,
// '-moz-transform': rotateValue,
// '-ms-transform': rotateValue,
// '-o-transform': rotateValue,
// 'transform': rotateValue,
//
// '-webkit-transform-origin': rotateOrigin,
// '-moz-transform-origin': rotateOrigin,
// '-ms-transform-origin': rotateOrigin,
// '-o-transform-origin': rotateOrigin,
//
// 'text-align' : 'left',
// });
}
var
previousPoint
=
null
;
$
(
"#grade-detail-graph"
).
bind
(
"plothover"
,
function
(
event
,
pos
,
item
)
{
$
(
"#x"
).
text
(
pos
.
x
.
toFixed
(
2
));
...
...
sass/_profile.scss
View file @
0600de35
...
...
@@ -26,13 +26,26 @@ div.profile-wrapper {
@include
box-shadow
(
0
1px
0
#eee
);
padding
:
7px
lh
();
border-bottom
:
1px
solid
#d3d3d3
;
position
:
relative
;
div
#location_sub
,
div
#language_sub
{
font-weight
:
bold
;
@include
inline-block
();
form
{
width
:
100%
;
}
input
{
&
[
type
=
"text"
]
{
margin
:
lh
(
.5
)
0
;
width
:
100%
;
@include
box-sizing
(
border-box
);
}
&
[
type
=
"input"
]
{
}
}
&
:empty
{
...
...
@@ -43,6 +56,19 @@ div.profile-wrapper {
div
#description
{
font-size
:
12px
;
}
a
#change_language
,
a
#change_location
{
position
:
absolute
;
top
:
9px
;
right
:
lh
(
.5
);
text-transform
:
uppercase
;
font-size
:
12px
;
color
:
#999
;
&
:hover
{
color
:
#555
;
}
}
}
}
...
...
sass/courseware/_courseware.scss
View file @
0600de35
...
...
@@ -173,6 +173,15 @@ div.course-wrapper {
margin-left
:
lh
();
}
}
div
.staff_info
{
white-space
:
pre-wrap
;
border-top
:
1px
solid
#ccc
;
padding-top
:
lh
();
margin-top
:
lh
();
line-height
:
lh
();
font-family
:
Consolas
,
"Lucida Console"
,
Monaco
,
"Courier New"
,
Courier
,
monospace
;
}
}
&
.closed
{
...
...
sass/discussion/_answers.scss
View file @
0600de35
...
...
@@ -42,6 +42,16 @@ div.answer-block {
padding-top
:
20px
;
width
:
100%
;
div
.official-stamp
{
background
:
$mit-red
;
color
:
#fff
;
font-size
:
12px
;
margin-top
:
10px
;
padding
:
2px
5px
;
text-align
:
center
;
margin-left
:
-1px
;
}
img
.answer-img-accept
{
margin
:
10px
0px
10px
16px
;
}
...
...
sass/discussion/_forms.scss
View file @
0600de35
...
...
@@ -129,3 +129,31 @@ form.question-form {
margin-top
:
10px
;
}
}
div
#question-list
{
background-color
:
rgba
(
255
,
255
,
255
,
0
.95
);
@include
box-sizing
(
border-box
);
margin-top
:
-15px
;
max-width
:
505px
;
min-width
:
300px
;
overflow
:
hidden
;
padding-left
:
5px
;
position
:
absolute
;
width
:
35%
;
z-index
:
9999
;
h2
{
text-transform
:
none
;
padding
:
8px
0
;
border-bottom
:
1px
solid
#eee
;
margin
:
0
;
span
{
background
:
#eee
;
color
:
#555
;
padding
:
2px
5px
;
@include
border-radius
(
2px
);
margin-right
:
5px
;
}
}
}
sass/discussion/_question-view.scss
View file @
0600de35
...
...
@@ -181,6 +181,21 @@ div.question-header {
&
:first-child
{
border-top
:
0
;
}
&
.official
{
padding-top
:
10px
;
span
.official-comment
{
background
:
$mit-red
;
color
:
#fff
;
display
:
block
;
font-size
:
12px
;
margin
:
0
0
10px
-5%
;
padding
:
2px
5px
2px
5%
;
text-align
:
left
;
width
:
100px
;
}
}
}
form
.post-comments
{
...
...
simplewiki_revision_feed.html
0 → 100644
View file @
0600de35
##This file is based on the template from the SimpleWiki source which carries the GPL license
<
%
inherit
file=
"simplewiki_base.html"
/>
<
%
block
name=
"title"
><title>
Revision feed - MITx 6.002x Wiki
</title></
%
block>
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%
block
name=
"wiki_page_title"
>
<h1>
Revision Feed - Page ${wiki_page}
</h1>
</
%
block>
<
%
block
name=
"wiki_body"
>
<table
id=
"wiki_history_table"
class=
"wiki-history"
>
<thead>
<tr>
<th
id=
"revision"
>
Revision
</th>
<th
id=
"comment"
>
Comment
</th>
<th
id=
"diff"
>
Diff
</th>
<th
id=
"modified"
>
Modified
</th>
</tr>
</thead>
<tbody>
<
%
loopCount =
0
%
>
%for revision in wiki_history:
%if revision.deleted
<
2
or
show_delete_revision:
<%
loopCount
+=
1
%
>
<tr
style=
"border-top: 1px"
class=
"${'dark ' if (loopCount % 2) == 0 else ''}${'deleted ' if (revision.deleted==2) else ''}"
>
<td
width=
"15px"
>
<a
href=
"${reverse('wiki_view_revision',args=[revision.counter, revision.article.get_url()])}"
>
${revision.article.title} - ${revision}
</a>
</td>
<td>
${ revision.revision_text if revision.revision_text else "
<i>
None
</i>
" }
</td>
<td
class=
"diff"
>
%for x in revision.get_diff():
${x|h}
<br/>
%endfor
</td>
<td>
${revision.get_user()}
<br/>
${revision.revision_date.strftime("%b %d, %Y, %I:%M %p")}
</td>
</tr>
%endif
%endfor
</tbody>
%if wiki_prev_page or wiki_next_page:
<tfoot>
<tr>
<td
colspan=
"4"
>
%if wiki_prev_page:
<a
href=
"${reverse("
wiki_revision_feed
",
args=
[wiki_prev_page])}"
>
Previous page
</a>
%endif
%if wiki_next_page:
<a
href=
"${reverse("
wiki_revision_feed
",
args=
[wiki_next_page])}"
>
Next page
</a>
%endif
</td>
</tr>
</tfoot>
%endif
</table>
</
%
block>
video_init.js
View file @
0600de35
...
...
@@ -30,14 +30,13 @@ function good() {
ajax_video
=
good
;
loadNewVideo
(
streams
[
"1.0"
],
$
{
position
});
// load the same video speed your last video was at in a sequence
// if the last speed played on video doesn't exist on another video just use 1.0 as default
function
add_speed
(
key
,
stream
)
{
var
id
=
'speed_'
+
stream
;
//TODO: this should be smarter and know which video is first selected when we have
// video speed as an option/parameter per user that is saved
if
(
key
==
1.0
)
{
if
(
key
==
video_speed
)
{
$
(
"#video_speeds"
).
append
(
' <li class=active id="'
+
id
+
'">'
+
key
+
'x</li>'
);
}
else
{
$
(
"#video_speeds"
).
append
(
' <li id="'
+
id
+
'">'
+
key
+
'x</li>'
);
...
...
@@ -64,9 +63,24 @@ function sort_by_value(a,b) {
l
.
sort
(
sort_by_value
);
for
(
var
i
=
0
;
i
<
l
.
length
;
i
++
)
{
$
(
document
).
ready
(
function
()
{
video_speed
=
$
.
cookie
(
"video_speed"
);
console
.
log
(
"ready"
);
console
.
log
(
video_speed
);
if
((
!
video_speed
)
||
(
!
streams
[
video_speed
]
))
{
video_speed
=
"1.0"
;
}
console
.
log
(
video_speed
);
loadNewVideo
(
streams
[
"1.0"
],
streams
[
video_speed
],
$
{
position
});
for
(
var
i
=
0
;
i
<
l
.
length
;
i
++
)
{
add_speed
(
l
[
i
],
streams
[
l
[
i
]])
}
}
});
function
toggleVideo
(){
if
(
$
(
"#video_control"
).
hasClass
(
"play"
)){
...
...
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