Skip to content

Commit

Permalink
Merged develop into gallery_jobs7; fixed minor merge conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
mschmittfull committed Oct 19, 2014
2 parents 168c952 + f124668 commit ce9e3ba
Show file tree
Hide file tree
Showing 184 changed files with 13,251 additions and 4,146 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# pylint core --rcfile=.pylintrc -i y

[GENERAL]
init-hook='import sys; sys.path.append("../oppia_tools/google_appengine_1.9.10/google_appengine")'
init-hook='import sys; sys.path.append("../oppia_tools/google_appengine_1.9.11/google_appengine")'

[BASIC]

Expand Down
82 changes: 82 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,88 @@ This file contains a summary of changes to the Oppia code base. For a full chang
https://code.google.com/p/oppia/source/list


v1.2.10.patch (10 Oct 2014)
--------------------
Editor improvements:
* In noneditable mode, hide the widget selector in the state editor.
* Fix a bug relating to the graph visualization height in Firefox.

Infrastructure:
* Allow exploration statistics datastore models to be migrated.

v1.2.10 (7 Oct 2014)
--------------------
General editor improvements:
* Add a preview mode to enable changes to be previewed without saving.
* Add a tutorial for the editor page.
* Shorten the label for the 'Save Changes' button and make it clearer when an exploration has been saved.
* Add a category label to the top of the page.
* Simplify the inter-tab routing code, and allow sub-tabs in the editor page to be accessed directly.
* Fix a routing bug causing errors when the user navigates to states whose names have trailing question marks.

State editor improvements:
* Make the overall state editor interface cleaner, friendlier and more responsive.
* Fix the layout and panning behavior of the state graph.
* Fix a couple of bugs involving graph elements (arrow tips and legends) not showing up in Firefox.
* Allow the exploration creator to change which state is the initial one.
* Change the default initial state name from '(untitled state)' to 'First State'.
* Fix issue 166: allow states defined in rules to use periods in their names.
* Show a warning when invalid new state names are entered, in order to explain why they are invalid.
* Fix a bug in the state editor that allowed states to be renamed to 'END'.
* Speed up the process of adding a new state by removing the need for a backend RPC.
* Add unit tests for the state editor.

Improvements to the editor settings tab:
* Rename 'Objective' to 'Goal'.
* Remove the helper text around the objective field, which does not make sense for non-English explorations.
* Remove the obtrusive warning message that appears when the objective field is blurred.
* Add a 'Permissions' section to clarify an exploration's sharing status, and add a field showing a link to the exploration that can be shared.
* Add an option allowing private explorations to be viewed by anyone with the link.
* Remove functionality for adding users by email, and add functionality for adding them by username instead.

Improvements to the learner view:
* Highlight the most recent content and feedback in the conversation skin view, and clean up the user interface slightly.

Improvements to the dashboard and gallery pages:
* Add objective and language fields to the exploration creation modal.
* Slightly simplify the 'Create New Exploration' flow triggered by the button in the gallery page.
* In the dashboard, make the links for feedback notifications point directly to the feedback tab in the exploration editor.

Widget improvements:
* Rename all interactive widget descriptions for consistency in the state editor dropdown.
* Set input widget: create new elements automatically when the user hits the enter key.
* Interactive map widget: fix an issue where the map width spills over that of its boundary container.
* Music notes widget:
- rename 'play desired sequence' to 'play target sequence'
- add a note icon to the 'Add Note' button
- add functionality for specifying an initial sequence of notes
* Numeric widget:
- in the learner view, do not show integers as floats
- fix a bug where inputs of 0 were not being accepted
* Text widget: improve the description of the 'rows' field.
* Code widget: add a border around the coding pane to separate it more clearly from the surrounding container.
* Video widget: add autoplay functionality.
* Link widget: show an error message when an invalid link is saved (issue 147).

Moderator/Admin functionality:
* Fix issue 373: for moderators, show edit buttons in the gallery.
* Fix issue 374: fix broken timestamps in the moderator page, and add a moderator page to the profile menu where relevant.
* Refactor the admin page to use the new schema-based forms framework.

Infrastructure and testing improvements:
* Create a framework for end-to-end testing in protractor, and add tests for the state editor page, settings tab, publication process and subsequent gallery display.
* In the forms framework, add a validator for testing the maximum length of a list.
* Downgrade error logging about unused widget customization arguments to a warning.

