Skip to content

Commit

Permalink
Merge pull request #3156 from learningequality/develop
Browse files Browse the repository at this point in the history
Develop into central-develop
  • Loading branch information
jamalex committed Mar 9, 2015
2 parents ee90bd5 + 50b8108 commit e6f34b2
Show file tree
Hide file tree
Showing 111 changed files with 3,698 additions and 7,910 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ writeup/
/data/logs
/data/i18n
/data/subtitles
/data/screenshots
/kalite/*.jpg
/kalite/*.mp4.part
/kalite/i18n/data/dubbed_video_mappings.json
Expand All @@ -50,11 +51,14 @@ writeup/
/kalite/secrets.py
/kalite/static
/kalite/i18n/static/js/i18n
/kalite/ghostdriver.log
/TAGS
.tags
/kalite/i18n/static/
/.vagrant/
ghostdriver.log
/kalite/_built.touch
*.swp
sphinx-docs/_build
sphinx-docs/images/*
/data/khan/assessmentitems.json.version
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Please include the following information when opening an issue:
* The branch you found the issue on
* The current date / the build that the issue affects
* Expected behavior
* Actual behavior
* Steps to reproduce (be detailed!)

If opening a PR, please observe the following guidelines
* If you're fixing a bug, write a regression test (or have a really good reason for not writing one... and I mean **really** good!)
* Update the documentation if your changes affect it (don't just assume they don't)
* Double check your own code for good style
16 changes: 10 additions & 6 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,20 @@ See: https://khan-exercises.readthedocs.org/en/latest/#small-print


------------------------------------------------------------------------------
For the Khan Academy content (exercises and videos):
For the Khan Academy content (Perseus exercises):
------------------------------------------------------------------------------
Unless otherwise indicated, all Licensed Educational Content is the property of Khan Academy or its subsidiaries or affiliated companies and/or third-party licensors and, subject to the terms and conditions of these Terms, is licensed to You under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License (available at http://creativecommons.org/licenses/by-nc-sa/3.0/us/) (the “Creative Commons License”).
Perseus exercise data is copyright Khan Academy and its partners, and is included here with permission.

See: http://www.khanacademy.org/about/tos#7
For full content license, see: http://www.khanacademy.org/about/tos#7


------------------------------------------------------------------------------
For the Khan Academy content (videos):
------------------------------------------------------------------------------
Unless otherwise indicated, the subset of the Khan Academy videos that are downloadable into KA Lite are released under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License (available at http://creativecommons.org/licenses/by-nc-sa/3.0/us/) (the “Creative Commons License”).

For full content license, see: http://www.khanacademy.org/about/tos#7

------------------------------------------------------------------------------
For the Python packages found under "ka-lite/python-packages":
(please alert us to any discrepancies)
Expand Down Expand Up @@ -57,6 +64,3 @@ requests
Under the ASL license v2 (http://www.apache.org/licenses/LICENSE-2.0.html):
rsa
south

Under LGPL version 3 (http://www.gnu.org/licenses/lgpl.html):
mplayer
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ Official website: http://kalite.learningequality.org/
#### License information:

The KA Lite sourcecode itself is open-source [MIT licensed](http://opensource.org/licenses/MIT), and the other included software and content is licensed as described in the [LICENSE](https://raw.github.com/learningequality/ka-lite/master/LICENSE) file. Please note that KA Lite is not officially affiliated with, nor maintained by, Khan Academy, but rather makes use of Khan Academy's open API and Creative Commons content, which may only be used for non-commercial purposes.


[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/learningequality/ka-lite/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

77 changes: 41 additions & 36 deletions kalite/coachreports/hbtemplates/coach_nav/reports-nav.handlebars
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
<form id="coachreport-select-form" class="form-inline">
<div class="form-group">
<label for="report-select">{{_ "Report Type" }} ({{ selected }})&nbsp;&nbsp;</label>
<select id="report-select" class="reports-select form-control">
<option value="tabular"
{{#ifcond selected "===" "tabular" }}selected{{/ifcond}}>
{{_ "Tabular Report" }}
</option>
<option value="scatter"
{{#ifcond selected "===" "scatter" }}selected{{/ifcond}}>
{{_ "Scatter Report" }}
</option>
<option value="timeline"
{{#ifcond selected "===" "timeline" }}selected{{/ifcond}}>
{{_ "Timeline Report" }}
</option>
{{#if nalanda }}
<option value="test"
{{#ifcond selected "===" "test" }}selected{{/ifcond}}>
{{_ "Test Report" }}
</option>
<option value="spending"
{{#ifcond selected "===" "spending" }}selected{{/ifcond}}>
{{_ "Spending Report" }}
</option>
{{/if}}
</select>
</div><br/>
<div id="facility-select-container" class="form-group">
{{!-- Insert facility select template here --}}
</div><br/>
<div id="group-select-container" class="form-group">
{{!-- Insert group select template here --}}
</div><br/>
<br/>
<button id="display-coach-report" class="btn btn-primary btn">{{_ "Go" }}</button>
<form id="coachreport-select-form" class="form-vertical">
<div class="col-sm-4">
<div class="form-group">
<label for="report-select">{{_ "Report Type" }} ({{ selected }})&nbsp;&nbsp;</label>
<select id="report-select" class="reports-select form-control">
<option value="tabular"
{{#ifcond selected "===" "tabular" }}selected{{/ifcond}}>
{{_ "Tabular Report" }}
</option>
<option value="scatter"
{{#ifcond selected "===" "scatter" }}selected{{/ifcond}}>
{{_ "Scatter Report" }}
</option>
<option value="timeline"
{{#ifcond selected "===" "timeline" }}selected{{/ifcond}}>
{{_ "Timeline Report" }}
</option>
{{#if nalanda }}
<option value="test"
{{#ifcond selected "===" "test" }}selected{{/ifcond}}>
{{_ "Test Report" }}
</option>
<option value="spending"
{{#ifcond selected "===" "spending" }}selected{{/ifcond}}>
{{_ "Spending Report" }}
</option>
{{/if}}
</select>
</div>
</div>
<div class="col-sm-3">
<div id="facility-select-container" class="form-group">
{{!-- Insert facility select template here --}}
</div>
</div>
<div class="col-sm-3">
<div id="group-select-container" class="form-group">
{{!-- Insert group select template here --}}
</div>
</div>
<button id="display-coach-report" class="btn btn-primary btn reports-go-btn">{{_ "Go" }}</button>
</form>
9 changes: 3 additions & 6 deletions kalite/coachreports/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
from kalite.playlist.models import VanillaPlaylist as Playlist, QuizLog
from kalite.topic_tools import get_slug2id_map, get_id2slug_map, convert_leaf_url_to_id, get_leafed_topics, get_content_cache, get_exercise_cache

ID2SLUG_MAP = get_id2slug_map()
SLUG2ID_MAP = get_slug2id_map()

class PlaylistProgressParent:
"""Parent class for helpful class methods"""

Expand All @@ -20,7 +17,7 @@ def get_playlist_entry_ids(cls, playlist):
"""Return a tuple of the playlist's video ids and exercise ids as sets"""
playlist_entries = playlist.get("entries") or playlist.get("children")
# TODO(dylanjbarth): 0.13 playlist entities shouldn't have the /v or /e in them at all.
pl_video_ids = set([SLUG2ID_MAP.get(entry.get("entity_id")) or entry.get("id") for entry in playlist_entries if entry.get("entity_kind") == "Video"])
pl_video_ids = set([get_slug2id_map().get(entry.get("entity_id")) or entry.get("id") for entry in playlist_entries if entry.get("entity_kind") == "Video"])
pl_exercise_ids = set([entry.get("entity_id") or entry.get("id") for entry in playlist_entries if (entry.get("entity_kind") or entry.get("kind")) == "Exercise"])
return (pl_video_ids, pl_exercise_ids)

Expand Down Expand Up @@ -87,7 +84,7 @@ def user_progress(cls, user_id):
user_vid_logs, user_ex_logs = cls.get_user_logs(user)

exercise_ids = set([ex_log["exercise_id"] for ex_log in user_ex_logs])
video_ids = set([ID2SLUG_MAP.get(vid_log["video_id"]) for vid_log in user_vid_logs])
video_ids = set([get_id2slug_map().get(vid_log["video_id"]) for vid_log in user_vid_logs])
quiz_log_ids = [ql_id["quiz"] for ql_id in QuizLog.objects.filter(user=user).values("quiz")]
# Build a list of playlists for which the user has at least one data point
## TODO(dylanjbarth) this won't pick up playlists the user is assigned but has not started yet.
Expand Down Expand Up @@ -248,7 +245,7 @@ def user_progress_detail(cls, user_id, playlist_id):
if kind == "Divider":
continue
elif kind == "Video":
entity_id = SLUG2ID_MAP.get(ent.get("entity_id")) or ent.get("id")
entity_id = get_slug2id_map().get(ent.get("entity_id")) or ent.get("id")
vid_log = next((vid_log for vid_log in user_vid_logs if vid_log["video_id"] == entity_id), None)
if vid_log:
if vid_log.get("complete"):
Expand Down
38 changes: 29 additions & 9 deletions kalite/coachreports/static/css/coachreports/base.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
#coachreport-navigation-container {
padding-bottom: 30px;
margin-bottom: 15px;
}

.container-margin-bottom {
margin-bottom: 50px;
}

.coach-reports-row {
border-bottom: 3px solid #5AA685;
margin-bottom: 20px;
padding: 20px 0;
margin-bottom: 3%;
}

select.reports-select {
width: 300px !important;
}
#display-topic-report {
margin-top: 22px;
}

#display-coach-report {
margin-top: 20px;
margin-left: 16px;
}

#display-topic-report {
margin-top: 35px;
margin-left: 16px;
}

@media (min-width: 768px) {
#display-coach-report {
margin-top: 35px;
margin-left: 10px;
}

#display-topic-report {
margin-top: 35px;
margin-left: 0px;
}
}

.subtitle {
font-size: 1.15em;
font-weight: bold;
}
6 changes: 3 additions & 3 deletions kalite/coachreports/static/css/coachreports/scatter_view.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ table.detail td.data {
background-color: #cfc;
}

#legend-list {
#legend {
vertical-align:middle;
margin:12px 25px 2px 10px;
overflow: hidden;
}

.legend-item {
.legend {
float:left;
height:20px;
text-align:center;
Expand All @@ -71,7 +71,7 @@ table.detail td.data {
margin-right: 2px;

}
.legend-item div {
.legend div {
float:left;
width:35px;
height:21px;
Expand Down
5 changes: 0 additions & 5 deletions kalite/coachreports/static/css/coachreports/tabular_view.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
width: 100%;
}

.subtitle {
font-size: 1.15em;
font-weight: bold;
}

.subtitle.error {
margin-left: 4px;
margin-top: 15px;
Expand Down
14 changes: 6 additions & 8 deletions kalite/coachreports/templates/coachreports/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,12 @@
{# Now we create the coachreport selection bar #}
<div class="container container-margin-bottom">
<div class="row coach-reports-row">
<div class="col-sm-3">
<div class="subtitle coach-heading">
{# Note to translators: following this phrase is the name of a class. #}
{% trans "Coach Reports" %}
</div>
<div id="coachreport-navigation-container">
{# insert backbone magic here for coachreport navigation #}
</div>
<div class="subtitle coach-heading">
{# Note to translators: following this phrase is the name of a class. #}
{% trans "Coach Reports" %}
</div>
<div id="coachreport-navigation-container">
{# insert backbone magic here for coachreport navigation #}
</div>
</div>
{% block report_content %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
width: 900px;
height: 450px;
}
.subtitle {
float: left;
}
#summary {
border: 1px black solid;
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load my_filters %}

<div class="userstatus">
<table class="table table-hover table-bordered">
<table class="table table-bordered">
<thead>
<tr>
{% for exercise in exercises %}
Expand Down
Loading

0 comments on commit e6f34b2

Please sign in to comment.