Web-Based Music School Manager: Research Manual

Total Page:16

File Type:pdf, Size:1020Kb

Web-Based Music School Manager: Research Manual

Web-Based Music School Manager Research Manual

Author: Aaron Redmond Student ID: C00002396 Supervisor: Paul Barry Contents Web-Based Music School Manager: Research Manual

Introduction My project is the Web Based Music School Manager. It is a real world project, for the local Carlow music school. The local Carlow music school currently has no dedicated management software and at present uses Microsoft Excel for it data entry and timetable creation.

The aim of this project is to create a piece of software which will allow the director of the music school to easily enter and maintain student and school data. It should also provide a mechanism for timetable creation; be it automated or manual, preferably both.

Initially we need to know is how the local music school currently operates: how does it currently acquire student information; how does it currently store this information; how is the yearly timetable put together; etc. This information was gathered by conducting an interview with the director of the music school.

We also need to know exactly how a timetabling system works, exactly what information is required in order to successfully compile a timetable. The best way to find this out is to look at what existing systems are available.

We now know what data is needed in order to create a timetable, but what processes must be carried out on this data. All automated timetabling systems run some sort of heuristic algorithm on the data in order to create the timetables; there are several differing types of algorithms available within the public domain.

Probably the biggest part of the research for this project is the research into web development technologies. Firstly an architectural model must be decided upon; this will decide exactly how the server and client will interact with each other. Then we must look at how we are going to store our data. Fortunately there are a host of open source databases available for us to choose from. We must also consider what languages we are going to use for both server and client side scripting. There are a host of languages available, all claiming to be better than the next.

An intriguing new trend is cloud computing, so we must also take a look at what options are available to us in this area.

Once we have decided what database to go with and exactly what scripting language to use, a web application framework must be chosen. This will allow us to implement our chosen architectural model in our language of choice; and supply us with connectivity to our chosen data store.

C00002396 Page 3 Web-Based Music School Manager: Research Manual

Existing Music School Management System In order to understand exactly what was required for this project I had to look at the existing method the music school uses to create its yearly timetable and how it got the information to do so. This was done by conducting an interview with the director of the music school. This interview was conducted at 12 noon on Thursday 21st of October and lasted approximately 20 minutes.

Questions for interview The first task was to compile a list of relevant questions to ask the director of the music school. The questions were based around how the music school currently collects information on its students, what information is collected and how it is stored and compiled into a timetable. The following is the list of questions brought to the interview.

1. Do you use a computer to timetable lessons? If yes then what applications do you currently use?

2. Is there a set class length (20 minutes, 40 minutes, 60 minutes, etc.)?

3. How many different locations do you have classes in?

4. Do you have set classes such as 9am, 10am, etc.?

5. Do teachers teach multiple instruments?

6. How long is the academic day (6, 7, 8 hours)?

7. How long is the academic week (Mon – Fri, Mon – Sat)?

8. Are there evening classes?

9. What types of groups do you have (Theory, etc.)?

10. What is the average number of students per group?

11. How many classes would a teacher teach before taking a break?

12. Do you have different types of classes apart from the different grades being taught?

13. Do you have group and individual lessons? (Types of groups?)

14. What specific information do you need for teachers?

Results of the Interview The results of the interview can be broken down into three sections. The following was garnered from my interview with the music school director.

How the time table is currently produced Before the start of the school year, once the majority of the enrolment forms have been returned, the timetable for coming school year is complied. The first step in the process is to manually enter all the student details, such as: name; address; age; grade; and instrument into an Excel spread sheet.

C00002396 Page 4 Web-Based Music School Manager: Research Manual

The next step is to group the students by their grade for theory class, as each grade represents a different skill level. Once these groups have been made, they must be assigned to a teacher and a room. Finally, individual instrument lessons must be timetabled and these also require the assignment of a teacher and a room.

Problems with the current system Apart from the time consuming effort required to create the timetable by hand, some of the major problems with the current system are:

 Constant feedback from the students and teachers about their available hours is required before a final timetable can be produced.  If a problem arises where a teacher cannot take a class, the student or students affected must either be distributed into other classes or a replacement class must be timetabled. This must all be worked out by hand.  Each year students must fill in an enrolment form, which quickly mounts up to a lot of paper work.  There is currently no system available where the director can view student details in one place. At the moment this information is stored separately, part of the information is in Excel and part on enrolment forms.

Desires in a new system One of the pieces of information that emerged from the interview was the directors desire to be able to just select a student and automatically view all their details in one place, such as the instrument they are playing, the grade level they are currently at, who is teaching them and where they are to be taught.

