CSC/ECE 517 Fall 2015 E1579 Instructor account creation over the web: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
 
(29 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==  '''Introduction''' ==
==  '''Introduction to Expertiza''' ==


Introduction to Expertiza:


Expertiza is a project developed using Ruby on Rails. It provides features like peer review, team assignments and submission of projects. This can be achieved by submitting code base, URL of hosted code on remote server and Wiki submissions. It is an open source application and the code can be cloned from GitHub. This application provides an efficient way to manage assignments, grades and reviews. This makes the process easier and faster when the class strength is large.
Expertiza[https://expertiza.ncsu.edu/wiki/] is a project developed using Ruby on Rails[https://en.wikipedia.org/wiki/Ruby_on_Rails]. It provides features like peer review, team assignments and submission of projects. This can be achieved by submitting code base, URL of hosted code on remote server and Wiki submissions. It is an open source application and the code can be cloned from GitHub[https://en.wikipedia.org/wiki/GitHub]. This application provides an efficient way to manage assignments, grades and reviews. This makes the process easier and faster when the class strength is large.


== '''Purpose''' ==
== '''Purpose''' ==


The purpose of this project is to allow new users to access the system and experiment with all the features of Expertiza and make a “Demo like” feel for the new user where the user can experiment with it.  This project adds  a new feature of Instructor Creation over the web which is completely different from the previous way the user and instructor accounts were created by existing super administrators, instructors or TAs. Code will be restructured to convey readability, handle exceptions.
The purpose of this project is to allow new users to access the system and experiment with all the features of Expertiza and make a “Demo like” feel for the new user where the user can experiment with it.  This project adds  a new feature of Instructor Creation over the web which is completely different from the previous way the user and instructor accounts were created by existing super administrators. Code will be restructured to convey readability, handle exceptions.
   
   
== '''Scope''' ==
== '''Scope''' ==


The scope of this project will involve adding a new View/Page that would input all the new user(Instructor) Details which would be a signup page.The signup page will be designed in a way which would have security feature as Captchas embedded into it.  There would be another new View/Page created that would act as the landing page for the newly created Demo_instructor  which would contain specific instructions/ Video on how to add assignments, add students to the assignments. Also an email is sent soon after a successful creation of such user. The project also deals with providing limited access to all the features, which could be extended manually by a super admin.The code will also be tested well to ensure the robustness of newly added functionality without compromising the existing working functionalities.
The scope of this project will involve adding a new View/Page that would input all the new user(Instructor) Details which would be a signup page.The signup page will be designed in a way which would have security feature as Captchas embedded into it.  There would be another new View/Page created that would act as the landing page for the newly created Demo_instructor  which would contain specific instructions/ Video on how to add assignments, add students to the assignments. Also an email is sent soon after a successful creation of such user. The project also deals with providing no access to the public features, which could be extended manually by a super admin.The code will also be tested well to ensure the robustness of newly added functionality without compromising the existing working functionalities.


=='''Implementation'''==
=='''Implementation'''==


==== What needs to be done ====
==== Project outcomes ====
*Create a new role by SuperAdmin
**Fixed the drop-down menu for Based on roles option while creating a new.
**Fixed add new permissions for a role functionality.


*Allow people to request instructor accounts over the web.  
*Allow people to request instructor accounts over the web.  
**Add a Link in Main Screen “Instructor Account request”.
**Added a Link in Main Screen “Demo Instructor signup”.
**Create a New Page where the User Fills the details wrt to a new Instructor Privileged access.
**Created a New Page where the User Fills the details wrt to a new Instructor Privileged access.
**Include Captcha Functionality and other necessary features for a secure Sign Up.
**Included Captcha Functionality and other necessary features for a secure Sign Up.
**Fixed role permission deletion functionality.


*Upon Successful Creation of Instructor Account.
*Upon Successful Creation of Instructor Account.
**Redirect the New Instructor back to the Login Page.
**Redirect the New Instructor back to the Login Page.
**Send an email to the super Admin notifying him of a new Instructor that has been created over the web
**Send an email to the super Admin notifying him of a new Instructor that has been created over the web
**Send an email to new user with username and new password details.


*Upon Successful Login of the New Instructor
*Upon Successful Login of the New Instructor
**Redirect the User to a New Landing Page/Instruction Page which gives information on how to create an assignments and register students for it and other basic information needed. Basically a Placeholder page that can be used for providing information.
**Redirect the User to a Instruction Page which gives information on how to create an assignments and register students for it and other basic information needed. Basically a instructions page that can be used for providing information.
**Provide a Button that would redirect him to the main Expertiza page.
**Provided a Button (Proceed) that would redirect him to the main Expertiza page.
**Make sure that he does not see any Public entities( assignments, Courses) created by any other TA's, Admins or Super Admins.
**Made sure that he does not see any Public entities( assignments, Courses) created by any other TA's, Admins or Super Admins.
**Should have a general access to Expertiza and should be able to perform basic actions like adding a course, adding an assignment and assigning students for the created assignments.
**Demo user has a general access to Expertiza and should be able to perform basic actions like adding a course, adding an assignment & assigning students for the created assignments.


==== Files to be changed ====
==== Files to be changed ====
The following are some of the files that will be changed for the implementation to work.
*role.rb
*tree_display_controller.rb
*auth_controller.rb
*auth/_login.html.erb


''Users Controller''
==== Files Added ====
*demo_controller.rb
*tree_display_demo.jsx
*tree_display/list_for_demo.html.erb
*tree_display_demo.scss
*demo_controller_spec.rb
*demo_controller/instructions_page.html.erb


''login.html.erb''
====Future scope for improvements====
*The save functionality after editing an assignment throws an error which needs to be checked upon.  


''List Controller''
'''The demo_controller is created to support the main functionalities'''


We will be adding a new attribute Demo_instructor to the Roles Table for implementing the new change.
  def action_allowed?
    true
  end
 
  def new
    @demo_role = Role.find_by_name("demo_instructor")
    if @demo_role
        @user = User.new
          @demo_role_id = @demo_role.id
    else
      flash[:error] = "Demo Instructor Role not yet created"
      redirect_to '/'
    end
  end
 
  def instruction_page
  end
 
  def proceed
    redirect_to :controller => 'tree_display', :action => 'list'
  end
 
  def create
    if simple_captcha_valid?
      check = User.find_by_name(params[:user][:name])
        if check != nil
        params[:user][:name] = params[:user][:email]
        end
      @user = User.new(user_params)
        if @user.save
        password = @user.reset_password        # the password is reset
        MailerHelper::send_mail_to_user(@user, "Your Expertiza account and password have been created", "user_welcome", password).deliver
        flash[:success] = "A new password has been sent to new user's e-mail address."
        redirect_to '/'
      else
        flash[:error] = "Please check on the credentials again and re enter."
        render :action => 'new'
      end
    else
      flash[:error] = "Please ENTER the correct CAPTCHA code"
      render :action => 'new'
    end
  end
 
  def show
  end
 
  def user_params
    params.require(:user).permit(:name, :crypted_password, :role_id, :password_salt, :fullname, :email, :parent_id, :private_by_default,
:mru_directory_path, :email_on_review, :email_on_submission, :email_on_review_of_review, :is_new_user, :master_permission_granted, :handle, :leaderboard_privacy, :digital_certificate, :persistence_token, :timezonepref, :public_key, :copy_of_emails,:institutions_id)
  end
'''Refactored code in tree_display_controller'''
   
  if ['Super-Administrator', 'Administrator','Instructor','Teaching Assistant'].include? current_role_name
      res[nodeType] << tmpObject
    elsif node.get_instructor_id===session[:user].id
      res[nodeType] << tmpObject
  end
 
<br>
 
'''For the creation of Demo Instructor experimenting with the features of expertiza
'''
<br>
 
In the controller admin_controller.rb, the new actions to be added and their purpose is explained below.
 
Action added: create_demo_instructor role<br>
Purpose: create role for the demo_instructor by super administrator
 
Action added: new_demo_instructor signup <br>
Purpose: Linked to the Signup form for creating an instructor to allow the experimenting with expertiza features
 
Action added: Display instructions page for demo user<br>
Purpose: Show case all the instructions for a new instructor.
 
Action added : remove_demo_instructor<br>
Purpose: For the super administrator to remove the instructor
 
The corresponding views for the new_demo_instructor, list_demo_instructors, remove_demo_instructor are added manually.
<br>
 
'''Upon Demo Instructor Login into the account created
'''
<br>
In the tree_display_controller.rb, goto_instructions action is added and instructions.html.erb view is created for this action. instructions.html.erb contains the instructions required for the creation of courses, assignments, adding participants to assignments, etc.


== '''Requirements''' ==
== '''Requirements''' ==
Line 47: Line 146:
The main objective for the project is to add the new signup functionality for the new User and also to clarify and improve code quality.  Although specific implementation details will change through this process, the functionality of the system will remain intact.  The overall requirements to the system will therefore not change. We need to make sure that the new demo instructor will not be able to see all the public entities of other instructors, TA's. need to implement and change all the necessary files to make sure unnecessary items are not showcased to the demo instructor.
The main objective for the project is to add the new signup functionality for the new User and also to clarify and improve code quality.  Although specific implementation details will change through this process, the functionality of the system will remain intact.  The overall requirements to the system will therefore not change. We need to make sure that the new demo instructor will not be able to see all the public entities of other instructors, TA's. need to implement and change all the necessary files to make sure unnecessary items are not showcased to the demo instructor.


== ''' Flow ''' ==
The following diagram represents the high level flow of control in the project.
[[File:Capture.PNG]]
== '''Mock Ups ''' ==
== '''Mock Ups ''' ==


The Expertiza Login page with the Instructor Account Request Link.
The role creation page by super administrator.


[[File: Homepage.PNG]]
[[File: Course.png‎]]


The PlaceHolder page will have few instructions and a Simple Video Tutorial.
The instructions page will have few instructions and a Simple Video Tutorial.


[[File: Placehlder.PNG]]
[[File: Instructions page.png]]


The home page for demo instructor excluding public entities.
The Expertiza Home page with the Demo_Instructor.


[[File: Instructor_default_page_(1).PNG]]
[[File: Role creation.png]]


== '''Use Cases''' ==
== '''Use Cases''' ==
Line 70: Line 174:


'''4.New instructor-private items''' The demo instructor can access all the private items.
'''4.New instructor-private items''' The demo instructor can access all the private items.
== '''Use case Diagram'''==
[[File:Uml_oodd.png‎ ]]
We would be writing the below test cases so as to make sure all the necessary functionalities are properly implemented and tested.
== '''Test Cases'''==
'''1.Sign-up Test Case''': We will be checking if the demo user provides all the inputs needed for proper signup along with passing the Captcha .
'''2.Landing Page Test Case''': Will be checking on if all the demo users land on the same Instruction page and if other Users like TA/SuperUser/Instructors do not land on the Instruction page.
'''3. Accessibility Test''': The Demo User should be only be able to access his only entities and not the Public entities of other users(TA/SuperUser/Instructors).
'''4. Adding Entities Test Case''': Will check if the Demo user is able to 1) create Assignments, 2) Add students to Assignments, 3)  Make Questionnaires and have access to these entities.


