2
2
2
_______________
A Thesis
Presented to the
Faculty of
_______________
In Partial Fulfillment
Master of Science
in
Computer Science
_______________
by
Cheena Garg
Spring 2013
iii
Copyright © 2013
by
Cheena Garg
All Rights Reserved
iv
DEDICATION
I would like to dedicate this thesis to my parents, sisters and my husband who have
been very supportive throughout my education.
v
At San Diego State University about 10 years ago a certificate in GIS was established
requiring 27 units distributed almost equally between Geography and Computer Science.
A few years later a San Diego Consortium made up of SDSU, Mesa College and San
Diego city schools was awarded a grant by NSF-ATE (National Science Foundation-
Advanced Technological Education) to develop a scalable skills certification program,
articulate curriculum between institutions, and increase community awareness of GIS as a
discipline and as a career.
The GIS Test Bank is developed primarily to promote GIS education and career
advancement. It is a web based application which can be accessed anywhere with an internet
facility. It consists of various essay type and multiple choice questions with graphics from
different GIS categories. The user has to provide login information in order to access the
application. Once authenticated, based on the role as an administrator, faculty, teaching
assistant or student, the user will be able to use the application based on the permissions
given to them. Test bank can be used to prepare class tests, prepare for exams, give tests
online whose scores will be automatically reported to the faculty, upload or access class
lectures or handouts etc. The test bank initially emphasizes a class articulated between SDSU
and community colleges.
vi
TABLE OF CONTENTS
PAGE
ABSTRACT ...............................................................................................................................v
LIST OF FIGURES ................................................................................................................. ix
ACKNOWLEDGEMENTS ..................................................................................................... xi
CHAPTER
1 INTRODUCTION .........................................................................................................1
1.1 NSF-ATE Program ............................................................................................1
1.2 GIS Test Bank ....................................................................................................2
1.3 Architecture of GIS Test Bank ..........................................................................3
1.4 Application Flow ...............................................................................................4
1.5 Challenges Faced ...............................................................................................5
1.5.1 Keeping Up with Rails ..............................................................................5
1.5.2 Choosing a Database .................................................................................5
1.5.3 Database Creation .....................................................................................5
1.5.4 Plug-ins .....................................................................................................5
2 GEOGRAPHIC INFORMATION SCIENCE ...............................................................7
2.1 Definition ...........................................................................................................7
2.2 Components of GIS............................................................................................7
2.3 Applications of GIS ...........................................................................................8
2.3.1 Government...............................................................................................8
2.3.2 Business ....................................................................................................8
2.3.3 Emergency Services ..................................................................................8
2.3.4 Environment and Conservation.................................................................9
2.3.5 Education and Science ..............................................................................9
3 GIS TEST BANK ........................................................................................................10
3.1 Advantages of the Test Bank ...........................................................................10
3.2 What the Test Bank Covers?............................................................................11
3.2.1 Multiple Choice Questions .....................................................................11
vii
LIST OF FIGURES
PAGE
ACKNOWLEDGEMENTS
My foremost thanks to my thesis advisor Dr. Carl Eckberg, whose guidance and
support has been very valuable.
Thanks are also due to Dr. Ming-Hsiang Tsou for being very kind and extending
every form of help whenever needed, for giving me the opportunity to work for the NSF-
ATE program which led to this Thesis.
And of course, Thanks go to my family for their invaluable support through all times
and also for test running the application.
1
CHAPTER 1
INTRODUCTION
class tests consisting of essay type questions for each category. The number of questions on
the test is decided by the faculty. Different sets of question papers can be created in order to
prevent plagiarism. Apart from testing features like uploading lectures online, self-study help
for students etc. are also included in this application. The test bank is created using Ruby on
Rails which follows the Model View Controller (MVC) paradigm. The MVC architecture
allows clean separation of business logic (the controller), data (the model) and the formatting
of data for display and user interaction (the view). This test bank has a feature of role based
authentication which allows a user to access the system as an administrator, faculty, teaching
assistant or a student user. Each role has a predefined set of permissions, access and control
over the application. MySQL is used as a database though Rails works with many other
databases like PostgreSQL, Oracle, SQLite 3 etc.
Browser
Web Controller
option from given GIS categories. Students have access to all the lectures and class handouts
uploaded by the faculty and can view all the scores attained by them.
1.5.4 Plug-ins
Rails provide one of the fastest ways to add functionality in an application using
Plug-ins. Plug-ins are easy to install and easy to use. As Rails is growing rapidly, many
different kinds of plug-ins can be used to do same kind of function. For example, to add an
6
CH
HAPTER
R2
GEOGR
RAPHIC INFORMA
ATION SC
CIENCE
1 DEFINITION
2.1
Geograph
hical informaation system
ms are used too explore thee fundamenttals of
graphy. Geog
Geog graphic inforrmation scieence is a systtem created tto work withh geographiccal
refereenced inform
mation i.e. in
nformation based on locaation. This ggeo-referencced data is
captu
ured, stored, analyzed an
nd displayed by a GIS syystem. GIS aallows us to eexplore the ddata
in thee form of maaps, globes, charts
c etc. to
o find the rellationships aand patterns in the data [[7,
24].
2.2 COM
MPONENTS OF GIS
GIS can be
b divided in ponents: Appplication, Data, Hardwaare, Softwaree,
nto five comp
and People
P (see Figure
F 2.1 [7
7]).
Figure
F 2.1. Components
C s of GIS. Soource: IT Trrends –
Latest/Recen
L nt Trends inn Informatioon Technology. GIS:
Geographica
G al Informatiion System,, 2010.
http://rtmnu
h uittrends.blo
ogspot.com//2010/11/gissgeographicc
al-informati
a on-system.hhtml, accesssed Jan. 20113.
8
Application: Applications include how the data will be inputted, stored, analyzed and
presented as a final output. Application examples include water quality monitoring,
land use planning etc [6].
Data: Data is one of the most important components of GIS. Geographic and tabular
data can be collected or purchased from a data provider. A DBMS is used to create
and maintain a database and help organize and maintain data [6].
Hardware: Hardware is equipment like computers, scanners, digitizer, and plotters on
which GIS operates. The software runs on various hardware types including
centralized servers to desktop computers [23].
Software: Software provides functions and tools to store, analyze and display
geographic data [23].
People: GIS users are the people who design and maintain the system.
2.3.1 Government
GIS is helpful in planning and organizing geographic data for many government
organizations. GIS is being used by various government bodies which helps them to keep
track of description and ownership of properties, public works, roads, and more within their
jurisdiction. It also helps military defense for terrain analysis and many other critical
planning and operations [11, 2].
2.3.2 Business
GIS is beneficial to various businesses in a variety of ways. GIS can be used to track
properties, property value, tax information etc. for real estate agents and bankers. Health care
professionals use GIS to track the spread of disease [2].
CHAPTER 3
It should be noted that test banks of this kind are used for certification tests for Java,
Oracle, Microsoft (Certified Engineer), A +, Cisco etc.
Category: Level:
Unit 2: Mapping the Earth Beginner
Each multiple choice question can have one or more correct answers. In this test bank,
students have to select all correct answers for each question. An example to show the select
all correct answers in a multiple choice question is shown in Figure 3.2. There are 50
multiple choice questions in the database so far and more can be added whenever needed.
Category: Level:
Unit 3: Network of Geographic Information, Intermediate
Georeference and Projection.
Choices are:
It divide the earth into two equal hemisphere.
Is the path with smallest curvature.
On the earth, equator is a great circle.
The center of great circle coincides with center of the earth.
Category: Level:
Unit 3: Network of Geographic Information, Medium
Georeference and Projection.
Choices are:
Peter projection
Mercator projection
Azimuthal distance projection
Robinson projection
Answer to these kinds of questions can be answered only after carefully examining
the respective image.
Category:
Unit 2: Mapping the Earth
3.3 USAGE
This test bank application can be used as one of the exercises during lab work in order
to help prepare students for exams. This will also help testing this application by geography
students.
15
CHAPTER 4
RUBY ON RAILS
4.1 INTRODUCTION
Rails is a web development framework written in the Ruby language. A web
framework is used to develop web applications and web services with ease. The overhead
associated with common activities of web development can be reduced by libraries,
templates, session management and other software tools provided by a web framework [25].
In the Rails framework all the layers are built to work together with less code and promote
“don’t repeat yourself” (DRY).
Rails is organized around the Model, View and Controller architecture, usually called
MVC. The MVC paradigm provides clean separation of business logic (the controller), data
(the model), and the data display format and user interaction (the view). This helps to
maintain, debug and extend web applications with ease.
Some of the other useful features of Ruby on Rails framework used in the GIS Skills
Certificate Test Bank are listed below.
4.2 DEVISE
An interactive application like test bank needs to use an authentication mechanism to
keep track of users. This can be achieved in Rails using a gem known as Devise. Devise is a
full featured Rack-based authentication solution based on Warden [5, 13].
Devise can be used by adding the devise gem in the Gemfile and installing the gem
by running the bundler. Devise Modules are generated using the following command:
rails generate devise_install
The authentication system requires User Model, view and controller which was generated
using:
rails generate devise User
16
A successful authentication routes the user to a welcome page while a failed login
brings back the user to the login page. The user session starts as soon as the authentication is
done.
Sometimes, successful authorization is required by some action with the controller or
all the action in the controller in order to be accessed. Filters like before_filter can be used to
implement such features.
4.3 MIGRATIONS
Database migrations can be defined using rails. Each migration represents a change
that has to be made to the database. These changes can update both the database schema and
the data in the database tables. You can also roll back to the previous database.
When a new model is created using a generator, rails automatically creates migration
in the \db\migrate folder that can be used to create the corresponding table. Blank migration
can be created using the following command:
Script/generate migration MigrationName
The class name is the same as that of the ruby migration file name. Methods like
self.up and self.down are used to migrate any new changes and roll back to previous
respectively [23].
Rails supports eleven data types, namely string, text, integer, float, decimal, datetime,
timestamp, time, date, binary and Boolean. An example of table creation is:
class CreateUsers < ActiveRecord::Migration
def self.up
create_table "users", :force => true do |t|
t.column :firstname, :string
t.column :lastname, :string
t.column :email, :string
t.column :login, :string
t.column :crypted_password, :string, :limit => 40
t.column :salt, :string, :limit => 40
t.column :created_at, :datetime
t.column :updated_at, :datetime
17
def self.down
drop_table "users"
end
end
4.4 VALIDATIONS
Validations help to ensure that only valid data is saved into your database. This
includes database constraints, client-side validations, controller-level validations, and model-
level validations [14]. For example, it is important to this application to ensure that every
user provides a valid email address, a certain field should not be blank, password is within a
certain range etc [14]. An example of how validation can be used in rails application is
shown below:
To validate that the specified attributes are not empty:
validates_presence_of :user_name,: password
To validate the uniqueness of a field:
validates_uniqueness_of :email
To validate length of a field:
validates_length_of :name, :minimum => 4
18
CHAPTER 5
The GIS test bank application requires a Ruby interpreter, Rails framework and
MySQL as a database. Any version of Ruby later than 1.8.6 can be used. Ruby 1.8.6 and
earlier are not supported and neither is version 1.9.1. Ruby Gems are a standard package
manager for Ruby and will also need to be installed [18]. Bundler is used to install and
include the gems needed by the application. Once we have Gems, Rails and its dependencies
can easily be installed by executing the following command:
gem install rails
The database is used to store the different data used in the application which will be
used by rails to display on screen to the user. I have used MySQL database though other
databases like SQLite, PostgreSQL and Oracle can also be used.
MySQL adapter is needed to use MySQL in Rails greater than 2.1:
$ gem install mysql
To create a new Rails application using the MySQL adapter:
$ rails new gis_thesis -d mysql
Next, config/database.yml also needs to be edited accordingly. Example is given below [26]:
development:
adapter: mysql
database: gis_thesis
username: root
password: cheena
host: localhost
It is also easy to use other databases like PostgreSQL, SQLite, and Oracle with Rails.
Creation of skeleton, controllers, and model is done only once. This gis_thesis folder
can be copied in ruby/bin folder on the server and is now ready to use.
t.trackable
t.column :email, :string
t.column :log
gin, :string
t.column :firsstname, :striing
t.column :lasttname, :strin
ng
t.timestamps
end
d
add
d_index :useers, :login, :unique => trrue
add
d_index :useers, :email, :uniique => truee
add ken, :unique => true
d_index :useers, :reset_paassword_tok
end
def self.down
op_table :useers
dro
end
end
The correesponding tab
ble created in
i the databaase is shown in Figure 5..1 Each Userr has
D, first name, last name, email addresss, login nam
an ID me and passw
word (at leasst 4 characteers)
fieldss.
Each Role has an ID, role name and role description field. There are only four entries
in the table namely administrator, faculty, teaching assistant and student. The role table is
shown in Figure 5.2 and 5.3.
The Roles_Users table contains role ID and User ID fields. This table maps the roles
that are assigned to each user. The Roles_users table is shown in Figure 5.4.
The Category table has ID and category name field as shown in Figure 5.5. Category
name fields consists of GIS topics covered in the test bank.
The Level table has ID and level name field. Level table have three entries of
beginner, intermediate and advanced. Description of level table is shown in Figure 5.6 and
5.7.
23
The Questions table consists of four fields namely ID, question, category ID and level
ID. Category ID and Level ID shows the category and level a particular question belongs to.
Figure 5.8 shows the question table.
The Answers table consists of four fields namely ID, answer, question ID and
isCorrect. Question ID field indicates the question to which that answer belongs to while
24
isCorrrect fields teells whether that answerr choice is coorrect or not.. Figure 5.9 shows the
answ
wer table.
The Imag
ges table contains the imaage associateed with multtiple choice questions. T
This
table has an ID, title, content and question ID field. Im
mages table is shown inn Figure 5.100.
The Docu
uments table is created to
o store the doocuments orr lectures uploaded by thhe
n or faculty member. Do
admin ocument tablle consists oof an ID, titlee and contennt field as shoown
in thee Figure 5.12
2.
ords the scorees achieved by all the stuudents durinng online test.
The Scorees table reco
Scoree table contaains an ID, User
U ID, totall questions, ccorrect answ
wers, incorreect answers, ttotal
numb
ber of correcct answers, percentage,
p and
a date and time test takken fields. D
Description oof
scorees table is sho
own in Figu
ure 5.13.
CH
HAPTER
R6
APP
PLICATIO
ON FLOW
W CONTR
ROL
6.1 AUTHENTICA
U ATION
Each userr who wishess to access th
he applicatioon has to entter their login ID and
word (see Fig
passw gure 6.1). On
nce the user informationn is authenticcated, the usser will be
redireected to the respective
r home page baased on theirr role. If a usser forgets hhis/her passw
word,
he caan contact thee application
n administraator to reset iit to another password. T
There are fouur
typess of users wh
ho can use th
his applicatio
on, namely aadministratorr, faculty, teaching assisstant
(TA) and studentt.
6.2
6 LIST OFF PERMISSSIONS FOR A
AN ADMIN R,
NISTRATOR
FACULTY
Y, TEACHIN NG ASSISTA
TANT AND STUDENT
The homeepage of the user indicattes the set off permissionss assigned too them. Figuures
6 6.4, & Figure 6.5 sho
6.2, 6.3, ows the hom
mepages of aan administraator, faculty,, TA and stuudent
respeectively.
6.3 USERSS
Test Bank
k contains vaarious users based on rolle assigned tto them. Bassed on the tyype of
role, a user can ad
dd, edit, rem
move or list all
a the users. An admin oor a faculty uuser can alsoo
view students sco
oresheet.
29
6.3.2 Editin
ng and Listting Detaiils
The differrence betweeen an admin
nistrator and faculty perm
mission here is that an addmin
user can
c edit the information,, remove and
d view detaills of all the rregistered ussers while a
faulty
y user can ed
dit, remove and
a view dettails of a tea ching assistaant and studeent user (seee
Figurre 6.7).
6.3.3
6 View Student S
Score Sheeet
Administrrators and faaculty memb w scores histtory of all thhe student users
bers can view
along
g with the daate and time at which theey gave the ttest (see Figuure 6.8 and 66.9).
30
6.3.4 Cha
ange User P
Password
The administrator hass the capability to changee or reset thee password oof any existiing
user. So, In case any user forgets his/her password, thhey can conttact the adm
ministrator (seee
Figurre 6.10).
31
6.4
4 QUESTIO
ONS
Test Bank
k contains tw
wo types of questions
q quuestions nam
mely multiplee choice and
essay
y type. Add, edit, delete or
o search cap
pabilities cann be perform
med on questtions based oon
the user role.
32
6.4.1 Ad
dd New Q
Question
An admin
nistrator or a faculty mem
mber can addd two types of questionss namely muultiple
choicce and essay type. Essay type questio
on can be addded by enterring the question statement
along
g with the caategory to wh
hich it belon
ngs. To add a multiple chhoice questioon, user musst
proviide the questtion statemen
nt, category,, level, answ
wer choices aand the correect answer(s))
amon
ng them. Useer can also upload
u an image with thee multiple chhoice questioon (see Figurre
6.11)).
6.4.2 Edit,
E Rem
move and S
Search Question
ministrator an
Both adm nd faculty haave permissioons to edit, rremove and view a list oof all
questtions. They can
c also searrch for a queestion from tthe database (see Figuress 6.12 and 6.13).
6..5 ANSWER
RS
The administrator or a faculty meember can addd a new ansswer to an exxisting questtion
in thee database. They
T can alsso edit, remo
ove or changge the answeer choices. Prrint key optiion is
also available
a to them,
t wheree they can view all the quuestions of a category w
with their corrrect
answ
wers (see Figu
ure 6.14).
33
6.6
6 CATEGOR
RY
Administrrator and facculty membeer can add, eedit details annd view all ccategories inn the
system
m. An admin
n has a poweer to removee a category (see Figure 6.15).
6..7 LECTUR
RE
Lectures, handouts, cllass notes caan be uploadded by an adm
min or a facuulty memberr.
Studeents have acccess to thesee documents (see Figure 6.16).
34
6.8
8 CLASS TEEST
An admin
nistrator or a faculty mem
mber can gennerate a classs test consissting of essayy
type questions.
q The
T number of
o questions on the test iis decided byy the admin or faculty buut the
questtions are randomly selected by the ap
pplication. A
Admin or facculty can creeate many
differrent sets of same
s numberr of question
ns to be distrributed in thee class to avvoid plagiarissm
(see Figure
F 6.17).
35
6.9 STU
UDENT FEA
ATURES
GIS Test Bank provid
des various functionalitie
f es to the studdents. They can take thee test
onlin
ne, access thee uploaded documents
d orr use self stuudy feature tto prepare thhemselves for
exam
ms.
36
6.9.1
1. Online T
Test
Any studeent user can take a test consisting off multiple choice questioons. Each
questtion can havee one or morre than one correct
c answ
wer choice. N
Negative marrking is enabbled
with every incorrrect answer or
o missed an
nswer. Stude nt can view all the questtions with
correct answers at
a the end alo
ong with their grades. Thhis grade will also be repported to thee
facultty member (see
( Figures 6.18 and 6.1
19).
6.9.3 Access
A Lecctures
Student users
u can view
w all the lecttures, handoouts, class nootes or assignnments uplooaded
by the faculty meembers.
38
6.9.4 Stud
dent Profiile Details
All studen
nt users can view their own
o profile ddetails and chhange their eexisting
word. A stud
passw dent can also
o view all thee scores histoory (see Figuures 6.22 annd 6.23).
CHAPTER 7
FUTURE DEVELOPMENT
The Test Bank can be further developed which may include the enhancements given
below.
Test Bank can be extended to cover all the courses of Department of Geography and
Department of Computer Science necessary for GIS certificate. These courses can then be
accessed by the student based on their registered courses.
Test bank can be further enhanced by using essay type questions not only to produce
class test but online test as well. Grading of essay type questions can also be provided based
on matching keyword.
Timers can be introduced for online test in which certain time limit will be given to
students to answer all the questions in one test.
Features where student can also upload their assignments online can be implemented.
Format of online test can be enhanced by displaying radio buttons for unique answer
question to enforce students to give only one answer where as displaying check boxes for
select all correct answer questions.
40
REFERENCES
[1] Beginning Rails 3. The Libraries that Make Up Rails, n.d. https://s3-ap-northeast-
1.amazonaws.com/booksikindle/html/Beginning%20Rails%203%20(Expert's%20Voic
e%20in%20Web%20Development)1/dummy_split_021.html, accessed Jan. 2013.
[2] Center for Research Computing. What is GIS, 2011. http://crc.nd.edu/index.php/
cyberinfrastructure/gal/93, accessed Mar. 2013.
[3] Dev Articles. Ruby-on-Rails: The MVC Pattern in the Rails Framework, 2009.
http://www.devarticles.com/c/a/Ruby-on-Rails/The-MVC-Pattern-in-the-Rails-
Framework/, accessed Jan. 2013.
[4] GIS Career & Education Awareness Website. Home Page, n.d.
http://geoinfo.sdsu.edu/hightech/index.htm, accessed Jan. 2013.
[5] GitHub. Devise, n.d. https://github.com/plataformatec/devise, accessed Apr. 2011.
[6] High Point. Geographic Information Services, n.d.
http://www.highpointnc.gov/gis/what_is_gis.cfm, accessed July 2012.
[7] IT Trends – Latest/Recent Trends in Information Technology. GIS: Geographical
Information System, 2010. http://rtmnuittrends.blogspot.com/2010/11/gisgeographical-
information-system.html, accessed Jan. 2013.
[8] MySQL. Home Page, n.d. http://www.mysql.com/, accessed Mar. 2011.
[9] MySQL. Using MySQL with Ruby, n.d. http://dev.mysql.com/usingmysql/ruby/,
accessed Mar. 2011.
[10] Nationalatlas.gov. Map Projections: From Spherical Earth to Flat Map, n.d.
http://www.nationalatlas.gov/articles/mapping/a_projections.html, accessed Jan. 2013.
[11] NC State University College of Education. Where is GIS Used?, 2004.
http://www.ncsu.edu/gisined/where.html, accessed Jan. 2013.
[12] G. D. Pavagada. GIS Skills Certificate Test Bank. Master’s thesis, San Diego State
University, San Diego, CA, 2008.
[13] Rails Casts. #209 Introducing Devise, 2010. http://railscasts.com/episodes/209-
introducing-devise, accessed Jan. 2013.
[14] Rails Guides. Active Record Validations and Callbacks, 2009.
http://guides.rubyonrails.org/v2.3.11/activerecord_validations_callbacks.html, accessed
Jan. 2013.
[15] Rails Guides. Getting Started with Rails, n.d.
http://guides.rubyonrails.org/getting_started.html, accessed Jan. 2011.
[16] S. Ramaiah. Enhanced Framework for Computer Based Testing. Master’s thesis, San
Diego State University, San Diego, CA, 2005.
41