The Electronic Grade Book System



The Electronic Grade Book System

System Design Document

Version: 3.0

Team “B”

Document prepared by:

Date: May 10,2001

Table of Contents

1. Introduction

1.1 Purpose 3

1.2 Scope 3

1.3 References 3

1.4 Overview 3

1.5 Constraints 3

2. System Overview

Context Diagram 4

3. System Architecture

3.1 Architecture Description 5

3.2 Component Decomposition 5

3.3 Architecture Alternatives 9

3.4 Design Rationale 9

4. Data Design

4.1 Database Description 9

4.2 Global Data Structures 10

4.3 Object-use Description Diagrams 12

5. Component Design

5.1 User Interface Design 13

5.2 Database Design 20

5.3 Import Design 44

5.4 Report Design 47

6. Human Interface Design

6.1 Overview of User Interface 61

6.2 Screen Images 61

6.3 Screen Objects and Actions 62

6.4 Reports Format 62

7. Requirement Matrix 64

8. Resource Estimators 65

9. Definitions, Acronyms, and Abbreviation 65

10. Appendix A – Figures Table 65

1. Introduction

1.1 Purpose

The purpose of this document is to provide a detailed decomposition of the Electronic Grade Book System (EGBS). The coding team shall use this document to implement the EGBS.

1.2 Scope

This software provides a system for the instructor to keep track of students’ grades. The system provides a method to produce statistical data based on the grades both on a per student basis and a whole class basis. The EGBS provides services to an instructor to organize his/her grades, report student performance, and report statistical data that is based on student grades. The EGBS also provides an easy and efficient means of access to these services.

1.3 References

“The Electronic Grade Book System Software Requirement’s Specification”, Version 2.0, March 25, 2001

1.4 Overview

This document provides a detailed description of the system functions and the services it provides. After a summary, there is a decomposition of each subsystem. Following the component description is a detailed design of each component. Finally, there is a design description of the user interface.

5. Constraints

This system must be able to run on the UNIX environment available on the GL system, the general system available to all faculty, staff and students, at UMBC known as IRIX. The system must use a text shell interface on the UNIX system. Also, C++ and the CC compiler provided by IRIX will be used to implement the system.

2. System Overview

The EGBS is being developed as the result of our client, Dr. Richard Chang, needing additional functionality from his current grades keeping system. The EGBS incorporates the client’s desired functionalities and allows the client to have access to these functionalities through the user interface. Additionally, the EGBS is divided into components for maintenance and testing purposes. Each component is designed to operate independent of each other. There is no interaction among components except with the executive. From the context diagram below, the client can only access the EGBS through the user interface. The user interface shall pass the client’s selection to the executive. Upon receiving the request, the executive will call the appropriate component to complete the request. Therefore, the executive role is to interact with the other components so it can process requests from the user.

[pic]

Figure 1.1 – Context Diagram

3. System Architecture

3.1 Architectural Description

This system uses the repository architecture. The repository consists of a database, which is used to store the data. The executive controls the handling of requests and how the database gets modified.

3.2 Component Decomposition

The EGBS consists of four main components. The designs for these four main components and their subcomponents are illustrated in this section. Additionally, this section describes the global data structures used by the EGBS.

3.2.a Object Diagram

Figures 3.1 through 3.4 show the designs for the 4 major components that make up the EGBS.

[pic]

Figure 3.1 Figure 3.2

[pic]

Figure 3.3 Figure 3.4

Figure 3.5 through 3.8 show the designs for backend implementation of the database.

[pic]

Figure 3.5 Figure 3.6

[pic]

Figure 3.7 Figure 3.8

Figures 3.9 and 3.10 show the designs of the two embedded classes used by the report interface to generate user requested report.

[pic]

Figure 3.9 Figure 3.10

Figures 3.11 through 3.17 show the global data structures used by the EGBS.

[pic]

Figure 3.11 Figure 3.12 Figure 3.13 Figure 3.14

[pic]

Figure 3.15 Figure 3.16 Figure 3.17

3.2.b Aggregation Hierarchy

Figure 3.18 displays the aggregation hierarchy of the EGBS. The aggregation hierarchy shows that only the report interface has subcomponents.

[pic]

Figure 3.18

3.3 Architectural Alternatives

Before choosing the repository model, we considered the event-driven model. With this model, for every request, other components can associate a procedure with the request. By allowing different components to associate a handle to the request, the executive has no control over how a request would be handled. Therefore, this model was not the appropriate architecture for this system.

3.4 Design Rationale

The repository architecture allows our data be stored in one location. This architecture causes less retrieval times than if the data was spread out in different locations. Also, the repository architecture allows an organized way to handle requests to the system. A trade off to this architecture is that shared data must be in a form that is acceptable by every component that uses the data. Therefore, components that do not require all data in that structure must accept the whole structure rather than accepting only the needed data.

4. Data Design

4.1 Database Description

The database back-end used for the EGBS shall be of a proprietary design. By default, the database shall contain three system table files, namely “systables, syscolumns, and sysfkeys.” The existence of these system tables allows for the proper operation of the database. The ‘systables’ table contains a listing of all of the tables in the database, and where they are located (the table’s filename.) The ‘syscolumns’ table contains a listing of all the columns existing in the database, their data-type, constraints, and in addition to other housekeeping information, which table they belong to. The ‘sysfkeys’ table contains a listing of all of the foreign key relationships existent in the database. The internal storage of all tables including the system tables will be text based. All non-character based column fields are separated by a single space. Character based columns are formatted so that spaces are replaced with a “_” (underscore) character and are then separated by a single space. A set of n column fields makes up a row. A carriage return/linefeed pair then separates each row in a table. The following lines are example rows from a sample database table.

Figure 4.1

A foreign key relationship is defined to be a reference from one table to a second table. The relationship defines columns from the first table that relates to the primary key columns of the second table. The foreign key requires that for all columns involved in the relationship, the data inserted into the first table must already exist in the second table.

The database front-end shall consist of six tables, namely “Students, Classes, Enrollment, Scores, Component Groups, and Components.” This configuration will allow for a single student to be enrolled in multiple courses in the system. The following diagram further describes the relationships of each of the EGBS tables.

[pic]

Figure 4.2

4.2 Global Data Structures

This system shall contain the following global data structures.

Data Structure Name: Policy

Description: This data structure contains the grading policy. This data structure stores the number of quizzes, homeworks and exams, and attendance along with their respective percentage.

class Policy

{

public:

int NumberOfGroups;

Vector Names;

Vector Values;

Vector MaxGrade;

};

Data Structure Name: Grades

Description: This data structure contains the grades for an individual student.

class Grades

{

public:

Vector Values;

};

Data Structure Name: ClassGrades

Description: This data structures contains the grades for an individual class

class ClassGrades

{

public:

Vector Students;

Vector Values;

};

Data Structure Name: StudentInfo

Description: This data structure contains the information about an individual student.

class StudentInfo

{

public:

String Name;

String StudentID;

String ClassID;

String Email;

Policy IndividualGradingPolicy;

bool Active;

};

Data Structure Name: ClassInfo

Description: This data structure contains the information about and individual class.

class ClassInfo

{

public :

String ClassID;

String Name;

Policy GradingPolicy;

int NumberOfStudents;

Vector StudentData;

};

Data Structure Name: ClassList

Description: This data structure contains information that is needed to make a class list.

class ClassList

{

public:

int NumberOfStudents;

Vector Students;

};

Data Structure Name: StudentGradeList

Description: This data structure contains information for a listing of multiple students.

class StudentGradeList

{

public:

Vector StudentData;

Vector StudentGrades;

};

Data Structure Name: MenuList

Description: This data structure contains the data to be displayed in menu form.

class MenuList

{

public:

String Title;

String Value;

bool IsCenter;

};

4.3 Object-use Description Diagrams

These diagrams show the object interactions among each component of the EGBS. Refer back to section 3.2.a for the decomposition of the EGBS.

Key for the Objection Interaction Diagram

An eclipse/circle represents an object.

A square/rectangle represents a function called.

