CSC/ECE 517 Fall 2019 - E1991. Improvements to anonymized view: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 77: Line 77:
   end
   end
</code>
</code>
In the above snippet, we have omitted the irrelevant parts of code. The only change we need to do is the logic for <code>User.find_by()</code> function. We will add a condition to check whether the current view is anonymized or not. If anonymized mode is set, we will convert the anonymous name back to the original name of the student.


=== ''' User Flowchart/Design ''' ===
=== ''' User Flowchart/Design ''' ===

Revision as of 01:40, 12 November 2019

Introduction

The Expertiza project takes advantage of peer-review among students to allow them to learn from each other. Tracking the time that a student spends on each submitted resources is meaningful to instructors to study and improve the teaching experience. Unfortunately, most peer assessment systems do not manage the content of students’ submission within the systems. They usually allow the authors to submit external links to the submission (e.g. GitHub code / deployed application), which makes it difficult for the system to track the time that the reviewers spend on the submissions.


Problem Statement

The main idea of this exercise is to improve anonymized view in Expertiza. The feature is already implemented. However, there are issues / limitations with the current implementation which we will try to improve as a part of this project.

Anonymized View For Students

Currently, anonymized view is not implemented for students. Although, not directly required by students, instructors may want to use anonymized view when impersonating a student.

Issue with Impersonating Anonymized Student

In an anonymized view, instructors cannot impersonate a student because the username field has the anonymized name instead of their real name in the database. In order to be able to impersonate a student, we need to know their real names from database.

Wrong Anonymized Names

In some places, anonymized names are not shown. For example, heatgrid view.

Anonymizing Team Names

Currently, team names are not anonymized.

Optional Objective

Use randomized American names for anonymized users.

Proposed Solution

In this section, we propose solutions to the problems / issues discussed above.

Anonymized View For Students

Instructors often use 'impersonate' functionality to use Expertiza as a different user. Sometimes they also need to use anonymized view while they are impersonating a student. Therefore, anonymized view needs to be extended to students as well.

In order to extend Anonymized view for students, the first thing we need to do is extend the following function :

 def set_anonymized_view
   anonymized_view_starter_ips = $redis.get('anonymized_view_starter_ips') || 
   session[:ip] = request.remote_ip
   if anonymized_view_starter_ips.include? session[:ip]
     anonymized_view_starter_ips.delete!(" #{session[:ip]}")
   else
     anonymized_view_starter_ips += " #{session[:ip]}"
   end
   $redis.set('anonymized_view_starter_ips', anonymized_view_starter_ips)
   redirect_to :back
 end

This function is responsible to switch back and forth between normal view and an anonymized view. We could figure out that the session of current user is being manipulated to change views. The main driving logic works by storing user's IP address in a value field of anonymized_view_starter_ips which is in Redis database.

Impersonating Student Using Anonymized Names

When an instructor is already in Anonymized view and wants to impersonate a student, they have to quit the anonymized view and get the real username of that student. However, we want the instructor to be able to impersonate a student by using their anonymized names. The following function in impersonate_controller.rb is responsible to impersonate students.

 def impersonate
   ...
   begin
     original_user = session[:super_user] || session[:user]
     # Impersonate using form on /impersonate/start
     if params[:impersonate].nil?
       ...
       user = User.find_by(name: params[:user][:name]) 
       ...
     else
       # Impersonate a new account
       if !params[:impersonate][:name].empty?
         ...
         user = User.find_by(name: params[:impersonate][:name])          
         ...
       else
         ...
       end
     end
     ...
   rescue Exception => e
     flash[:error] = e.message
     redirect_to :back
   end
 end

In the above snippet, we have omitted the irrelevant parts of code. The only change we need to do is the logic for User.find_by() function. We will add a condition to check whether the current view is anonymized or not. If anonymized mode is set, we will convert the anonymous name back to the original name of the student.

User Flowchart/Design

At this stage, we are not able to figure out the flow of the application completely. We do not intend come up with a mediocre design based on wrong assumptions.

Test Plan

Team Information

  1. Shubham Dilip Pampattiwar (sdpampat)
  2. Pranav Maruti Gaikwad (pmgaikwa)
  3. Omkar Sunil Kulkarni (oskulkar)
  4. Deepayan Bardhan (dbardha)

Mentor: Sharique Khan (mkhan8)
Professor: Dr. Edward F. Gehringer (efg)

References

  1. Expertiza on GitHub