CSC/ECE 517 Fall 2016 E1685: UI changes for review and score reports

From Expertiza_Wiki
Jump to navigation Jump to search

Introduction

Expertiza<ref>https://expertiza.ncsu.edu/</ref> is an open-source web application to create re-usable learning objects through peer-reviews to facilitate incremental learning. Students can submit learning objects such as articles, wiki pages, repository links and with the help of peer reviews, improve them. The project has been developed using the Ruby on Rails<ref>https://en.wikipedia.org/wiki/Ruby_on_Rails</ref> framework and is supported by the National Science Foundation.

Project Description

Purpose and Scope

Expertiza assignments are based on a peer review system where the instructor creates rubrics for an assignment through questionnaires which students use to review other students' submissions. The author of the submission is given an opportunity to provide feedback about these reviews. Expertiza displays reviews (i) to the team who was reviewed, and (ii) to the reviewer. A student user can see all the reviews of his/her team’s project. The instructor can see all the reviews of everyone’s project. The instructor also has access to a Review report, which shows, for each reviewer, all the reviews that (s)he wrote. Both score report and review report use different code so UI is non-orthogonal, it would be great if we can follow same UI structure for both score and review report which also reduce the DRY problems. There is no functionality for user to search between reviews of particular project, such a functionality will help user to search through all reviews for specific problem they are trying to focus on.

Task Description

The project requires completion of the following tasks:

