CSC/ECE 517 Spring 2022 - E2245: View for results of bidding

From Expertiza_Wiki
Jump to navigation Jump to search

CSC/ECE 517 Spring 2022 - E2245: View for results of bidding

Problem Statement

When students sign up for topics, they are presented with a system to bid on their favorite topics. This process is allowed for both individual students as well as teams. As a result, many students will first sign up for topics, which can reduce the number of teams that get their first pick, and result in long waitlists. A bidding algorithms has been developed to give as many groups as possible their first choice. As this is an NP-complete problem, the algorithm has to use heuristics to guess efficiently. There needs to be a way for instructors to easily view and compare the results of the bidding algorithms to get a quantitative sense of their effectiveness.

Project Goal

This project aims to solve this issue by giving clear and concise feedback of the algorithms in topics list in the assignment. However, since topics in the table potentially have several fields, care must be taken not to overcrowd the table with information. There are several different UI/UX approaches to display this information, and the chosen one should:

  • Maximize useful information at a glance, while minimizing clutter
  • Fit into the flow of the topic page
  • Allow further information to be obtained if requested
  • Not be visible if bidding is not used

Some other miscellaneous goals of this project are to:

  • Remove topic fields from view if they are not applicable
  • Refactor code as needed
  • Increase test coverage as appropriate

Previous Work

Current User Cases

Below is the use case diagram that depicts the existing use cases that associated to the topics bidding features of the application. Notice that in order to check some bidding information for a topic/project, the Instructor has to impersonate a student.

Old user cases

Current Work Flow Diagram

As an Instructor, the user after, being authenticated, needs to go to the Assignments >> Topics view to create the topics/projects and then once the bidding started, needs to impersonate a student to partially (at very minimal level) get the bidding process information

Old user cases

Strategy to implement our plan to improve previous Works

Change in Use Cases

Old user cases

Student: This actor is responsible for submitting and deleting bids for topics while the topic selection period is open for an assignment which uses the new lottery topic selection mechanism.

Instructor: This actor is responsible for updating an assignment to use the new lottery topic selection as well as closing the bidding period and beginning the automatic topic selection. Instructor is also able to view the progress details of bids without having to impersonate students

UI design

The existing view with very limited information about the bidding process

Before:

Popup prototype


With this proposed new view, the Instructor can gain a more complete view of the whole bidding process in one place.

Proposed UI

Popup prototype

Change in Work Flow Diagram

With the new flow and implementation, the Instructor now can have all (complete) information he/she needs in one place at the Topics list/details view instead of having to impersonate a student to get even some minimal, un-completed piece of information about the bidding.

Old user cases

Class Diagram

Class diagram


Track our works for transparency, collaboration and productivity

We've been working collaboratively to deliver this project as a team, by using Github Project feature to assign, track and collaborate our tasks. We've created an accompanying github project for this purpose, link can be found here

project tasks

Code changes