A hexagon represents a function.

An arrow represents a service request.

Object interactions for the EGBS

[pic]

Figure 4.3

5. Component Design

This section describes the designs found in section 3.2.a. The description of each component contains its purpose, functionalities, dependencies, and subordinates.

Component Identifier: User Interface

Purpose: The purpose of this component is to allow the client to have access to the functionalities of the system.

Subordinates: None

Dependencies: None

Class Header File for User Interface:

/*

File Name: User_Interface.h

Description: This file contains all class information for the User

Interface class

Notes: None

*/

#ifndef UI_H

#define UI_H

#include "Common.H"

#include "string.H"

#ifndef WIN32

#include

#endif

/*

Class Name: UserInterface

Description: This class handles all input and output from the user

All user input and screen displays are made through

this class.

Testablity:

1) This Object shall be tested by testing each method of the class.

All methods should be tested for correct output. Correct output

is the only test for testing success.

2) Test Results :

*/

class UserInterface

{

public:

UserInterface(void); // constructor

~UserInterface(void); // destructor

int DisplayMenu(const MenuList MList,int &MenuReturn); // display user menu

int DisplayClassList (ClassList CList,int &ListReturn); // display class listing

int DoGradeEntry(ClassList CList,ClassGrades &NewGrades); // enter grades

int GetStudentInfo (StudentInfo CurrentInfo,StudentInfo &NewInfo); // enter student info

int GetFileName(String &FileName); // get a filename

int GetClassInfoB(ClassInfo CInfo, ClassInfo &NewInfo); // get class info

int GetPolicyInfo(Policy CurrentPolicy,Policy &NewPolicy); // get a policy

int GetKey(String &Key); // get ssn or name

int DisplayGradeList (ClassGrades Scores, Policy StudentPolicy,ClassGrades &NewGrades); // display grade list admin

int DisplayReport (String Report); // display grade report

int CreateClass(Policy &NewPolicy); // create class

int UpdateComponents(Policy CurrentPolicy, Policy &NewPolicy); // update a policy component

protected:

private:

#ifndef WIN32

WINDOW *win;

#endif

char menu(const char *str, char lines, char len,const char *top); // print out menu

void PrintName( String Name );

void PrintData (String Data,int StartAt,int HighlightX,int HighlightY);

int FindGroup(Policy &ThePolicy,int index);

int FindIndex (Policy &ThePolicy,int index);

};

#endif

PDL for User Interface:

/*

File Name: User_Interface.cpp

Description: This file contains the function implementations for the User

Interface class.

Author: Jeff Germain

Created: 3/26/2001

Modified: 4/10/2001

Notes: None

*/

#include “User_Interface.h”

/*

Function Name: DisplayMenu

Description: This function formats the a Menu object to display to the screen

Input: Menu List object with menu choices; menu return value

Output: Integer error code

Testablity:

1)

2)

*/

int DisplayMenu(const MenuList MList,int &MenuReturn)

{

//call menu function passing MList.Title, Mlist.Value

//MenuReturn= Menu function return

return 0

}

/*

Function Name: DisplayClassList

Description: This function formats the class list to display in menu selectable format

Input: Class List object; list return value

Output:Integer error code

Testablity:

1)

2)

*/

int DisplayClassList (ClassList CList,int &ListReturn)

{

//String Studentlist;

//loop for all students

// Add student name to Studentlist

// call menu function ("Class List",Sudentlist);

//ListReturn = Menu function return

return 0

}

/*

Function Name: DoGradeEntry

Description: This function allows the user to enter grades for a list of students

Input: List of students, reference to new grade object

Output:Integer error code

Testablity:

1)

2)

*/

int DoGradeEntry(ClassList CList,ClassGrades &NewGrades)

{

// Prompt for which grade value

// get grade value type ie. HW EXAM Proj

// loop until all grades are entered

// {

// Prompt user for student key value type ie. name or SSN

// loop until student found

// {

// get keypress

// try and match input to student key

// }

// get grade for student

// Validate Item

// enter grade into newgrade object

// }

return 0

}

/*

Function Name: GetStudentInfo

Description: This function allows the user to view/edit student info.

Input: Current student info; new student info.

Output:Integer error code

Testablity:

1)

2)

*/

int GetStudentInfo (StudentInfo CurrentInfo,StudentInfo &NewInfo)

{

// display current student info

// copy current to newinfo.

// loop for all fields in the Student info

// {

// get data item

// Validate Item

// put data item in NewInfo.

// }

}

/*

Function Name: GetFileName

Description: This function prompts the user to enter a filename

Input: file name to return

Output:Integer error code

Testablity:

1)

2)

*/

int GetFileName(String &FileName)

{

// loop until good name

// {

// prompt user

// get file name

// Validate Item

// }

// put filename in FileName

return 0;

}

/*

Function Name: GetClassInfo

Description: This function allows the user to view/edit the class info.

Input: Current info; new class info.

Output:Integer error code

Testablity:

1)

2)

*/

int GetClassInfo(Classinfo CInfo, Classinfo &NewInfo)

{

// display current class info

// copy current to newinfo.

// loop for all fields in the class info

// {

// get data item

// Validate Item

// put data item in NewInfo.

// }

return 0;

}

/*

Function Name: GetPolicyInfo

Description: This function allows the user to view/edit the policy info.

Input: current policy info; new policy info.

Output:Integer error code

Testablity:

1)

2)

*/

int GetPolicyInfo(Policy CurrentPolicy,Policy &NewPolicy)

{

// display current policy info

// copy current to newinfo.

// loop for all fields in the policy info

// {

// get data item

// Validate Item

// put data item in NewInfo.

// }

return 0;

}

/*

Function Name: GetGrade

Description: This function displays a class list and allows user to enter grades

Input: Class list; new grade object

Output:Integer error code

Testablity:

1)

2)

*/

int GetGrade(ClassList Clist,ClassGrades &NewGrades)

{

// Prompt for which grade value type

// get grade value type ie. HW EXAM Proj

// Prompt user for student key value type ie. name or SSN

// loop until student found

// {

// get keypress

// try and match input to student key

// }

// get grade for student

// Validate Item

// enter grade into newgrade object

return 0

}

/*

Function Name: GetKey

Description: This function prompts the user to enter a Key

Input: key return value

Output:Integer error code

Testablity:

1)

2)

*/

int GetKey(String &Key)

{

// prompt of key

// get string

// Validate string

// Assign string to Key

}

/*

Function Name: DisplayGradeList

Description: This function displays the grade list w/ policy

Input: student scores and policy

Output:Integer error code

Testablity:

1)

2)

*/

int DisplayGradeList (ClassGrades Scores, Policy StudentPolicy)

{

// display policy information

// loop for all students

// loop for all groups

// loop for all items

// display grade

return 0;

}

/*

Function Name: DisplayReport

Description: This function prints the report to the screen

Input: report string

Output:Integer error code

Testablity:

1)

2)

*/

int DisplayReport (String Report)

{

// loop until end of report

// print report line

return 0;

}

/*

Function Name: CreateClass

Description: This Function creates a new class listing

Input: new policy info

Output:Integer error code

Testablity:

1)

2)

*/

int CreateClass(Policy &NewPolicy)

{

// call updatecomponents

// return newpolicy

}

/*

Function Name: UpdateComponents

Description: This function allows the user to update the policy info

Input: Current Policy; new policy return

Output:Integer error code

Testablity:

1)

2)

*/

int UpdateComponents(Policy CurrentPolicy, Policy &NewPolicy)

{

// display current policy info

// copy current to newinfo.

// loop for all fields in the policy info

// {

// get/edit data item

// Validate Item

// put data item in NewInfo.

// }

return 0;

}

/*

Function Name: menu

Description: This function prints the menu to the screen

Input: Menu choices, number of lines, length of lines, title

Output: menu selection

Testablity:

1)

2)

*/

char menu(char *str, char lines, char len, char *top)

