sugarlabs/sugarizer

Name: sugarizer

Owner: Sugar Labs

Description: A taste of the Sugar learning platform on any device

Forked from: llaske/sugarizer

Created: 2017-01-05 11:48:07.0

Updated: 2018-05-16 20:04:34.0

Pushed: 2018-05-16 20:03:46.0

Homepage: http://sugarizer.org

Size: 347942

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

What is Sugarizer ?

The Sugar Learning Platform is a leading learning platform that began in the famous One Laptop Per Child project. It is used every day by nearly 3 million children around the world.

Sugarizer is a web implementation of the platform and runs on every device - from tiny Raspberry Pi computers to small Android and iOS phones to tablets and to laptops and desktops.

Like Sugar, Sugarizer includes a bunch of pedagogic activities thought for children.

Sugarizer is available as:

Enjoy the experience and help us reach every child on every device in every country.

Sugarizer Application

Sugarizer Application is a cross-platform application for installing on any GNU+Linux, Windows, Mac OS X, Android, iOS, or Chrome OS device.

To run Sugarizer Application on Android, download it on Google Play, Amazon Store or F-Droid.

Sugarizer on Android is also available as a launcher to replace the current launcher of your device so you could launch native Android applications from Sugarizer. You could download this Sugarizer version on Google Play.

You could also build yourself the Sugarizer Application APK using instruction below.

To run Sugarizer Application on iOS, download it on Apple Store or build yourself the Sugarizer Application IPA using instructions below.

To run Sugarizer Application on Windows 10, download it on Windows Store. You could also build yourself the Sugarizer Windows Application using instructions below.

To run Sugarizer Application as Chrome Web App, download it from the Chrome Web Store or use the Chrome Apps & Extensions Developer Tool and use the Sugarizer directory as the target for the unpacked application.

To run Sugarizer Application from the Web Browser (GNU Linux/Mac OS/Windows), close any running instances of Chrome and re-launch it using the command line:

chrome --allow-file-access-from-files index.html

The option --allow-file-access-from-files is needed to enable access to local files.

Equivalent options for other browser are available.

If you run Sugarizer this way often, you should create an alias for this command (learn more).

Sugarizer Web Application

Try it now! (try.sugarizer.org)

Sugarizer Web App is a web application that runs on any device with a recent Chrome version and has also been tested successfully on Firefox, Safari and EDGE.

As a web application, it does not run offline and requires a permanent network connection to a Sugarizer Server.

Sugarizer Server allow deployment of Sugarizer on a local server, for example on a school server, so expose locally Web Application (without Internet access). Sugarizer Server can also be used to provide collaboration features for Sugarizer Application on the network.

To install your own Sugarizer Server, follow instructions on Sugarizer Server repository

Activities

Sugarizer includes a bunch of pedagogic activities. All activities could be found in the activities directory. Each activity has its own subdirectory. So for example, the Abecedarium activity is located in activities/Abecedarium.activity

You could distribute Sugarizer with whatever activities you want. To do that, you first need to adapt the content of the activities directory to match your wish: removing activities you don't want to distribute and adding in this directory new activities you want to include.

Then you need to update the activities.json file to reflect your choice. Here an example of this file:

[
    {"id": "org.sugarlabs.GearsActivity", "name": "Gears", "version": 6, "directory": "activities/Gears.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.sugarlabs.MazeWebActivity", "name": "Maze Web", "version": 2, "directory": "activities/MazeWeb.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.olpcfrance.PaintActivity", "name": "Paint", "version": 1, "directory": "activities/Paint.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.olpcfrance.TamTamMicro", "name": "TamTam Micro", "version": 1, "directory": "activities/TamTamMicro.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.olpcfrance.MemorizeActivity", "name": "Memorize", "version": 1, "directory": "activities/Memorize.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.olpg-france.physicsjs", "name": "Physics JS", "version": 1, "directory": "activities/PhysicsJS.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.sugarlabs.CalculateActivity", "name": "Calculate", "version": 1, "directory": "activities/Calculate.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.sugarlabs.TurtleBlocksJS", "name": "Turtle Blocks JS", "version": 1, "directory": "activities/TurtleBlocksJS.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.sugarlabs.Clock", "name": "Clock Web", "version": 1, "directory": "activities/Clock.activity", "icon": "activity/activity-clock.svg", "favorite": true, "activityId": null},
    {"id": "org.olpcfrance.RecordActivity", "name": "Record", "version": 1, "directory": "activities/Record.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.olpcfrance.Abecedarium", "name": "Abecedarium", "version": 5, "directory": "activities/Abecedarium.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.olpcfrance.KAView", "name": "KA View", "version": 1, "directory": "activities/KAView.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.olpcfrance.FoodChain", "name": "FoodChain", "version": 4, "directory": "activities/FoodChain.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.olpc-france.labyrinthjs", "name": "Labyrinth JS", "version": 1, "directory": "activities/LabyrinthJS.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.olpcfrance.TankOp", "name": "Tank Operation", "version": 1, "directory": "activities/TankOp.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.sugarlabs.ChatPrototype", "name": "ChatPrototype", "version": 1, "directory": "activities/ChatPrototype.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.olpcfrance.Gridpaint", "name": "Grid Paint", "version": 2, "directory": "activities/Gridpaint.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.olpc-france.LOLActivity", "name": "Last One Loses Activity", "version": 1, "directory": "activities/LastOneLoses.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.sugarlabs.StopwatchActivity", "name": "Stopwatch", "version": 1, "directory": "activities/Stopwatch.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.sugarlabs.Markdown", "name": "Markdown", "version": 3, "directory": "activities/Markdown.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.sugarlabs.GTDActivity", "name": "Get Things Done", "version": 1, "directory": "activities/GetThingsDone.activity", "icon": "activity/activity-icon.svg", "favorite": true, "activityId": null},
    {"id": "org.laptop.WelcomeWebActivity", "name": "WelcomeWeb", "version": 1, "directory": "activities/WelcomeWeb.activity", "icon": "activity/welcome-activity.svg", "favorite": true, "activityId": null},
    {"id": "org.vpri.EtoysActivity", "name": "Etoys", "version": 1, "directory": "activities/Etoys.activity", "icon": "activity/activity-etoys.svg", "favorite": false, "activityId": null},
    {"id": "io.cordova.all_in_one_plugin_sample", "name": "Cordova", "version": 1, "directory": "activities/Cordova.activity", "icon": "activity/activity-icon.svg", "favorite": false, "activityId": null},
    {"id": "org.olpcfrance.MediaViewerActivity", "name": "MediaViewer", "version": 1, "directory": "activities/MediaViewer.activity", "icon": "activity/activity-icon.svg", "favorite": false, "activityId": null}
]

