Documentation internal to each module is defined by the comments in each module. Comments may exist at any level in the module and are not necessarily found in any given location
Coding Standards
All web pages are written in standard PHP. The team making program is written in JDK 1.4.1+ compatible Java. There is no explicit variable naming convention, but each module should be internally consistent and claer. Formatting should be done with either K+R or BSD style braces with the '\t' tab character for logical indentation.
File Naming Conventions
The first file in a series of web pages should be named foo.php, with the next page foo1.php, then foo2.php, and so on. If a page performs an action and forwards control to another page, its name should end in "action". Java files need not follow any naming convention since their names are predefined by the Java language.
Source Code Files
1 add_question_to_survey.php
Purpose: Insert a record in the SurveyQuestions table and return to the create_survey2.php page
Contains: A call to AddQuestionToSurvey and a redirect
No subparts
Programming Language: PHP
2 answers_submitted.php
Purpose: Notify the user that their answers to the survey have been recorded
Contains: A simple "thank you"
No subparts
Programming Language: PHP
3 create_input_for_algorithm
Purpose: Deprecated by make_teams2.php
Contains: Deprecated code
No subparts
Programming Language: PHP
4 create_question.php
Purpose: First page of interface for creating a new question
Contains: Interface for selecting what kind of question and (possibly) possible responses to the question
No subparts
Programming Language: PHP
5 create_question_action
Purpose: Push the data from create_question.php to the database, add the new question to the current survey, and return to the create_survey1.php page
Contains: SQL commands
No subparts
Programming Language: PHP
6 create_survey.php
Purpose: The first screen for creating a new survey
Contains: Input for deciding survey title, permission, and deadline
No subparts
Programming Language: PHP
7 create_survey1.php
Purpose: The bulk of the create survey process. Creates a new survey by adding it to the DB if it didn't already exist (this is the case when coming from create_survey.php), or displays the current one (the non-exceptional case). Shows existing questions, options for manipulating them, options for changing survey properties, and an interface for adding new questions
Contains: Routines for displaying the current survey, menus for each question, and the add-question interface
No subparts
Programming Language: PHP
8 dbcode.php
Purpose: Serves as a global repository for functionality needed across the entire system.
Contains: Many many subroutines
db_connect: connects to the database
db_close: closes the database link
insert_record(query): executes the query parameter, selects the ID of the object created by the query, and returns it
question_html(id,number): returns the HTML code needed to display the question specified by id with the ordinal specified by number
quotes_to_html(string): converts ' to &39;
unmagic(string): Takes a magic-quoted string (all quotes escaped) and turns the special characters (<>'") into HTML entities so we can put it both in the DB and echo it for HTML purposes.
mssql_query_array(q): shortcut for mssql_fetch_array(mssql_query(q))
percent(n): converts n (a number like .34) to a string like "34%"
percent_of(n,d): shortcut for percent(n/d)
fprintf(f,s): shortcut for fputs(f,s . "\n")
squoted(s): converts "foo" to "'foo'" (single-quoted)
AddQuestionToSurvey(s,q): inserts question with id q into the survey with id s
user_link(name,s): returns the HTML for a link to view_results.php for the specified user and survey id
Programming Language: PHP
9 edit_question.php
Purpose: Provide an interface for a user to edit a question that already exists in the database
Contains: UI for showing the current state of the question and controls for changing it
No subparts
Programming Language: PHP
10 edit_question_action.php
Purpose: Execute the changes specified from edit_question.php and redirect to create_survey1.php
Contains: SQL commands
No subparts
Programming Language: PHP
11 edit_survey.php
Purpose: Deprecated by create_survey1.php
Contains: Deprecated code
No subparts
Programming Language: PHP
12 edit_survey_props.php
Purpose: Deprecated by create_survey1.php
Contains: Deprecated code
No subparts
Programming Language: PHP
13 edit_teams.php
Purpose: Provide an interface for choosing which set of teams to edit
Contains: Iteration through existing surveys and team sets
No subparts
Programming Language: PHP
14 edit_teams_action.php
Purpose: Perform the action specified by edit_teams1.php and return to edit_teams1.php
Contains: SQL commands, HTTP redirect
No subparts
Programming Language: PHP
15 edit_teams1.php
Purpose: Provide an interface by which to move students between teams
Contains: A mess of radio buttons
No subparts
Programming Language: PHP
16 finish_survey.php
Purpose: Set the "completed" bit in the database for the specified survey and show a confirmation
Contains: SQL command and a user confirmation
No subparts
Programming Language: PHP
17 index.php
Purpose: Provide a "main menu" for the user
Contains: Links to main subpages
No subparts
Programming Language: PHP
18 make_teams.php
Purpose: Provide an interface to choose which survey to make teams from
Contains: Dynamic list of all surveys available to make teams from
No subparts
Programming Language: PHP
19 make_teams1.php
Purpose: Provide an interface to specify question weights and team sizes
Contains: A set of "slider radio-button" controls to specify the weighting of each question in the survey and how many teams to make
No subparts
Programming Language: PHP
20 make_teams2.php
Purpose: Execute the team-making program and display the results
Contains: A call to the team-making program and code to display the results from the file
No subparts
Programming Language: PHP
21 move_question.php
Purpose: Move a question within a survey
Contains: Code to move a question either up one spot or down one spot
No subparts
Programming Language: PHP
22 remove_question_from_survey.php
Purpose: Remove a question from a survey and return to create_survey1.php
Contains: Simple SQL query and redirect
No subparts
Programming Language: PHP
23 save_teams.php
Purpose: Save the teams generated by the team-making program to the database for later use
Contains: SQL commands and user confirmation
No subparts
Programming Language: PHP
24 submit_answers.php
Purpose: To add the input gathered from the survey to the database
Contains: SQL commands, user confirmation
No subparts
Programming Language: PHP
25 take_survey.php
Purpose: Provide an interface for choosing which survey to take
Contains: List of available authorized surveys
No subparts
Programming Language: PHP
26 take_survey1.php
Purpose: Provide the survey-taking interface for a specific survey
Contains: A list of questions and controls for answering them
No subparts
Programming Language: PHP
27 view_results.php
Purpose: Provide an interface to choose which survey to view answers from
Contains: A list of surveys the user created
No subparts
Programming Language: PHP
28 view_results1.php
Purpose: Provide an interface to choose which student (or summary) to view answers of
Contains: A link to the summary page and a list of students who have taken the survey
No subparts
Programming Language: PHP
29 view_results2.php
Purpose: Show the answers a student gave to a survey
Contains: A list of questions and the answers the student gave
No subparts
Programming Language: PHP
Software Installation
1. Development Platform
Hardware
Same as delivery - see below
Software
Same as delivery - see below
Installation and Configuration Instructions for the Client's Software
Same as delivery - see below
2. Client Delivery Platform
Hardware
Win2k+ machine with approximately 256 MB of RAM, a 300 MHz processor, 2 GB of HDD space, and internet functionality.
Software
SQL Server
Apache with mod_php
Installation and Configuration Instructions for the Client's Software
<Description of how to install and configure the client's software on
the delivery platform so that the client can use it.>
Design Issues List
Items
How do we handle human constraints of team preferences (i.e. I don't want to work with Joe)