Also the ability to enrol students into the system, thereby doing away with the tedious yearly enrolment forms. This would make the director and student’s life easier as it is a more efficient system of enrolment. It is also greener.

C00002396 Page 5 Web-Based Music School Manager: Research Manual

How a timetabling system works A school timetabling systems needs a certain amount of data before an actual timetable can be compiled. The data needed is:

 Rooms

o Where the actual lessons will take place. Rooms may or may not be part of a larger building.

 Subjects

o What subject or subjects will be taught to the class group by the teacher?

 Class groups

o Who will be taught? The class group may be comprised of 1 or more students. The size of the class group is usually determined by the average room capacity.

 Teachers

o The person who will teach the subject to the class group.

 Days per week

o How many days per week the school operates. The maximum number of days is seven, which would be Monday through to Sunday. The usual is five days, Monday through to Friday.

 Hours per day

o The number of school working hours per day. The average working day comprises of 9 hours, with a 1 hour break which may be further sub-divided.

Of course, with music schools there will be a few unique situations that would not occur in a regular school or college. Music students require one-to-one tutorials for their musical instrument of choice, but still must take part in the group theory class for their grade. One-to-one tutorials for members of the same family are frequently problematic when it comes time to creating a timetable. This is because a parent will want their children scheduled as close to one another as possible, thereby saving them time and multiple trips to and from the music school.

C00002396 Page 6 Web-Based Music School Manager: Research Manual

Existing timetabling systems Currently there are several timetabling systems available, from open-source projects such as FET to large commercial applications like Scientia’s Syllabus Plus, which is the timetabling software of choice for I.T. Carlow. In the following section I will be looking at the following software: FET; Paritor; Lantiv Timetabler and Prime Timetable.

FET

Figure 1: FET main form

FET is open source free software for automatically scheduling school timetables. It uses a fast and efficient timetabling algorithm which is licensed under GNU GPL [3]. It uses an XML format for the input file, so it can be easily modified with an XML editor.

In order to create a timetable with FET you must first generate the following data:  Institution information  Days per week  Hours per day  Subjects  Teachers  Students  Activities  Space (Building and/or Rooms)

We will now look at how to create a timetable using FET in detail.

C00002396 Page 7 Web-Based Music School Manager: Research Manual

The first thing to do in FET is set up your school’s information; a school name is all that is required in FET.

Figure 2: FET - school information

Then enter the number of days per week. For our example we need to enter 6 days as the school operates from Monday to Saturday, with only Sunday off.

Figure 3: FET - days per week

C00002396 Page 8 Web-Based Music School Manager: Research Manual

Next, you enter in the times during the day. In order to accommodate different schedules for different parts of the school, the schedule should be broken down into the lowest common denominator of time differences. In this example it has been broken into 30 minute periods, with no schedule between 12 mid-day and 3pm.

Figure 4: FET - set hours per day

Time constraints may also be added. In our example, adults are taught in the morning from 8am til mid-day and students are taught from 3pm until 8pm. We can specifically specify that students cannot have lessons scheduled before 3pm, and vice versa for the adults.

All subjects to be timetabled must then be entered.

Figure 5: FET - enter subjects

C00002396 Page 9 Web-Based Music School Manager: Research Manual

Then the teachers must be added.

Figure 6: FET - add teachers

Every school needs some students, so the next step is to add some students. In FET students cannot be added individually, instead FEF has years, groups and subgroups, where:

 Year o A set of students at the same stage of their schooling. For example an Irish Secondary school has years 1 to 6. A year contains (in most cases) several groups (classes). [4]  Group o A set of students who visit the same activities. So they meet the same teachers to study the same subjects at the same time. [4]  Subgroup o A set of groups that might have activities simultaneously. If Group numbers are small subgroups may not even be used. [4]

Figure 7: FET - students

C00002396 Page 10 Web-Based Music School Manager: Research Manual

Now that we have some basic data to work with, we can begin to construct lessons or “Activities” in FET terminology [5]. To create an activity we must have the following data:  Teacher(s)  Student(s)  A subject

It is here in this process that a lot of the timetabling work is done, you specify the teachers, students and subject, along with how many hours per week you wish this subject to be taught, and if those hours are on the same day or different days.

Figure 8: FET - activities

Finally if you wish you can enter the number of buildings and the rooms within that building. You may then set the space constraints so that a certain subject, teacher or student can only be taught in that room, or that you can only change rooms a set amount of times per week.

Once the activities and their durations have been defined, timetables can be generated. As you can see in the screen shots bellow, FET can produce both teacher and student timetables. If you have assigned specific rooms for all your activities then you can also produce timetables for those rooms.

In figure 10 bellow, you can see the time constraints which have been set for the students, that they cannot have lessons in the morning, only from 3pm onwards.

