Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.15.x to central-develop #4683

Merged
merged 61 commits into from
Nov 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
2da4cac
fix #4382 -- we are MIT licensed
benjaoming Sep 7, 2015
5d6ddd7
Merge pull request #4384 from benjaoming/mit-license
jamalex Sep 7, 2015
7073fb4
Actually translate assessment item data.
rtibbles Sep 24, 2015
b2e0fee
Use empty list not string of empty list.
rtibbles Sep 24, 2015
a1dd608
Merge pull request #4482 from rtibbles/assessment_item_translate_0.14.x
aronasorman Sep 24, 2015
4e82a5b
Add warning to langauge pack download completion to restart server.
rtibbles Sep 24, 2015
45b1e7c
Merge pull request #4491 from rtibbles/download_fix
aronasorman Sep 24, 2015
5ce63a6
Update install_all.rst
arnoan Sep 24, 2015
1224480
Merge pull request #4493 from arnoan/patch-1
aronasorman Sep 25, 2015
c1b4045
Generate a secret key file, and load SECRET_KEY from said file.
aronasorman Sep 24, 2015
0818d65
Merge pull request #4494 from aronasorman/4213
aronasorman Sep 25, 2015
306de74
bump version to 0.14.1.
Sep 30, 2015
39413a3
Merge pull request #4485 from learningequality/0.14.x
benjaoming Oct 5, 2015
78552b6
Avoid unnecessary dependencies for old dbbackup version
benjaoming Oct 7, 2015
3ed84eb
Update requirements.txt
benjaoming Oct 7, 2015
290b4fc
Change version comparison logic
MCGallaspy Oct 7, 2015
dceccca
Merge pull request #4587 from MCGallaspy/lang-pack-js-fix
aronasorman Oct 7, 2015
1d47b8d
Increment version to 0.14.2.
aronasorman Oct 8, 2015
718cbb4
Merge pull request #4588 from learningequality/0.14.x
benjaoming Oct 8, 2015
a51c6af
Put note in release_notes and system_requirements
djallado Oct 8, 2015
e83b429
Reinstate Khan i18n helpers, overwrite $._ to ensure translation.
rtibbles Oct 9, 2015
2b71b96
Update the documentation to upgrade on kalite OS X installer.
mrpau-richard Oct 9, 2015
ad1655d
Add step to install kalite OS X installer
mrpau-richard Oct 9, 2015
e8f52eb
Update the release notes.
mrpau-richard Oct 9, 2015
8efdcdb
Merge pull request #4590 from mrpau/4501-final-docs-release-notes
cpauya Oct 9, 2015
6cf3eac
Merge pull request #4585 from learningequality/dbbackup-version-update
aronasorman Oct 9, 2015
bd8df62
Merge pull request #4597 from rtibbles/update_perseus
aronasorman Oct 9, 2015
f268378
Include docs in sdist and add Makefile for common build, dev, test
benjaoming Oct 2, 2015
03b6df0
do not clean before making assets, bad for automated testing scenario
benjaoming Oct 11, 2015
e8444ab
Fixes doRequest reference.
rtibbles Oct 12, 2015
b2e9ad8
Don't try to parse empty responses. Bloody TastyPie.
rtibbles Oct 12, 2015
903cf61
Translate stuff in the guts of Khan Exercises i18n.
rtibbles Oct 12, 2015
c91c646
Say 0.16 about the fix for cmd line options
benjaoming Oct 12, 2015
f7ce373
Remove regressions from bad rebase
benjaoming Oct 12, 2015
f01c301
fix platform dependent pattern
benjaoming Oct 12, 2015
435d35a
use @MCGallaspy's wording
benjaoming Oct 12, 2015
aa5c0c1
Adds additional requires for force_sync.
rtibbles Oct 12, 2015
583743c
Merge pull request #4565 from benjaoming/makefile-dist-docs
MCGallaspy Oct 12, 2015
928d890
Fix require stmt
MCGallaspy Oct 12, 2015
7a48b87
Merge pull request #22 from MCGallaspy/fix_js_errors
rtibbles Oct 12, 2015
7e9f53e
Merge pull request #4607 from rtibbles/fix_js_errors
MCGallaspy Oct 12, 2015
ae9d94a
automatically generate a manpage and put it in docs/
benjaoming Oct 13, 2015
791fba0
Merge pull request #4618 from benjaoming/manpage
MCGallaspy Oct 13, 2015
b813124
Merge branch 'master' into 0.15.x
benjaoming Oct 13, 2015
64cadec
Fix regressions introduced from merge with 0.14 master
benjaoming Oct 13, 2015
4bf1bd0
Merge pull request #4621 from benjaoming/master-into-0.15.x
benjaoming Oct 13, 2015
278687a
Update install_all.rst
MCGallaspy Oct 14, 2015
129b271
Upgrade to latest dbbackup #4634
benjaoming Oct 19, 2015
ee7107a
Merge pull request #4635 from benjaoming/fix-dbbackup-req
aronasorman Oct 20, 2015
b656555
propagate the request language in user progress.
aronasorman Nov 17, 2015
d0232c9
set the right default language logic for user_progress_detail.
aronasorman Nov 17, 2015
2576612
refactor user_progress_detail to not use create_empty_entry.
aronasorman Nov 18, 2015
1df82a5
add i18n tags.
aronasorman Nov 18, 2015
ef9135e
propagate language in our coachreports.
aronasorman Nov 18, 2015
cbd178d
Sprinkle a bit of that i18n dust.
aronasorman Nov 18, 2015
cc60303
Handle missing exercise; handle StopIteration exc; model error
MCGallaspy Nov 18, 2015
e7127a9
Decrease # of db hits
MCGallaspy Nov 18, 2015
690a13f
Amend docstrings
MCGallaspy Nov 18, 2015
c48fba6
Amend test -- click non-zero area element
MCGallaspy Nov 19, 2015
ff7a099
Merge pull request #4675 from MCGallaspy/cont-rec-fix-4603
rtibbles Nov 19, 2015
dca97a9
Merge pull request #4673 from aronasorman/i18n-progress-reports
rtibbles Nov 19, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ dist-packages-temp/
dist-packages-downloads/
dist-packages/