{

// display menu box

// display title

// display menu items

// loop

// {

// redraw menu

// get input

// Validate Input

// if (upkey)

// move current selection up;

// if (downkey)

// move current selection down;

// if (enterkey)

// exit loop;

// }

// return input;

}

Component Identifier: DB Interface

Purpose: The purpose of this component is to store the data in an organized manner.

Subordinates: DB Col Descriptor, SQL DB, DB Table, and DB System Table

Dependencies: None

Class Header File for DB Interface:

/******************************************************************************

File Name: DB_Interface.H

Description: This is the header file for the database interface. It includes

constructors, destructors, and function prototypes for the

database interface.

Author: Jeff Barnes and Dave Matthews

Created: 3/26/2001

Modified: 4/24/2001

Notes: None

******************************************************************************/

#ifndef DB_INTERFACE_H

#define DB_INTERFACE_H

#include "Common.H"

#include "vector.H"

#include "string.H"

#include "DB_Backend.H"

/*

Class Name: DB_Interface

Description: The DB_Interface provides an interface between the Executive and

the Database. The DB_Interface translates given class structures

into data structures that the database will be able to use to perform

the necessary functions. Each interface function returns either 0 or

DBERROR if there is an error generated while attempting to perform a

function with the database.

*/

class DB_Interface {

public:

DB_Interface(); //main constructor, this will call all the database init functions

DB_Interface(String str); //main constructor, this will call all the database init functions

//We could have a copy constructor but I don't really see a point in it.

~DB_Interface(); //Destructor to exit out of the database.

//Main interface functions that the executive will call to use the database

//Each function will return an integer, 0 if the function executed properly

//and non-zero if an error occurred.

//Insert the vector of students into database

int InsertStudents(Vector students);

//Insert a new class into the database

int InsertClass(ClassInfo new_class);

//delete students from the databases

int DeleteStudents(Vector student_ids);

//delete a class from the database

int DeleteClass(String class_name);

//update student information in the database

int UpdateStudents(Vector students, Vector studen_id);

//update class information in the database

int UpdateClass(ClassInfo info, String id);

//update a batch of grades

int UpdateStudentGrades(ClassGrades grades);

//select all the class names from the database

int SelectClassNames(Vector < String > &class_names);

//select a specific class from the database

int SelectClass(String class_name, ClassInfo &result);

//select a specific student from the database

int SelectStudent(String student_id, String class_name, StudentInfo &result);

//select specific grades from the database

int SelectStudentGrades(String id, String class_name, Grades &result);

//select all grades for a particular class

int SelectClassGrades(String class_name, ClassGrades &result);

private:

//need to have a private SQL_DB object to be able to access the database

SQL_DB db;

};

#endif /* DB_INTERFACE_H */

Class Header file for DB Backend:

/******************************************************************************

File Name: DB_Backend.H

Description: Low-level database code header file (based on SQL Server)

Author: David Matthews

Created: 3/06/2001

Modified: 4/14/2001

Notes: Currently the following are left to be implemented:

-foreign keys

-NULL values

-multi-table selects

-complex boolean expressions

******************************************************************************/

#ifndef DB_BACKEND_H

#define DB_BACKEND_H

#include //FILE *

#include "Common.H"

typedef enum {

INT_COL= 0x0,

CHAR_COL

} COLUMN_TYPE;

typedef enum {

NOCHECK= 0x0,

GTHAN,

LTHAN,

GTHANEQ,

LTHANEQ,

NEQUAL,

EQUAL

} CHECK_TYPE;

typedef struct

{

String tableName;

String columnName;

CHECK_TYPE type; //Constraint check

String value; //Check value

} DB_condition;

typedef struct {

String columnName;

String value;

} DB_column_value;

typedef struct

{

String tableName;

String columnName;

} DB_select_column;

//Forward Declarations

class DB_col_descriptor;

//DB row-set types

typedef Vector DB_row;

typedef Vector DB_row_set;

typedef Vector DB_table_set;

typedef Vector DB_condition_set;

//DB column set-types

typedef Vector DB_column_set;

typedef Vector DB_column_select_set;

typedef Vector DB_column_value_set;

/*

CLASS NAME: DB_col_descriptor

DESCRIPTION: This class describes a column in a database table.

*/

class DB_col_descriptor

{

public:

//Constructor

DB_col_descriptor( const unsigned int cID= 0,

const String &name= "Default",

const COLUMN_TYPE colType= INT_COL,

const bool allowNULLS= false,

const CHECK_TYPE chkType= NOCHECK,

const String &chkValue= "0",

const bool isP= false);

// Copy constructor

DB_col_descriptor( const DB_col_descriptor &dcd );

//Assignment operator

const DB_col_descriptor & operator= ( const DB_col_descriptor& dcd );

//Assignment operator

const DB_col_descriptor & operator= ( const DB_row &dbr );

// Destructor

~DB_col_descriptor();

//Accessors

bool isPrimary();

unsigned int columnID();

String columnName();

COLUMN_TYPE type();

DB_row buildRow(const int tableID);

CHECK_TYPE checkType();

String checkValue();

friend class SQL_DB;

//Mutators

void setColumnID(const unsigned int cID);

private:

unsigned int _columnID; //Column ID

String _columnName; //Column name

COLUMN_TYPE _type; //Type of values in column (int/char...)

bool _allowNULL; //Are values of NULL allowed?

CHECK_TYPE _checkType; //Constraint check

String _checkValue; //Check value

bool _isPrimary; //Is this column a primary key?

};

typedef struct {

unsigned int fTableID; //Foreign table ID

Vector dColumnID; //Vector of domestic columns //(each index position corresponds to the ith

//column of the foreign table)

DB_condition_set cond;

} DB_fkey_descriptor;

//DB fkey set type

typedef Vector DB_fkey_set;

/*

CLASS NAME: SQL_DB

DESCRIPTION: This class is the one and only database backend. It

supports all queries including Select/Insert/Update/Delete

*/

class SQL_DB

