Skip to content

Commit

Permalink
Merge pull request #5433 from benjaoming/various-fixes
Browse files Browse the repository at this point in the history
Documentation updates
  • Loading branch information
benjaoming committed Apr 7, 2017
2 parents b5f7bf9 + 5eafb67 commit ba7cc0f
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 98 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ future of KA Lite.
Connect
^^^^^^^

- Community forums: `community.learningequality.org <https://community.learningequality.org/>`__
- IRC: **#kalite** on Freenode
- Twitter: `@ka_lite <http://twitter.com/ka_lite>`__
- Mailing list: `dev@learningequality.org on Google Groups <https://groups.google.com/a/learningequality.org/forum/#!forum/dev>`__
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

# General information about the project.
project = u'KA Lite'
copyright = u'%d, Learning Equality' % datetime.now().year
copyright = u'%d, Learning Equality, licensed under a Creative Commons Attribution-ShareAlike 4.0 International License' % datetime.now().year

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
63 changes: 60 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
contain the root `toctree` directive.
KA Lite Documentation
===================================
=====================

by `Learning Equality <https://learningequality.org/>`__


Welcome to the KA Lite Documentation page! Here, you will find all the
information needed to set up the KA Lite software. Additionally, there's
Expand All @@ -15,13 +18,67 @@ check our `Forums`_!

.. _Forums: https://community.learningequality.org/

Main sections
-------------

.. toctree::
:maxdepth: 2
:maxdepth: 1

Installation Guide <installguide/install_main>
User Manual <usermanual/userman_main>
FAQ <faq>
Developer Docs <developer_docs/index>


.. include:: ../README.rst
About KA Lite
-------------

`Khan Academy <http://www.khanacademy.org/>`__'s core mission is to
"provide a free world-class education for anyone anywhere", and as over `60%
of the world's population is without access to the
internet <http://en.wikipedia.org/wiki/Global_Internet_usage>`__,
primarily in the developing world, providing an alternative delivery
mechanism for Khan Academy content is key to fulfilling this mission.

`KA Lite <http://kalite.learningequality.org/>`__ is a lightweight
`Django <https://www.djangoproject.com/>`__ web app for serving core
Khan Academy content (videos and exercises) from a local server, with
points and progress-tracking, without needing internet connectivity.


Get involved!
-------------

- Learn how you can contribute code on our `KA Lite GitHub Wiki <https://github.com/learningequality/ka-lite/wiki>`__
- Report bugs by `creating issues <https://github.com/learningequality/ka-lite/wiki/Report-Bugs-by-Creating-Issues>`__
- Read more about the project's motivation at `Introducing KA Lite, an offline version of Khan
Academy <http://jamiealexandre.com/blog/2012/12/12/ka-lite-offline-khan-academy/>`__.


Connect
^^^^^^^

- Community forums: `community.learningequality.org <https://community.learningequality.org/>`__
- IRC: **#kalite** on Freenode
- Twitter: `@ka_lite <http://twitter.com/ka_lite>`__
- Mailing list: `dev@learningequality.org on Google Groups <https://groups.google.com/a/learningequality.org/forum/#!forum/dev>`__

Contact Us
^^^^^^^^^^

Tell us about your project and experiences!

- Email: info@learningequality.org
- Add your project to the map: https://learningequality.org/ka-lite/map/

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.
92 changes: 3 additions & 89 deletions kalite/control_panel/tests/control_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from kalite.testing.mixins.student_progress_mixins import StudentProgressMixin

from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait

Expand Down Expand Up @@ -46,9 +45,9 @@ def test_device_registration_availability(self):
self.browse_to(self.reverse('zone_redirect')) # zone_redirect so it will bring us to the right zone
element = self.browser.find_element_by_id('not-registered')
try:
WebDriverWait(self.browser, 0.7).until(EC.visibility_of(element))
WebDriverWait(self.browser, 0.7).until(EC.visibility_of(element))
except TimeoutException:
pass
pass
self.assertTrue(element.is_displayed())


Expand All @@ -65,7 +64,7 @@ def test_device_already_register(self):
self.browse_to(self.reverse('zone_redirect')) # zone_redirect so it will bring us to the right zone
element = self.browser.find_element_by_id('force-sync')
try:
WebDriverWait(self.browser, 0.7).until(EC.visibility_of(element))
WebDriverWait(self.browser, 0.7).until(EC.visibility_of(element))
except TimeoutException:
pass
self.assertTrue(element.is_displayed())
Expand All @@ -82,16 +81,6 @@ def setUp(self):

super(FacilityControlTests, self).setUp()

# def test_delete_facility(self):
# facility_name = 'should-be-deleted'
# self.fac = self.create_facility(name=facility_name)
# self.browser_login_admin(**self.admin_data)
# self.browse_to(self.reverse('zone_redirect')) # zone_redirect so it will bring us to the right zone

# selector = '.facility-delete-link'
# self.browser_click_and_accept(selector, text=facility_name)


def test_teachers_have_no_facility_delete_button(self):
facility_name = 'should-not-be-deleted'
self.fac = self.create_facility(name=facility_name)
Expand Down Expand Up @@ -180,22 +169,6 @@ def setUp(self):

