CSC/ECE 517 Spring 2017 E1734

From Expertiza_Wiki
Jump to navigation Jump to search

Improve survey functionality

Problem Description

Expertiza used to have functionality for conducting surveys. However, the existing code is inefficient and needs to be improved. This functionality has rarely been used and so isn't tested very well either. Therefore, there are parts of survey functionality that are broken or are totally unfinished.

So, there are three major problems this project will tackle.

1) Restructure and move around functionality within classes to further streamline the code.

2) Test the existing functionality and catalog what parts work and what do not. As an instance of a broken feature, take survey deployments for example. During initial testing, it is not possible to deploy any kind of survey. There are other features as well that need little fixes to make them work.

3) Fixing the broken features. This involves little bug fixes here and there, as well as finishing the features that are completely unfinished.

Types of Surveys

There are three kinds of surveys available in the Expertiza application. They are differentiated based on the group of people that can have access to these surveys.

The surveys are as follows:

1) Course Survey:

All the participants in a course can take the course survey.

File: course_evaluation_questionnaire.rb

2) Global Survey:

Any Expertiza user can take the global survey.

File: global_survey_questionnaire.rb

3) Targeted Survey:

The admin can create a survey targeted to a specific group of people.

File: survey_questionnaire.rb

Class Design

Existing class structure:

Updated class structure:


New Class Functionality:

Questionnaire:

Contains the basic information and methods required for posing questions to students or users in general. It is inherited by Classes Quiz, Survey, etc.

We can reuse this class's functionality to create, edit and delete surveys. The functionality for checking if questions have been answered can also be borrowed from this class.

Survey:

This project will introduce a new class called Survey.

This class will inherit from the Questionnaire class and it will be a superclass for the three different kinds of survey classes.

This class will include the assign_participants() method that can be used by any of the child classes to assign participants for their respective surveys.

Global Survey:

This class will inherit from class Survey.

This class will be set the display_type for the survey to be global. So, while assigning participants all the users of Expertiza will be able to see this particular survey.

This kind of survey can only be created by admins of the Expertiza system.

Course Evaluation:

This is also another type of survey and will inherit from class Survey.

Surveys of this type, however, will only be available to the class to which this survey would be assigned. Accordingly, the display_type for it will be set to course.

So assign_participants() will create new survey participants for all users in a particular course.

Survey Questionnaire:

This class will also inherit from the class Survey. The name used for this class may change after further discussions with the professor.

The existing survey_questionnaire class will be repurposed to be used to create surveys that could be targeted to a group of users or be attached to a questionnaire.

It will allow for an association between an assignment and a questionnaire to be established. Additionally, it maintains the instructor id who will create the association.

A flag for a score outside an acceptable range will also be set. It could also be used to play a part in the total score calculation for the assignment.


DB Schema

Table: Survey Deployments

Element Type Attributes
course_evaluation_id Integer Limit: 4
start_date Datetime
end_date Datetime
num_of_students Integer Limit: 4
last_reminder Datetime
course_id Integer Limit: 4, Default: 0, Null: false


Table: Survey Participants

Element Type Attributes
user_id Integer Limit: 4
survey_deployment_id Integer Limit: 4


Table: Survey Responses

Element Type Attributes
score Integer Limit: 4
comments Text Limit: 65535
assignment_id Integer Limit: 4, Default: 0, Nil: false
question_id Integer Limit: 4, Default: 0, Nil: false
survey_id Integer Limit: 4, Default: 0, Nil: false
email String Limit: 255

Test Plan

Testing tool:

RSpec

Test case 1:

Description:

Test to check whether an instructor can create a survey questionnaire.

Test case 2:

Description:

Test to check whether a survey questionnaire is deleted.

Test case 3:

Description:

Test to check whether a survey questionnaire is updated.

Test case 4:

Description:

Test to check whether a survey is deployed to the appropriate users.

Test case 5:

Description:

Test to check whether the distribution of survey responses is correct.

Test case 6:

Description:

Test to check whether a survey_participant record is created for the user in the participants table, if the user is assigned to take part in a survey.