== ''' References ''' ==
== ''' References ''' ==
[https://expertiza.ncsu.edu/ Expertiza home page] <br>
[https://expertiza.ncsu.edu/ Expertiza home page] <br>
[[http://research.csc.ncsu.edu/efg/expertiza/papers Papers on Expertiza]
[https://en.wikipedia.org/wiki/GitHub Github Wikipedia Page]<br>
[https://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails Wikipedia Page]<br>
[http://research.csc.ncsu.edu/efg/expertiza/papers Papers on Expertiza]

Latest revision as of 20:19, 7 December 2015

Introduction to Expertiza

Expertiza[1] is a project developed using Ruby on Rails[2]. It provides features like peer review, team assignments and submission of projects. This can be achieved by submitting code base, URL of hosted code on remote server and Wiki submissions. It is an open source application and the code can be cloned from GitHub[3]. This application provides an efficient way to manage assignments, grades and reviews. This makes the process easier and faster when the class strength is large.

Purpose

The purpose of this project is to allow new users to access the system and experiment with all the features of Expertiza and make a “Demo like” feel for the new user where the user can experiment with it. This project adds a new feature of Instructor Creation over the web which is completely different from the previous way the user and instructor accounts were created by existing super administrators. Code will be restructured to convey readability, handle exceptions.

Scope

The scope of this project will involve adding a new View/Page that would input all the new user(Instructor) Details which would be a signup page.The signup page will be designed in a way which would have security feature as Captchas embedded into it. There would be another new View/Page created that would act as the landing page for the newly created Demo_instructor which would contain specific instructions/ Video on how to add assignments, add students to the assignments. Also an email is sent soon after a successful creation of such user. The project also deals with providing no access to the public features, which could be extended manually by a super admin.The code will also be tested well to ensure the robustness of newly added functionality without compromising the existing working functionalities.

Implementation

Project outcomes

  • Create a new role by SuperAdmin
    • Fixed the drop-down menu for Based on roles option while creating a new.
    • Fixed add new permissions for a role functionality.
  • Allow people to request instructor accounts over the web.
    • Added a Link in Main Screen “Demo Instructor signup”.
    • Created a New Page where the User Fills the details wrt to a new Instructor Privileged access.
    • Included Captcha Functionality and other necessary features for a secure Sign Up.
    • Fixed role permission deletion functionality.
  • Upon Successful Creation of Instructor Account.
    • Redirect the New Instructor back to the Login Page.
    • Send an email to the super Admin notifying him of a new Instructor that has been created over the web
    • Send an email to new user with username and new password details.
  • Upon Successful Login of the New Instructor
    • Redirect the User to a Instruction Page which gives information on how to create an assignments and register students for it and other basic information needed. Basically a instructions page that can be used for providing information.
    • Provided a Button (Proceed) that would redirect him to the main Expertiza page.
    • Made sure that he does not see any Public entities( assignments, Courses) created by any other TA's, Admins or Super Admins.
    • Demo user has a general access to Expertiza and should be able to perform basic actions like adding a course, adding an assignment & assigning students for the created assignments.

Files to be changed

  • role.rb
  • tree_display_controller.rb
  • auth_controller.rb
  • auth/_login.html.erb

Files Added

  • demo_controller.rb
  • tree_display_demo.jsx
  • tree_display/list_for_demo.html.erb
  • tree_display_demo.scss
  • demo_controller_spec.rb
  • demo_controller/instructions_page.html.erb

Future scope for improvements

  • The save functionality after editing an assignment throws an error which needs to be checked upon.

The demo_controller is created to support the main functionalities

 def action_allowed?
   true
 end
 def new
    @demo_role = Role.find_by_name("demo_instructor")
   if @demo_role
        @user = User.new
         @demo_role_id = @demo_role.id
   else
     flash[:error] = "Demo Instructor Role not yet created"
     redirect_to '/'
   end
 end
 def instruction_page
 end
 def proceed
   redirect_to :controller => 'tree_display', :action => 'list'
 end
 def create
   if simple_captcha_valid?
     check = User.find_by_name(params[:user][:name])
       if check != nil
       params[:user][:name] = params[:user][:email]
       end
     @user = User.new(user_params)
       if @user.save
       password = @user.reset_password         # the password is reset
       MailerHelper::send_mail_to_user(@user, "Your Expertiza account and password have been created", "user_welcome", password).deliver
       flash[:success] = "A new password has been sent to new user's e-mail address."
       redirect_to '/'
     else
       flash[:error] = "Please check on the credentials again and re enter."
       render :action => 'new'
     end
   else
     flash[:error] = "Please ENTER the correct CAPTCHA code"
     render :action => 'new'
   end
 end
 def show
 end
 def user_params
   params.require(:user).permit(:name, :crypted_password, :role_id, :password_salt, :fullname, :email, :parent_id, :private_by_default,
:mru_directory_path, :email_on_review, :email_on_submission, :email_on_review_of_review, :is_new_user, :master_permission_granted, :handle, :leaderboard_privacy, :digital_certificate, :persistence_token, :timezonepref, :public_key, :copy_of_emails,:institutions_id)
 end

Refactored code in tree_display_controller

 if ['Super-Administrator', 'Administrator','Instructor','Teaching Assistant'].include? current_role_name
      res[nodeType] << tmpObject
    elsif node.get_instructor_id===session[:user].id
      res[nodeType] << tmpObject
 end


For the creation of Demo Instructor experimenting with the features of expertiza

In the controller admin_controller.rb, the new actions to be added and their purpose is explained below.

Action added: create_demo_instructor role
Purpose: create role for the demo_instructor by super administrator

Action added: new_demo_instructor signup
Purpose: Linked to the Signup form for creating an instructor to allow the experimenting with expertiza features

Action added: Display instructions page for demo user
Purpose: Show case all the instructions for a new instructor.

Action added : remove_demo_instructor
Purpose: For the super administrator to remove the instructor

The corresponding views for the new_demo_instructor, list_demo_instructors, remove_demo_instructor are added manually.

Upon Demo Instructor Login into the account created
In the tree_display_controller.rb, goto_instructions action is added and instructions.html.erb view is created for this action. instructions.html.erb contains the instructions required for the creation of courses, assignments, adding participants to assignments, etc.

Requirements

The main objective for the project is to add the new signup functionality for the new User and also to clarify and improve code quality. Although specific implementation details will change through this process, the functionality of the system will remain intact. The overall requirements to the system will therefore not change. We need to make sure that the new demo instructor will not be able to see all the public entities of other instructors, TA's. need to implement and change all the necessary files to make sure unnecessary items are not showcased to the demo instructor.

Flow

The following diagram represents the high level flow of control in the project.

Mock Ups

The role creation page by super administrator.

The instructions page will have few instructions and a Simple Video Tutorial.

The Expertiza Home page with the Demo_Instructor.

Use Cases

1.Sign-up as new Instructor: New users can signup to view all features(except the public entities).

2.View instructions page: New instructor can view an instructions page for a walk through of the features.

3.Super-admin gives access: Super-admin gives access to all public entities for the newly created instructor.

4.New instructor-private items The demo instructor can access all the private items.

Use case Diagram


We would be writing the below test cases so as to make sure all the necessary functionalities are properly implemented and tested.

Test Cases

1.Sign-up Test Case: We will be checking if the demo user provides all the inputs needed for proper signup along with passing the Captcha .

2.Landing Page Test Case: Will be checking on if all the demo users land on the same Instruction page and if other Users like TA/SuperUser/Instructors do not land on the Instruction page.

3. Accessibility Test: The Demo User should be only be able to access his only entities and not the Public entities of other users(TA/SuperUser/Instructors).

4. Adding Entities Test Case: Will check if the Demo user is able to 1) create Assignments, 2) Add students to Assignments, 3) Make Questionnaires and have access to these entities.

References

Expertiza home page
Github Wikipedia Page
Ruby on Rails Wikipedia Page
Papers on Expertiza