Dependencies:
* Use a local version of MathJax, since the CDN sometimes does not respond.
* Upgrade GAE version to v1.9.11.
* Update select2 version to v3.5.1.
* Upgrade d3 version to v3.4.11.
* Update protractor version to v1.2.0.
* Update MIDI.js version to revision 2ef687.


v1.2.9 (11 Sep 2014)
--------------------
Deprecations:
Expand Down
4 changes: 2 additions & 2 deletions app.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
application: oppiaserver
version: 1
version: 1-2-10-patch
runtime: python27
api_version: 1
threadsafe: false

env_variables:
DJANGO_SETTINGS_MODULE: 'oppiaserver.settings'
# Modify the 'version' field above to match this.
OPPIA_VERSION: '1.2.9'
OPPIA_VERSION: '1.2.10.patch'

builtins:
- appstats: on
Expand Down
54 changes: 24 additions & 30 deletions core/controllers/admin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
import feconf


ADMIN_EMAIL = '[email protected]'
BOTH_MODERATOR_AND_ADMIN_EMAIL = '[email protected]'
MODERATOR_EMAIL = '[email protected]'
SITE_NAME = 'sitename.org'


Expand All @@ -34,7 +31,7 @@ class AdminIntegrationTest(test_utils.GenericTestBase):
def test_admin_page(self):
"""Test that the admin page shows the expected sections."""
# Login as an admin.
self.login('[email protected]', is_super_admin=True)
self.login(self.EDITOR_EMAIL, is_super_admin=True)

response = self.testapp.get('/admin')

Expand All @@ -55,25 +52,23 @@ def test_admin_page_rights(self):
self.assertEqual(response.status_int, 302)

# Login as a non-admin.
self.login('[email protected]')
self.login(self.EDITOR_EMAIL)
response = self.testapp.get('/admin', expect_errors=True)
self.assertEqual(response.status_int, 401)
self.logout()

# Login as an admin.
self.login('[email protected]', is_super_admin=True)
self.login(self.ADMIN_EMAIL, is_super_admin=True)
response = self.testapp.get('/admin')
self.assertEqual(response.status_int, 200)
self.logout()

def test_change_configuration_property(self):
"""Test that configuration properties can be changed."""

# Login as an admin.
self.login('[email protected]', is_super_admin=True)

ANNOUNCEMENT_TEXT = 'TEST ANNOUNCEMENT'
ANNOUNCEMENT_TEXT = self.UNICODE_TEST_STRING

self.login(self.ADMIN_EMAIL, is_super_admin=True)
response = self.testapp.get('/admin')
csrf_token = self.get_csrf_token_from_response(response)

Expand Down Expand Up @@ -106,9 +101,7 @@ def test_change_splash_page_config_property(self):
self.assertIn('SITE_NAME', response.body)
self.assertNotIn(SITE_NAME, response.body)

# Log in as an admin and customize the site name.
self.login('[email protected]', is_super_admin=True)

self.login(self.ADMIN_EMAIL, is_super_admin=True)
response = self.testapp.get('/admin')
csrf_token = self.get_csrf_token_from_response(response)
self.post_json('/adminhandler', {
Expand All @@ -117,7 +110,6 @@ def test_change_splash_page_config_property(self):
pages.SITE_NAME.name: SITE_NAME
}
}, csrf_token)

self.logout()

# Navigate to the splash page. The site name is set.
Expand All @@ -129,43 +121,45 @@ def test_change_rights(self):
"""Test that the correct role indicators show up on app pages."""

# Navigate to any page. The role is not set.
response = self.testapp.get('/')
response.mustcontain(no=['Moderator', 'Admin'])
self.testapp.get('/').mustcontain(
no=['(Moderator)', '(Admin)', '/moderator', '/admin'])

# Log in as a superadmin. The role is set.
# Log in as a superadmin. This gives access to /admin.
self.login('[email protected]', is_super_admin=True)
response = self.testapp.get('/')
response.mustcontain('Admin', no=['Moderator'])
self.testapp.get('/').mustcontain(
'/admin', no=['(Moderator)', '(Admin)', '/moderator'])

