CSC 325 Grinnell College Fall, 2008
 
Databases and Web Application Design
 

A Departmental Survey of Graduating Majors, Part 1

This laboratory exercise provides practice with the use of several database tables in the context of a Web-based survey that might be used for graduating majors. This type of survey is typical of many applications on the Web.

Background

For several years, the computer science faculty have invited graduating seniors to provide feedback on the CS major. For example, a slightly edited and reformatted version of the questions for 2007-2008 follows:

  1. Experiences with the CS Major:

    1. Looking back on your experiences in the major, what did you like best?
    2. What did you like least?
  2. Learnings:

    1. What did you gain from the major?
    2. What did you wish you had gained from the major?
  3. Courses:

    1. What courses in the major do you regard as essential to your education in computer science? Why?
    2. Were there any courses in the major that you took but wish you had not taken? If so, which ones and why?
    3. Were there any courses in computer science or in mathematics that you wish that you had taken but didn't? Which ones and why?
    4. Were there courses outside the major that you regard as essential to your education in computer science? If so, which ones and why?
  4. What suggestions do you have for improving or changing our program for majors?

  5. The intent of the new CS Learning Center is to support students taking CS courses. What could we do to better support them?

Over the years, the first several questions have remained constant, but the department has adjusted the last question or two to account for current circumstances.

Through May 2008, all of these surveys were conducted in person, with a faculty advisor taking notes during an exit interview. This has allowed for follow-up on several questions and has worked well in many ways. However, there have been at least two drawbacks from the current system:

One possible response to these difficulties might be a Web-based system (although the faculty continue to discuss that option).

What follows in this lab and some subsequent labs is designed to move the discussion along regarding a possible on-line survey instrument to obtain feedback from graduating seniors. Of course, any final version would have to address such issues as confidentiality, privacy, access, authentication, and the like. To get started, the task is to provide some very basic functionality.

Some Basic Needs

In converting exit interviews from a paper format to a database, the following requirements seem likely:

Some Thoughts on Design

Class brainstorming led to the following

Tables

Creation of Basic Tables

The following statements have been executed to define the above tables:


create table surveyStudent
( studentID bigint(20) unsigned not null auto_increment,
  gradYear varchar(25),
  advisor varchar(25),
  numCourses bigint(20) unsigned,
  primary key (studentID)
);

create table surveyQuestions
( questionID bigint(20) unsigned not null auto_increment,
  questionText varchar(255),
  category varchar(255),
  primary key (questionID)
);

create table surveyAnswers
( surveyID varchar(25),
  questionID bigint(20),
  studentID bigint(20),
  answerText varchar(255)
);

create table surveyForm
( surveyID varchar(25),
  questionID bigint(20),
  sequenceNum bigint(20),
  primary key (surveyID, questionID)
);

The following statement inserts the questions for the 2006-2007 and 2007-2008 exit interview surveys:


INSERT into surveyQuestions VALUES
(1, "Looking back on your experiences in the major, what did you like best?", 
    "short-answer"),
(2, "What did you like least?",
    "short-answer"),
(3, "What did you gain from the major?",
    "short-answer"),
(4, "What did you wish you had gained from the major?",
    "short-answer"),
(5, "What courses in the major do you regard as essential to your education in computer science? Why?",
    "short-answer"),
(6, "Were there any courses in the major that you took but wish you had not taken? If so, which ones and why?",
    "short-answer"),
(7, "Were there any courses in computer science or in mathematics that you wish that you had taken but didn't? Which ones and why?",
    "short-answer"),
(8, "Were there courses outside the major that you regard as essential to your education in computer science? If so, which ones and why?",
    "short-answer"), 
(9, "What suggestions do you have for improving or changing our program for majors?",
    "short-answer"), 
(10,"The intent of the new CS Learning Center is to support students taking CS courses. What could we do to better support them? ",
    "short-answer"), 
(11,"As you may know, the faculty recently voted to adopt MAPs (mentored advanced projects, such as summer research in CS) as part of the curriculum.  What role do you see for MAPs in the CS curriculum?
", 
    "short-answer");

INSERT into surveyForm VALUES
("2007-2008", 1, 10), ("2007-2008", 2, 20), ("2007-2008", 3, 30), ("2007-2008", 4, 40), 
("2007-2008", 5, 50), ("2007-2008", 6, 60), ("2007-2008", 7, 70), ("2007-2008", 8, 80), 
("2007-2008", 9, 90), ("2007-2008", 10, 100), 
("2006-2007", 1, 10), ("2006-2007", 2, 20), ("2006-2007", 3, 30), ("2006-2007", 4, 40), 
("2006-2007", 5, 50), ("2006-2007", 6, 60), ("2006-2007", 7, 70), ("2006-2007", 8, 80), 
("2006-2007", 11, 90), ("2006-2007", 9, 100);

Note that the database is set up, so that the first 10 questions mesh exactly with the 2007-2008 survey, but the 2006-2007 survey used questions 1-9 and 11, and question 11 came before question 9 in the presentation of the 2006-2007 survey. Also, note that the sequence numbers are not consecutive, as this allows a new question to be inserted easily without resequencing all other questions.

Steps for this Lab

  1. Write an HTML/PHP script display-survey-1 that generates a Web based survey, given the survey name (e.g, "2007-2008") as a query string (e.g, URL?2007-2008).

  2. Write an HTML/PHP script process-survey-1.php that takes the information from the form and enters the responses:

  3. Write an HTML/PHP script tabulate-survey-1.php that displays the number of students who have completed each survey.

Work to Turn In


This document is available on the World Wide Web as

     http://www.walker.cs.grinnell.edu/courses/325.fa08/labs/grad-survey-1.shtml

created 8 October 2008
last revised 10 October 2008
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.