C00002396 Page 11 Web-Based Music School Manager: Research Manual

Figure 9: FET - teacher’s timetable

Figure 10: FET - student’s timetable

Conclusion

FET is an excellent piece of open source software, which in my opinion could easily compete with some of the expensive brand leaders where it to be given a more user friendly User Interface.

C00002396 Page 12 Web-Based Music School Manager: Research Manual

Probably the most important part of FET with regards to my project is the actual timetabling algorithm, which I will look at in detail in the Timetabling algorithms section. One thing that FET does not contain that I feel necessary for my project is the ability to enter individual student data.

C00002396 Page 13 Web-Based Music School Manager: Research Manual

Paritor Academy Paritor are an independent software house based in the southwest of England who specialise in software for the administration management of performing arts related businesses. They provide software for individual teachers and local authority performing arts services as well as for private studios, schools and academies. I will be looking at their academic package, Academy. [1]

While not a timetabling system, Academy gives great insight on what is needed in regards to student, teacher, lesson and location details. It also uses the Microsoft cloud as its data storage location of choice.

First I downloaded the installation package from their website [2]. Then I had to do the following before the application was ready for use:  Run the installation package which downloaded and installed the application.  Register a new account and create a new cloud database.  Follow a 7-step wizard for your initial data setup.

Figure 11: Paritor - Main Screen

This is a large application, so I will only be looking at the aspects of the software which relate to the project, namely:  Create a Pupil  Activities  Create a School

C00002396 Page 14 Web-Based Music School Manager: Research Manual

Create a Pupil

Figure 12: Paritor - create a pupil

The Academy pupil registration process allows the user to create a pupil and enter all their relevant details. The Academy suite allows for a vast range of details to be entered and shows exactly what details are required for the add student process, these details are:  Name  Mobile Number  Email  Emergency Contact Number  Parent Name  Parent Address  Parent Mobile  Parent Email  Photo

C00002396 Page 15 Web-Based Music School Manager: Research Manual

Activities

Figure 13: Paritor - Activities

The Academy Activities section allows the user to define the activities of the organization i.e. what subjects are taught. It is a simple process which allows the user to add, remove or edit an activity.

In relation to my project I envision a similar process for controlling the lesson types.

C00002396 Page 16 Web-Based Music School Manager: Research Manual

Create a School

Figure 14: Paritor – create a school

The Academy Schools process allows the user to add a School to the system. For my project I need a way to add and edit locations and something similar to this process would be required, but containing much less details. The details required would be:  Name  Address  Telephone  Email

Conclusion

Paritor’s Academy package is a very large and extensive piece of software. It would take weeks if not months of use before a regular user could get to grips with it. But it certainly contains everything one would need to manage a large performing arts centre. However, the software my project aims to create in not for a large scale operation with dedicated administration staff but for a small school administrated by a person who also teaches. What ideas I can take from this software are its data input process and the idea of data storage on the cloud.

C00002396 Page 17 Web-Based Music School Manager: Research Manual

Lantiv Timetabler

Figure 15: LantivTimetabler

Lantiv Timetabler is a free client based timetabling application which allows users to schedule activities either interactively by using a drag and drop facility or automatically based on constraints entered [6]. It has very user friendly Interface and is quite easy to use; within a few minutes of launching the application I was able to begin entering data. Data is saved using an XML format and so may be easily edited using an XML editor.

Before a timetable can be created, the user must enter the following data: day; lesson; group; student; teacher; room and activity data. This is all done via one interface.

Figure 16: LantivTimetabler - data entry

Once all the relevant data has been entered and you click OK, the scheduling workspace is opened; it is here that you can create your timetable. If any violations occur, they may be automatically fixed with the click of a button. A violation is a situation in which some constraint you entered is not fulfilled in the timetable e.g. 4 hours of a lesson are required but only 3 are timetabled.

C00002396 Page 18 Web-Based Music School Manager: Research Manual

Conclusion

The simplicity and ease of use of the Lantiv Timetabler is what I like most, I could imagine anyone with basic PC skills being able to use it. Data entry is very straight forward and it is all done via one interface. Being able to drag and drop your activities into various time slots is a feature which would be very useful for a small school that aims to accommodate parents, students, and teachers alike.

C00002396 Page 19 Web-Based Music School Manager: Research Manual

Prime Timetable Prime Timetable describes itself as “online school timetable software for primary and secondary schools” [7]. It uses Microsoft Silverlight technology to make it look and feel like a regular desktop application, but has the advantage of being completely web-based and therefore accessible from PC or MAC from any location with an available web connection.

For the purposes of this example I used the free edition, which is available via their website.