Task-1 (Update review report view in Instructor's view)

  • A single way of displaying reviews that would be visible to students (reviews that they did, and reviews that their team received), and instructors (reviews that each team received, sorted by team; and reviews that each student did, sorted by student)


For student view the UI is consistent in displaying reviews they have done and reviews they have received but for instructor's view the review report follows different UI and have different code. To make the UI consistent we have decided to choose the UI design of student view as the base and modify the UI design for review report in instructor's view. This will allow us to use the same code in both views, thereby following DRY principle.

Previous View:

Updated View:

Implementation:

Review report view is rendered in app/views/popup/team_users_popup.html.haml. In this view, we populate table by iterating over each question under each round. While same approach was used previously but here we replace each row by a predefined format used for rendering question similar to student view.

 %table{:border => "1px solid #ccc"}
        %tr
          %th{:align => "left", :width => "50%"} Question
          %th{:width => "5%"} Score
          %th{:width => "45%"} Comments
        - instance_variable_get('@scores_round_' + round.to_s).each do |s|
          %tr
            %td{:align => "left"}
              = Question.find(s.question_id).txt
            - if Question.find(s.question_id).is_a?(ScoredQuestion)
              %td{:align => "center"}
                = s.answer
                \/#{instance_variable_get('@max_score_round_' + round.to_s)}
            - else
              %td{:align => "center"}
                = s.answer
            %td{:align => "left"}
              = s.comments
        %tr
          %th Reviewer Score (Σ weighted score/Σ weighted available score)
          %td{:align => "center"}
            = instance_variable_get('@sum_round_' + round.to_s)
            \/#{instance_variable_get('@total_possible_round_' + round.to_s)}
          %td{:align => "left"}
            \= #{instance_variable_get('@total_percentage_round_' + round.to_s)}
      %table

We replace the above code by code below, here in each row we invoke view_completed_question method defined in Criterion.rb for scored questions which insert the html code to render question,score,comments.

      %table{:border => "1px solid #ccc" ,:class => "table table-bordered"}
        - counter = 0
        - instance_variable_get('@scores_round_' + round.to_s).each do |s|
          - counter += 1
          - row_class = counter.even? ? "info" : "warning"
          - question = Question.find(s.question_id)
          %tr{:class => row_class}
            %td
              = question.becomes(Criterion).view_completed_question(counter,s,instance_variable_get('@max_score_round_' + round.to_s))
        %tr
          %td{:style => "font-weight:bold"}
            = 'Reviewer Score (Σ weighted score/Σ weighted available score) = '+ instance_variable_get('@sum_round_' + round.to_s).to_s |
            \/ #{instance_variable_get('@total_possible_round_' + round.to_s)} (#{instance_variable_get('@total_percentage_round_' + round.to_s)}%)
      %table

Task-2 (Button to show/hide all the reviews)

  • Add button/link to hide and expand all the reviews for a Round.

In student view,for a particular assignment, the UI has show review button for each review in a round. Adding a single button will help student view all the review of a round with single click.

Previous View:


Updated View:


Implementation:

Review view is rendered in app/views/grades/_reviews.html.erb. In this view, we added show all reviews and hide all reviews buttons which when clicked call toggleAllElement function and displays all the reviews of a round.


        <a href="#" name=<%="roundshow_" + round.to_s + "Link" %> onClick="toggleAllElement('<%= str %>','show');return false;">show all reviews</a>
        <a href="#" name=<%="roundhide_" + round.to_s + "Link" %> onClick="toggleAllElement('<%= str %>','hide');return false;">hide all reviews</a>

We added toggleAllElemnet function in app/assets/javascripts/tableactions.js which toggles all the review of a round using existing toggleElement function.

function toggleAllElement(elementIdList, mode=''){
    console.log(elementIdList)
    var res = elementIdList.split(",");
    var childText = 'review';

    for (var y = 0; y < res.length - 1; y++) {
        toggleElement(res[y], childText, mode);
    }
}

Task-3(Create a tabbed view for stats, reviews and heatmap)

  • Create a tabbed view for each review view type : Statistic, Reviews and Alternate Views tabs.

Initially I weighed using TabsOnRails or Tabulous gems to create the tabs for this project but after doing some research these gems did not allow me to create tabs dynamically so Jquery UI was used to create the tabs. This was a plus since we did not need to install a new gem to the project. The review report will need to be modified to have the addition of the Statistic, Reviews and Alternate Views tabs at the top of the page. It will default to the Statistics tab which should look something like:

And the Reviews tab should produce a view like:

The Alternate View tab should produce a view like:

Task 3 Implementation

To create the tabs on the view_my_scores view we used the following Jquery code:

<div id="tabs">
  <ul>
    <li><a href="#tabs-1">Stats</a></li>
    <li><a href="#tabs-2">Reviews</a></li>
    <li><a href="#tabs-3">Alternate View</a></li>
  </ul>
  <div id="tabs-1">
    <TABLE class="grades" >
      <%= render :partial => 'grades/participant_charts', :locals => {:prefix => nil} %>
      <%= render :partial => 'grades/participant_title', :locals => {:prefix => nil} %>
      <%= render :partial => 'grades/participant', :locals => {:prefix => 'user',
                                                               :team => false,
                                                               :participant_id => ptid = @participant.id,
                                                               :index => 0,
                                                               :team_size => 1,
                                                               :pscore => @pscore} %>

    </TABLE>
    <% case @assignment.reputation_algorithm %>
    <% when 'Hamer' %>
        <h3>Reputation</h3>
        <p id = "reputation_score" class = <%= get_css_style_for_hamer_reputation(@participant.Hamer)%> style = "width:60px;"><%= @participant.Hamer %></p>
    <% when 'Lauw' %>
        <h3>Reputation</h3>
        <p id = "reputation_score" class = <%= get_css_style_for_lauw_reputation(@participant.Lauw)%> style = "width:60px;"><%= @participant.Lauw %></p>
    <%end%>
  </div>
  <div id="tabs-2">
    <TABLE>
      <TR>
        <TD COLSPAN="10"><%= render :partial=>'grades/reviews', :locals => {:prefix => 'user', :participant => @pscore[:participant], :rscore => @pscore[:review]} %></TD>
      </TR>
    </TABLE>
  </div>
  <div id="tabs-3">
    <%= render "view_team", :id => params[:id] %>
  </div>
</div>

<script>
    $(function() {
        $( "#tabs" ).tabs();
    });
</script>

The Stats tab was easy since we just took what was already in that view and moved it to only be displayed under the first tab.

The Review tab was created by pulling up the rendering of the review partial out of the participant partial. This just needed to point the local variables to variables that were in this View.

The Alternate View tab was a bit tricky since it was it's on view (view_team). So what was done was creating a partial named _view_team and moving all of the code that was in that view the partial and rendering the partial in the view_team view. This allowed us to access this view from the view_team and view_my_score views simultaneously while using the same code base.

We were going to add the sub tabs for the Reviewers but after implementing the "show all reviews" buttons those tabs became tricky and the page got really cluttered. So we decided that we could just keep the existing scores Review layout with the changes of toggling whether to hide or show the reviews.

Task 3 Testing

To test this feature go to the view_my_scores page for the student where you should see the 3 tabs. Make sure that each tab gives you a similar view as described above.

Task-4(Buttons to toggle questions/score/answers)

  • Make review feedback more readable by changing UI or background color.
  • Option to toggle review question or score or answers.

This task is to make feedback response more readable or more focused for user to read. Instructor suggested this can be done by graying out the question or we can change the background of the response text. The existing review also has this behavior. We added toggle button to show/hide questions/score/answers for a review based on instructor suggestion.

Previous View:


Update View:


Implementation:

The implementation of this functionality is similar to Task 2. A review is rendered in app/models/response.rb. We added toggle questions, toggle score and toggle answers button in a review view, which when clicked calls toggleAllElement function in app/assets/javascripts/tableactions.js that toggles respective view.

code+='<br><a href="#" name= "question_' + str + 'Link" onClick="toggleAllElement(' + "'" + str_ques + "','review'" + ');return false;">toggle questions</a>'
    code+='   <a href="#" name= "score_' + str + 'Link" onClick="toggleAllElement(' + "'" + str_score + "','review'" + ');return false;">toggle scores</a>'
    code+='   <a href="#" name= "answer_' + str + 'Link" onClick="toggleAllElement(' + "'" + str_answer + "','review'" + ');return false;">toggle answers</a>'

Task-5 (Change view in response controller, when clicked on review link)

When scores are view in alternate view(Heat map) it displays score received for each review in tabular format when we click on any review hyperlink it invokes view method of response controller which render unnecessary elements like submission content, upload file button,etc along with review and feedback, instead it should just show review and feedback. So we created a new view to implement this functionality and removed other unrequired elements.

Files updated:

 app/controllers/response_controller.rb
 app/views/grades/_view_team.html.erb
 app/views/response/view_review.html.erb
 config/routes.rb

We have selected the unrequired element in below mockup image.

UI TEST
  • Log-in as student.
  • Go to particular assignment
  • Select alternative view
  • Click on any review hyperlink, to see reviews.

Task-6 (Optional if Task 2 is complete)

  • Add search box to search between reviews for particular string for a specific project(Student's view) or for specific user(Instructor's view).

This functionality will help user to readily access the required content within the reviews.
Below is the mock-up image of how functionality will look after implementations

UI Testing

  • To Test UI for student View
    • Log-in as Student.
    • Go to Assignment
    • Click Your scores
    • Click show reviews
  • To Test UI for instructor View
    • Log-in as Instructor.
    • Go to Manage Assignments
    • Click on review report of a particular assignment
    • Click on any item in team reviewed tab, to see reviews.

Future Improvements

References

<references/>