super(GroupControlTests, self).setUp()

# def test_delete_group(self):

# self.browser_login_admin(**self.admin_data)
# self.browse_to(self.reverse('facility_management', kwargs={'facility_id': self.facility.id, 'zone_id': None}))

# group_row = self.browser.find_element_by_xpath('//tr[@value="%s"]' % self.group.id)
# group_delete_checkbox = group_row.find_element_by_xpath('.//input[@type="checkbox" and @value="#groups"]')
# if not group_delete_checkbox.is_selected():
# group_delete_checkbox.click()

# confirm_group_selector = ".delete-group"
# self.browser_click_and_accept(confirm_group_selector)

# with self.assertRaises(NoSuchElementException):
# self.browser.find_element_by_xpath('//tr[@value="%s"]' % self.group.id)

def test_teachers_have_no_group_delete_button(self):
teacher_username, teacher_password = 'teacher1', 'password'
self.teacher = self.create_teacher(username=teacher_username,
Expand Down Expand Up @@ -555,62 +528,3 @@ def test_device_log_csv_endpoint(self):
zone_filtered_resp = self.client.get(self.api_device_log_csv_url + "?zone_id=" + self.zone.id + "&format=csv").content
rows = filter(None, zone_filtered_resp.split("\n"))
self.assertEqual(len(rows), 2, "API response incorrect")


# class CSVExportBrowserTests(CSVExportTestSetup, BrowserActionMixins, CreateAdminMixin, KALiteBrowserTestCase):

# def setUp(self):
# super(CSVExportBrowserTests, self).setUp()

# def test_user_interface(self):
# self.browser_login_admin(**self.admin_data)
# self.browse_to(self.distributed_data_export_url)

# # Check that group is disabled until facility is selected
# group_select = WebDriverWait(self.browser, 30).until(EC.presence_of_element_located((By.ID, "group-name")))
# self.assertFalse(group_select.is_enabled(), "UI error")

# # Select facility, wait, and ensure group is enabled
# facility_select = self.browser.find_element_by_id("facility-name")

# self.assertEqual(len(facility_select.find_elements_by_tag_name('option')), 2, "Invalid Number of Facilities")

# for option in facility_select.find_elements_by_tag_name('option'):
# if option.text == 'facility1':
# option.click() # select() in earlier versions of webdriver
# break

# # Check that group is enabled now
# group_select = WebDriverWait(self.browser, 30).until(EC.presence_of_element_located((By.ID, "group-name")))
# self.assertTrue(group_select.is_enabled(), "UI error")

# # Click and make sure something happens
# # note: not actually clicking the download since selenium cannot handle file save dialogs
# export = self.browser.find_element_by_id("export-button")
# self.assertTrue(export.is_enabled(), "UI error")

# def test_user_interface_teacher(self):
# teacher_username, teacher_password = 'teacher1', 'password'
# self.teacher = self.create_teacher(username=teacher_username,
# password=teacher_password)
# self.browser_login_teacher(username=teacher_username,
# password=teacher_password,
# facility_name=self.teacher.facility.name)
# self.browse_to(self.distributed_data_export_url)

# facility_select = WebDriverWait(self.browser, 30).until(EC.presence_of_element_located((By.ID, "facility-name")))
# self.assertFalse(facility_select.is_enabled(), "UI error")

# for option in facility_select.find_elements_by_tag_name('option'):
# if option.text == self.teacher.facility.name:
# self.assertTrue(option.is_selected(), "Invalid Facility Selected")
# break

# # Check that group is enabled now
# group_select = WebDriverWait(self.browser, 30).until(EC.presence_of_element_located((By.ID, "group-name")))
# self.assertTrue(group_select.is_enabled(), "UI error")

# # Click and make sure something happens
# # note: not actually clicking the download since selenium cannot handle file save dialogs
# export = self.browser.find_element_by_id("export-button")
# self.assertTrue(export.is_enabled(), "UI error")
3 changes: 0 additions & 3 deletions kalite/main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ def calc_points(cls, basepoints, ncorrect=1, add_randomness=True):
def get_points_for_user(user):
return ExerciseLog.objects.filter(user=user).aggregate(Sum("points")).get("points__sum", 0) or 0

def get_attempt_logs(self):
return AttemptLog.objects.filter(user=self.user, exercise_id=self.exercise_id, context_type__in=["playlist", "exercise"])


class UserLogSummary(DeferredCountSyncedModel):
"""Like UserLogs, but summarized over a longer period of time.
Expand Down
7 changes: 5 additions & 2 deletions kalite/packages/bundled/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Bundling packages

DO NOT PUT ANYTHING HERE!
DO NOT PUT ANYTHING IN THIS PACKAGE! EVERYTHING IS HERE BECAUSE OF LEGACY.

Use requirements.txt

Packages will automatically be bundled from there.
Packages will automatically be bundled from there.

Old issue tracking the unbundle process is here:
https://github.com/learningequality/ka-lite/issues/3403

0 comments on commit ba7cc0f

Please sign in to comment.