From preliminary research, we believed we would need to add and modify, refactor code from almost all layers of the features (including Controllers, Models, Views but we end up decided to focus on delivering the feature with minimum code changes and regression tests, so majority of our code changes are on Views layer. Following are the changes we made (We also added links to our Github commits for each change so that the reviewers can link directly to github for more in-depth inspection/review)


New Files added:

Total bids

1-2 bids

Files changed:

View:

Add Signup Topics

Add Signup Topics

Add Signup Topics

Helper:

Add Signup Topics

Test:

Add Signup Topics


Configuration:

  • config/locales/en_US.yml

Functionalities added

  1. Here is the link to our recorded demo of the feature
  2. The instructor should be able to see how many teams have bid for each topic without having to impersonate students

Here is the screenshot of real app running that shows what the Instructor will see in Assignment >> Topic view:

Assignment Topics View

Testing

Manual UI testing for the deployed project.

UI Testing

Instructor View

  • username: instructor6
  • password: password

Student View

  • username: student575
  • password: password

View total bids for a topic

  1. Log into expertiza as Instructor
  2. Go to Assignments >> Topics page/tab
  3. Execute this query against the application database to get the total number of bids for each topic for a particular assignment: SELECT topic_id as topic_id, COUNT(b.topic_id) as count FROM sign_up_topics t JOIN bids b ON t.id = b.topic_id WHERE t.assignment_id = 834 GROUP BY t.id
  4. Once the Topics page shows up, verify the bidding details (total number of bids) for each Topic on the table

Example:


mysql> SELECT topic_id as topic_id, COUNT(b.topic_id) as count FROM sign_up_topics t JOIN bids b ON t.id = b.topic_id WHERE t.assignment_id = 834 GROUP BY t.id;
+----------+-------+
| topic_id | count |
+----------+-------+
|     3918 |    29 |
|     3919 |    14 |
|     3920 |    12 |
|     3921 |    29 |
|     3922 |    19 |
|     3923 |    13 |
|     3924 |    14 |
|     3925 |    15 |
|     3926 |    11 |
|     3927 |    10 |
|     3928 |     9 |
|     3929 |     6 |
|     3930 |     7 |
|     3931 |     8 |
|     3932 |     5 |
|     3933 |     7 |
|     3934 |    17 |
|     3935 |    12 |
|     3936 |     4 |
|     3937 |    19 |
|     3938 |    10 |
+----------+-------+
21 rows in set (0.00 sec)

View total of #1 bids for a topic

  1. Log into expertiza as Instructor
  2. Go to Assignments >> Topics page/tab
  3. Execute this query against the application database to get the total number of bids for each topic for a particular topic: select * from bids where priority = 1 and topic_id=3918;
  4. Once the Topics page shows up, verify the bidding details (total number of #1 bids) for each Topic on the table

Example:


mysql> select count(*) from bids where priority = 1 and topic_id=3918;
+----------+
| count(*) |
+----------+
|       10 |
+----------+
1 row in set (0.00 sec)

View total of #2 bids for a topic

  1. Log into expertiza as Instructor
  2. Go to Assignments >> Topics page/tab
  3. Execute this query against the application database to get the total number of bids for each topic for a particular topic: select * from bids where priority = 2 and topic_id=3918;
  4. Once the Topics page shows up, verify the bidding details (total number of # 2 bids) for each Topic on the table

Example:


mysql> select count(*) from bids where priority = 2 and topic_id=3921;
+----------+
| count(*) |
+----------+
|        6 |
+----------+
1 row in set (0.00 sec)

Test case for sign_up_sheet_helper


  describe '#get_team_bids' do
    before(:each) do
      @assignment1 = create(:assignment, name: 'final 1', directory_path: 'final_1')
      @topic1 = create(:topic, assignment: @assignment1)
      @assignment2 = create(:assignment, name: 'final 2', directory_path: 'final_2')
      @topic2 = create(:topic, assignment: @assignment2)
      @participant1 = create(:participant, assignment: @assignment1)
    end

    it 'The get_team_bids method return an empty string' do
      out_string = helper.get_team_bids(@topic1, [@participant1])
      expect(out_string).to be_nil
    end

    it 'The get_team_bids method should throw an exception' do
      expect { helper.get_team_bids(@topic1, @assignment1, nil) }.to raise_exception(ArgumentError)
    end
  end  

Future Work

Because of the time constraints, we could only implement that much of features and would like to layout some potential future works need to be done:

  1. More testing for edge-cases
  2. Add automatic test for UIs

Team Roster

Mentor: Ed Gehringer - efg@ncsu.edu

  • Duy Nguyen - dvnguye3@ncsu.edu
  • Kwon HyeokJun - khyeokj@ncsu.edu
  • Shawn Salekin - ssaleki@ncsu.edu
  • David Glymph - dwglymph@ncsu.edu

Reference

  1. Previous works
  2. Team code repo
  3. Upstream code repo