{

public:

//Default Constructor

SQL_DB(const String &DB_file_root= "");

//Copy Constructor

//SQL_DB(const SQL_DB &rhs) {}

//Assignment Operator

//const SQL_DB & operator= (const SQL_DB & rhs) {}

//Destructor

~SQL_DB();

//Query the Database using SQL

int QueryDB(const String &queryString, DB_row_set &result_set);

// - OR - Access via direct DB system calls

//Creates a new table in the database with given name

int CreateTable(const String &tableName, DB_column_set &column_set, DB_fkey_set &fkey_set);

//Removes a table from the database with the given name

int DeleteTable(const String &tableName);

//Selects rows from tables into row set with given conditions

int Row_Select(DB_column_select_set &column_set, DB_row &table_set, DB_condition_set &cond_set, DB_row_set &result_set);

//Inserts rows from row set into the given table, processed rows are returned

int Row_Insert(const String &tableName, DB_row_set &row_data);

//Updates rows from table with given conditions, returning # rows processed

int Row_Update(const String &tableName, DB_column_value_set &new_Values, DB_condition_set &cond_set);

//Delete rows from table with given conditions, returning # rows processed

int Row_Delete(const String &tableName, DB_condition_set &cond_set);

//Load a table into LoadedTables

int LoadTable(const String &tableName);

//Unload a table from LoadedTables

int UnloadTable(const String &tableName);

private:

typedef struct

{

String tableName;

String columnName;

unsigned int tableID;

unsigned int columnID;

} DB_INT_select_column;

typedef Vector < DB_INT_select_column DB_INT_column_select_set;

typedef struct

{

String tableName;

String columnName;

unsigned int tableID; //Table ID

unsigned int columnID; //Column ID

CHECK_TYPE type; //Constraint check

String value; //Check value

} DB_INT_condition;

typedef Vector < DB_INT_condition > DB_INT_condition_set;

typedef struct {

String columnName;

String value;

unsigned int columnID;

} DB_INT_column_value;

typedef Vector < DB_INT_column_value > DB_INT_column_value_set;

/*

CLASS NAME: DB_table

DESCRIPTION: This class is a representation an internal database table.

*/

class DB_table

{

public:

//Default constructor

DB_table();

//Load table- open file, load data

DB_table(const int theTableID, const String &theTableName, const String &fname, const DB_column_set &theCols, const DB_fkey_set &theFkeys);

//Copy constructor

DB_table(const DB_table &rhs);

//Assignment operator

const DB_table & operator=(const DB_table &rhs);

//Unload table- close file

~DB_table();

//Select rows

int Select(DB_INT_column_select_set &column_set,

DB_INT_condition_set &cond_set,

DB_row_set &result_set);

//Insert rows

int Insert(DB_row_set &row_data);

//Update rows

int Update(DB_INT_column_value_set &new_Values,

DB_INT_condition_set &cond_set);

//Delete rows

int Delete(DB_INT_condition_set &cond_set);

//Accesors

String tableName();

int tableID();

bool GetColumnByName(const String &columnName, DB_INT_select_column &column);

bool GetColumnByName(const String &columnName, DB_INT_condition &condition);

bool GetColumnByName(const String &columnName, DB_INT_column_value &condition);

bool VerifyConstraints(DB_row &row, DB_column_set &col_set);

bool VerifyConstraints(DB_row &row, DB_INT_condition_set &cond_set);

protected:

//Replace rows with data from disk file

int DiskRead();

//Write rows to disk file

int DiskWrite();

int _tableID; //Table ID

String _tableName; //Table name

DB_column_set _cols; //Actual columns descriptors

DB_fkey_set _fkeys;

DB_row_set _rows; //Data

FILE *_fp; //Associated File pointer

Bool _modified; //Data modified since last diskwrite?

int _numPkeys; //number of primary keys

String _file_name;

};

/*

CLASS NAME: DB_systable

DESCRIPTION: A derived class specifically for holding the listing of existing tables in the database.

*/

class DB_systables : public DB_table

{

public:

//Default Constructor

DB_systables();

//Load table- open file, load data

DB_systables(const int theTableID,

const String &theTableName,

const String &fname,

const DB_column_set &theCols,

const DB_fkey_set &theFkeys);

//Copy constructor

DB_systables(const DB_systables &rhs)

{ operator=(*this); }

//Assignment operator

const DB_systables & operator=(const DB_systables &rhs);

//Unload table- close file

~DB_systables();

//Insert rows

int Insert(const String &tableName, const String &fname);

//Select row

int Select(const String &tableName, String &fname);

private:

int nextFreeTableID;

};

/*

CLASS NAME: DB_syscolumns

DESCRIPTION: A derived class specifically for holding the listing of existing columns in the database.

*/

class DB_syscolumns : public DB_table

{

public:

//Default Constructor

DB_syscolumns();

//Load table- open file, load data

DB_syscolumns(const int theTableID,

const String &theTableName,

const String &fname,

const DB_column_set &theCols,

const DB_fkey_set &theFkeys);

//Copy constructor

DB_syscolumns(const DB_syscolumns &rhs): DB_table(rhs) {}

//Assignment operator

const DB_syscolumns & operator=(const DB_syscolumns &rhs);

//Unload table- close file

~DB_syscolumns();

//Insert rows

int Insert(const unsigned int id, DB_column_set &column_set);

int Select(const unsigned int id, DB_column_set &column_set);

};

//Master DB system tables

DB_systables systables;

DB_syscolumns syscolumns;

DB_table sysfkeys;

String file_root;

Vector LoadedTables;

};

#endif /* DB_BACKEND_H */

PDL for DB Interface:

/******************************************************************************

File Name: DB_Interface.cpp

Description: This is the implementation file for the Database. The

executive will use this file to interface with the database.

Each function will return an integer, 0 if the function

terminates properly and non-zero if an error occurs.

Author: Jeff Barnes

Created: 3/26/2001

Modified: 4/04/2001

Notes: None

******************************************************************************/

#include "DB_Interface.H"

#include "DB_Backend.H"

#include "Vector.H"

#include "String.H"

#include "Common.H"

//Default constructor

DB_Interface::DB_Interface() {

//call the DB_Backend constructor to set up the database for running.

//run any other init procedures that are needed.

}

//destructor

DB_Interface::~DB_Interface() {

//destroy the DB_Backend object.

//do any other necessary cleanup.

}

//insert students into the database

