CSC/ECE 517 Fall 2022 - E2257: Refactor questionnaires controller.rb: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 17: Line 17:
==Changes==
==Changes==
===Fix #1===
===Fix #1===
The <code>create_teams</code> method's name poorly reflected it's actual function. The function takes a group of students from an assignment or course and creates randomized teams. To reflect this, the method was renamed to <code>randomize_teams</code> and a comment was added briefly describing the function. This also needed to be updated in the rspec test <code>teams_controller_spec.rb</code>:
The <code>create_questionnnaires</code> method was present but its related functionality had been removed. Some kind of link to it is still present in one of the initial migrations which are populating a database to show values for a drop-down that is no longer in use. Thus we ended up removing the function, its corresponding test case and
<nowiki>  describe 'create teams method' do
    context 'when correct parameters are passed' do
      it 'creates teams with random names' do
        allow(ExpertizaLogger).to receive(:info).and_return(nil)
        ...
        user_session = { user: instructor, team_type: 'Assignment' }
        result = get :randomize_teams, params: request_params, session: user_session
        # status code 302: Redirect url
        ...
      end
    end
  end</nowiki>


===Fix #2===
===Fix #2===
Line 55: Line 43:


===Reference===
===Reference===
#[http://152.7.177.127:3000/ VCL link]
#[http://152.7.177.154:8080/ VCL link]
#[https://github.com/b4443/expertiza Github Repo]
#[https://github.com/Ashwinshankar98/expertiza Github Repo]
#[https://github.com/expertiza/expertiza/pull/2470 Github Pull Request]
#[https://github.com/expertiza/expertiza/pull/2470 Github Pull Request]
#[https://github.com/expertiza/expertiza Expertiza on GitHub]
#[https://github.com/expertiza/expertiza Expertiza on GitHub]
#[https://github.com/vyasrc/expertiza/tree/refactor_suggestion_controller GitHub Project Repository Fork]
#[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza Project Documentation Wiki]
#[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza Project Documentation Wiki]
#[https://docs.codeclimate.com/docs/cognitive-complexity CodeClimate Documentation]
#[https://codeclimate.com/github/expertiza/expertiza/app/controllers/questionnaires_controller.rb CodeClimate Documentation]

Revision as of 23:34, 26 October 2022

Introduction

In Expertiza, Questionnaire is the superclass for all kinds of questionnaires and rubrics—rubrics for evaluating submissions and teammate contributions, and taking quizzes and surveys. All of these are subclasses of Questionnaire. questionnaires_controller.rb is charged with creating, displaying, and managing Questionnaires. Because it is used so widely, malfunctions could cause bugs in many parts of the system; hence it is especially important that the code be clear.


Issues Fixed

  1. Removed create_questionnaire

Files Changed

  • app\controllers\questionnaires_controller.rb

Changes

Fix #1

The create_questionnnaires method was present but its related functionality had been removed. Some kind of link to it is still present in one of the initial migrations which are populating a database to show values for a drop-down that is no longer in use. Thus we ended up removing the function, its corresponding test case and

Fix #2

Fix #3

Fix #4

Fix #5

Project Mentor

Edward Gehringer (efg@ncsu.edu)


Team Member

Ashwin Shankar Umasankar (aumasan@ncsu.edu)

Kailash Singaravelu (ksingar2@ncsu.edu)

Pujitha Enamandala (penaman@ncsu.edu)

Reference

  1. VCL link
  2. Github Repo
  3. Github Pull Request
  4. Expertiza on GitHub
  5. Expertiza Project Documentation Wiki
  6. CodeClimate Documentation