The first thing you must do is set-up the basic timetable information, such as the working days in a week and the number of lessons per day. You must then enter the following data before a timetable can be generated: subjects; rooms; teachers; classes and lessons.

Figure 17: Prime Timetable - data entry

Once this data has been entered you can generate a timetable.

Figure 18: Prime Timetable - basic timetable

C00002396 Page 20 Web-Based Music School Manager: Research Manual

You can then save the timetable in a variety of forms such as: HTML, JPEG or XML.

Figure 19: Prime Timetable - options

Conclusion

Primo Timetable is an excellent resource for primary or secondary schools. The ability to access your timetable from anywhere via the web is a great selling point. For my project I would like to implement similar features such as its data input and timetable view and generation facility.

The main disadvantages as far as my project is concerned would be the fact that you can only have a maximum of 16 classes per day and you cannot specify individual students.

C00002396 Page 21 Web-Based Music School Manager: Research Manual

Timetabling algorithms Course timetabling problems are an NP-hard problem, which means that they are difficult to solve with conventional methods; and the amount of computation required to find an optimal solution increases exponentially with the problem size. The main idea of this problem is to assign a set of teachers to rooms and time slots while satisfying a number of constraints. The constraints are usually divided into two sets: hard constraints and soft constraints. Hard constraints have a higher priority than soft constraints. The objective of this problem is to satisfy the hard constraints and minimise the violation of the soft constraints [33].

In the following section, we will look at some Meta-heuristic methods, such as genetic algorithms (GA), simulated annealing (SA),Ant Colony Optimisation (ACO) as well as the algorithm used in FET.

Genetic Algorithms Genetic algorithms (GA) are search procedures based on the mechanics of natural selection and natural genetics. They were developed by Prof. John H. Holland and his students at the University of Michigan during the 1960’s and 70’s.

Genetic algorithms operate on a set of possible solutions. Because of the random nature of the genetic algorithm, solutions found by the algorithm can be good, poor or infeasible so there should be a way to specify how good that solution is. This is done by assigning a fitness value to the solution. Chromosomes represent solutions within the genetic algorithm. Two basic components of chromosomes are the coded solution and its fitness value [32]. The outline of a basic genetic algorithm is:

1. [Start] Generate random population of n chromosomes (suitable solutions for the problem) 2. [Fitness] Evaluate the fitness f(x) of each chromosome x in the population 3. [New population] Create a new population by repeating following steps until the new population is complete a. [Selection] Select two parent chromosomes from a population according to their fitness (the better fitness, the bigger chance to be selected) b. [Crossover] With a crossover probability cross over the parents to form a new offspring (children). If no crossover was performed, offspring is an exact copy of parents. c. [Mutation] With a mutation probability mutate new offspring at each locus (position in chromosome). d. [Accepting] Place new offspring in a new population 4. [Replace] Use new generated population for a further run of algorithm 5. [Test] If the end condition is satisfied, stop, and return the best solution in current population 6. [Loop] Go to step 2 [31]

Chromosomes are grouped into a population [set of solutions] on which the genetic algorithm operates. In each step [generation] the genetic algorithm selects chromosomes from the population [usually based on the fitness value of chromosome] and combines them to produce new chromosomes [offspring]. These offspring chromosomes form a new population [or replace some of the chromosomes in the existing population] in the hope that the new population will be better than the previous one. Populations keep track of the best and worst chromosomes and stores additional statistical information which can then be used by the genetic algorithm to determine the stop criteria [32].

C00002396 Page 22 Web-Based Music School Manager: Research Manual

C00002396 Page 23 Web-Based Music School Manager: Research Manual

The general form for a genetic algorithm is defined as: procedure genetic algorithm; begin set time t := 0; initialise the population P(t); while termination conditions not met do begin evaluate the fitness of each member of the population P(t); select members from population P(t) based on fitness; produce the offspring of these pairs using genetic operators; replace, based on fitness, candidates of P(t), with these offspring; set time t := t + 1; end end Table 1: The genetic algorithm [30]

Simulated annealing Simulated annealing is a Monte-Carlo technique which can be used to find solutions to optimisation problems. The technique simulates the cooling of a collection of hot vibrating atoms in metal. The heat causes the atoms to move around randomly, and as they cool the atoms find new positions. If the mass is cooled quickly then chance of obtaining a low cost solution is lower than if it is cooled slowly (or annealed). At any given temperature a new configuration of atoms is accepted if the system energy is lowered. However, if the energy is higher, then the configuration is accepted only if the probability of such an increase is lower than that expected at the given temperature.