# Add a moderator, an admin, and a person with both roles, then log
# out.
BOTH_MODERATOR_AND_ADMIN_EMAIL = '[email protected]'
response = self.testapp.get('/admin')
csrf_token = self.get_csrf_token_from_response(response)
self.post_json('/adminhandler', {
'action': 'save_config_properties',
'new_config_property_values': {
config_domain.ADMIN_EMAILS.name: [
ADMIN_EMAIL, BOTH_MODERATOR_AND_ADMIN_EMAIL],
self.ADMIN_EMAIL, BOTH_MODERATOR_AND_ADMIN_EMAIL],
config_domain.MODERATOR_EMAILS.name: [
MODERATOR_EMAIL, BOTH_MODERATOR_AND_ADMIN_EMAIL],
self.MODERATOR_EMAIL, BOTH_MODERATOR_AND_ADMIN_EMAIL],
}
}, csrf_token)
self.logout()

# Log in as a moderator.
self.login(MODERATOR_EMAIL)
response = self.testapp.get(feconf.GALLERY_URL)
response.mustcontain('Moderator', no=['Admin'])
self.login(self.MODERATOR_EMAIL)
self.testapp.get(feconf.GALLERY_URL).mustcontain(
'(Moderator)', '/moderator', no=['(Admin)', '/admin'])
self.logout()

# Log in as an admin.
self.login(ADMIN_EMAIL)
response = self.testapp.get(feconf.GALLERY_URL)
response.mustcontain('Admin', no=['Moderator'])
self.login(self.ADMIN_EMAIL)
self.testapp.get(feconf.GALLERY_URL).mustcontain(
'(Admin)', '/moderator', no=['(Moderator)', '/admin'])
self.logout()

# Log in as a both-moderator-and-admin.
# Log in as a both-moderator-and-admin. Only '(Admin)' is shown in the
# navbar.
self.login(BOTH_MODERATOR_AND_ADMIN_EMAIL)
response = self.testapp.get(feconf.GALLERY_URL)
response.mustcontain('Admin', no=['Moderator'])
self.testapp.get(feconf.GALLERY_URL).mustcontain(
'(Admin)', '/moderator', no=['(Moderator)', '/admin'])
self.logout()
2 changes: 2 additions & 0 deletions core/controllers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ def render_template(
'FULL_SITE_URL': FULL_SITE_URL.value,
'ABOUT_PAGES': feconf.ABOUT_PAGES,
'SHOW_FORUM_PAGE': feconf.SHOW_FORUM_PAGE,
'ALL_LANGUAGE_CODES': feconf.ALL_LANGUAGE_CODES,
'DEFAULT_LANGUAGE_CODE': feconf.ALL_LANGUAGE_CODES[0]['code'],
})

if self.user_id:
Expand Down
8 changes: 5 additions & 3 deletions core/controllers/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def test_create_and_validate_token(self):
base.CsrfTokenManager.is_csrf_token_valid('bad_user', page, token))
self.assertFalse(base.CsrfTokenManager.is_csrf_token_valid(
uid, 'wrong_page', token))
self.assertFalse(base.CsrfTokenManager.is_csrf_token_valid(
uid, self.UNICODE_TEST_STRING, token))
self.assertFalse(
base.CsrfTokenManager.is_csrf_token_valid(uid, page, 'new_token'))
self.assertFalse(
Expand Down Expand Up @@ -166,7 +168,7 @@ def get(self):
"""Handles GET requests."""
self.values.update({
'ADMIN_EMAIL_ADDRESS': ['<[angular_tag]>'],
'SITE_NAME': '{{51 * 3}}',
'SITE_NAME': 'x{{51 * 3}}y',
})
self.render_template('pages/about.html')

Expand All @@ -188,8 +190,8 @@ def test_jinja_autoescaping(self):
self.assertIn('&lt;[angular_tag]&gt;', response.body)
self.assertNotIn('<[angular_tag]>', response.body)

self.assertIn('{{51 * 3}}', response.body)
self.assertNotIn('153', response.body)
self.assertIn('x{{51 * 3}}y', response.body)
self.assertNotIn('x153y', response.body)

def test_special_char_escaping(self):
response = self.testapp.post('/fake', {})
Expand Down
Loading

0 comments on commit ce9e3ba

Please sign in to comment.