int DB_Interface::InsertStudents(Vector students) {

DB_row_set *row_data;

/* for (i > ws;

in.getline(buffer, MAX, delimeter);

in >> ws;

temp = buffer;

}

return temp;

}

/*

Function Name: CheckValid

Description: check to make the value is a valid format

Param: str - the string to check for validity

type - invalid character to check for in string

Return: 0 - successful

-1 - invalid

Testability:

*/

int ImportInterface::CheckValid(String str, char type)

{

//check for invalid character in string

for (int i = 0; i < str.length(); i++)

{

if (str[i] == type || str[i] == ',')

return -1;

}

return 0;

}

/*

Function Name: FindGradeIndex

Description: find the location where this component gets stored

Param: stu_policy - the grading policy for a student

str - the name of the component

Return: index of the component or -1 if not found

Testability:

*/

int ImportInterface::FindGradeIndex(Policy & stu_policy, String str)

{

//look for component index

for (int i = 0; i < stu_policy.Names.size(); i++)

{

//found component and return index

if (stu_policy.Names[i] == str)

{

return i;

}

}

return -1;

}

/*

Function Name: FindStudent

Description: find the location of student in the array

Param: lst - the array that stores all the student

str - the name of the student lookin for

Return: index of the student in the array or -1 if not found

Testability:

*/

int ImportInterface::FindStudent(ClassGrades & lst, String str)

{

//search index of a student

for (int i = 0; i < lst.Students.size(); i++)

{

//found student and return index

if ((lst.Students[i].StudentID) == str)

{

return i;

}

}

return -1;

}

Component Identifier: Report

Purpose: The purpose of this component is to view statistical data from the current data in the database in a form of a report.

Subordinates: Individual Report and Class Report

Dependencies: None

Class Header File for Report Interface:

/*****************************************************************************

File name: Report.h

Description: The report subsystem header file guides generation of

individual and class reports for Electronic Grade Book System.

Author: Iwona Wiszczor

Created: 3/27/2001

Modified: 3/28/2001 4/01/2001 4/16/2001 4/17/2001 4/22/2001 4/24/2001

Notes: None

*****************************************************************************/

#ifndef REPORT_H

#define REPORT_H

// LIBRARIES

#include "string.H"

#include "vector.H"

#include "Common.H"

/*

CLASS NAME: Report

DESCRIPTION: This class provides generation of individual and class reports.

*/

class Report

{

public:

// Constructor

Report();

// Destructor

~Report();

// This function generates a report containing the statistic on an

// overall course basis.

int GenerateClassReport(ClassInfo cls_info, ClassGrades grds, String & out);

// This function generates a report containing statistics on a per student basis.

int GenerateIndividualReport(ClassInfo cls_info, StudentInfo std_info, Grades grds, String & out);

/*

CLASS NAME: ClassReport

DESCRIPTION: This class provide the functionality to generate statistics on an

overall class basis.

*/

class ClassReport

{

public:

// class name

String ClassName;

// class grades per assignment

Vector < Vector < Vector < float > > > ClassGrades;

// class grade policy per assignment

Vector < Vector < Vector < float > > > ClassGradePolicy;

// maximum obtainable grades per assignment

Vector < Vector < float > > MaxGrades;

// assignment group names

Vector < String > GroupNames;

// formatted report for output

String Output;

// indication of proper constructor invocation

bool GoodLoad;

// Constructor

ClassReport(String cls_nam, // class name

Vector < Vector < Vector < float > > > grds, // class grades

Vector < Vector < Vector < float > > > pol, // class policies

Vector < Vector < float > > max_grds, // class maximum obtainable grades

Vector < String > grp_nams); // assignment group names

// Destructor

~ClassReport();

// Mutator. Writes to formatted report output. Appends new String to

void Write(String str);

};

/*

CLASS NAME: IndividualReport

DESCRIPTION: This class provides the functionality to generate an individual report

*/

class IndividualReport

{

public:

// student name

String StudentName;

// student's class name

String ClassName;

// student's grades

Vector < float > StudentGrades;

// student's grade policy

Vector < float > GradePolicy;

// maximum obtainable grades

Vector < float > MaxGrades;

// assignment group names

Vector < String > GroupNames;

// formatted report for output

String Output;

// indication of proper constructor invocation

bool GoodLoad;

// indexes of lowest grades to drop

Vector < int > DropIndexes;

// Constructor

IndividualReport(String std_nam, // student name

String cls_nam, // class name

Vector < float > grds, // student grades

Vector < float > pol, // student grade policy

Vector < float > max_grds, // maximum obtainable grades

Vector < String > grp_nams); // assignment group names

// Destructor

~IndividualReport();

// Mutator. Writes to formatted report output. Appends new String to

// existing formatted output String.

void Write(String str);

};

// This functions formats the output String to fit the class list report template.

int ClassFormatting(ClassReport & cls_rep);

// This function formats the output String to fit individual student report

// template

int IndividualFormatting(IndividualReport & ind_rep);

// Calculates mean, median, minimum and maximum values based on grades and

// grade policy.

int Statistics(Vector < float > grades, Vector < float > policy,

Vector < float > max_grades, float & mean, float & median,

float & min, float & max_min, float & max, float & max_max,

int flag, Vector < int > dropped);

// Utility function

// Converts float value to a String object. Used by formatting functions.

String ConvertFloat(float fl_value);

// Utility function

// Converts integer value to a String object. Used by formatting functions.

String ConvertInt(int int_value);

// utility function

// Copy indexes of lowest grades into DropIndexes specified in DropLowest where

// DropIndexes is a data member of the IndividualReport object

void DropLowestGrades(Vector < Vector < float > > grds,

Vector < Vector < float > > max,

Vector < Vector < float > > pol,

Vector < int > drop_lowest_vector,

IndividualReport & ind_rep);

};

#endif

PDL for Report Interface:

/******************************************************************************

File Name: Report.cpp

Description: Implementation of the Report Interface.

Author: Iwona Wiszczor

Created: 3/27/2001

Modified: 3/28/2001

Note: None

******************************************************************************/

#include "Report.H"

// ************* ReportClass implementation *************

// NAME: GenerateClassReport

// DESCRIPTION: This function generates a report containing the statistic

// on an overall course basis.

// PARAM: ClassInfo object, StudentInfo object, Grades object, and reference

// to formatted output String

// object.

// RETURN: 0 if success, otherwise integer representing error code described

// in EGBS error standards.

// TRACIBILITY: requirement 12

int Report::GenerateClassReport(ClassInfo cls, StudentGradeList grds, String & out)

{

// // Check If class exists.

// If ClassInfo is NULL

// Display appropriate error message.

// Return the integer representing the error to the Executive function.

// // Declare temporary variables

// ClassReport object

// tempPolicy

// PolicyVector

// GradeVector

// MaxGradeVector

// // Find content of the vector of tempPolicy (class and individual policies)

// for i = 0 to (StudentGradeList.StudentGrades.size - 1)

// If StudentGradeList.StudentData[i].Active is false

// continue

// else

// If ClassInfo.StudentData[i].IndividualGradingPolicy is NULL

// tempPolicy[i] = ClassInfo.GradingPolicy

// else

// tempPolicy[i] =

// StudentGradeList.StudentData[i].IndividualGradingPolicy

// // Vector size check for the vectors passed as parameters

// If StudentGradeList.StudentsGrades.size not equal to tempPolicy.size

// Display appropriate error message.

// Return the integer representing the error to the Executive function.

//

// for i = 0 to (StudentGradeList.StudentsGrades.size - 1)

// If StudentGradeList.StudentsGrades[i].size not equal to tempPolicy[i].MaxPoint.size

// Display appropriate error message.

// Return the integer representing the error to the Executive function.

//

// for i = 0 to (StudentGradeList.StudentsGrades.size - 1)

// for j = 0 to (StudentGradeList.StudentsGrades[i].size - 1)

// If StudentGradeList.StudentsGrades[i][j].size not equal to

// tempPolicy[i][j].MaxPoint.size

// Display appropriate error message.

// Return the integer representing the error to the Executive function.

// // Convert all data vectors per student to data vectors per assignment

// for i = 0 to (StudentGradeList.StudentsGrades.size - 1)

// If StudentGradeList.StudentData[i].Active is false

// continue

// else

// for j = 0 to (StudentGradeList.StudentsGrades[i].Values.size - 1)

// for k = 0 to (StudentGradeList.StudentsGrades[i].Values[j].size-1)

// // Check if the grade exists

// If StudentGradeList.StudentsGrades[i].Values[j][k] not NULL

// // Convert Vector of Grades per student to

// // vector of Grades per assignment

// GradeVector[k][j][i] = StudentGradeList.StudentsGrades[i]

// Values[j][k]

// // Convert Vector of MaxGrades per student to vector of

// // MaxGrades per assignment.

// MaxGradeVector[k][j][i] = tempPolicy[i].MaxPoint[j][k]

// // Convert Vector of Policy per student to vector of Policy per

// // assignment.

// PolicyVector[k][j][i] = tempPolicy[i][j][k]

// // Check If NamesVector is appropriate length

// If GradeVector.size not equal to NameVector.size

// Display appropriate error message.

// Return the integer representing the error to the Executive function.

// // Instantiate ClassReport object:

// ClassName = ClassInfo.Name

// ClassGrades = GradeVector

// ClassGradePolicy = PolicyVector

// MaxGrades = MaxGradeVector

// GroupNames = ClassInfo.GradingPolicy.Names

// Pass reference to the ClassReport object as parameter to ClassFormatting function.

// Check if the ClassFormatting function returned 0.

// If 0 was not returned

// Display appropriate to integer returned error message (error int assignment

// according to system design standards)

// Return the integer representing the error to the Executive function.

// If 0 was returned

// Copy ClassReport.Output to the parameter passed as reference designated for

// the formatted report string

// Return 0 to Executive function to indicate success.

}

// ************* ClassReport class implementation *************

// NAME: Constructor

// DESCRIPTION: Instantiates ClassReport object.

// PARAM: Class name as String object, class grades as Vector, class grade policy,

// maximum obtainable

// grades as Vector, names of grades' division groups, and reference to String object

// used for formatted output.

// RETURN: 0 if success, otherwise integer representing error code described in EGBS

// error standards.

Report::ClassReport::ClassReport(String cls, Vector grds, Vector pol,

Vector maxgrds, Vector grpNames, String & out)

{

// ClassName = cls

// ClassGrades = grds

// ClassGradePolicy = pol

// MaxGrades = maxgrds

// GroupNames = pol.GroupNames

}

// NAME: Write

// DESCRIPTION: Mutator. Writes to formatted report output. Appends new String to

// existing formatted

// output String.

// PARAM: Formatted string to be appended to the output String.

// RETURN: 0 if success, otherwise integer representing error code described in EGBS

// error standards.

int Report::ClassReport::Write(String apstr)

{

// Append apstr to Output String

}

// NAME: GetClassName

// DESCRIPTION: Accessor. Gets class name.

// PARAM: None.

// RETURN: Class name String object.

String Report::ClassReport::GetClassName() const

{

// return ClassName

}

// NAME: GetGrade

// DESCRIPTION: Accessor. Gets class grades by assignment and group division.

// PARAM: Index of the assignment and index of the group.

// RETURN: Student grades as a vector of floats.

Vector Report::ClassReport::GetGrade(int groupIndex, int assignmentIndex) const

{

// return ClassGrades[groupIndex][ assignmentIndex]

}

// NAME: GetPolicy

// DESCRIPTION: Accessor. Gets class grade policy by assignment and group division.

// PARAM: Index of the assignment and index of the group.

// RETURN: Student grade policy as a vector of floats.

Vector Report::ClassReport::GetPolicy(int groupIndex, int assignmentIndex) const

{

// return ClassGradePolicy[groupIndex][ assignmentIndex]

}

// NAME: GetMaxGrade

// DESCRIPTION: Accessor. Gets class maximum obtainable grades by assignment and group

// division.

// PARAM: Index of the assignment and index of the group.

// RETURN: Student maximum obtainable grade for the assignment.

float Report::ClassReport::GetMaxGrade(int groupIndex, int assignmentIndex) const

{

// return MaxGrades[groupIndex][ assignmentIndex]

}

// NAME: GetGroupName

// DESCRIPTION: Accessor. Gets name of an assignment group.

// PARAM: Index of the group.

// RETURN: Assignment group name.

String Report::ClassReport::GetGroupName(int groupIndex) const

{

// return GroupName[groupIndex]

}

// NAME: GenerateIndividualReport

// DESCRIPTION: This function generate a report containing statistics on a per student basis.

// PARAM: ClassInfo object, StudentGradeList object, and reference to formatted output String

// object.

// RETURN: 0 if success, otherwise integer representing error code described in EGBS error

// standards.

// TRACIBILITY: requirement 10, requirement 11.

int Report::GenerateIndividualReport(ClassInfo cls, StudentInfo std, Grades grds, String & out)

{

// // Check if the class exist.

// If ClassInfo is NULL

// Display appropriate error message.

// Return the integer representing the error to the Executive function.

// // Check if the student.

// If StudentInfo is NULL

// Display appropriate error message.

// Return the integer representing the error to the Executive function.

// // Declare temporary variables

// IndividualReport object

// tempPolicy

// PolicyVector

// GradeVector

// MaxGradeVector

// NamesVector

// // Find grading policy and place in temporary variable tempPolicy

// If StudentInfo.IndividualGradingPolicy is not NULL

// tempPolicy = StudentInfo.IndividualGradingPolicy

// else

// tempPolicy = ClassInfo.GradingPolicy

// // Size check for vectors used to instantiate IndividualReport.

// If tempPolicy.Percentage.size not equal to Grades.Values.size

// Display appropriate error message.

// Return the integer representing the error to the Executive function.

// for i = 0 to (tempPolicy.Percentage[i].size - 1)

// If tempPolicy.Percentage[i].size not equal to Grades.Values[i].size

// Display appropriate error message.

// Return the integer representing the error to the Executive function.

// // Prepare vectors used for IndividualReport instantiation.

// for i = 0 to (tempPolicy.Percentage.size - 1)

// for j = 0 to (tempPolicy.Percentage[i].size - 1)

// // Check if grade exists

// if Grades.Values[i][j] not NULL

// // Convert Vector of Policy objects to one long

// Vector of floats.

// PolicyVector.push_back(tempPolicy.Percentage[i][j])

// Convert Vector structure of group names to one long

// Vector of Stirngs.

// NamesVector.push_back(tempPolicy.Names[i])

// // Convert Vector of MaxGrades objects to one long

// Vector of floats.

// MaxGradeVector.push_back(tempPolicy.MaxPoint[i][j])

// // Convert Vector of Grades objects to one long

/ Vector of floats.

// GradeVector.push_back(Grades.Values[i][j])

// // Instantiate IndividualReport object:

// StudentName = StudentInfo.Name

// ClassName = ClassInfo.Name

// GradePolicy = PolicyVector

// StudentGrades = GradesVector

// MaxGrades = MaxGradesVector

// GroupNames = NamesVector

// Pass reference to the IndividualReport object as parameter to IndividualFormatting

// function.

// // Check If the IndividualFormatting function returned 0.

// If 0 was not returned

// Display appropriate to integer returned error message

// (error int assignment according to system design standards)

// Return the integer representing the error to the Executive function.

// If 0 was returned

// Copy IndividualReport.Output to the parameter passed as reference

// designated for the formatted report string

// Return 0 to Executive function to indicate success.

}

// ************* IndividualClass implementation *************

// NAME: Constructor

// DESCRIPTION: Instantiates IndividualReport object.

// PARAM:Student name as String object, class name as String object, student grades

// as vector, student grade // policy as Vector, maximum obtainable grades as vector,

// reference to String object used for formatted output.

// RETURN: 0 if success, otherwise integer representing error code described in EGBS

// error standards.

Report::IndividualReport::IndividualReport(String std, String cls, Vector grds,

Vector pol, Vector maxgrds, String & out)

{

// StudentName = std

// ClassName = cls

// StudentGrades = grds

// GradePolicy = pol

// MaxGrades = maxgrds

// GroupNames = pol.GroupNames

}

// NAME: Write

// DESCRIPTION: Mutator. Writes to formatted report output. Appends new String to existing

// formatted

// output String.

// PARAM: Formatted string to be appended to the output String.

// RETURN: 0 if success, otherwise integer representing error code described in EGBS

// error standards.

int Report::IndividualReport::Write(String apstr)

{

// Append apstr to Output String

}

// NAME: GetClassName

// DESCRIPTION: Accessor. Gets class name.

// PARAM: None.

// RETURN: Class name String object.

String Report::IndividualReport::GetClassName() const

{

// return ClassName;

}

// NAME: GetStudentName

// DESCRIPTION: Accessor. Gets student name.

// PARAM: None.

// RETURN: Student name String object.

String Report::IndividualReport::GetStudentName() const

{

// return StudentName

}

// NAME: GetGrade

// DESCRIPTION: Accessor. Gets student grades.

// PARAM: None.

// RETURN: Student grades as a vector of floats.

Vector Report::IndividualReport::GetGrade(int groupIndex) const

{

// return StudentGrades[groupIndex]

}

// NAME: GetGradePolicy

// DESCRIPTION: Accessor. Gets student grade policy.

// PARAM: None.

// RETURN: Student grade policy object.

Vector Report::IndividualReport::GetGradePolicy(int groupIndex) const

{

// return GradePolicy[groupIndex]

}

// NAME: GetMaxGrade

// DESCRIPTION: Accessor. Gets class maximum obtainable grades.

// PARAM: None

// RETURN: Student maximum obtainable grades as a vector of floats.

Vector Report::IndividualReport::GetMaxGrade(int groupIndex) const

{

// return MaxGrades[groupIndex]

}

// NAME: GetGroupName

// DESCRIPTION: Accessor. Gets name of an assignment group.

// PARAM: Index of the group.

// RETURN: Assignment group name.

String Report::IndividualReport::GetGroupName(int groupIndex) const

{

// return GroupNames[groupIndex]

}

// ************* ReportClass implementation continue *************

// NAME: IndividualFormatting

// DESCRIPTION: This function formats the output String to fit individual student report

// template.

// PARAM: Reference to IndividualReport object.

// RETURN: 0 if success, otherwise integer representing error code described in EGBS

// error standards.

// TRACIBILITY: requirement 10, requirement 11

int Report::IndividualFormatting(IndividualReport & indRep)

{

// // Declare temporary variables

// mean

// min

// maxmin

// max

// maxmax

// Format header

// Write to output String "INDIVIDUAL STUDENT REPORT"

// Append to output String carriage return and new line

// Append to output String "STUDENT NAME: "

// Append to output String IndividualReport.StudentName

// Append to output String carriage return and new line

// Append to output String "CLASS: "

// Append to output String IndividualReport.ClassName

// Append to output String carriage return and new line

// // Format student grades per assignment

// for i = 0 to (GradeVector.size - 1)

// Append to output String IndividualReport.GroupNames[i]

// Append to output String " "

// Append to output String i

// Append to output String ": "

// Append to output String IndividualReport.StudentGrades[i]

// Append to output String " / "

// Append to output String IndividualReport.MaxGrades[i]

// Append to output String " ("

// Append to output String

// (IndividualReport. StudentGrades[i]/ IndividualReport.MaxGrades[i]) * 100

// Append to output String "%)"

// Append to output String carriage return and new line

// Append to output String carriage return and new line

// // Set temporary variables to 0's:

// mean = 0

// min = 0

// maxmin = 0

// max = 0

// maxmax = 0

// Pass IndividualReport.StudentGrades Vector, IndividualReport.GradePolicy Vector,

// IndividualReport.MaxGrades Vector, reference to mean, dummy value for median (0),

// reference to min, referene to maxmin (maximum obtainable grade for the minimum

// grade found), reference to max, referene to maxmax (maximum obtainable grade for

// the maximum grade found), and flag set to 0 (indication of individual report)

// to Statistics function.

// Check if the Statistics function returned 0.

// If 0 was not returned

// Display appropriate to integer returned error message

// (error int assignment according to system design standards)

// Return the integer representing the error to the

// IndividualFormatting function.

// If 0 was returned

// Copy IndividualReport.Output to the parameter passed as reference

// designated for the formatted report string

// Return 0 to the IndividualFormatting function.

// // Format statistics output

// Append to output String "STATISTICS"

// Append to output String carriage return and new line

// Append to output String "Grade Mean : "

// Append to output String mean

// Append to output String "%"

// Append to output String carriage return and new line

// Append to output String "Min Grade : "

// Append to output String min

// Append to output String " / "

// Append to output String maxmin

// Append to output String " ("

// Append to output String (min/maxmin) * 100

// Append to output String "%)"

// Append to output String carriage return and new line

// Append to output String "Max Grade : "

// Append to output String max

// Append to output String " / "

// Append to output String maxmax

// Append to output String (max/maxmax) * 100

// Append to output String "%"

// Append to output String carriage return and new line

// Return 0 to GenerateIndividualReport function to indicate success.

}

// NAME: ClassFormatting

// DESCRIPTION: This functions formats the output String to fit the class list report

// template.

// PARAM: Reference to ClassReport object

// RETURN: 0 if success, otherwise integer representing error code described in EGBS

// error standards.

// TRACIBILITY: requirement 11, requirement 12

int Report::ClassFormatting(ClassReport & clsRep)

{

// // Declare temporary variales

// mean

// median

// min

// maxmin

// max

// maxmax

// allGrades

// allMaxGrades

// allPolicy

// allCounter

// // Format header

// Write to output String "CLASS REPORT"

// Append to output String carriage return and new line

// Append to output String "CLASS: "

// Append to output String Class.Report.ClassName

// Append to output String carriage return and new line

// Append to output String carriage return and new line

// // Format statistics by group and assignment

// for i = 0 to (ClassReport.GroupNames.size - 1)

// for j = 0 to (ClassReport.ClassGrades.size - 1)

// // Set temporary variables to 0's:

// mean = 0

// median = 0

// min = 0

// maxmin = 0

// max = 0

// maxmax = 0

// Pass ClassReport.ClassGrades[i][j] Vector,

// ClassReport.ClassGradePolicy[i][j]

// Vector, ClassReport.MaxGrades[j] float value, reference to

// mean, reference to median, reference to min, reference to

// maxmin (maximum obtainable grade for the minimum grade

// found),, reference to max, reference to maxmax (maximum

// obtainable grade for the maximum grade found), and flag set

// to 1 (indication of class report) to Statistics function.

// Check if the Statistics function returned 0.

// If 0 was not returned

// Display appropriate to integer returned error

// message (error int assignment according to system

// design standards)

// Return the integer representing the error to the

// ClassFormatting function.

// // Format assignment statistics output

// Append to output String ClassReport.GroupNames[i]

// Append to output String ": "

// Append to output String j

// Append to output String carriage return and new line

// Append to output String "Grade Mean: "

// Append to output String mean

// Append to output String "%"

// Append to output String " Grade Median: "

// Append to output String median

// Append to output String "%"

// Append to output String " Min Grade: "

// Append to output String min

// Append to output String " / "

// Append to output String maxmin

// Append to output String " ("

// Append to output String (min/maxmin) * 100

// Append to output String "%)"

// Append to output String " Max Grade: "

// Append to output String max

// Append to output String " / "

// Append to output String maxmax

// Append to output String (max/maxmax) * 100

// Append to output String "%"

// Append to output String carriage return and new line

// Append to output String carriage return and new line

// // Format class statistics

// // Set temporary variables to 0's:

// mean = 0

// median = 0

// min = 0

// maxmin = 0

// max = 0

// maxmax = 0

// // Create vectors of all class values without assignment division

// allCounter = 0

// for i = 0 to (ClassReport.ClassGrades.Size - 1)

// for j = 0 to (ClassReport.ClassGrades[i].size - 1)

// for k = 0 to (ClassReport.ClassGrades[i][j].size - 1)

// allGrades[allCounter] = ClassReport.ClassGrades[i][j][k]

// allPolicy[allCounter] = ClassReport.ClassGradePolicy[i][j][k]

// allMaxGrades[allCounter] = ClassReport.MaxGrades[k]

// allCounter = allCounter + 1

// Pass allGrades Vector, allPolicy Vector, allMaxGrades Vector, reference to

// mean, reference to median, referene to maxmin (maximum obtainable grade

// for the minimum grade found), reference to max, referene to maxmax

// (maximum obtainable grade for the maximum grade found), and flag set to 1

// (indication of class report) to Statistics function.

// Check if the Statistics function returned 0.

// If 0 was not returned

// Display appropriate to integer returned error message (error int

// assignment according to system design standards)

// Return the integer representing the error to the ClassFormatting

// function.

// // Format class statistics output

// Append to output String "CLASS STATISTICS"

// Append to output String carriage return and new line

// Append to output String "Grade Mean: "

// Append to output String mean

// Append to output String "%"

// Append to output String carriage return and new line

// Append to output String "Grade Median: "

// Append to output String median

// Append to output String "%"

// Append to output String carriage return and new line

// Append to output String "Min Grade: "

// Append to output String min

// Append to output String " / "

// Append to output String maxmin

// Append to output String " ("

// Append to output String (min/maxmin) * 100

// Append to output String "%)"

// Append to output String carriage return and new line

// Append to output String "Max Grade: "

// Append to output String max

// Append to output String " / "

// Append to output String maxmax

// Append to output String (max/maxmax) * 100

// Append to output String "%"

// Append to output String carriage return and new line

// Return 0 to GenerateClassReport function to indicate success.

}

// NAME: Statistics

// DESCRIPTION: Calculates mean, median, minimum and maximum values based on grades and

// grade policy.

// -> grade mean = [Sum(((grade / maximum grade) * grade policy)) / no of existing grades]

// * Sum(grade policy)

// -> grade median = middle value((grade / maximum grade))

// -> grade min = min grade / maxmin grade (maximum obtainable grade for min)

// -> grade max = max grade / maxmax grade (maximum obtainable grade for max)

// PARAM: Vector of grades, Vector of policies, reference to mean, reference to median,

// reference to min grade, referance to min grades's maximum obtainable grade, reference

// to max, reference to // max grades's maximum obtainable grade, flag (0 for individual

// report, 1 for class report).

// RETURN: 0 if success, otherwise integer representing error code described in EGBS

// error standards. Implicitly min, maxmin, max, maxmax, and mean are returned for

// individual report and min, maxmin, max, // maxmax, median, and mean are returned for

// class report.

// TRACIBILITY: requirement 10, requirement 11, requirement 12

int Report::Statistics( grades, policy,

maxGrades, float & mean, float & median, float & min, float & maxmin, float & max, float & maxmax, int flag)

{

// // Check for input correctness

// for i = 0 to (grades.size - 1)

// If grades[i] is NULL

// Display appropriate error message.

// Return the integer representing the error to the

// IndividualFormatting or ClassFormatting function.

// If maxGrades[i] is NULL

// Display appropriate error message.

// Return the integer representing the error to the

// IndividualFormatting or ClassFormatting function.

// If policy[i] is NULL

// Display appropriate error message.

// Return the integer representing the error to the

// IndividualFormatting or ClassFormatting function.

// If grades[i] < 0

// Display appropriate error message.

// Return the integer representing the error to the

// IndividualFormatting or ClassFormatting function.

// If maxGrades[i] =< 0

// Display appropriate error message.

// Return the integer representing the error to the

// IndividualFormatting or ClassFormatting function.

// // Check if input vectors have equal sizes

// If grades.size not equal to maxGrades.size

// Display appropriate error message.

// Return the integer representing the error to the IndividualFormatting or

// ClassFormatting function.

// If grades.size not equal to policy.size

// Display appropriate error message.

// Return the integer representing the error to the IndividualFormatting or //

// ClassFormatting function.

// // Declare temporary variables

// policySum

// // Set min, maxmin, and maxmax to assure algorithm correctness

// // Min some high value

// min = 1000

// // Maxmin and maxmax to one to avoid division by zero

// maxmin = 1

// maxmax = 1

// // Find min, maxmin, max, and maxmax

// for i = 0 to (grades.size - 1)

// If grades[i]/maxGrades[i] equals to min/maxmin

// // Choose the grade for assignment with greater maximum of

// obtainable points

// If maxGrade[i] > maxmin

// min = Grade[i]

// maxmin = maxGrade[i]

// If grades[i]/maxGrades[i] < min/maxmin

// min = Grade[i]

// maxmin = maxGrade[i]

// If grades[i]/maxGrades[i] equals to max/maxmax

// // Choose the grade for assignment with greater maximum of obtainable points

// If maxGrade[i] > maxmax

// max = Grade[i]

// maxmax = maxGrade[i]

// If grades[i]/maxGrades[i] > max/maxmax

// max = Grade[i]

// maxmax = maxGrade[i]

// // Calculate mean

// policySum = 0

// for i = 0 to (grades.size - 1)

// mean = mean + ((grades[i] / maxGrades[i]) * Policy[i])

// policySum = policySum + Policy[i]

// mean = mean * policySum

// // Check if class report

// // If class report then create and sort the tempVector and find median

// If flag set to 1

// // Declare temporary variables used in the following scope

// tempVector

// tempIndex

// tempVal

// // Create tempVector of values = grade / maxGrade

// for i = 0 to (grades.size - 1)

// tempVector = grades[i] / maxGrades[i]

// // Sort the tempVector in ascending order

// tempVal = 0

// for i = 0 to (tempVector.size - 2)

// for j = (i + 1) to (tempVector.size - 1)

// If tempVector[j] < tempVal

// tempIndex = j

// tempVal = tempVector[tempIndex]

// tempVector[tempIndex] = tempVector[i]

// tempVector[i] = tempVal

// // Find median

// If (tempVector.size - 1) mod 2 == 0

// median = ((tempVector[floor((tempVector.size - 1) / 2)] +

// tempVector[ceiling((tempVector.size - 1) / 2)] ) / 2) * 100

// else

// median = tempVector[(tempVector.size - 1) / 2] * 100

// Return 0 to IndividualFormatting or ClassFormatting function to indicate success.

}

6. Human Interface Design

6.1 Overview of the User Interface

The user interface is a menu driven system. When first starting the EGBS the user shall be prompted to enter a user name and password. The EGBS after validating the user will allow a given access to a class selection. (Figure 6.1- class selection) If the user is an administrator, then they may choose from a list of classes in the EGBS or creating a new class. If the user is a grader then only a class may be selected. (Figure 6.2 – import class) If the user selects a new class they will be prompted to enter a file name which contains a class list to import. After this the user will be asked to enter a new grading policy. After a class has been selected or a new class as been created, the main menu will be displayed if the user is the administrator. (Figure 6.3 - main menu) From this menu the user shall be able to access the functionality of the EGBS. (Figure 6.4 – class selection and Figure 6.5 – class report) These figures show the output of two functionalities of the EGBS that is accessible through the menu. The user shall be able to enter new grades for the current class. The menu system and the grade entering system can be navigated with the arrow keys. The Grader will not be allowed to view this menu and will be prompted to entering grades.

6.2 Screen Images

Class Selection

[pic]

Figure 6.1

Import Class

[pic]

Figure 6.2

Main Menu

[pic]

Figure 6.3

Class Listing

[pic]

Figure 6.4

Class Report

[pic]

Figure 6.5

6.3 Screen Objects and Actions

The Main Menu shall have items on it that the user can select to manipulate the class data.

4. Reports Format

The EGBS generates either a class report or an individual student report. This section displays a sample format for the each report. Figure 16 shows the format for the individual student report. The next diagram, figure 17, shows the format for a class report.

[pic]

Figure 6.6

[pic]

Figure 6.7

7. Requirements Matrix

|Function Requirement |Component |Function Name |

|Requirement 1 |Import |ImportClassList |

| |User Interface |GetFileName |

| |Database |UpdateClass |

|Requirement 2 |Import |ImportClassList |

| |User Interface |GetFileName |

| |Database |UpdateClass |

|Requirement 3 |Import |ImportClassList |

|Requirement 4 |Import |ImportGradeList |

| |User Interface |GetFileName |

| |Database |UpdateStudentGrades |

|Requirement 5 |Import |ImportGradeList |

| |User Interface |GetFileName |

| |Database |UpdateStudentGrades |

|Requirement 6 |Import |ImportGradeList |

| |User Interface |GetFileName |

| |Database |UpdateStudentGrades |

|Requirement 7 |User Interface |DoGradeEntry |

| |Database |UpdateStudentGrades |

|Requirement 8 |Report |GenerateIndividualReport |

| |User Interface |DisplayReport |

|Requirement 9 |Report | 1. Statistics |

|Requirement 10 |Report |GenerateIndividaulReport, IndividualFormatting, |

| |User Interface |Statistics |

| | |DisplayReport |

|Requirement 11 |Report |GenerateClassReport, IndividualFormatting, Statistics |

| |User Interface |DisplayReport |

|Requirement 12 |Report |GenerateClassReport, ClassFormatting, Statistics |

| |User Interface |DisplayReport |

|Requirement 13 |User Interface |UpdateComponent |

| |Database |UpdateStudentInfo |

|Requirement 14 |UserInterface |UpdateComponent |

| |Database |UpdateStudentInfo |

|Requirement 15 |User Interface |UpdateComponent |

| |Database |UpdateStudentInfo |

|Requirement 16 |Report | 1. Statistics |

|Requirement 17 |User Interface |GetStudentInfo |

| |Database |UpdateStudents |

|Requirement 18 |User Interface |GestStudentInfo |

| |Database |UpdateStudentGrades |

8. Resource Estimate

In order to operate this software, the user shall have 10 megabytes of storage space to accommodate the EGBS.

9. Definitions, Acronyms, and Abbreviations

UMBC – University of Maryland Baltimore County.

EGBS – The Electronic Grade Book System that is being designed.

Executive – The main component of the system uses to communicate with all the subcomponents to perform the user’s requests.

IRIX – The general UNIX system available at UMBC.]