To apply simulated annealing to the timetabling problem, you just need to replace the atoms with the timetabling elements. The system energy is replaced by the timetable cost. An initial allocation is made in which elements are placed in a randomly chosen period. The initial cost and an initial temperature are computed. The cost is used to reflect the quality of the timetable, just as the system energy reflects the quality of a substance being annealed. The temperature is used to control the probability of an increase in cost and relates to the temperature of a physical substance. At each iteration a period is chosen at random, called the ‘from’ period, and an element randomly selected from that period. Another period is chosen at random, called the ‘to’ period. The change in cost is calculated from two components:

1. The cost of removing the element from the ‘from’ period,

2. The cost of inserting the element into the ‘to’ period.

The change in cost is the difference of these two components. The element is moved if the change in cost is accepted, either because it lowers the system cost, or the increase is allowed at the current temperature [34].

C00002396 Page 24 Web-Based Music School Manager: Research Manual

s := s0 e := E(s) k := 0 while k emax sn := neighbour(s) en := E(sn) if random() < P(en - e, temp(k/kmax)) then s := sn; e := en k := k + 1 return s Table 2: Pseudo-code implementation of the simulated annealing heuristic [35]

Ant Colony Optimisation Ant Colony Optimisation (ACO) is a population based meta-heuristic that can be used to find approximate solutions to difficult optimisation problems. In ACO, a set of software agents called artificial ants search for good solutions to a given optimisation problem. To apply ACO, the optimisation problem is transformed into the problem of finding the best path on a weighted graph. The artificial ants (hereafter ants) incrementally build solutions by moving on the graph. The solution construction process is stochastic and is biased by a pheromone model, that is, a set of parameters associated with graph components (either nodes or edges) whose values are modified at runtime by the ants [36].

procedure ACO_MetaHeuristic while(not_termination) generateSolutions() daemonActions() pheromoneUpdate() end while end procedure Table 3: ACO example pseudo-code [37]

FET The FET source code is freely available to download from “http://lalescu.ro/liviu/fet/download.html”. It was written using QT C++ [28]. The actual source for the algorithm can be found in the file ‘generate.cpp’, with the initialisation being done with the file ‘generate_pre.cpp’.

Up to and including FET version 4, a genetic algorithm was used; however FET version 5 now uses a recursive swapping algorithm. It places the activities in turn, starting with the most difficult ones. If it cannot find a solution it points you to the potential impossible activities, so they can be manually corrected. The algorithm swaps activities recursively in order to make space for a new activity or in extreme cases, backtracks and switches the order of evaluation.

Unfortunately as with a lot of open-source software, the documentation for the code and algorithm is very sparse and therefore hard to actually understand without intensive study as there are roughly 15,000 lines of code between the two files mentioned above.

C00002396 Page 25 Web-Based Music School Manager: Research Manual

Web Development

Technologies Web technologies can be broken into two categories: Client-side technologies and Server-side technologies. Client-side technologies are focused on the design and presentation of the browsers output; be it on a desktop, laptop or mobile device. Server-side technologies deal with the processing of requests from the client-side, be it a request for data or user validation. Once a request has been processed it creates a response which it sends back to the calling client-side application.

The way we browser the web is changing; it’s no longer just the domain of desktop web browsers such as Internet Explorer (IE), Firefox, etc. Televisions, games consoles such as the Playstation 3 and Xbox 360, Netbooks and mobile devices such as the iPhone and Andriod are becoming ever more popular way for users to digest content. It is important to remember that our creation will probably be viewed on any one of the aforementioned devices, and therefore the selection of technologies is very important and must take these considerations into account. Architecture

3-Tier Model

Figure 20: 3-tier model

As the name implies 3-Tier is a model which has the following three tiers:

 Tier 1 o The presentation Tier which deals with the GUI front-end, be it a web browser, iPhone, iPad, etc. Client-side scripts can be run here via the browser.  Tier 2 o The application or business tier where the application logic lives; it is where all the content processing and generation will take place and where the server-side scripts will be run. Provides the communication between tier 1 and tier 3.  Tier 3 o The data tier which contains the data store. It could be a database or a flat file such as XML.

In this model the client tier never communicates directly with the data tier; all communication must pass through the middleware tier.

C00002396 Page 26 Web-Based Music School Manager: Research Manual

2-Tier Model

Figure 21: 2-tier model

In a 2-tier model the client talks directly to a server. There is no intermediate between client and server as in the 3-Tier model. The two tiers of two-tier architecture are:

 Data tier o The data store, where our database or flat file is stored.  Client tier o The browser, which could be on a PC, laptop or mobile device.

With the 2-tier model understanding and maintenance is easier but come with the loss of performance as the number of users increase.

C00002396 Page 27 Web-Based Music School Manager: Research Manual

Model-View-Controller

Figure 22: Model-View_Controller pattern