# Generated by kalite manage setup
secretkey.txt

# User cache data generated at runtime
cache/

Expand All @@ -48,13 +45,21 @@ static-updates
# Python compiling
*.pyc
*.pyo

# Backup files
*~

# Sublime editor
*.sublime-*

# Ignore all .zip files!? No comment?? Needs fixing, I guess it's to avoid
# committing local assessment items.
*.zip

# Documentation
docs/_build
docs/images/*
docs/kalite.1.gz

# oh-my-zsh convention for automatically
# switching on a venv
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in.dist
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ recursive-include data *
# Necessary because it's a data directory so they
# do not get automatically excluded
recursive-exclude python-packages *pyc

# Docs
recursive-include docs/_build/html *
97 changes: 97 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
.PHONY: clean-pyc clean-build docs clean

help:
@echo "clean - remove all build, test, coverage and Python artifacts"
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "clean-test - remove test and coverage artifacts"
@echo "lint - check style with pep8"
@echo "test - run tests the default Python"
@echo "test-bdd - run BDD tests only"
@echo "test-nobdd - run non-BDD tests only"
@echo "assets - build all JS/CSS assets"
@echo "coverage - check code coverage quickly with the default Python"
@echo "docs - generate Sphinx HTML documentation, including API docs"
@echo "release - package and upload a release"
@echo "dist - package locally"
@echo "install - install the package to the active Python's site-packages"

clean: clean-build clean-pyc clean-test

clean-build:
rm -fr build/
rm -fr dist/
rm -fr .eggs/
rm -fr dist-packages/
rm -fr dist-packages-temp/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +

clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +

clean-test:
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/

lint:
pep8 kalite
jshint kalite/*/static/js/*/

test:
bin/kalite manage test --bdd-only

test-bdd:
bin/kalite manage test --bdd-only

test-nobdd:
bin/kalite manage test --no-bdd

test-all:
@echo "Not supported yet"
# tox

coverage:
coverage run --source kalite kalitectl.py test
coverage report -m

coverage-bdd:
coverage run --source kalite kalitectl.py test --bdd-only
coverage report -m

coverage-nobdd:
coverage run --source kalite kalitectl.py test --no-bdd
coverage report -m

docs:
# rm -f docs/ka-lite.rst
# rm -f docs/modules.rst
# sphinx-apidoc -o docs/ ka-lite-gtk
$(MAKE) -C docs clean
$(MAKE) -C docs html
cli2man bin/kalite -o docs/kalite.1.gz
# open docs/_build/html/index.html

assets:
# Necessary because NPM may have wrong versions in the cache
npm cache clean
npm install --production
node build.js
bin/kalite manage compileymltojson

release: clean docs assets
python setup.py sdist --formats=gztar,zip upload --sign
python setup.py sdist --formats=gztar,zip upload --sign --static
ls -l dist

dist: clean docs assets
python setup.py sdist
python setup.py sdist --static
ls -l dist

install: clean
python setup.py install
11 changes: 7 additions & 4 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,25 @@ dependencies:
override:
- pip install -r requirements_test.txt
- pip install -e .
- npm install
- npm install -g jshint
# This cannot be done because pip on Circle doesn't understand our sdist
# - make sdist
# - pip install dist/ka-lite-"$(python setup.py --version)".tar.gz
post:
- if [[ ! -e sc-latest-linux/bin/sc ]]; then wget https://saucelabs.com/downloads/sc-latest-linux.tar.gz && tar -xzf sc-latest-linux.tar.gz && mv sc-*-linux sc-latest-linux; fi

test:
override:
- node build.js
- make assets
- kalite start --settings=kalite.project.settings.disk_based_cache --traceback -v2
- kalite status
- kalite stop --traceback -v2
- cd sc-*-linux && ./bin/sc -u $SAUCE_USERNAME -k $SAUCE_ACCESS_KEY --tunnel-identifier $CIRCLE_BUILD_NUM-$CIRCLE_NODE_INDEX --readyfile ~/sauce_is_ready > sc_output.txt 2>&1:
background: true
- while [ ! -e ~/sauce_is_ready ]; do sleep 1; done
- case $CIRCLE_NODE_INDEX in 0) kalite manage test --bdd-only ;; 1) kalite manage test --no-bdd;; esac:
- case $CIRCLE_NODE_INDEX in 0) make test-bdd ;; 1) make test-nobdd;; esac:
parallel: true
# TODO: replace below with "make link" when we're pep8
- npm install -g jshint
- jshint kalite/*/static/js/*/
post:
- killall --wait sc # wait for Sauce Connect to close the tunnel
1 change: 0 additions & 1 deletion data/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
students:
coaches: []
admins: []

bugs_fixed:
all:
Properly compare language pack versions (#4587).
Expand Down
49 changes: 31 additions & 18 deletions docs/installguide/install_all.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,50 @@ Windows
Upgrading KA Lite over an existing installation is easy -- just run the installer and follow the prompts!
You don't need to uninstall your old KA Lite installation first.

Mac/OSX
=======
Mac OS X
========

.. warning:: The latest OS X version (EL Capitan) is not yet supported.

**Note:** The latest OSX version (EL Capitan) is not yet supported.
Installation
____________

#. Download the KA Lite `OSX installer <https://learningequality.org/r/osx-installer-0-15>`_.
#. After the download is complete, double click the .dmg file.
#. Click the ``Agree`` button to accept the LICENSE agreement.
#. On the .dmg window, drag the ``KA-Lite Monitor`` app into the ``Applications`` folder.

.. note::
To upgrade an existing KA Lite installation, download the new installer and then drag it over to the "Applications"
folder to replace the existing "KA-Lite-Monitor" application.
Give confirmation to overwrite the existing app. Then proceed from this step as usual.
#. Launch ``KA-Lite Monitor`` from your ``Applications`` folder.
#. On first load, it will check your current environment and show the Preferences dialog.
#. Input your preferred admin username and password, then click the Apply button in ``KA-Lite Preferences`` dialog.
#. Input your preferred administrator username and password, then click the ``Apply`` button in ``KA-Lite Preferences`` dialog.
#. You will be prompted that initial setup will take a few minutes, click the ``OK`` button and wait for the notification that KA-Lite has been setup and can now be started.
#. Click on the KA-Lite logo icon on the Status Menu Bar and select the ``Start KA-Lite`` menu option.
#. Click on the KA-Lite logo icon on the menu bar and select the ``Start KA-Lite`` menu option.
#. Wait for the notification that you can now click on ``Open in Browser`` menu option.
#. Click on the KA-Lite logo icon on the Status Menu Bar and select ``Open in Browser`` menu option - this should launch KA-Lite in your preferred web browser.
#. Click on the KA-Lite logo icon on the menu bar and select ``Open in Browser`` menu option - this should launch KA-Lite in your preferred web browser.
#. Login using the administrator account you have specified during setup.

If the sidebar shows entries that are greyed-out, the child items of the entry may be videos that were not yet downloaded. If there are assessment items inside, then you need to extract the `assessment.zip` manually:
Upgrade
_______

To upgrade an existing KA Lite installation.

#. Download the KA Lite `OSX installer <https://learningequality.org/r/osx-installer-0-15>`_.
#. After the download is complete, double click the .dmg file.
#. Click the ``Agree`` button to accept the LICENSE agreement.
#. On the .dmg window, drag the ``KA-Lite Monitor`` app into the ``Applications`` folder.
#. Give confirmation to overwrite the existing app.
#. Launch ``KA-Lite Monitor`` from your ``Applications`` folder.
#. Click on the app icon at the menu bar.
#. Click on ``Preferences`` in the menu option.
#. Go to Advanced tab, click on the ``Extract Assessment`` button, then confirm the action.
#. Restart the server, login to the web app, then check the sidebar contents.

This will enable the greyed-out assessment items on the sidebar.
.. tip::
If the sidebar shows entries that are greyed-out, the child items of the entry may be videos that were not yet downloaded. If there are assessment items inside, then you need to extract the `assessment.zip` manually:

#. Launch ``KA-Lite Monitor`` from your ``Applications`` folder.
#. Click on the app icon at the menu bar.
#. Click on ``Preferences`` in the menu option.
#. Go to ``Advanced`` tab, click on the ``Extract Assessment`` button, then confirm the action.
#. Restart the server, login to the web app, then check the sidebar contents.

This will enable the greyed-out assessment items on the sidebar.


Linux
=====
Expand Down Expand Up @@ -93,7 +106,7 @@ It can be installed by downloading the latest .deb on the Pi and installing it::
# Install dependencies
sudo apt-get install python-m2crypto python-pkg-resources nginx python-psutil
# Fetch the latest .deb
sudo wget https://learningequality.org/r/deb-pi-installer-0-14 --no-check-certificate
sudo wget https://learningequality.org/r/deb-pi-installer-0-15 --no-check-certificate
# Install the .deb
sudo dpkg -i ka-lite-raspberry-pi*.deb

Expand Down
1 change: 1 addition & 0 deletions docs/installguide/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ General
Python 2.6 is no longer supported. It *may* still work, but we are no longer actively supporting it.
Other known issues:

* The latest OSX version (EL Capitan) is not yet supported.
* On OSX, you must restart the server after downloading videos in order for them to be marked as available.
* On all platforms, you must restart the server after downloading a language pack in order to use it.
* You can no longer configure your server using ``local_settings.py``. Instead, custom settings must appear in
Expand Down
3 changes: 3 additions & 0 deletions docs/installguide/system_requirements.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
System requirements
===================

.. note::
The latest OSX version (EL Capitan) is not yet supported.

Supported Browsers
------------------
KA Lite is currently *not* supported on Internet Explorer version 8 or lower. You must use IE9 or later.
Expand Down
10 changes: 5 additions & 5 deletions kalite/coachreports/api_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class CoachReportBaseResource(Resource):
"""
A base resource that houses shared code between the resources we actually use
A base resource that houses shared code between the resources we actually use
in the API
"""

Expand Down Expand Up @@ -54,7 +54,7 @@ class Meta:

def get_object_list(self, request):
user_id = request.GET.get('user_id')
result = PlaylistProgress.user_progress(user_id=user_id)
result = PlaylistProgress.user_progress(user_id=user_id, language=request.language)
return result

class PlaylistProgressDetailResource(CoachReportBaseResource):
Expand All @@ -72,8 +72,8 @@ class Meta:
def get_object_list(self, request):
user_id = request.GET.get("user_id")
playlist_id = request.GET.get("playlist_id")
result = PlaylistProgressDetail.user_progress_detail(user_id=user_id, playlist_id=playlist_id)
language = request.language
result = PlaylistProgressDetail.user_progress_detail(user_id=user_id, playlist_id=playlist_id, language=language)
if not result:
raise NotFound("User playlist progress details with user ID '%s' and playlist ID '%s' were not found." % (user_id, playlist_id))
raise NotFound("User playlist progress details with user ID '%s' and playlist ID '%s' were not found." % (user_id, playlist_id))
return result

8 changes: 5 additions & 3 deletions kalite/coachreports/api_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def return_log_type_details(log_type, topic_ids=None):
@require_admin
def learner_logs(request):

lang = request.language
page = request.GET.get("page", 1)

limit = request.GET.get("limit", 50)
Expand Down Expand Up @@ -100,7 +101,7 @@ def learner_logs(request):
topic_objects = log_objects.filter(latest_activity_timestamp__gte=start_date, latest_activity_timestamp__lte=end_date)
if topic_objects.count() == 0:
topic_objects = log_objects
objects = dict([(obj[id_field], get_content_cache().get(obj[id_field], get_exercise_cache().get(obj[id_field]))) for obj in topic_objects]).values()
objects = dict([(obj[id_field], get_content_cache(language=lang).get(obj[id_field], get_exercise_cache(language=lang).get(obj[id_field]))) for obj in topic_objects]).values()
output_objects.extend(objects)
output_logs.extend(log_objects)

Expand All @@ -122,6 +123,7 @@ def learner_logs(request):
@require_admin
def aggregate_learner_logs(request):

lang = request.language
learners = get_learners_from_GET(request)

event_limit = request.GET.get("event_limit", 10)
Expand All @@ -144,7 +146,7 @@ def aggregate_learner_logs(request):
"exercise_attempts": 0,
"exercise_mastery": None,
}

end_date = datetime.datetime.strptime(end_date,'%Y/%m/%d') if end_date else datetime.datetime.now()

start_date = datetime.datetime.strptime(start_date,'%Y/%m/%d') if start_date else end_date - datetime.timedelta(time_window)
Expand Down Expand Up @@ -179,7 +181,7 @@ def aggregate_learner_logs(request):
"complete": log.complete,
"struggling": getattr(log, "struggling", None),
"progress": getattr(log, "streak_progress", getattr(log, "progress", None)),
"content": get_exercise_cache().get(getattr(log, "exercise_id", ""), get_content_cache().get(getattr(log, "video_id", getattr(log, "content_id", "")), {})),
"content": get_exercise_cache(language=lang).get(getattr(log, "exercise_id", "")) or get_content_cache(language=lang).get(getattr(log, "video_id", None) or getattr(log, "content_id", "")) or {}
} for log in output_logs[:event_limit]]
output_dict["total_time_logged"] = round((UserLogSummary.objects\
.filter(user__in=learners, start_datetime__gte=start_date, start_datetime__lte=end_date)\
Expand Down
Loading