CSC/ECE 517 Fall 2017/E1794. Student-generated questions added to rubric

From Expertiza_Wiki
Revision as of 03:32, 6 December 2017 by Ksharma5 (talk | contribs)
Jump to navigation Jump to search

Introduction

Instructors make up rubrics in Expertiza. They can ask about anything that is relevant to all the projects that will be submitted. But sometimes students want specific advice on aspects of their work that may be different from the work or topics that other students are working on. It would be more convinient if students can add their own questionnaire to ask feedback for some specific functionalities regarding their project.

Changes implemented

Note: These changes are covered in Use Case section.

  • Added a button 'Manage Supplementary Rubric' on the page which appears when the student clicks on the 'Your Work' link.





  • This button takes the student to the create/edit Review Questionnaire page. The student then can create a new rubric.
  • Added a new field called 'supplementary_rubric' to the 'teams' table so that the supplementary rubric could be stored.
  • Supplementary rubric questions are visible along with instructor generated rubrics.





  • “View” function for a rubric displays answers submitted for the Supplementary rubric questions along with Review Questionnaire for Reviewer.





  • “Your Scores” function for the Reviewee displays answers submitted for the Supplementary rubric questions along with Review Questionnaire.





  • "Alternate View" for "Your scores" should also include Supplemenraty Rubric questionnaire.



    Design Principles to be Followed

    1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).
    2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.
    3. Polymorphism
    4. Inheritance

    Use Case

    Here SRQ is used for newly added field supplementaryReviewQuestions in the Teams table and it is initially set as null for all the table entries.Once a student adds a specific Questionnaire to his project this field stores the id of that Questionnaire which is stored in the Questionnaires table.

    Use Case to Add Questionnaire Functionality: In the "Your Work" section, Student will be shown a button "Manage Rubric", when clicked, if the supplementaryReviewQuestions column in Teams table is null for that team, Questionnaire will be created and SRQ in Teams table will be updated to contain the Questionnaire ID. The student will be directed to the Edit Questionnaire page with exsiting logic.
    Use Case for Show Questionnaire Functionality: When the student orders for new reviews, if the supplementaryReviewQuestions column in Teams table is not null for the assigned team, extract the questionnaire for supplementary reviews and append in a new section below normal Questionnaire.
    Use Case for Show Review( and Scores) Functionality: When the Student or the Instructor checks the reviews and scores on rubric, if the supplementaryReviewQuestions column in Teams table is not null for the team, extract the questionnaire review for supplementary questions and append in a new section below normal Questionnaire Reviews.

    To provide the view for the scores of a team we will add one more partition containing the scores for the supplementary questionnaire and implement the already build logic to get and display the scores.


    Files edited:

  • Controllers:
    grades_controller.rb
    response_controller.rb
    submitted_content_controller.rb
  • Model:
    response.rb
    team.rb
  • Views:
    grades/view_team.html.erb
    response/response.html.erb
    submitted_content/_main.html.erb
  • Config:
    routes.rb
  • DB:
    migration script
  • Javascript:
    view_team_in_grades.js

    Implementation

    1. Created a migration script to add a new column 'supplementary_rubric' to the Teams table

    2. To add supplementary rubric: In submitted_content_controller.rb: created a new function 'manage_supplementary_rubric'


     def manage_supplementary_rubric
       @participant = AssignmentParticipant.find(params[:id])
       @team = Team.find(@participant.team.id)
       if @team.supplementary_rubric.nil? then
         @questionnaire = Questionnaire.new
         @questionnaire.private = false
         @questionnaire.name = "SR_" + @team.id.to_s
         @questionnaire.instructor_id = @team.id
         @questionnaire.min_question_score = 0
         @questionnaire.max_question_score = 5
         @questionnaire.type = "ReviewQuestionnaire"
         @questionnaire.display_type = "Review"
         @questionnaire.instruction_loc = Questionnaire::DEFAULT_QUESTIONNAIRE_URL
         begin
           @questionnaire.save
           @team.supplementary_rubric = @questionnaire.id
           @team.save
           flash[:success] = 'You have successfully created a questionnaire!'
         rescue
           flash[:error] = $ERROR_INFO
         end
       else
         @questionnaire = Questionnaire.find(@team.supplementary_rubric)
       end
       redirect_to controller: 'questionnaires', action: 'edit', id: @questionnaire.id
     end
    

    In the view, submitted_content/_mail.html.erb: Created a button 'Manage Supplementary rubric' to be shown in 'your work' tab


      <% if stage != "Finished" %>
       <%= button_to :action => "manage_supplementary_rubric", :id => participant.id do %>
           Manage Supplementary Rubric
       <% end %>
      <% end  %>
    

    After this, the same functionality of adding a rubric and questions is used as before.

    3. To display the supplementary rubric questions: In response_controller.rb: Changes in create, set_content, set_questionnaire_for_new_response, set_questionnaire

    #for Supp Questions
       unless @supp_questionnaire.nil?
         questions_supp = sort_questions(@supp_questionnaire.questions)
         questions = questions+questions_supp
       end
       ###
    

    in set content

    # For supp Questionnaire
       unless @supp_questionnaire.nil?
         @questions_supp = sort_questions(@supp_questionnaire.questions)
       end
       ###
    

    in set_questionnaire_for_new_response

    ##For supp Questionnaire
         @supp_questionnaire_id = Team.supplementary_rubric_by_team_id(@contributor.id)
         unless @supp_questionnaire_id.nil?
           @supp_questionnaire = Questionnaire.find(@supp_questionnaire_id)
         end
         ###
    

    in set_questionnaire

       answer_supp = @response.scores.last
       @supp_questionnaire = Questionnaire.find(@supp_questionnaire_id)
       @supp_questionnaire = @response.questionnaire_by_answer(answer_supp)
    


    In View, response/response.html.erb: added code to display supplementary questions.


       <% unless @questions_supp.nil?%>
           
           <%@questions_supp.each do |question| %>
               <% answer = Answer.where(question_id: question.id, response_id: @response.id).first if !@response.nil?%>
               <% if question.instance_of? Criterion%>
                   <%= question.complete(i, answer, @questionnaire.min_question_score, @questionnaire.max_question_score, @dropdown_or_scale) %>
               <% elsif question.instance_of? Scale %>
                   <%= question.complete(i, answer, @questionnaire.min_question_score, @questionnaire.max_question_score) %>
               <% elsif question.instance_of? UploadFile %>
               <% else %>
                   <%= question.complete(i, answer) %>
               <% end %>
               <% i += 1%>
           <% end %>
       <% end %>
    

    4. To edit a review if saved: In response_controller.rb: Changes in edit, update

    #for Supp Questions
         questions_supp = sort_questions(@supp_questionnaire.questions)
         all_questions = questions+questions_supp
    

    5. For the reviewer and the reviewee to view the completed review: Model: response.rb: Created new function, display_html_helper.

    def display_html_helper(questions, answers, questionnaire_max)
       count = 0
       code = 
       questions.each do |question|
         count += 1 if !question.is_a? QuestionnaireHeader and question.break_before == true
         answer = answers.find {|a| a.question_id == question.id }
         row_class = count.even? ? "info" : "warning"
         row_class = "" if question.is_a? QuestionnaireHeader
    
    code += ''
         if !answer.nil? or question.is_a? QuestionnaireHeader
           code += if question.instance_of? Criterion or question.instance_of? Scale
                     question.view_completed_question(count, answer, questionnaire_max)
                   else
                     question.view_completed_question(count, answer)
                   end
         end
    
    code += '' end return code end and made changes in display_as_html function. ###For supp_questionnaire response_map = self.map reviewee_id = response_map.reviewee_id supp_questionnaire_id = Team.supplementary_rubric_by_team_id(reviewee_id) unless supp_questionnaire_id.nil? supp_questionnaire = Questionnaire.find(supp_questionnaire_id) supp_questions = supp_questionnaire.questions.sort {|a, b| a.seq <=> b.seq } end #### 6. For the reviewee to see the review in heat chart: grades_controller.rb: view_team function, added code for supplementary questions, ###For Supp questionnaire supp_questionnaire_id = Team.supplementary_rubric_by_team_id(@team_id) if not supp_questionnaire_id.nil? supp = VmQuestionResponse.new(questionnaire, @round, @assignment.rounds_of_reviews) supp_questionnaire = Questionnaire.find(supp_questionnaire_id) supp_questions = supp_questionnaire.questions supp.add_questions(supp_questions) supp.add_team_members(@team) supp.add_reviews(@participant, @team, @assignment.varying_rubrics_by_round?) supp.get_number_of_comments_greater_than_10_words @supplist << supp else @supplist << nil end ### created separate VmQuestionResponse for supplentary questions.

    Test Plan

  • To check if manage rubric button is added or not.





  • To check if manage rubric button takes the student on the edit Questionnaire page or not.





  • To check when supplementary_rubric is not null, is the project specific questionnaire appended to the original rubric or not.





  • To check that the scores of Student-generated questions are not considered in the overall score of the review.