The Model-View-Controller (MVC) is an architectural design pattern which separates the modelling of the domain, the presentation, and the actions based on user input into three separate classes [19]:

 Model o The model manages the behaviour and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller) [20].  View o The view manages the display of information [20]. It allows a developer to create separate views for PC, iPhone, etc. without having to change the functionality of the Model or Controller.  Controller o This is the means by which the user interacts with the application. For example, if a user clicks a menu item, the controller is responsible for determining how the application should respond.

C00002396 Page 28 Web-Based Music School Manager: Research Manual

Server The server is the machine on which the web server application is running, and in general when we talk about the server we actually mean the web server. The primary job of a web server is to deliver content to the client, over the World Wide Web (WWW), this content is generally HTML and whatever content is associated with it: images, videos, etc.

Of course the server is responsible for more than the delivery of web pages; it might also be acting as an e-mail server and an ftp server.

Client Clients used to comprise of browsers running on desktop PC’s and MAC’s alone; presently there are several devices capable of running an Internet browser, such as:

 Desktop machines o PC, MAC.  Laptops  Netbooks  Mobile Devices o Such as iPhone, iPad, Andriod, etc.  Televisions o One example would be the Sony Internet TV [21].  Game Consoles o Modern consoles such as the Playstation 3, Wii and Xbox 360 all have Internet connectivity, and are beginning to offer a number of internet related services such as movies on demand, youtube, etc.

Clients rely on servers for resources, such as data, files and even processing power.

Basic Client Server Relationship The stages involved in the delivery of a web page are as follows:

 User enters URL into the address bar of their client. o The URL (uniform resource locator) is generally comprised of 3 parts: 1. The protocol (“http”) 2. The server name (“www.itcarlow.ie”) 3. The file name (“index.htm”)  The client communicates with a name server, which translates the URL into an IP address.  The client then connects to the server at that IP address, usually on port 80.  The client the sends a GET request to the server, asking for the requested URL.  The server then processes that request and sends the HTML for the requested URL to the client.  The client then reads the HTML, formats and finally displays the web.

C00002396 Page 29 Web-Based Music School Manager: Research Manual

Data Probably the single most important aspect from a school administration point of view is its data. The data required for a school can be broken into the following categories:

 Student o This is all the data relating to the student, the usual data such as name, address, etc. o Additional parent/guardian information is also required. o This data will have to be updated every year, as the student progresses through school. o New student will be added each year.  Teacher o All relevant Teacher data, such as: name, address, subjects taught, etc. o Once entered this data will be relatively static.  School o General school information, such as: name, address, contact information, etc. o Information on the number of building, rooms, etc. o Available subjects. o Lessons, which are a combination of subjects, teachers and students.

Database Systems When considering the type of data store to use, cost is the major deciding factor and for that reason we will be focusing on free and open-source database implementations. There are also some interesting data store solutions to be found in the cloud, some of which are looked at in the Cloud Technologies section.

MySQL MySQL, “The world's most popular open source database”, is a fast, open-source Relational Database Management System (RDBMS) that uses Structured Query Language (SQL) [22]. It is:

 Transaction-safe

o Transaction-Safe Tables (TST) ensures that you can get your data back in the event of a system crash or hardware failure. It also provides a ROLLBACK facility to ignore changes and if an update fails, all your changes will be restored.

 ACID compliant

o This means that the database transactions are processed reliably in accordance to the set of properties defined by ACID: atomicity, consistency, isolation, durability.

The option to have Not Transaction-Safe Tables (NTST) is also available; this gives a speed advantage over TST, but with the loss of restorative features.

Tables in MySQL are managed using storage engines. Different storage engines have differing performance characteristics, so you can choose the engine which most closely matches the characteristics you need. The most common engines used in MYSQL are InnoDB and MyISAM.

Stored procedures were introduced to MySQL in version 5.0, and allow us to automate many tasks directly on the server, which previously required external scripts to do.

One of the most popular web applications for managing MyPhp is phpMyAdmin, currently it can create, drop and alter tables; delete, edit and add fields; manage privileges and export data into various formats.

Businesses such as Facebook, Yahoo, Google, Nokia and Youtube all use MySQL.

C00002396 Page 30 Web-Based Music School Manager: Research Manual

The latest version of MySQL is version 5.1.52.

PostgreSQL PostgreSQL is a powerful, open source object-relational database system (ORDBMS). An ORDBMS is similar to a relational database but supports objects, classes and inheritance.

It is fully ACID compliant, supports foreign keys and stored procedures. As well as supporting all the regular data types: CHAR, INTEGER, BOOLEAN, etc; it also supports the storage of pictures, sound and video. PostgreSQL has a single storage engine.

