README_FOR_APP

Path: doc/README_FOR_APP
Last Update: Tue Sep 08 03:48:37 -0400 2009

Welcome to the skid documentation. This is how the code and html are divided:

app/controllers/application.rb contains the code for generating the buttons, the module list and the choices. It also makes everything clickable.

app/views/layouts/application.html.erb contains the html for showing the buttons, the module list, the choices, the settings links below, and has the necessary code for incorporating the extra display material for each module, as described in its index.html.erb.

Each time a skid url is invoked, say, skid.org.in/modules/first_time, a controller of the appropriate kind, in this case ModulesController, is created, and the desired function, in this case first_time, invoked. After the appropriate view is processed and html sent to the invoker, the controller dies. In order to save data such that it is available to subsequent incarnations of the controller, session variables have been used.

Please do not access session variables directly, instead, use the appropriate getter functions. For instance, do not use session[:text], use get_text instead. This naming convention for getter functions has been consistently used.

For accessing information stored as images or text files, please see the documentation for Giver.rb. Its source code is in app/models/giver.rb

The ones marked with * are more likely to be useful to you :-)

Documentation of skid session variables

session[:modules] array of modules listed on the page

session[:choices] used to hold intermediate values for choices, say, when a row of choices has been selected

session[:presentation] the filename of the presentation currently showing

*session[:selected_item] the number of the currently highlighted item, but this cycles around, so modulo must be used

session[:sticks] the number of sticks left over in the game of nim

*session[:stepsize] used to control how much effect each click of up or down has, in photoediting functions

**session[:text] the text being typed, edited, scrolled, mailed..

session[:toggle] in the font module and some photo-editing modules, where you switch modes between up/down and increase/decrease. This tells you which is active

*session[:overflow] scrolling is done between session[:text] and session[:overflow]

session[:nitems] in recognize, determines difficulty, via the number of choices offered

session[:picfolder] the folder from which recognize takes pictures

session[:answer] the correct answer in recognize

*session[:typed] used by modules like easypic to add text to session[:text]

session[:controller] used to send focus to another module

session[:auto_refresh] is true for auto-scrolling

session[:nobuttons] used to toggle button display

session[:nomodules] used to toggle module list display

session[:delay] seconds before autoscroll

session[:nopics] used to toggle image display in choices

*session[:spoken] text put here is automatically deleted after being sent to the text to speech

Arun Mehta May 26, 2009

[Validate]