Each line in this file is one activity. Here is the description of each field:

Remove in this file rows for activities that you want to remove. Add in this file a line for each activity you want to add.

Note than:

  1. The activities/ActivityTemplate directory does not contain a real activity. It's just a template that you could use to create your own activity.
  2. The activities.json is used only by Sugarizer Application, the Web Application relies on the /api/activities API that dynamically browse the activities directory. By the way, it's a good practice to match the content of the activities.json file and the content of the activities directory.

Create your own activity

With Sugarizer, it's easy to create an activity with a bunch of HTML and JavaScript.

If you're interested to create your own activity, a full tutorial will guide you between all development steps:

Let's start here.

Unit testing

To run unit tests for Sugarizer Application, run “file:///PathToYourSugarizerRepo/test/index.html” in your browser.

Build Application for Android, iOS or Windows 10

Sugarizer Application could be packaged as an Android, iOS and Windows 10 application using Cordova.

To build it, first install Cordova as described here.

Then create a directory for Sugarizer Cordova and put the content of the git repository in the www directory:

cordova create sugar-cordova
cd sugar-cordova
rm config.xml
rm -fr www
git clone https://github.com/llaske/sugarizer.git www

Add the platform you want to add (here Android):

cordova platform add android

Replace the auto generated config.xml file by the Sugarizer one:

cp www/config.xml .

Build the package:

cordova build android

On Android, if you want to generate the Sugarizer OS version, remove the SugarizerOS comment around the cordova-plugin-sugarizeros plugin in config.xml file.

Reduce package size

The current size of Sugarizer is about 300 Mb. This huge size is related to media content and resources include in two activities:

By the way, both activities are able to retrieve the content remotely if its not deployed locally. So, if you want to reduce the Sugarizer package size (specifically for deployment on mobile) you could either remove completely those two activities or just remove the media content of this activities.

To remove activities, just remove both activities directory and update activities.json file as explain above.

To remove media content for Abecedarium, remove directories:

The activity will look for media content on the server referenced in activities/Abecedarium.activity/config.js, by default http://server.sugarizer.org/activities/Abecedarium.activity/.

To remove resources for Etoys, remove directory activities/Etoys.activities/resources and replace the value resources/etoys.image in activities/Etoys.activities/index.html by the remote location of the resources, for example http://server.sugarizer.org/activities/Etoys.activity/resources/etoys.image.

Optimize performance

If you want to optimize JavaScript performance, you could generate an optimized version of Sugarizer with Grunt. This optimized version will minimize and reduce size of all JavaScript files.

The Gruntfile.js contains tasks settings to build an optimized version of Sugarizer. To do that, ensure first that grunt is installed:

npm install -g grunt-cli

Then just launch:

grunt

At the end of the process, the build directory will contain the optimized version of each file in a same directory that the initial one, so you could just copy files:

cp -r build/* .

Localization

If you're not a developer and you want to translate Sugarizer into your own language, please go to the Sugarizer translation platform where you will be able to do that. If you're a developer, the following paragraphs will explain to you how the Sugarizer localization system works.

Sugarizer use webL10n localization system by Fabien Cazenave.

Here how to add a new translation. See a video tutorial here.

All strings are localized in the locale.ini file at the root of the repository. If you want to add a new translation, copy the whole [en] section at the end of the file and:

Warning: Note that text inside {{}} must not be localized. So here, {{name}} is not translated.

Sugarizer automatically detects the navigator language. To enable this detection, you need to update the settings.init function in the lib/settings.js file. Add a test on your language code. For example in French:

else if (navigatorLanguage.indexOf("fr") != -1)
    this.language = "fr";

Sugarizer settings display a list of all available languages. You need to add your language in this dialog. For this you have to:

That's all. Test the result in your browser.

Note that this translation is for Sugarizer only. Each activity could provide its own localization feature.

How to contribute

As all Open Source software, contributions to this software are welcome.

The best way to start is to do the whole tutorial. It will give you a good understanding of Sugarizer internal.

Then, you could start to contribute by trying to fix some existing issues here.

Note than the master branch of the repository is for released/stable version, the dev branch is for development. So to contribute:

Thanks in advance for your contribution.

License

This project is licensed under Apache v2 License. See LICENSE for full license text.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.