One of the most popular web applications for managing PostgreSQL is phpPgAdmin.

Prominent users of PostgreSQL include: the International Space Station; MySpace and Skype.

The latest version of PostgreSQL is version 9.0.1

SQL Server Express Microsoft’s SQL Server Express is the free version of its commercial RDBMS, SQL Server. It is recommended for web, desktop and small server applications. Some of the features available to SQL Server Express are:

 Same database engine as the higher editions of SQL Server.  Stored procedures.  Integration with many of the current crop of Microsoft products.  Backup and restore.  Compatible with SQL Azure Database service.  10 GB database storage.

SQL Server Express looks like a good package for small applications which in the main are going to be run on a Windows platform [29].

SQLite SQLite is an ACID-compliant embedded SQL database engine. Unlike other SQL databases, SQLite does not have a separate server process. A complete SQL database is contained in a single cross- platform file on disk. It supports INTEGER, REAL, TEXT, BLOB and NULL data types, but uses dynamic typing; which means that you can store a string in a database column of type integer, if you so wish. Several processes may gain read access to a database at the same time, however only one write may occur at a time.

SQLite has bindings for several languages, such as: C++, C#, Java, Perl, Php, Python, Ruby, JavaScript and VBScript.

Some well know users of SQLite are Adobe; Apple and Mozilla to name but a few.

C00002396 Page 31 Web-Based Music School Manager: Research Manual

Languages

Server-side Server-side scripting or programming is a technology which allows HTML to be created on the fly, therefore providing interactive web sites that interface to databases or other data stores. The main advantage to server-side scripting is the ability to create dynamic content, which customises the response based on the user’s requirements, access rights, or queries [8]. Server-side scripting is more secure than client-side scripting as it can be encrypted, therefore protecting user data against hack attempts. Examples of some server-side scripting languages are: ASP; PHP; Perl; Python; Ruby and Java Servlet, which we will be examining in detail bellow.

ASP Active Server Pages (ASP), also known as Classic ASP are a free web application framework from Microsoft that you can use to create and run dynamic, interactive Web server applications. With ASP, you can combine HTML pages, script commands, and COM components to create interactive web pages and applications. A Component Object Model (COM) can be described as a “black box” that encompasses a set of methods and associated data, which allow web sites to access functionality in compiled libraries such as DLLs.

ASP pages have the extension .asp, so when a page with this extension is requested by a browser the web server knows to interpret any ASP contained within the web page before sending the HTML produced to the browser. In this way all the ASP is run on the web server and no ASP will ever be passed to the web browser. Web pages containing ASP cannot be run simply by opening them in a web browser, the page must be requested through a web server that supports ASP.

The default scripting language used for writing ASP is VBScript, although other scripting languages such as Jscript or PerlScript can be used. Jscript is Microsoft’s version of JavaScript.

<% Dim theDate theDate= Date() Response.Write("The date is: " &theDate) %> Table 4: Simple VBScript which displays “The date is: ” in the body of a HTML document

In general ASP is run on Microsoft web servers such as WindowsNT Server running Internet Information Services (IIS) which supports VBScript, Jscript, with ActiveX scripting plug-ins available

C00002396 Page 32 Web-Based Music School Manager: Research Manual for REXX, Perl and Python. It can also be run on the Apache Web Server but this only supports Perl scripting. There are some on-going projects which allow ASP to function with other environments and web servers: InstantPHP [10]; Chili!Soft ASP [11]; and Mono [12].

PHP PHP: Hypertext Preprocessor (PHP) is a free HTML-embedded scripting language, and is almost always in the top 10 of any programming language survey or poll. PHP code is embedded into the HTML source document and interpreted by a web server running a PHP processor module, which then generates the web page.

The latest version of PHP is PHP5, which contains several new features such as improved MySQL support, native SQLite support and a host of new functions. It is important to note that several versions of PHP can be run at the same time.

It is claimed that “PHP can access virtually any database available today” [9]. This claim would appear to be true as PHP has support for legacy databases such as IBM DB2; popular database systems like MySQL and Oracle; and lesser known database systems such as PostgreSQL. I will be investigating some of these database systems later on in the Data section.

Within a HTML document, PHP code is embedded within the PHP delimiters “”. Only the code within these delimiters is parsed by the PHP engine. Other delimiters are also available.

Hello World

Table 5: PHP code embedded in an HTML document

PHP is widely used in web applications from blogging on WordPress to content management systems such as Drupal and Joomla. One of the main advantages of PHP is the fact that it was specifically designed for the web, and therefore includes many useful web-related features straight out of the box, such as: functions for the creation and manipulation of graphics; functions for working with HTML; and the ability to talk to databases.

