CSC/ECE 517 Fall 2016/E1643. Refactor Suggestion controller

From Expertiza_Wiki
Revision as of 22:30, 28 October 2016 by Smagapu (talk | contribs)
Jump to navigation Jump to search

E1643. Refactor and Test Suggestion Controller

This page gives a detail of the OSS project of refactoring and testing the suggestion controller of Expertiza.

Introduction

Expertiza is a Ruby on Rails based open source project. The main motive of this project is to make learning more effective through peer review. This website is a result of combined effort of both students and faculty at NC State, and is used not just by this university but also in many other universities. The website allows students to form teams and work on various projects listed by the instructor and also suggest new topics that seem interesting, though they can opt not to work on them. It also makes it easy for the instructor to add a new topic to an assignment/project, create a new project and add students to it. The time spent by TAs and instructor is greatly reduced. The key feature is peer review, where the students can review the work of others and provide feedback. This helps in improving the existing work and also provides a new way to learn. There isn’t any restriction on the format of submission as it accepts any form of submission varying from URL to wiki pages, which isn’t a common feature in other websites.

Motivation

This provides a great opportunity for the students to learn through collaboration. It provides a chance to contribute to an open source project. One would take back experience of working on Rails, and testing environments like RSpec. Being one of the primary user of Expertiza, students would enhance the functionalities according to their experiences using it and can view their changes implemented real-time.

Problem Statement

Our files to be modified are: app/views/mailer/suggested_topic_approved_message.html.erb, suggestion_controller_spec.rb

The current folder of suggestion_controller.rb provides a chance to suggest a new topic to work on for a project. There is also an option for the student to not work on it. One can also submit the suggestion anonymously. Once a student submits the topic, the instructor can check that in the view suggestions tab, and can either approve or reject. Once the instructor approves, the student gets a mail regarding the approval. This mail is sent only if the student doesn’t submit the topic anonymously. In the process of assigning the given suggestion as a project topic to the student, it automatically gets assigned to the whole team if the student is part of a team.

Our problem statement includes:

1. Modifying the code in accordance to rails 4 syntax

2. Send email code which was duplicated needs to be replaced by a single method

3. Fix and test the working of email functionality (an email is sent to the student who suggested the topic once the instructor approves, unless he/she sends it anonymously)

4. Write integration tests for each method in suggestion_controller.rb (including some edge cases)

Setup

Before starting off with working on the Expertiza project, we need to fork the existing code from expertiza/master branch. We are provided with 3 methods of setting up Expertiza: Docker, setting it up locally and using Expertiza image. We are describing the first two methods (the ones we used) below.

Docker

On a Local Machine