GL – The general system available to all faculty, staff and students at UMBC

11. Appendix A – Figures Table

|Figure Number |Page Number |

|Figure 1.1 |4 |

|Figure 3.1 |5 |

|Figure 3.2 |5 |

|Figure 3.3 |6 |

|Figure 3.4 |6 |

|Figure 3.5 |6 |

|Figure 3.6 |6 |

|Figure 3.7 |7 |

|Figure 3.8 |7 |

|Figure 3.9 |7 |

|Figure 3.10 |7 |

|Figure 3.11 |8 |

|Figure 3.12 |8 |

|Figure 3.13 |8 |

|Figure 3.14 |8 |

|Figure 3.15 |8 |

|Figure 3.16 |8 |

|Figure 3.17 |8 |

|Figure 3.18 |8 |

|Figure 4.1 |10 |

|Figure 4.2 |10 |

|Figure 4.2 |12 |

|Figure 6.1 |61 |

|Figure 6.2 |61 |

|Figure 6.3 |62 |

|Figure 6.4 |62 |

|Figure 6.5 |62 |

|Figure 6.6 |63 |

|Figure 6.7 |63 |

-----------------------

1 Students EGBS_Database_Files\Students.DB

2 Grades EGBS_Database_Files\Grades.DB

3 Enrollment EGBS_Database_Files\Enrollment.DB

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download