Perl Perl which officially stands for Practical Extraction and Report Language is a general purpose programming language. Some of Perl’s uses include graphics programming, network programming, and the one we are interested in CGI scripting on the web. Because of its flexibility Perl has acquired the nickname “the Swiss Army chainsaw of scripting languages” [13].

A CGI script is a relatively small program that runs on the web server, which usually produces some sort of dynamic web page. CGI stands for Common Gateway Interface, and is a mechanism which allows web servers to run scripts when requested by a web browser.

C00002396 Page 33 Web-Based Music School Manager: Research Manual

#!/usr/bin/perl

@months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); @weekDays = qw(Sun Mon Tue Wed Thu Fri Sat Sun); ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $daylightSavings) = localtime(); $year = 1900 + $yearOffset; $theTime = "$weekDays[$dayOfWeek] $months[$month] $dayOfMonth, $year"; print "Content-type: text/html\n\n"; print < A Simple Perl CGI

A Simple Perl CGI

$theTime

HTML exit;

Table 6: Simple CGI script which will insert the current date into the page each time the script is called. [14]

The main advantage of Perl is its string processing and regular expression support. This is because Perl was originally developed as a way to make report processing easier and most of what is being created on the web happens with text.

C00002396 Page 34 Web-Based Music School Manager: Research Manual

Python Python is a powerful dynamic programming language that is used in a wide variety of application domains such as: web and internet development; database access; desktop GUIs; and software development to name but a few. Of course it is the web and internet development that we are interested in. It is the cgi module at the core of Python CGI scripts, which defines a number of utilities for use by CGI scripts written in Python. If you are using an Apache web server then you have the option of using Mod_python which is much faster that CGI but only available for Apache.

#!/usr/bin/env python print "Content-Type: text/html" print print """\

Hello World!

Table 7: "Hello World" in python CGI fashion [15]

All Python code will be executed at the server only. The client’s browser will never see a single line of Python, instead it will only see the output of the Python script, be it text, HTML, CSS, etc.

The main advantages of using Python are its readability because Python’s syntax is very readable due to imposed block structure defined by indentations and it is easy to learn because of the source codes resemblance to pseudo code.

C00002396 Page 35 Web-Based Music School Manager: Research Manual

Ruby Ruby is a dynamic object-orientated programming language, and is often used as an alternative to PHP as a server-side language. In Ruby every data type is an object and every function is a method. It is a very flexible language, as it allows users to freely alter its parts at will.

CGI scripts can be written quite easily in Ruby. To have a Ruby script generate HTML output, all you need is

#!/usr/bin/ruby print "HTTP/1.0 200 OK/r/n" print "Content-type: text/html\r\n\r\n" print"Hello World! It’s #{Time.now}\r\n” Table 8: Simple Ruby CGI script which generates some HTML [16]

Ruby comes with a class library called cgi which enables more sophisticated interactions than those above, such as: form processing; cookies; and sessions.

#!/usr/bin/ruby require 'cgi' cgi = CGI.new puts cgi.header puts "Hello World!"

Table 9: Simple CGI object

Important Note: Ruby should not be confused with Ruby on Rails, which is a web application framework, built using Ruby.

C00002396 Page 36 Web-Based Music School Manager: Research Manual

JavaScript Server-side JavaScript (SSJS) refers to JavaScript that runs on a server and is therefore not downloaded to the browser. It is composed of core JavaScript (same as Client-side) and additional objects and functions for accessing databases and file systems, sending e-mail, etc. SSJS must be served by a JavaScript-enabled server.

The following is some sample JavaScript:

<%@LANGUAGE="JavaScript"%> <% Response.Write("\r") Response.Write("\"Hello World\"
\r") Response.Write("\r") %>

This produces the following HTML code for the browser to interpret and display.

"Hello World"

One of the main advantages of JavaScript is that both Server and Client programs can be written in the same language.

C00002396 Page 37 Web-Based Music School Manager: Research Manual

Client-side When we talk about Client-side, we are interested in the technologies that are run on client machines, usually by the browser. Some of the technologies we are going to examine are: HTML; CSS; JavaScript; and AJAX.

HTML HTML (HyperText Markup Language) is the main language used in the creation of web pages. It uses sets of tags to specify the structure of the document. Within these tags the content of the document is defined. HTML tags generally come in pairs, the first being the start tag with the second being the end tag. The client’s web browser then uses these tags to interpret the content and structure of a web page.

Basic HTML test

Hello World!

Table 10: Simple HTML document

During its lifetime HTML has gone through many revisions, the next major revision is HTML5 which adds a lot of new features to the HTML specification, such as:

 Elements like,

,
and
Recommended publications