<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pagrawa2</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pagrawa2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Pagrawa2"/>
	<updated>2026-05-31T13:20:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Timeline.png&amp;diff=106676</id>
		<title>File:Timeline.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Timeline.png&amp;diff=106676"/>
		<updated>2016-12-07T19:57:12Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: uploaded a new version of &amp;amp;quot;File:Timeline.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106671</id>
		<title>CSC/ECE 517 Fall 2016/E1686-Timestamps for students' submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106671"/>
		<updated>2016-12-07T19:51:03Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Files Added/Modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
In this project, We will keep track of timestamp records for students' submissions and updates of artifacts (links to google doc/wikipedia/github), reviewers' submissions and edits of peer-reviews and author feedbacks.We will also create a timeline view for each artifact, showing when it was submitted/resubmitted and when it was reviewed. With our work, users (students and instructors) can see:&lt;br /&gt;
* when do the authors submit and update their artifacts.&lt;br /&gt;
* when do reviewers submit peer-reviews.&lt;br /&gt;
* when do reviewees send author feedback.&lt;br /&gt;
* when do reviewers update their peer reviews.&lt;br /&gt;
== Approach ==&lt;br /&gt;
[[File:appraoch.JPG|center]]&lt;br /&gt;
From a perspective (both instructors and students), users should be able to see such a timeline with all the events for each submission of an assignment. The events can be - &lt;br /&gt;
*add/edit events of various submission links/files&lt;br /&gt;
*Reviews&lt;br /&gt;
*author feedbacks&lt;br /&gt;
*peer reviews&lt;br /&gt;
Each of these artifacts can be edited and updated multiple times. Because we want to track when these artifacts are updated, we have to store their information in the database. We use the table suggested in the problem description “submission_histories”- &lt;br /&gt;
*Id :: integer- primary key for this table. &lt;br /&gt;
*team_id :: integer ← foreign key to the teams table&lt;br /&gt;
*submitted_detail :: string ← details of the event. This can be one of x values.&lt;br /&gt;
**Link  - if it is a assignment submission link. This can further be of 4 types - &lt;br /&gt;
**Google Docs&lt;br /&gt;
**Wikipedia&lt;br /&gt;
**Github repository &lt;br /&gt;
**Any other web link&lt;br /&gt;
*Review ids - if the event is a review submission&lt;br /&gt;
*Author feedback id - if the event is an add or edit operation on author feedback.&lt;br /&gt;
*Peer review id - if the event is an add or edit operation on peer review.&lt;br /&gt;
*Submitted_at  :: datetime ← to store the timestamp of the event&lt;br /&gt;
*Type :: string ← field which distinguish between different types of events - to be used for polymorphism.&lt;br /&gt;
*Action :: string - add / edit / delete based on the event.&lt;br /&gt;
These are the common components under which each component in the timeline can be classified. Each of these components are explained in detail on how it fits into the timeline and its significance and types listed. &lt;br /&gt;
&lt;br /&gt;
'''Data stored in submission_histories table'''&lt;br /&gt;
*Google Document, Wikipedia article, Github repository url : All of these are types of links given by the team during their submission. Through the url, we will identify which type of a submission is this, and then create an object of the particular class using the factory pattern. Each of these classes will implement their own “getLastUpdatedTimestamp” method, using the suggested APIs, through which we can get the required timestamp.&lt;br /&gt;
*File path and any other web link - These are also a part of main submissions, but since there is no way of tracking changes to these artifacts, we just take the time of the system when the link is added or removed.&lt;br /&gt;
*Peer Reviews, Author feedback: Peer reviews and author feedbacks are updated into the submission history table for every edit that takes place. The “updated_at” field acts as the current timestamp for edits in the Peer Reviews and Author feedbacks and the “created_at” field marks the start of these Events.&lt;br /&gt;
'''Data retrieved from existing tables'''&lt;br /&gt;
*Reviews: Timestamp for assignment reviews are taken from “responses” and “response_maps” table. The responses table contains round field and when “is_submitted” flag is true, the submission appears on the reviewee timeline where the “reviewee_id” retrieved from response_maps table. The reviews attached to the respective reviewee are collected and updated_at field gives the submission timestamp which is used on the timeline. Each review is collected and is added to the single Event map.&lt;br /&gt;
*Timeline Parameters: Values corresponding to an assignment which are common for a given Assignment are retrieved from the assignments table. And the timeline parameters are obtained by calculating from the created_at which is the start date for the assignment and  the field rounds_of_reviews determines the deadline by adding up the value stored in days_between_submission field of the same table. The Events - Start Date, Submission Deadline and Revision Deadline and Final assignment deadline exists for each assignment.&lt;br /&gt;
All the components are then added into one single map - Event -&amp;gt; Timestamp which is sorted on timestamp values and is displayed on screen.&lt;br /&gt;
&lt;br /&gt;
== UML Diagram:==&lt;br /&gt;
[[File:Class.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
== Files Added/Modified ==&lt;br /&gt;
Models&lt;br /&gt;
* assignment&lt;br /&gt;
 require 'rufus-scheduler'&lt;br /&gt;
 after_save :record_submission&lt;br /&gt;
&lt;br /&gt;
 +private&lt;br /&gt;
 +  def record_submission&lt;br /&gt;
 +    # whenever a new assignment is added, add a job on each of its deadlines, to update the&lt;br /&gt;
 +    # timestamps of teams' submissions.&lt;br /&gt;
 +    scheduler = Rufus::Scheduler.singleton&lt;br /&gt;
 +&lt;br /&gt;
 +    self.due_dates.each do |due_date|&lt;br /&gt;
 +      if due_date.deadline_type.name == 'submission'&lt;br /&gt;
 +        scheduler.at(due_date.due_at.to_s, &amp;quot;assignment&amp;quot;=&amp;gt;self) do |job, time, arg|&lt;br /&gt;
 +          LinkSubmissionHistory.add_submission(job.opts['assignment'].id)&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
* files_submission_history&lt;br /&gt;
 +class FileSubmissionHistory &amp;lt; SubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = FileSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_pull_request_submission_history&lt;br /&gt;
 +class GithubPullRequestSubmissionHistory &amp;lt; GithubSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    link_path = uri.path&lt;br /&gt;
 +    git_user_details = link_path.split(&amp;quot;/&amp;quot;)&lt;br /&gt;
 +    github = Github.new&lt;br /&gt;
 +    a = github.pulls.get git_user_details[1], git_user_details[2], git_user_details[4]&lt;br /&gt;
 +    return a.updated_at&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_repo_submission_history&lt;br /&gt;
 +class GithubRepoSubmissionHistory &amp;lt; GithubSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    link_path = uri.path&lt;br /&gt;
 +    git_user_details = link_path.split(&amp;quot;/&amp;quot;)&lt;br /&gt;
 +    github = Github.new&lt;br /&gt;
 +    a = github.repos.get git_user_details[1], git_user_details[2]&lt;br /&gt;
 +    return a.pushed_at&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_submission_history&lt;br /&gt;
 +class GithubSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    if link.include? &amp;quot;pull&amp;quot;&lt;br /&gt;
 +      history_obj = GithubPullRequestSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = GithubRepoSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* googledoc_submission_history&lt;br /&gt;
 +class GoogledocSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GoogledocSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* link_submission_history&lt;br /&gt;
 +class LinkSubmissionHistory &amp;lt; SubmissionHistory&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    # lets assume link of type http://docs.google.com  or   http://wiki.expertiza.ncsu.edu  or http://github.com/goeltanmay/&lt;br /&gt;
 +    if link.include? &amp;quot;docs.google.com&amp;quot;&lt;br /&gt;
 +      history_obj = GoogledocSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    elsif link.include? &amp;quot;wiki.expertiza.ncsu.edu&amp;quot;&lt;br /&gt;
 +      history_obj = WikipediaSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    elsif link.include? &amp;quot;github.com&amp;quot;&lt;br /&gt;
 +      history_obj = GithubSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      # some random link has been given&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.new&lt;br /&gt;
 +      history_obj.team = team&lt;br /&gt;
 +      history_obj.submitted_detail = link&lt;br /&gt;
 +      history_obj.action = action&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.add_submission(assignment_id)&lt;br /&gt;
 +    @assignment = Assignment.find_by_id(assignment_id)&lt;br /&gt;
 +    teams = @assignment.teams&lt;br /&gt;
 +    teams.each do |team|&lt;br /&gt;
 +      submitted_links = team.hyperlinks&lt;br /&gt;
 +      submitted_links.each do |link|&lt;br /&gt;
 +        submission_history = SubmissionHistory.create(team, link)&lt;br /&gt;
 +        timestamp = submission_history.get_submitted_at_time(link)&lt;br /&gt;
 +        submission_history.submitted_at = timestamp&lt;br /&gt;
 +        begin&lt;br /&gt;
 +          submission_history.save&lt;br /&gt;
 +        rescue&lt;br /&gt;
 +          @error_message = &amp;quot;No new updates&amp;quot;&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* submission_history&lt;br /&gt;
 +class SubmissionHistory &amp;lt; ActiveRecord::Base&lt;br /&gt;
 +  belongs_to :team&lt;br /&gt;
 +  validates_uniqueness_of :submitted_detail, scope: [:team_id, :submitted_at]&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.create(team, link)&lt;br /&gt;
 +    # for file, the link will be? - put this as default condition&lt;br /&gt;
 +    # determine whether this is a file or a link&lt;br /&gt;
 +    existing_submission = SubmissionHistory.where([&amp;quot;team_id = ? and submitted_detail = ?&amp;quot;, team, link])&lt;br /&gt;
 +    if existing_submission.size&amp;gt;0&lt;br /&gt;
 +      action = &amp;quot;edit&amp;quot;&lt;br /&gt;
 +    else&lt;br /&gt;
 +      action = &amp;quot;add&amp;quot;&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    if link.start_with?(&amp;quot;http&amp;quot;)&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = FileSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.delete_submission(team, link)&lt;br /&gt;
 +    # just add a delete record&lt;br /&gt;
 +    if link.start_with?(&amp;quot;http&amp;quot;)&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.create(link, team, &amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = FileSubmissionHistory.create(link, team, &amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    return Time.current&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +end&lt;br /&gt;
* wikipedia_submission_history&lt;br /&gt;
 +class WikipediaSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = WikipediaSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    wiki_title = uri.path&lt;br /&gt;
 +    wiki_title.slice! &amp;quot;/index.php/&amp;quot;&lt;br /&gt;
 +    url = URI.parse('http://wiki.expertiza.ncsu.edu/api.php?action=query&amp;amp;prop=info&amp;amp;titles='+ wiki_title +'&amp;amp;format=json')&lt;br /&gt;
 +    req = Net::HTTP::Get.new(url.to_s)&lt;br /&gt;
 +    res = Net::HTTP.start(url.host, url.port) {|http|&lt;br /&gt;
 +      http.request(req)&lt;br /&gt;
 +    }&lt;br /&gt;
 +    hash= JSON.parse res.body&lt;br /&gt;
 +    id = hash[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;].keys&lt;br /&gt;
 +    return hash[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;][id[0]][&amp;quot;touched&amp;quot;]&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
* submitted_content_controller&lt;br /&gt;
 +    #create timeline for generalized map to just loop in the html&lt;br /&gt;
 +    @timeline = Hash.new()&lt;br /&gt;
 +    #Get timeline entries from submission_histories table&lt;br /&gt;
 +    @submission_history = SubmissionHistory.where(team: @participant.team.id).order(:submitted_at)&lt;br /&gt;
 +    #reviews&lt;br /&gt;
 +    @review_maps = ResponseMap.where(reviewee_id: @participant.team.id)&lt;br /&gt;
 +    @review_maps.each do |map|&lt;br /&gt;
 +      if &amp;quot;ReviewResponseMap&amp;quot;.eql?map.type&lt;br /&gt;
 +        @response = Response.find_by(map_id: map.id)&lt;br /&gt;
 +        @timeline[@response.updated_at]={:heading =&amp;gt; map.type.chomp('ResponseMap') , :description =&amp;gt; '', :color =&amp;gt; 'green'}&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +    #feedbacks&lt;br /&gt;
 +    @feedback_maps = ResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
 +    @feedback_maps.each do |map|&lt;br /&gt;
 +      if &amp;quot;FeedbackResponseMap&amp;quot;.eql?map.type&lt;br /&gt;
 +        @response = Response.find_by(map_id: map.id)&lt;br /&gt;
 +        @timeline[@response.updated_at]={:heading =&amp;gt; map.type.chomp('ResponseMap') , :description =&amp;gt; '', :color =&amp;gt; 'info'}&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +    @submission_history.each do |submission|&lt;br /&gt;
 +      @timeline[submission.submitted_at]={:heading =&amp;gt; submission.type+' '+submission.action, :description =&amp;gt; submission.submitted_detail}&lt;br /&gt;
 +    end&lt;br /&gt;
 +    @assignment.due_dates.each do |due_date|&lt;br /&gt;
 +      @timeline[due_date.due_at]={:heading =&amp;gt; ' Due Date ', :description =&amp;gt; due_date.deadline_type.name+' deadline', :color =&amp;gt; 'danger'}&lt;br /&gt;
 +    end&lt;br /&gt;
&lt;br /&gt;
Views&lt;br /&gt;
* submitted_content/_main.html.erb&lt;br /&gt;
 + &amp;lt;%if !@timeline.nil? %&amp;gt;&lt;br /&gt;
 +      &amp;lt;%= render partial: 'submitted_content/submission_history', locals: {timeline: @timeline, origin: ''} %&amp;gt;&lt;br /&gt;
 +  &amp;lt;%end%&amp;gt;&lt;br /&gt;
 +   &lt;br /&gt;
* submitted_content/_submission_history.html.erb&lt;br /&gt;
[[File:View.JPG]]&lt;br /&gt;
[[File:Timeline.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
*Unit Testing of controllers&lt;br /&gt;
This involves unit testing of following controllers: TeamsController, because we will have to change some methods.&lt;br /&gt;
*Unit Testing of Models&lt;br /&gt;
This involves writing rspec test for all the newly created models like submission_history, google_doc_submission_history, etc. Tests for team model are already written.&lt;br /&gt;
&lt;br /&gt;
* models/github_pull_request_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubPullRequestSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github pull request was updated&amp;quot; do&lt;br /&gt;
 +      history_object = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/github_repo_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubRepoSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github repo was pushed&amp;quot; do&lt;br /&gt;
 +      history_object = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/link_submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe LinkSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;add submission&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add GithubRepoSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubRepoSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add GithubPullRequestSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubPullRequestSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add WikipediaSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(WikipediaSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe SubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;create method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should create link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://www.youtube.com/watch?v=dQw4w9WgXcQ&amp;amp;ab_channel=RickAstleyVEVO&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(LinkSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubRepoSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubPullRequestSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create wikipedia link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(WikipediaSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create google doc link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GoogledocSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create file submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(FileSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  describe &amp;quot;delete method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a link submission history with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as edit&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history.submitted_at = Time.current&lt;br /&gt;
 +      submission_history.save&lt;br /&gt;
 +&lt;br /&gt;
 +      submission_history2 = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history2.submitted_at = Time.current&lt;br /&gt;
 +      submission_history2.save&lt;br /&gt;
 +      expect(submission_history2.action).to eq(&amp;quot;edit&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/wikipedia_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe WikipediaSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a wiki page was updated&amp;quot; do&lt;br /&gt;
 +      history_object = WikipediaSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
*UI Testing&lt;br /&gt;
**Login as student/instructor.&lt;br /&gt;
**Go to Assignments Home Page.&lt;br /&gt;
**Here you will find a timeline with several tags like submission, review, resubmission, rereview. &lt;br /&gt;
**Also, There will be a tags for the authors submitting and updating their artifacts, reviewers submitting peer-reviews, reviewees sending author feedback and reviewers updating their peer reviews.&lt;br /&gt;
**As UI would be modified a lot, more testing part would be added after the implementation.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
*https://developers.google.com/drive/v3/web/quickstart/ruby&lt;br /&gt;
*https://github.com/piotrmurach/github&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Timeline.png&amp;diff=106670</id>
		<title>File:Timeline.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Timeline.png&amp;diff=106670"/>
		<updated>2016-12-07T19:49:02Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106668</id>
		<title>CSC/ECE 517 Fall 2016/E1686-Timestamps for students' submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106668"/>
		<updated>2016-12-07T19:37:04Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Files Added/Modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
In this project, We will keep track of timestamp records for students' submissions and updates of artifacts (links to google doc/wikipedia/github), reviewers' submissions and edits of peer-reviews and author feedbacks.We will also create a timeline view for each artifact, showing when it was submitted/resubmitted and when it was reviewed. With our work, users (students and instructors) can see:&lt;br /&gt;
* when do the authors submit and update their artifacts.&lt;br /&gt;
* when do reviewers submit peer-reviews.&lt;br /&gt;
* when do reviewees send author feedback.&lt;br /&gt;
* when do reviewers update their peer reviews.&lt;br /&gt;
== Approach ==&lt;br /&gt;
[[File:appraoch.JPG|center]]&lt;br /&gt;
From a perspective (both instructors and students), users should be able to see such a timeline with all the events for each submission of an assignment. The events can be - &lt;br /&gt;
*add/edit events of various submission links/files&lt;br /&gt;
*Reviews&lt;br /&gt;
*author feedbacks&lt;br /&gt;
*peer reviews&lt;br /&gt;
Each of these artifacts can be edited and updated multiple times. Because we want to track when these artifacts are updated, we have to store their information in the database. We use the table suggested in the problem description “submission_histories”- &lt;br /&gt;
*Id :: integer- primary key for this table. &lt;br /&gt;
*team_id :: integer ← foreign key to the teams table&lt;br /&gt;
*submitted_detail :: string ← details of the event. This can be one of x values.&lt;br /&gt;
**Link  - if it is a assignment submission link. This can further be of 4 types - &lt;br /&gt;
**Google Docs&lt;br /&gt;
**Wikipedia&lt;br /&gt;
**Github repository &lt;br /&gt;
**Any other web link&lt;br /&gt;
*Review ids - if the event is a review submission&lt;br /&gt;
*Author feedback id - if the event is an add or edit operation on author feedback.&lt;br /&gt;
*Peer review id - if the event is an add or edit operation on peer review.&lt;br /&gt;
*Submitted_at  :: datetime ← to store the timestamp of the event&lt;br /&gt;
*Type :: string ← field which distinguish between different types of events - to be used for polymorphism.&lt;br /&gt;
*Action :: string - add / edit / delete based on the event.&lt;br /&gt;
These are the common components under which each component in the timeline can be classified. Each of these components are explained in detail on how it fits into the timeline and its significance and types listed. &lt;br /&gt;
&lt;br /&gt;
'''Data stored in submission_histories table'''&lt;br /&gt;
*Google Document, Wikipedia article, Github repository url : All of these are types of links given by the team during their submission. Through the url, we will identify which type of a submission is this, and then create an object of the particular class using the factory pattern. Each of these classes will implement their own “getLastUpdatedTimestamp” method, using the suggested APIs, through which we can get the required timestamp.&lt;br /&gt;
*File path and any other web link - These are also a part of main submissions, but since there is no way of tracking changes to these artifacts, we just take the time of the system when the link is added or removed.&lt;br /&gt;
*Peer Reviews, Author feedback: Peer reviews and author feedbacks are updated into the submission history table for every edit that takes place. The “updated_at” field acts as the current timestamp for edits in the Peer Reviews and Author feedbacks and the “created_at” field marks the start of these Events.&lt;br /&gt;
'''Data retrieved from existing tables'''&lt;br /&gt;
*Reviews: Timestamp for assignment reviews are taken from “responses” and “response_maps” table. The responses table contains round field and when “is_submitted” flag is true, the submission appears on the reviewee timeline where the “reviewee_id” retrieved from response_maps table. The reviews attached to the respective reviewee are collected and updated_at field gives the submission timestamp which is used on the timeline. Each review is collected and is added to the single Event map.&lt;br /&gt;
*Timeline Parameters: Values corresponding to an assignment which are common for a given Assignment are retrieved from the assignments table. And the timeline parameters are obtained by calculating from the created_at which is the start date for the assignment and  the field rounds_of_reviews determines the deadline by adding up the value stored in days_between_submission field of the same table. The Events - Start Date, Submission Deadline and Revision Deadline and Final assignment deadline exists for each assignment.&lt;br /&gt;
All the components are then added into one single map - Event -&amp;gt; Timestamp which is sorted on timestamp values and is displayed on screen.&lt;br /&gt;
&lt;br /&gt;
== UML Diagram:==&lt;br /&gt;
[[File:Class.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
== Files Added/Modified ==&lt;br /&gt;
Models&lt;br /&gt;
* assignment&lt;br /&gt;
 require 'rufus-scheduler'&lt;br /&gt;
 after_save :record_submission&lt;br /&gt;
&lt;br /&gt;
 +private&lt;br /&gt;
 +  def record_submission&lt;br /&gt;
 +    # whenever a new assignment is added, add a job on each of its deadlines, to update the&lt;br /&gt;
 +    # timestamps of teams' submissions.&lt;br /&gt;
 +    scheduler = Rufus::Scheduler.singleton&lt;br /&gt;
 +&lt;br /&gt;
 +    self.due_dates.each do |due_date|&lt;br /&gt;
 +      if due_date.deadline_type.name == 'submission'&lt;br /&gt;
 +        scheduler.at(due_date.due_at.to_s, &amp;quot;assignment&amp;quot;=&amp;gt;self) do |job, time, arg|&lt;br /&gt;
 +          LinkSubmissionHistory.add_submission(job.opts['assignment'].id)&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
* files_submission_history&lt;br /&gt;
 +class FileSubmissionHistory &amp;lt; SubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = FileSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_pull_request_submission_history&lt;br /&gt;
 +class GithubPullRequestSubmissionHistory &amp;lt; GithubSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    link_path = uri.path&lt;br /&gt;
 +    git_user_details = link_path.split(&amp;quot;/&amp;quot;)&lt;br /&gt;
 +    github = Github.new&lt;br /&gt;
 +    a = github.pulls.get git_user_details[1], git_user_details[2], git_user_details[4]&lt;br /&gt;
 +    return a.updated_at&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_repo_submission_history&lt;br /&gt;
 +class GithubRepoSubmissionHistory &amp;lt; GithubSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    link_path = uri.path&lt;br /&gt;
 +    git_user_details = link_path.split(&amp;quot;/&amp;quot;)&lt;br /&gt;
 +    github = Github.new&lt;br /&gt;
 +    a = github.repos.get git_user_details[1], git_user_details[2]&lt;br /&gt;
 +    return a.pushed_at&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_submission_history&lt;br /&gt;
 +class GithubSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    if link.include? &amp;quot;pull&amp;quot;&lt;br /&gt;
 +      history_obj = GithubPullRequestSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = GithubRepoSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* googledoc_submission_history&lt;br /&gt;
 +class GoogledocSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GoogledocSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* link_submission_history&lt;br /&gt;
 +class LinkSubmissionHistory &amp;lt; SubmissionHistory&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    # lets assume link of type http://docs.google.com  or   http://wiki.expertiza.ncsu.edu  or http://github.com/goeltanmay/&lt;br /&gt;
 +    if link.include? &amp;quot;docs.google.com&amp;quot;&lt;br /&gt;
 +      history_obj = GoogledocSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    elsif link.include? &amp;quot;wiki.expertiza.ncsu.edu&amp;quot;&lt;br /&gt;
 +      history_obj = WikipediaSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    elsif link.include? &amp;quot;github.com&amp;quot;&lt;br /&gt;
 +      history_obj = GithubSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      # some random link has been given&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.new&lt;br /&gt;
 +      history_obj.team = team&lt;br /&gt;
 +      history_obj.submitted_detail = link&lt;br /&gt;
 +      history_obj.action = action&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.add_submission(assignment_id)&lt;br /&gt;
 +    @assignment = Assignment.find_by_id(assignment_id)&lt;br /&gt;
 +    teams = @assignment.teams&lt;br /&gt;
 +    teams.each do |team|&lt;br /&gt;
 +      submitted_links = team.hyperlinks&lt;br /&gt;
 +      submitted_links.each do |link|&lt;br /&gt;
 +        submission_history = SubmissionHistory.create(team, link)&lt;br /&gt;
 +        timestamp = submission_history.get_submitted_at_time(link)&lt;br /&gt;
 +        submission_history.submitted_at = timestamp&lt;br /&gt;
 +        begin&lt;br /&gt;
 +          submission_history.save&lt;br /&gt;
 +        rescue&lt;br /&gt;
 +          @error_message = &amp;quot;No new updates&amp;quot;&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* submission_history&lt;br /&gt;
 +class SubmissionHistory &amp;lt; ActiveRecord::Base&lt;br /&gt;
 +  belongs_to :team&lt;br /&gt;
 +  validates_uniqueness_of :submitted_detail, scope: [:team_id, :submitted_at]&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.create(team, link)&lt;br /&gt;
 +    # for file, the link will be? - put this as default condition&lt;br /&gt;
 +    # determine whether this is a file or a link&lt;br /&gt;
 +    existing_submission = SubmissionHistory.where([&amp;quot;team_id = ? and submitted_detail = ?&amp;quot;, team, link])&lt;br /&gt;
 +    if existing_submission.size&amp;gt;0&lt;br /&gt;
 +      action = &amp;quot;edit&amp;quot;&lt;br /&gt;
 +    else&lt;br /&gt;
 +      action = &amp;quot;add&amp;quot;&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    if link.start_with?(&amp;quot;http&amp;quot;)&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = FileSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.delete_submission(team, link)&lt;br /&gt;
 +    # just add a delete record&lt;br /&gt;
 +    if link.start_with?(&amp;quot;http&amp;quot;)&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.create(link, team, &amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = FileSubmissionHistory.create(link, team, &amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    return Time.current&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +end&lt;br /&gt;
* wikipedia_submission_history&lt;br /&gt;
 +class WikipediaSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = WikipediaSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    wiki_title = uri.path&lt;br /&gt;
 +    wiki_title.slice! &amp;quot;/index.php/&amp;quot;&lt;br /&gt;
 +    url = URI.parse('http://wiki.expertiza.ncsu.edu/api.php?action=query&amp;amp;prop=info&amp;amp;titles='+ wiki_title +'&amp;amp;format=json')&lt;br /&gt;
 +    req = Net::HTTP::Get.new(url.to_s)&lt;br /&gt;
 +    res = Net::HTTP.start(url.host, url.port) {|http|&lt;br /&gt;
 +      http.request(req)&lt;br /&gt;
 +    }&lt;br /&gt;
 +    hash= JSON.parse res.body&lt;br /&gt;
 +    id = hash[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;].keys&lt;br /&gt;
 +    return hash[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;][id[0]][&amp;quot;touched&amp;quot;]&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
* submitted_content_controller&lt;br /&gt;
 +    #create timeline for generalized map to just loop in the html&lt;br /&gt;
 +    @timeline = Hash.new()&lt;br /&gt;
 +    #Get timeline entries from submission_histories table&lt;br /&gt;
 +    @submission_history = SubmissionHistory.where(team: @participant.team.id).order(:submitted_at)&lt;br /&gt;
 +    #reviews&lt;br /&gt;
 +    @review_maps = ResponseMap.where(reviewee_id: @participant.team.id)&lt;br /&gt;
 +    @review_maps.each do |map|&lt;br /&gt;
 +      if &amp;quot;ReviewResponseMap&amp;quot;.eql?map.type&lt;br /&gt;
 +        @response = Response.find_by(map_id: map.id)&lt;br /&gt;
 +        @timeline[@response.updated_at]={:heading =&amp;gt; map.type.chomp('ResponseMap') , :description =&amp;gt; '', :color =&amp;gt; 'green'}&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +    #feedbacks&lt;br /&gt;
 +    @feedback_maps = ResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
 +    @feedback_maps.each do |map|&lt;br /&gt;
 +      if &amp;quot;FeedbackResponseMap&amp;quot;.eql?map.type&lt;br /&gt;
 +        @response = Response.find_by(map_id: map.id)&lt;br /&gt;
 +        @timeline[@response.updated_at]={:heading =&amp;gt; map.type.chomp('ResponseMap') , :description =&amp;gt; '', :color =&amp;gt; 'info'}&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +    @submission_history.each do |submission|&lt;br /&gt;
 +      @timeline[submission.submitted_at]={:heading =&amp;gt; submission.type+' '+submission.action, :description =&amp;gt; submission.submitted_detail}&lt;br /&gt;
 +    end&lt;br /&gt;
 +    @assignment.due_dates.each do |due_date|&lt;br /&gt;
 +      @timeline[due_date.due_at]={:heading =&amp;gt; ' Due Date ', :description =&amp;gt; due_date.deadline_type.name+' deadline', :color =&amp;gt; 'danger'}&lt;br /&gt;
 +    end&lt;br /&gt;
&lt;br /&gt;
Views&lt;br /&gt;
* submitted_content/_main.html.erb&lt;br /&gt;
 + &amp;lt;%if !@timeline.nil? %&amp;gt;&lt;br /&gt;
 +      &amp;lt;%= render partial: 'submitted_content/submission_history', locals: {timeline: @timeline, origin: ''} %&amp;gt;&lt;br /&gt;
 +  &amp;lt;%end%&amp;gt;&lt;br /&gt;
 +   &lt;br /&gt;
* submitted_content/_submission_history.html.erb&lt;br /&gt;
[[File:View.JPG]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
*Unit Testing of controllers&lt;br /&gt;
This involves unit testing of following controllers: TeamsController, because we will have to change some methods.&lt;br /&gt;
*Unit Testing of Models&lt;br /&gt;
This involves writing rspec test for all the newly created models like submission_history, google_doc_submission_history, etc. Tests for team model are already written.&lt;br /&gt;
&lt;br /&gt;
* models/github_pull_request_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubPullRequestSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github pull request was updated&amp;quot; do&lt;br /&gt;
 +      history_object = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/github_repo_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubRepoSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github repo was pushed&amp;quot; do&lt;br /&gt;
 +      history_object = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/link_submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe LinkSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;add submission&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add GithubRepoSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubRepoSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add GithubPullRequestSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubPullRequestSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add WikipediaSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(WikipediaSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe SubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;create method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should create link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://www.youtube.com/watch?v=dQw4w9WgXcQ&amp;amp;ab_channel=RickAstleyVEVO&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(LinkSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubRepoSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubPullRequestSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create wikipedia link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(WikipediaSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create google doc link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GoogledocSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create file submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(FileSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  describe &amp;quot;delete method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a link submission history with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as edit&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history.submitted_at = Time.current&lt;br /&gt;
 +      submission_history.save&lt;br /&gt;
 +&lt;br /&gt;
 +      submission_history2 = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history2.submitted_at = Time.current&lt;br /&gt;
 +      submission_history2.save&lt;br /&gt;
 +      expect(submission_history2.action).to eq(&amp;quot;edit&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/wikipedia_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe WikipediaSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a wiki page was updated&amp;quot; do&lt;br /&gt;
 +      history_object = WikipediaSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
*UI Testing&lt;br /&gt;
**Login as student/instructor.&lt;br /&gt;
**Go to Assignments Home Page.&lt;br /&gt;
**Here you will find a timeline with several tags like submission, review, resubmission, rereview. &lt;br /&gt;
**Also, There will be a tags for the authors submitting and updating their artifacts, reviewers submitting peer-reviews, reviewees sending author feedback and reviewers updating their peer reviews.&lt;br /&gt;
**As UI would be modified a lot, more testing part would be added after the implementation.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
*https://www.tutorialspoint.com/design_pattern/factory_pattern.htm&lt;br /&gt;
*https://developers.google.com/drive/v3/web/quickstart/ruby&lt;br /&gt;
*https://www.mediawiki.org/wiki/API:Main_page&lt;br /&gt;
*https://github.com/octokit/octokit.rb&lt;br /&gt;
*https://github.com/piotrmurach/github&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106667</id>
		<title>CSC/ECE 517 Fall 2016/E1686-Timestamps for students' submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106667"/>
		<updated>2016-12-07T19:34:09Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Files Added/Modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
In this project, We will keep track of timestamp records for students' submissions and updates of artifacts (links to google doc/wikipedia/github), reviewers' submissions and edits of peer-reviews and author feedbacks.We will also create a timeline view for each artifact, showing when it was submitted/resubmitted and when it was reviewed. With our work, users (students and instructors) can see:&lt;br /&gt;
* when do the authors submit and update their artifacts.&lt;br /&gt;
* when do reviewers submit peer-reviews.&lt;br /&gt;
* when do reviewees send author feedback.&lt;br /&gt;
* when do reviewers update their peer reviews.&lt;br /&gt;
== Approach ==&lt;br /&gt;
[[File:appraoch.JPG|center]]&lt;br /&gt;
From a perspective (both instructors and students), users should be able to see such a timeline with all the events for each submission of an assignment. The events can be - &lt;br /&gt;
*add/edit events of various submission links/files&lt;br /&gt;
*Reviews&lt;br /&gt;
*author feedbacks&lt;br /&gt;
*peer reviews&lt;br /&gt;
Each of these artifacts can be edited and updated multiple times. Because we want to track when these artifacts are updated, we have to store their information in the database. We use the table suggested in the problem description “submission_histories”- &lt;br /&gt;
*Id :: integer- primary key for this table. &lt;br /&gt;
*team_id :: integer ← foreign key to the teams table&lt;br /&gt;
*submitted_detail :: string ← details of the event. This can be one of x values.&lt;br /&gt;
**Link  - if it is a assignment submission link. This can further be of 4 types - &lt;br /&gt;
**Google Docs&lt;br /&gt;
**Wikipedia&lt;br /&gt;
**Github repository &lt;br /&gt;
**Any other web link&lt;br /&gt;
*Review ids - if the event is a review submission&lt;br /&gt;
*Author feedback id - if the event is an add or edit operation on author feedback.&lt;br /&gt;
*Peer review id - if the event is an add or edit operation on peer review.&lt;br /&gt;
*Submitted_at  :: datetime ← to store the timestamp of the event&lt;br /&gt;
*Type :: string ← field which distinguish between different types of events - to be used for polymorphism.&lt;br /&gt;
*Action :: string - add / edit / delete based on the event.&lt;br /&gt;
These are the common components under which each component in the timeline can be classified. Each of these components are explained in detail on how it fits into the timeline and its significance and types listed. &lt;br /&gt;
&lt;br /&gt;
'''Data stored in submission_histories table'''&lt;br /&gt;
*Google Document, Wikipedia article, Github repository url : All of these are types of links given by the team during their submission. Through the url, we will identify which type of a submission is this, and then create an object of the particular class using the factory pattern. Each of these classes will implement their own “getLastUpdatedTimestamp” method, using the suggested APIs, through which we can get the required timestamp.&lt;br /&gt;
*File path and any other web link - These are also a part of main submissions, but since there is no way of tracking changes to these artifacts, we just take the time of the system when the link is added or removed.&lt;br /&gt;
*Peer Reviews, Author feedback: Peer reviews and author feedbacks are updated into the submission history table for every edit that takes place. The “updated_at” field acts as the current timestamp for edits in the Peer Reviews and Author feedbacks and the “created_at” field marks the start of these Events.&lt;br /&gt;
'''Data retrieved from existing tables'''&lt;br /&gt;
*Reviews: Timestamp for assignment reviews are taken from “responses” and “response_maps” table. The responses table contains round field and when “is_submitted” flag is true, the submission appears on the reviewee timeline where the “reviewee_id” retrieved from response_maps table. The reviews attached to the respective reviewee are collected and updated_at field gives the submission timestamp which is used on the timeline. Each review is collected and is added to the single Event map.&lt;br /&gt;
*Timeline Parameters: Values corresponding to an assignment which are common for a given Assignment are retrieved from the assignments table. And the timeline parameters are obtained by calculating from the created_at which is the start date for the assignment and  the field rounds_of_reviews determines the deadline by adding up the value stored in days_between_submission field of the same table. The Events - Start Date, Submission Deadline and Revision Deadline and Final assignment deadline exists for each assignment.&lt;br /&gt;
All the components are then added into one single map - Event -&amp;gt; Timestamp which is sorted on timestamp values and is displayed on screen.&lt;br /&gt;
&lt;br /&gt;
== UML Diagram:==&lt;br /&gt;
[[File:Class.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
== Files Added/Modified ==&lt;br /&gt;
Models&lt;br /&gt;
* assignment&lt;br /&gt;
 require 'rufus-scheduler'&lt;br /&gt;
 after_save :record_submission&lt;br /&gt;
&lt;br /&gt;
 +private&lt;br /&gt;
 +  def record_submission&lt;br /&gt;
 +    # whenever a new assignment is added, add a job on each of its deadlines, to update the&lt;br /&gt;
 +    # timestamps of teams' submissions.&lt;br /&gt;
 +    scheduler = Rufus::Scheduler.singleton&lt;br /&gt;
 +&lt;br /&gt;
 +    self.due_dates.each do |due_date|&lt;br /&gt;
 +      if due_date.deadline_type.name == 'submission'&lt;br /&gt;
 +        scheduler.at(due_date.due_at.to_s, &amp;quot;assignment&amp;quot;=&amp;gt;self) do |job, time, arg|&lt;br /&gt;
 +          LinkSubmissionHistory.add_submission(job.opts['assignment'].id)&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
* files_submission_history&lt;br /&gt;
 +class FileSubmissionHistory &amp;lt; SubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = FileSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_pull_request_submission_history&lt;br /&gt;
 +class GithubPullRequestSubmissionHistory &amp;lt; GithubSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    link_path = uri.path&lt;br /&gt;
 +    git_user_details = link_path.split(&amp;quot;/&amp;quot;)&lt;br /&gt;
 +    github = Github.new&lt;br /&gt;
 +    a = github.pulls.get git_user_details[1], git_user_details[2], git_user_details[4]&lt;br /&gt;
 +    return a.updated_at&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_repo_submission_history&lt;br /&gt;
 +class GithubRepoSubmissionHistory &amp;lt; GithubSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    link_path = uri.path&lt;br /&gt;
 +    git_user_details = link_path.split(&amp;quot;/&amp;quot;)&lt;br /&gt;
 +    github = Github.new&lt;br /&gt;
 +    a = github.repos.get git_user_details[1], git_user_details[2]&lt;br /&gt;
 +    return a.pushed_at&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_submission_history&lt;br /&gt;
 +class GithubSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    if link.include? &amp;quot;pull&amp;quot;&lt;br /&gt;
 +      history_obj = GithubPullRequestSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = GithubRepoSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* googledoc_submission_history&lt;br /&gt;
 +class GoogledocSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GoogledocSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* link_submission_history&lt;br /&gt;
 +class LinkSubmissionHistory &amp;lt; SubmissionHistory&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    # lets assume link of type http://docs.google.com  or   http://wiki.expertiza.ncsu.edu  or http://github.com/goeltanmay/&lt;br /&gt;
 +    if link.include? &amp;quot;docs.google.com&amp;quot;&lt;br /&gt;
 +      history_obj = GoogledocSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    elsif link.include? &amp;quot;wiki.expertiza.ncsu.edu&amp;quot;&lt;br /&gt;
 +      history_obj = WikipediaSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    elsif link.include? &amp;quot;github.com&amp;quot;&lt;br /&gt;
 +      history_obj = GithubSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      # some random link has been given&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.new&lt;br /&gt;
 +      history_obj.team = team&lt;br /&gt;
 +      history_obj.submitted_detail = link&lt;br /&gt;
 +      history_obj.action = action&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.add_submission(assignment_id)&lt;br /&gt;
 +    @assignment = Assignment.find_by_id(assignment_id)&lt;br /&gt;
 +    teams = @assignment.teams&lt;br /&gt;
 +    teams.each do |team|&lt;br /&gt;
 +      submitted_links = team.hyperlinks&lt;br /&gt;
 +      submitted_links.each do |link|&lt;br /&gt;
 +        submission_history = SubmissionHistory.create(team, link)&lt;br /&gt;
 +        timestamp = submission_history.get_submitted_at_time(link)&lt;br /&gt;
 +        submission_history.submitted_at = timestamp&lt;br /&gt;
 +        begin&lt;br /&gt;
 +          submission_history.save&lt;br /&gt;
 +        rescue&lt;br /&gt;
 +          @error_message = &amp;quot;No new updates&amp;quot;&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* submission_history&lt;br /&gt;
 +class SubmissionHistory &amp;lt; ActiveRecord::Base&lt;br /&gt;
 +  belongs_to :team&lt;br /&gt;
 +  validates_uniqueness_of :submitted_detail, scope: [:team_id, :submitted_at]&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.create(team, link)&lt;br /&gt;
 +    # for file, the link will be? - put this as default condition&lt;br /&gt;
 +    # determine whether this is a file or a link&lt;br /&gt;
 +    existing_submission = SubmissionHistory.where([&amp;quot;team_id = ? and submitted_detail = ?&amp;quot;, team, link])&lt;br /&gt;
 +    if existing_submission.size&amp;gt;0&lt;br /&gt;
 +      action = &amp;quot;edit&amp;quot;&lt;br /&gt;
 +    else&lt;br /&gt;
 +      action = &amp;quot;add&amp;quot;&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    if link.start_with?(&amp;quot;http&amp;quot;)&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = FileSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.delete_submission(team, link)&lt;br /&gt;
 +    # just add a delete record&lt;br /&gt;
 +    if link.start_with?(&amp;quot;http&amp;quot;)&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.create(link, team, &amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = FileSubmissionHistory.create(link, team, &amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    return Time.current&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +end&lt;br /&gt;
* wikipedia_submission_history&lt;br /&gt;
 +class WikipediaSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = WikipediaSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    wiki_title = uri.path&lt;br /&gt;
 +    wiki_title.slice! &amp;quot;/index.php/&amp;quot;&lt;br /&gt;
 +    url = URI.parse('http://wiki.expertiza.ncsu.edu/api.php?action=query&amp;amp;prop=info&amp;amp;titles='+ wiki_title +'&amp;amp;format=json')&lt;br /&gt;
 +    req = Net::HTTP::Get.new(url.to_s)&lt;br /&gt;
 +    res = Net::HTTP.start(url.host, url.port) {|http|&lt;br /&gt;
 +      http.request(req)&lt;br /&gt;
 +    }&lt;br /&gt;
 +    hash= JSON.parse res.body&lt;br /&gt;
 +    id = hash[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;].keys&lt;br /&gt;
 +    return hash[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;][id[0]][&amp;quot;touched&amp;quot;]&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
* submitted_content_controller&lt;br /&gt;
 +    #create timeline for generalized map to just loop in the html&lt;br /&gt;
 +    @timeline = Hash.new()&lt;br /&gt;
 +    #Get timeline entries from submission_histories table&lt;br /&gt;
 +    @submission_history = SubmissionHistory.where(team: @participant.team.id).order(:submitted_at)&lt;br /&gt;
 +    #reviews&lt;br /&gt;
 +    @review_maps = ResponseMap.where(reviewee_id: @participant.team.id)&lt;br /&gt;
 +    @review_maps.each do |map|&lt;br /&gt;
 +      if &amp;quot;ReviewResponseMap&amp;quot;.eql?map.type&lt;br /&gt;
 +        @response = Response.find_by(map_id: map.id)&lt;br /&gt;
 +        @timeline[@response.updated_at]={:heading =&amp;gt; map.type.chomp('ResponseMap') , :description =&amp;gt; '', :color =&amp;gt; 'green'}&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +    #feedbacks&lt;br /&gt;
 +    @feedback_maps = ResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
 +    @feedback_maps.each do |map|&lt;br /&gt;
 +      if &amp;quot;FeedbackResponseMap&amp;quot;.eql?map.type&lt;br /&gt;
 +        @response = Response.find_by(map_id: map.id)&lt;br /&gt;
 +        @timeline[@response.updated_at]={:heading =&amp;gt; map.type.chomp('ResponseMap') , :description =&amp;gt; '', :color =&amp;gt; 'info'}&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +    @submission_history.each do |submission|&lt;br /&gt;
 +      @timeline[submission.submitted_at]={:heading =&amp;gt; submission.type+' '+submission.action, :description =&amp;gt; submission.submitted_detail}&lt;br /&gt;
 +    end&lt;br /&gt;
 +    @assignment.due_dates.each do |due_date|&lt;br /&gt;
 +      @timeline[due_date.due_at]={:heading =&amp;gt; ' Due Date ', :description =&amp;gt; due_date.deadline_type.name+' deadline', :color =&amp;gt; 'danger'}&lt;br /&gt;
 +    end&lt;br /&gt;
&lt;br /&gt;
Views&lt;br /&gt;
* submitted_content/_main.html.erb&lt;br /&gt;
 + &amp;lt;%if !@timeline.nil? %&amp;gt;&lt;br /&gt;
 +      &amp;lt;%= render partial: 'submitted_content/submission_history', locals: {timeline: @timeline, origin: ''} %&amp;gt;&lt;br /&gt;
 +  &amp;lt;%end%&amp;gt;&lt;br /&gt;
 +   &lt;br /&gt;
* submitted_content/_submission_history.html.erb&lt;br /&gt;
[[File:View.JPG]]&lt;br /&gt;
&lt;br /&gt;
spec&lt;br /&gt;
* models/github_pull_request_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubPullRequestSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github pull request was updated&amp;quot; do&lt;br /&gt;
 +      history_object = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/github_repo_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubRepoSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github repo was pushed&amp;quot; do&lt;br /&gt;
 +      history_object = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/link_submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe LinkSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;add submission&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add GithubRepoSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubRepoSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add GithubPullRequestSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubPullRequestSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add WikipediaSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(WikipediaSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe SubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;create method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should create link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://www.youtube.com/watch?v=dQw4w9WgXcQ&amp;amp;ab_channel=RickAstleyVEVO&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(LinkSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubRepoSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubPullRequestSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create wikipedia link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(WikipediaSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create google doc link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GoogledocSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create file submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(FileSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  describe &amp;quot;delete method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a link submission history with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as edit&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history.submitted_at = Time.current&lt;br /&gt;
 +      submission_history.save&lt;br /&gt;
 +&lt;br /&gt;
 +      submission_history2 = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history2.submitted_at = Time.current&lt;br /&gt;
 +      submission_history2.save&lt;br /&gt;
 +      expect(submission_history2.action).to eq(&amp;quot;edit&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/wikipedia_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe WikipediaSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a wiki page was updated&amp;quot; do&lt;br /&gt;
 +      history_object = WikipediaSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
*Unit Testing of controllers&lt;br /&gt;
This involves unit testing of following controllers: TeamsController, because we will have to change some methods.&lt;br /&gt;
*Unit Testing of Models&lt;br /&gt;
This involves writing rspec test for all the newly created models like submission_history, google_doc_submission_history, etc. Tests for team model are already written.&lt;br /&gt;
&lt;br /&gt;
* models/github_pull_request_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubPullRequestSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github pull request was updated&amp;quot; do&lt;br /&gt;
 +      history_object = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/github_repo_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubRepoSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github repo was pushed&amp;quot; do&lt;br /&gt;
 +      history_object = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/link_submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe LinkSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;add submission&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add GithubRepoSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubRepoSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add GithubPullRequestSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubPullRequestSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add WikipediaSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(WikipediaSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe SubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;create method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should create link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://www.youtube.com/watch?v=dQw4w9WgXcQ&amp;amp;ab_channel=RickAstleyVEVO&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(LinkSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubRepoSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubPullRequestSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create wikipedia link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(WikipediaSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create google doc link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GoogledocSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create file submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(FileSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  describe &amp;quot;delete method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a link submission history with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as edit&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history.submitted_at = Time.current&lt;br /&gt;
 +      submission_history.save&lt;br /&gt;
 +&lt;br /&gt;
 +      submission_history2 = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history2.submitted_at = Time.current&lt;br /&gt;
 +      submission_history2.save&lt;br /&gt;
 +      expect(submission_history2.action).to eq(&amp;quot;edit&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/wikipedia_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe WikipediaSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a wiki page was updated&amp;quot; do&lt;br /&gt;
 +      history_object = WikipediaSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
*UI Testing&lt;br /&gt;
**Login as student/instructor.&lt;br /&gt;
**Go to Assignments Home Page.&lt;br /&gt;
**Here you will find a timeline with several tags like submission, review, resubmission, rereview. &lt;br /&gt;
**Also, There will be a tags for the authors submitting and updating their artifacts, reviewers submitting peer-reviews, reviewees sending author feedback and reviewers updating their peer reviews.&lt;br /&gt;
**As UI would be modified a lot, more testing part would be added after the implementation.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
*https://www.tutorialspoint.com/design_pattern/factory_pattern.htm&lt;br /&gt;
*https://developers.google.com/drive/v3/web/quickstart/ruby&lt;br /&gt;
*https://www.mediawiki.org/wiki/API:Main_page&lt;br /&gt;
*https://github.com/octokit/octokit.rb&lt;br /&gt;
*https://github.com/piotrmurach/github&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106664</id>
		<title>CSC/ECE 517 Fall 2016/E1686-Timestamps for students' submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106664"/>
		<updated>2016-12-07T19:29:04Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Files Added/Modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
In this project, We will keep track of timestamp records for students' submissions and updates of artifacts (links to google doc/wikipedia/github), reviewers' submissions and edits of peer-reviews and author feedbacks.We will also create a timeline view for each artifact, showing when it was submitted/resubmitted and when it was reviewed. With our work, users (students and instructors) can see:&lt;br /&gt;
* when do the authors submit and update their artifacts.&lt;br /&gt;
* when do reviewers submit peer-reviews.&lt;br /&gt;
* when do reviewees send author feedback.&lt;br /&gt;
* when do reviewers update their peer reviews.&lt;br /&gt;
== Approach ==&lt;br /&gt;
[[File:appraoch.JPG|center]]&lt;br /&gt;
From a perspective (both instructors and students), users should be able to see such a timeline with all the events for each submission of an assignment. The events can be - &lt;br /&gt;
*add/edit events of various submission links/files&lt;br /&gt;
*Reviews&lt;br /&gt;
*author feedbacks&lt;br /&gt;
*peer reviews&lt;br /&gt;
Each of these artifacts can be edited and updated multiple times. Because we want to track when these artifacts are updated, we have to store their information in the database. We use the table suggested in the problem description “submission_histories”- &lt;br /&gt;
*Id :: integer- primary key for this table. &lt;br /&gt;
*team_id :: integer ← foreign key to the teams table&lt;br /&gt;
*submitted_detail :: string ← details of the event. This can be one of x values.&lt;br /&gt;
**Link  - if it is a assignment submission link. This can further be of 4 types - &lt;br /&gt;
**Google Docs&lt;br /&gt;
**Wikipedia&lt;br /&gt;
**Github repository &lt;br /&gt;
**Any other web link&lt;br /&gt;
*Review ids - if the event is a review submission&lt;br /&gt;
*Author feedback id - if the event is an add or edit operation on author feedback.&lt;br /&gt;
*Peer review id - if the event is an add or edit operation on peer review.&lt;br /&gt;
*Submitted_at  :: datetime ← to store the timestamp of the event&lt;br /&gt;
*Type :: string ← field which distinguish between different types of events - to be used for polymorphism.&lt;br /&gt;
*Action :: string - add / edit / delete based on the event.&lt;br /&gt;
These are the common components under which each component in the timeline can be classified. Each of these components are explained in detail on how it fits into the timeline and its significance and types listed. &lt;br /&gt;
&lt;br /&gt;
'''Data stored in submission_histories table'''&lt;br /&gt;
*Google Document, Wikipedia article, Github repository url : All of these are types of links given by the team during their submission. Through the url, we will identify which type of a submission is this, and then create an object of the particular class using the factory pattern. Each of these classes will implement their own “getLastUpdatedTimestamp” method, using the suggested APIs, through which we can get the required timestamp.&lt;br /&gt;
*File path and any other web link - These are also a part of main submissions, but since there is no way of tracking changes to these artifacts, we just take the time of the system when the link is added or removed.&lt;br /&gt;
*Peer Reviews, Author feedback: Peer reviews and author feedbacks are updated into the submission history table for every edit that takes place. The “updated_at” field acts as the current timestamp for edits in the Peer Reviews and Author feedbacks and the “created_at” field marks the start of these Events.&lt;br /&gt;
'''Data retrieved from existing tables'''&lt;br /&gt;
*Reviews: Timestamp for assignment reviews are taken from “responses” and “response_maps” table. The responses table contains round field and when “is_submitted” flag is true, the submission appears on the reviewee timeline where the “reviewee_id” retrieved from response_maps table. The reviews attached to the respective reviewee are collected and updated_at field gives the submission timestamp which is used on the timeline. Each review is collected and is added to the single Event map.&lt;br /&gt;
*Timeline Parameters: Values corresponding to an assignment which are common for a given Assignment are retrieved from the assignments table. And the timeline parameters are obtained by calculating from the created_at which is the start date for the assignment and  the field rounds_of_reviews determines the deadline by adding up the value stored in days_between_submission field of the same table. The Events - Start Date, Submission Deadline and Revision Deadline and Final assignment deadline exists for each assignment.&lt;br /&gt;
All the components are then added into one single map - Event -&amp;gt; Timestamp which is sorted on timestamp values and is displayed on screen.&lt;br /&gt;
&lt;br /&gt;
== UML Diagram:==&lt;br /&gt;
[[File:Class.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
== Files Added/Modified ==&lt;br /&gt;
Models&lt;br /&gt;
* assignment&lt;br /&gt;
 require 'rufus-scheduler'&lt;br /&gt;
 after_save :record_submission&lt;br /&gt;
&lt;br /&gt;
 +private&lt;br /&gt;
 +  def record_submission&lt;br /&gt;
 +    # whenever a new assignment is added, add a job on each of its deadlines, to update the&lt;br /&gt;
 +    # timestamps of teams' submissions.&lt;br /&gt;
 +    scheduler = Rufus::Scheduler.singleton&lt;br /&gt;
 +&lt;br /&gt;
 +    self.due_dates.each do |due_date|&lt;br /&gt;
 +      if due_date.deadline_type.name == 'submission'&lt;br /&gt;
 +        scheduler.at(due_date.due_at.to_s, &amp;quot;assignment&amp;quot;=&amp;gt;self) do |job, time, arg|&lt;br /&gt;
 +          LinkSubmissionHistory.add_submission(job.opts['assignment'].id)&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
* files_submission_history&lt;br /&gt;
 +class FileSubmissionHistory &amp;lt; SubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = FileSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_pull_request_submission_history&lt;br /&gt;
 +class GithubPullRequestSubmissionHistory &amp;lt; GithubSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    link_path = uri.path&lt;br /&gt;
 +    git_user_details = link_path.split(&amp;quot;/&amp;quot;)&lt;br /&gt;
 +    github = Github.new&lt;br /&gt;
 +    a = github.pulls.get git_user_details[1], git_user_details[2], git_user_details[4]&lt;br /&gt;
 +    return a.updated_at&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_repo_submission_history&lt;br /&gt;
 +class GithubRepoSubmissionHistory &amp;lt; GithubSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    link_path = uri.path&lt;br /&gt;
 +    git_user_details = link_path.split(&amp;quot;/&amp;quot;)&lt;br /&gt;
 +    github = Github.new&lt;br /&gt;
 +    a = github.repos.get git_user_details[1], git_user_details[2]&lt;br /&gt;
 +    return a.pushed_at&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_submission_history&lt;br /&gt;
 +class GithubSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    if link.include? &amp;quot;pull&amp;quot;&lt;br /&gt;
 +      history_obj = GithubPullRequestSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = GithubRepoSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* googledoc_submission_history&lt;br /&gt;
 +class GoogledocSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GoogledocSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* link_submission_history&lt;br /&gt;
 +class LinkSubmissionHistory &amp;lt; SubmissionHistory&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    # lets assume link of type http://docs.google.com  or   http://wiki.expertiza.ncsu.edu  or http://github.com/goeltanmay/&lt;br /&gt;
 +    if link.include? &amp;quot;docs.google.com&amp;quot;&lt;br /&gt;
 +      history_obj = GoogledocSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    elsif link.include? &amp;quot;wiki.expertiza.ncsu.edu&amp;quot;&lt;br /&gt;
 +      history_obj = WikipediaSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    elsif link.include? &amp;quot;github.com&amp;quot;&lt;br /&gt;
 +      history_obj = GithubSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      # some random link has been given&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.new&lt;br /&gt;
 +      history_obj.team = team&lt;br /&gt;
 +      history_obj.submitted_detail = link&lt;br /&gt;
 +      history_obj.action = action&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.add_submission(assignment_id)&lt;br /&gt;
 +    @assignment = Assignment.find_by_id(assignment_id)&lt;br /&gt;
 +    teams = @assignment.teams&lt;br /&gt;
 +    teams.each do |team|&lt;br /&gt;
 +      submitted_links = team.hyperlinks&lt;br /&gt;
 +      submitted_links.each do |link|&lt;br /&gt;
 +        submission_history = SubmissionHistory.create(team, link)&lt;br /&gt;
 +        timestamp = submission_history.get_submitted_at_time(link)&lt;br /&gt;
 +        submission_history.submitted_at = timestamp&lt;br /&gt;
 +        begin&lt;br /&gt;
 +          submission_history.save&lt;br /&gt;
 +        rescue&lt;br /&gt;
 +          @error_message = &amp;quot;No new updates&amp;quot;&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* submission_history&lt;br /&gt;
 +class SubmissionHistory &amp;lt; ActiveRecord::Base&lt;br /&gt;
 +  belongs_to :team&lt;br /&gt;
 +  validates_uniqueness_of :submitted_detail, scope: [:team_id, :submitted_at]&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.create(team, link)&lt;br /&gt;
 +    # for file, the link will be? - put this as default condition&lt;br /&gt;
 +    # determine whether this is a file or a link&lt;br /&gt;
 +    existing_submission = SubmissionHistory.where([&amp;quot;team_id = ? and submitted_detail = ?&amp;quot;, team, link])&lt;br /&gt;
 +    if existing_submission.size&amp;gt;0&lt;br /&gt;
 +      action = &amp;quot;edit&amp;quot;&lt;br /&gt;
 +    else&lt;br /&gt;
 +      action = &amp;quot;add&amp;quot;&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    if link.start_with?(&amp;quot;http&amp;quot;)&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = FileSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.delete_submission(team, link)&lt;br /&gt;
 +    # just add a delete record&lt;br /&gt;
 +    if link.start_with?(&amp;quot;http&amp;quot;)&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.create(link, team, &amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = FileSubmissionHistory.create(link, team, &amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    return Time.current&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +end&lt;br /&gt;
* wikipedia_submission_history&lt;br /&gt;
 +class WikipediaSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = WikipediaSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    wiki_title = uri.path&lt;br /&gt;
 +    wiki_title.slice! &amp;quot;/index.php/&amp;quot;&lt;br /&gt;
 +    url = URI.parse('http://wiki.expertiza.ncsu.edu/api.php?action=query&amp;amp;prop=info&amp;amp;titles='+ wiki_title +'&amp;amp;format=json')&lt;br /&gt;
 +    req = Net::HTTP::Get.new(url.to_s)&lt;br /&gt;
 +    res = Net::HTTP.start(url.host, url.port) {|http|&lt;br /&gt;
 +      http.request(req)&lt;br /&gt;
 +    }&lt;br /&gt;
 +    hash= JSON.parse res.body&lt;br /&gt;
 +    id = hash[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;].keys&lt;br /&gt;
 +    return hash[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;][id[0]][&amp;quot;touched&amp;quot;]&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
* submitted_content_controller&lt;br /&gt;
 +    #create timeline for generalized map to just loop in the html&lt;br /&gt;
 +    @timeline = Hash.new()&lt;br /&gt;
 +    #Get timeline entries from submission_histories table&lt;br /&gt;
 +    @submission_history = SubmissionHistory.where(team: @participant.team.id).order(:submitted_at)&lt;br /&gt;
 +    #reviews&lt;br /&gt;
 +    @review_maps = ResponseMap.where(reviewee_id: @participant.team.id)&lt;br /&gt;
 +    @review_maps.each do |map|&lt;br /&gt;
 +      if &amp;quot;ReviewResponseMap&amp;quot;.eql?map.type&lt;br /&gt;
 +        @response = Response.find_by(map_id: map.id)&lt;br /&gt;
 +        @timeline[@response.updated_at]={:heading =&amp;gt; map.type.chomp('ResponseMap') , :description =&amp;gt; '', :color =&amp;gt; 'green'}&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +    #feedbacks&lt;br /&gt;
 +    @feedback_maps = ResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
 +    @feedback_maps.each do |map|&lt;br /&gt;
 +      if &amp;quot;FeedbackResponseMap&amp;quot;.eql?map.type&lt;br /&gt;
 +        @response = Response.find_by(map_id: map.id)&lt;br /&gt;
 +        @timeline[@response.updated_at]={:heading =&amp;gt; map.type.chomp('ResponseMap') , :description =&amp;gt; '', :color =&amp;gt; 'info'}&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +    @submission_history.each do |submission|&lt;br /&gt;
 +      @timeline[submission.submitted_at]={:heading =&amp;gt; submission.type+' '+submission.action, :description =&amp;gt; submission.submitted_detail}&lt;br /&gt;
 +    end&lt;br /&gt;
 +    @assignment.due_dates.each do |due_date|&lt;br /&gt;
 +      @timeline[due_date.due_at]={:heading =&amp;gt; ' Due Date ', :description =&amp;gt; due_date.deadline_type.name+' deadline', :color =&amp;gt; 'danger'}&lt;br /&gt;
 +    end&lt;br /&gt;
&lt;br /&gt;
Views&lt;br /&gt;
* submitted_content/_main.html.erb&lt;br /&gt;
 + &amp;lt;%if !@timeline.nil? %&amp;gt;&lt;br /&gt;
 +      &amp;lt;%= render partial: 'submitted_content/submission_history', locals: {timeline: @timeline, origin: ''} %&amp;gt;&lt;br /&gt;
 +  &amp;lt;%end%&amp;gt;&lt;br /&gt;
 +   &lt;br /&gt;
* submitted_content/_submission_history.html.erb&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
spec&lt;br /&gt;
* models/github_pull_request_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubPullRequestSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github pull request was updated&amp;quot; do&lt;br /&gt;
 +      history_object = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/github_repo_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubRepoSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github repo was pushed&amp;quot; do&lt;br /&gt;
 +      history_object = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/link_submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe LinkSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;add submission&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add GithubRepoSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubRepoSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add GithubPullRequestSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubPullRequestSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add WikipediaSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(WikipediaSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe SubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;create method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should create link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://www.youtube.com/watch?v=dQw4w9WgXcQ&amp;amp;ab_channel=RickAstleyVEVO&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(LinkSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubRepoSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubPullRequestSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create wikipedia link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(WikipediaSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create google doc link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GoogledocSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create file submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(FileSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  describe &amp;quot;delete method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a link submission history with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as edit&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history.submitted_at = Time.current&lt;br /&gt;
 +      submission_history.save&lt;br /&gt;
 +&lt;br /&gt;
 +      submission_history2 = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history2.submitted_at = Time.current&lt;br /&gt;
 +      submission_history2.save&lt;br /&gt;
 +      expect(submission_history2.action).to eq(&amp;quot;edit&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/wikipedia_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe WikipediaSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a wiki page was updated&amp;quot; do&lt;br /&gt;
 +      history_object = WikipediaSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
*Unit Testing of controllers&lt;br /&gt;
This involves unit testing of following controllers: TeamsController, because we will have to change some methods.&lt;br /&gt;
*Unit Testing of Models&lt;br /&gt;
This involves writing rspec test for all the newly created models like submission_history, google_doc_submission_history, etc. Tests for team model are already written.&lt;br /&gt;
*UI Testing&lt;br /&gt;
**Login as student/instructor.&lt;br /&gt;
**Go to Assignments Home Page.&lt;br /&gt;
**Here you will find a timeline with several tags like submission, review, resubmission, rereview. &lt;br /&gt;
**Also, There will be a tags for the authors submitting and updating their artifacts, reviewers submitting peer-reviews, reviewees sending author feedback and reviewers updating their peer reviews.&lt;br /&gt;
**As UI would be modified a lot, more testing part would be added after the implementation.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
*https://www.tutorialspoint.com/design_pattern/factory_pattern.htm&lt;br /&gt;
*https://developers.google.com/drive/v3/web/quickstart/ruby&lt;br /&gt;
*https://www.mediawiki.org/wiki/API:Main_page&lt;br /&gt;
*https://github.com/octokit/octokit.rb&lt;br /&gt;
*https://github.com/piotrmurach/github&lt;br /&gt;
Doubts:&lt;br /&gt;
Significance of submission record table&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106651</id>
		<title>CSC/ECE 517 Fall 2016/E1686-Timestamps for students' submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106651"/>
		<updated>2016-12-07T19:15:40Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Files Added/Modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
In this project, We will keep track of timestamp records for students' submissions and updates of artifacts (links to google doc/wikipedia/github), reviewers' submissions and edits of peer-reviews and author feedbacks.We will also create a timeline view for each artifact, showing when it was submitted/resubmitted and when it was reviewed. With our work, users (students and instructors) can see:&lt;br /&gt;
* when do the authors submit and update their artifacts.&lt;br /&gt;
* when do reviewers submit peer-reviews.&lt;br /&gt;
* when do reviewees send author feedback.&lt;br /&gt;
* when do reviewers update their peer reviews.&lt;br /&gt;
== Approach ==&lt;br /&gt;
[[File:appraoch.JPG|center]]&lt;br /&gt;
From a perspective (both instructors and students), users should be able to see such a timeline with all the events for each submission of an assignment. The events can be - &lt;br /&gt;
*add/edit events of various submission links/files&lt;br /&gt;
*Reviews&lt;br /&gt;
*author feedbacks&lt;br /&gt;
*peer reviews&lt;br /&gt;
Each of these artifacts can be edited and updated multiple times. Because we want to track when these artifacts are updated, we have to store their information in the database. We use the table suggested in the problem description “submission_histories”- &lt;br /&gt;
*Id :: integer- primary key for this table. &lt;br /&gt;
*team_id :: integer ← foreign key to the teams table&lt;br /&gt;
*submitted_detail :: string ← details of the event. This can be one of x values.&lt;br /&gt;
**Link  - if it is a assignment submission link. This can further be of 4 types - &lt;br /&gt;
**Google Docs&lt;br /&gt;
**Wikipedia&lt;br /&gt;
**Github repository &lt;br /&gt;
**Any other web link&lt;br /&gt;
*Review ids - if the event is a review submission&lt;br /&gt;
*Author feedback id - if the event is an add or edit operation on author feedback.&lt;br /&gt;
*Peer review id - if the event is an add or edit operation on peer review.&lt;br /&gt;
*Submitted_at  :: datetime ← to store the timestamp of the event&lt;br /&gt;
*Type :: string ← field which distinguish between different types of events - to be used for polymorphism.&lt;br /&gt;
*Action :: string - add / edit / delete based on the event.&lt;br /&gt;
These are the common components under which each component in the timeline can be classified. Each of these components are explained in detail on how it fits into the timeline and its significance and types listed. &lt;br /&gt;
&lt;br /&gt;
'''Data stored in submission_histories table'''&lt;br /&gt;
*Google Document, Wikipedia article, Github repository url : All of these are types of links given by the team during their submission. Through the url, we will identify which type of a submission is this, and then create an object of the particular class using the factory pattern. Each of these classes will implement their own “getLastUpdatedTimestamp” method, using the suggested APIs, through which we can get the required timestamp.&lt;br /&gt;
*File path and any other web link - These are also a part of main submissions, but since there is no way of tracking changes to these artifacts, we just take the time of the system when the link is added or removed.&lt;br /&gt;
*Peer Reviews, Author feedback: Peer reviews and author feedbacks are updated into the submission history table for every edit that takes place. The “updated_at” field acts as the current timestamp for edits in the Peer Reviews and Author feedbacks and the “created_at” field marks the start of these Events.&lt;br /&gt;
'''Data retrieved from existing tables'''&lt;br /&gt;
*Reviews: Timestamp for assignment reviews are taken from “responses” and “response_maps” table. The responses table contains round field and when “is_submitted” flag is true, the submission appears on the reviewee timeline where the “reviewee_id” retrieved from response_maps table. The reviews attached to the respective reviewee are collected and updated_at field gives the submission timestamp which is used on the timeline. Each review is collected and is added to the single Event map.&lt;br /&gt;
*Timeline Parameters: Values corresponding to an assignment which are common for a given Assignment are retrieved from the assignments table. And the timeline parameters are obtained by calculating from the created_at which is the start date for the assignment and  the field rounds_of_reviews determines the deadline by adding up the value stored in days_between_submission field of the same table. The Events - Start Date, Submission Deadline and Revision Deadline and Final assignment deadline exists for each assignment.&lt;br /&gt;
All the components are then added into one single map - Event -&amp;gt; Timestamp which is sorted on timestamp values and is displayed on screen.&lt;br /&gt;
&lt;br /&gt;
== UML Diagram:==&lt;br /&gt;
[[File:Class.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
== Files Added/Modified ==&lt;br /&gt;
Models&lt;br /&gt;
* assignment&lt;br /&gt;
 require 'rufus-scheduler'&lt;br /&gt;
 after_save :record_submission&lt;br /&gt;
&lt;br /&gt;
 +private&lt;br /&gt;
 +  def record_submission&lt;br /&gt;
 +    # whenever a new assignment is added, add a job on each of its deadlines, to update the&lt;br /&gt;
 +    # timestamps of teams' submissions.&lt;br /&gt;
 +    scheduler = Rufus::Scheduler.singleton&lt;br /&gt;
 +&lt;br /&gt;
 +    self.due_dates.each do |due_date|&lt;br /&gt;
 +      if due_date.deadline_type.name == 'submission'&lt;br /&gt;
 +        scheduler.at(due_date.due_at.to_s, &amp;quot;assignment&amp;quot;=&amp;gt;self) do |job, time, arg|&lt;br /&gt;
 +          LinkSubmissionHistory.add_submission(job.opts['assignment'].id)&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
* files_submission_history&lt;br /&gt;
 +class FileSubmissionHistory &amp;lt; SubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = FileSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_pull_request_submission_history&lt;br /&gt;
 +class GithubPullRequestSubmissionHistory &amp;lt; GithubSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    link_path = uri.path&lt;br /&gt;
 +    git_user_details = link_path.split(&amp;quot;/&amp;quot;)&lt;br /&gt;
 +    github = Github.new&lt;br /&gt;
 +    a = github.pulls.get git_user_details[1], git_user_details[2], git_user_details[4]&lt;br /&gt;
 +    return a.updated_at&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_repo_submission_history&lt;br /&gt;
 +class GithubRepoSubmissionHistory &amp;lt; GithubSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    link_path = uri.path&lt;br /&gt;
 +    git_user_details = link_path.split(&amp;quot;/&amp;quot;)&lt;br /&gt;
 +    github = Github.new&lt;br /&gt;
 +    a = github.repos.get git_user_details[1], git_user_details[2]&lt;br /&gt;
 +    return a.pushed_at&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_submission_history&lt;br /&gt;
 +class GithubSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    if link.include? &amp;quot;pull&amp;quot;&lt;br /&gt;
 +      history_obj = GithubPullRequestSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = GithubRepoSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* googledoc_submission_history&lt;br /&gt;
 +class GoogledocSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GoogledocSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* link_submission_history&lt;br /&gt;
 +class LinkSubmissionHistory &amp;lt; SubmissionHistory&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    # lets assume link of type http://docs.google.com  or   http://wiki.expertiza.ncsu.edu  or http://github.com/goeltanmay/&lt;br /&gt;
 +    if link.include? &amp;quot;docs.google.com&amp;quot;&lt;br /&gt;
 +      history_obj = GoogledocSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    elsif link.include? &amp;quot;wiki.expertiza.ncsu.edu&amp;quot;&lt;br /&gt;
 +      history_obj = WikipediaSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    elsif link.include? &amp;quot;github.com&amp;quot;&lt;br /&gt;
 +      history_obj = GithubSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      # some random link has been given&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.new&lt;br /&gt;
 +      history_obj.team = team&lt;br /&gt;
 +      history_obj.submitted_detail = link&lt;br /&gt;
 +      history_obj.action = action&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.add_submission(assignment_id)&lt;br /&gt;
 +    @assignment = Assignment.find_by_id(assignment_id)&lt;br /&gt;
 +    teams = @assignment.teams&lt;br /&gt;
 +    teams.each do |team|&lt;br /&gt;
 +      submitted_links = team.hyperlinks&lt;br /&gt;
 +      submitted_links.each do |link|&lt;br /&gt;
 +        submission_history = SubmissionHistory.create(team, link)&lt;br /&gt;
 +        timestamp = submission_history.get_submitted_at_time(link)&lt;br /&gt;
 +        submission_history.submitted_at = timestamp&lt;br /&gt;
 +        begin&lt;br /&gt;
 +          submission_history.save&lt;br /&gt;
 +        rescue&lt;br /&gt;
 +          @error_message = &amp;quot;No new updates&amp;quot;&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* submission_history&lt;br /&gt;
 +class SubmissionHistory &amp;lt; ActiveRecord::Base&lt;br /&gt;
 +  belongs_to :team&lt;br /&gt;
 +  validates_uniqueness_of :submitted_detail, scope: [:team_id, :submitted_at]&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.create(team, link)&lt;br /&gt;
 +    # for file, the link will be? - put this as default condition&lt;br /&gt;
 +    # determine whether this is a file or a link&lt;br /&gt;
 +    existing_submission = SubmissionHistory.where([&amp;quot;team_id = ? and submitted_detail = ?&amp;quot;, team, link])&lt;br /&gt;
 +    if existing_submission.size&amp;gt;0&lt;br /&gt;
 +      action = &amp;quot;edit&amp;quot;&lt;br /&gt;
 +    else&lt;br /&gt;
 +      action = &amp;quot;add&amp;quot;&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    if link.start_with?(&amp;quot;http&amp;quot;)&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = FileSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.delete_submission(team, link)&lt;br /&gt;
 +    # just add a delete record&lt;br /&gt;
 +    if link.start_with?(&amp;quot;http&amp;quot;)&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.create(link, team, &amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = FileSubmissionHistory.create(link, team, &amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    return Time.current&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +end&lt;br /&gt;
* wikipedia_submission_history&lt;br /&gt;
 +class WikipediaSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = WikipediaSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    wiki_title = uri.path&lt;br /&gt;
 +    wiki_title.slice! &amp;quot;/index.php/&amp;quot;&lt;br /&gt;
 +    url = URI.parse('http://wiki.expertiza.ncsu.edu/api.php?action=query&amp;amp;prop=info&amp;amp;titles='+ wiki_title +'&amp;amp;format=json')&lt;br /&gt;
 +    req = Net::HTTP::Get.new(url.to_s)&lt;br /&gt;
 +    res = Net::HTTP.start(url.host, url.port) {|http|&lt;br /&gt;
 +      http.request(req)&lt;br /&gt;
 +    }&lt;br /&gt;
 +    hash= JSON.parse res.body&lt;br /&gt;
 +    id = hash[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;].keys&lt;br /&gt;
 +    return hash[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;][id[0]][&amp;quot;touched&amp;quot;]&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
* submitted_content_controller&lt;br /&gt;
 +    #create timeline for generalized map to just loop in the html&lt;br /&gt;
 +    @timeline = Hash.new()&lt;br /&gt;
 +    #Get timeline entries from submission_histories table&lt;br /&gt;
 +    @submission_history = SubmissionHistory.where(team: @participant.team.id).order(:submitted_at)&lt;br /&gt;
 +    #reviews&lt;br /&gt;
 +    @review_maps = ResponseMap.where(reviewee_id: @participant.team.id)&lt;br /&gt;
 +    @review_maps.each do |map|&lt;br /&gt;
 +      if &amp;quot;ReviewResponseMap&amp;quot;.eql?map.type&lt;br /&gt;
 +        @response = Response.find_by(map_id: map.id)&lt;br /&gt;
 +        @timeline[@response.updated_at]={:heading =&amp;gt; map.type.chomp('ResponseMap') , :description =&amp;gt; '', :color =&amp;gt; 'green'}&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +    #feedbacks&lt;br /&gt;
 +    @feedback_maps = ResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
 +    @feedback_maps.each do |map|&lt;br /&gt;
 +      if &amp;quot;FeedbackResponseMap&amp;quot;.eql?map.type&lt;br /&gt;
 +        @response = Response.find_by(map_id: map.id)&lt;br /&gt;
 +        @timeline[@response.updated_at]={:heading =&amp;gt; map.type.chomp('ResponseMap') , :description =&amp;gt; '', :color =&amp;gt; 'info'}&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +    @submission_history.each do |submission|&lt;br /&gt;
 +      @timeline[submission.submitted_at]={:heading =&amp;gt; submission.type+' '+submission.action, :description =&amp;gt; submission.submitted_detail}&lt;br /&gt;
 +    end&lt;br /&gt;
 +    @assignment.due_dates.each do |due_date|&lt;br /&gt;
 +      @timeline[due_date.due_at]={:heading =&amp;gt; ' Due Date ', :description =&amp;gt; due_date.deadline_type.name+' deadline', :color =&amp;gt; 'danger'}&lt;br /&gt;
 +    end&lt;br /&gt;
&lt;br /&gt;
Views&lt;br /&gt;
* submitted_content/_main.html.erb&lt;br /&gt;
 + &amp;lt;%if !@timeline.nil? %&amp;gt;&lt;br /&gt;
 +      &amp;lt;%= render partial: 'submitted_content/submission_history', locals: {timeline: @timeline, origin: ''} %&amp;gt;&lt;br /&gt;
 +  &amp;lt;%end%&amp;gt;&lt;br /&gt;
 +   &lt;br /&gt;
* submitted_content/_submission_history.html.erb&lt;br /&gt;
 + &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/assets/timeline.css&amp;quot; &amp;gt;&lt;br /&gt;
 +&lt;br /&gt;
  &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;&lt;br /&gt;
 +        &amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
 +        &amp;lt;div class=&amp;quot;col-md-12&amp;quot;&amp;gt;&lt;br /&gt;
 +          &amp;lt;div class=&amp;quot;page-header&amp;quot;&amp;gt;&lt;br /&gt;
 +            &amp;lt;h1&amp;gt;Submission History&amp;lt;/h1&amp;gt;&lt;br /&gt;
 +          &amp;lt;/div&amp;gt;&lt;br /&gt;
 +          &amp;lt;div style=&amp;quot;display:inline-block;width:100%;overflow-y:auto;&amp;quot;&amp;gt;&lt;br /&gt;
 +            &amp;lt;ul class=&amp;quot;timeline timeline-horizontal&amp;quot;&amp;gt;&lt;br /&gt;
 +              &amp;lt;% @timeline.sort.map do |key, timemark| %&amp;gt;&lt;br /&gt;
 +              &amp;lt;%# Display timestamps from timeline hash! %&amp;gt;&lt;br /&gt;
 +                &amp;lt;li class=&amp;quot;timeline-item&amp;quot;&amp;gt;&lt;br /&gt;
 +                  &amp;lt;div class=&amp;quot;timeline-badge &amp;lt;%= timemark[:color] %&amp;gt;&amp;quot;&amp;gt;&amp;lt;i class=&amp;quot;glyphicon glyphicon-check&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
 +                  &amp;lt;div class=&amp;quot;timeline-panel&amp;quot;&amp;gt;&lt;br /&gt;
 +                    &amp;lt;div class=&amp;quot;timeline-heading&amp;quot;&amp;gt;&lt;br /&gt;
 +                      &amp;lt;h4 class=&amp;quot;timeline-title&amp;quot;&amp;gt;&amp;lt;%= timemark[:heading] %&amp;gt;&amp;lt;/h4&amp;gt;&lt;br /&gt;
 +                      &amp;lt;p&amp;gt;&amp;lt;small class=&amp;quot;text-muted&amp;quot;&amp;gt;&amp;lt;i class=&amp;quot;glyphicon glyphicon-time&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; &amp;lt;%= key %&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
 +                    &amp;lt;/div&amp;gt;&lt;br /&gt;
 +                    &amp;lt;div class=&amp;quot;timeline-body&amp;quot;&amp;gt;&lt;br /&gt;
 +                      &amp;lt;p&amp;gt;&amp;lt;%= timemark[:description] %&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
 +                    &amp;lt;/div&amp;gt;&lt;br /&gt;
 +                  &amp;lt;/div&amp;gt;&lt;br /&gt;
 +                &amp;lt;/li&amp;gt;&lt;br /&gt;
 +              &amp;lt;% end %&amp;gt;&lt;br /&gt;
 +            &amp;lt;/ul&amp;gt;&lt;br /&gt;
 +          &amp;lt;/div&amp;gt;&lt;br /&gt;
 +        &amp;lt;/div&amp;gt;&lt;br /&gt;
 +      &amp;lt;/div&amp;gt;&lt;br /&gt;
 +    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
spec&lt;br /&gt;
* models/github_pull_request_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubPullRequestSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github pull request was updated&amp;quot; do&lt;br /&gt;
 +      history_object = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/github_repo_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubRepoSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github repo was pushed&amp;quot; do&lt;br /&gt;
 +      history_object = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/link_submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe LinkSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;add submission&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add GithubRepoSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubRepoSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add GithubPullRequestSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubPullRequestSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add WikipediaSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(WikipediaSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe SubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;create method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should create link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://www.youtube.com/watch?v=dQw4w9WgXcQ&amp;amp;ab_channel=RickAstleyVEVO&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(LinkSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubRepoSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubPullRequestSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create wikipedia link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(WikipediaSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create google doc link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GoogledocSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create file submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(FileSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  describe &amp;quot;delete method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a link submission history with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as edit&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history.submitted_at = Time.current&lt;br /&gt;
 +      submission_history.save&lt;br /&gt;
 +&lt;br /&gt;
 +      submission_history2 = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history2.submitted_at = Time.current&lt;br /&gt;
 +      submission_history2.save&lt;br /&gt;
 +      expect(submission_history2.action).to eq(&amp;quot;edit&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/wikipedia_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe WikipediaSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a wiki page was updated&amp;quot; do&lt;br /&gt;
 +      history_object = WikipediaSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
'''Testing Plan:'''&lt;br /&gt;
*Unit Testing of controllers&lt;br /&gt;
This involves unit testing of following controllers: TeamsController, because we will have to change some methods.&lt;br /&gt;
*Unit Testing of Models&lt;br /&gt;
This involves writing rspec test for all the newly created models like submission_history, google_doc_submission_history, etc. Tests for team model are already written.&lt;br /&gt;
*UI Testing&lt;br /&gt;
**Login as student/instructor.&lt;br /&gt;
**Go to Assignments Home Page.&lt;br /&gt;
**Here you will find a timeline with several tags like submission, review, resubmission, rereview. &lt;br /&gt;
**Also, There will be a tags for the authors submitting and updating their artifacts, reviewers submitting peer-reviews, reviewees sending author feedback and reviewers updating their peer reviews.&lt;br /&gt;
**As UI would be modified a lot, more testing part would be added after the implementation.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
*https://www.tutorialspoint.com/design_pattern/factory_pattern.htm&lt;br /&gt;
*https://developers.google.com/drive/v3/web/quickstart/ruby&lt;br /&gt;
*https://www.mediawiki.org/wiki/API:Main_page&lt;br /&gt;
*https://github.com/octokit/octokit.rb&lt;br /&gt;
*https://github.com/piotrmurach/github&lt;br /&gt;
Doubts:&lt;br /&gt;
Significance of submission record table&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106650</id>
		<title>CSC/ECE 517 Fall 2016/E1686-Timestamps for students' submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106650"/>
		<updated>2016-12-07T19:11:53Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Files Added/Modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
In this project, We will keep track of timestamp records for students' submissions and updates of artifacts (links to google doc/wikipedia/github), reviewers' submissions and edits of peer-reviews and author feedbacks.We will also create a timeline view for each artifact, showing when it was submitted/resubmitted and when it was reviewed. With our work, users (students and instructors) can see:&lt;br /&gt;
* when do the authors submit and update their artifacts.&lt;br /&gt;
* when do reviewers submit peer-reviews.&lt;br /&gt;
* when do reviewees send author feedback.&lt;br /&gt;
* when do reviewers update their peer reviews.&lt;br /&gt;
== Approach ==&lt;br /&gt;
[[File:appraoch.JPG|center]]&lt;br /&gt;
From a perspective (both instructors and students), users should be able to see such a timeline with all the events for each submission of an assignment. The events can be - &lt;br /&gt;
*add/edit events of various submission links/files&lt;br /&gt;
*Reviews&lt;br /&gt;
*author feedbacks&lt;br /&gt;
*peer reviews&lt;br /&gt;
Each of these artifacts can be edited and updated multiple times. Because we want to track when these artifacts are updated, we have to store their information in the database. We use the table suggested in the problem description “submission_histories”- &lt;br /&gt;
*Id :: integer- primary key for this table. &lt;br /&gt;
*team_id :: integer ← foreign key to the teams table&lt;br /&gt;
*submitted_detail :: string ← details of the event. This can be one of x values.&lt;br /&gt;
**Link  - if it is a assignment submission link. This can further be of 4 types - &lt;br /&gt;
**Google Docs&lt;br /&gt;
**Wikipedia&lt;br /&gt;
**Github repository &lt;br /&gt;
**Any other web link&lt;br /&gt;
*Review ids - if the event is a review submission&lt;br /&gt;
*Author feedback id - if the event is an add or edit operation on author feedback.&lt;br /&gt;
*Peer review id - if the event is an add or edit operation on peer review.&lt;br /&gt;
*Submitted_at  :: datetime ← to store the timestamp of the event&lt;br /&gt;
*Type :: string ← field which distinguish between different types of events - to be used for polymorphism.&lt;br /&gt;
*Action :: string - add / edit / delete based on the event.&lt;br /&gt;
These are the common components under which each component in the timeline can be classified. Each of these components are explained in detail on how it fits into the timeline and its significance and types listed. &lt;br /&gt;
&lt;br /&gt;
'''Data stored in submission_histories table'''&lt;br /&gt;
*Google Document, Wikipedia article, Github repository url : All of these are types of links given by the team during their submission. Through the url, we will identify which type of a submission is this, and then create an object of the particular class using the factory pattern. Each of these classes will implement their own “getLastUpdatedTimestamp” method, using the suggested APIs, through which we can get the required timestamp.&lt;br /&gt;
*File path and any other web link - These are also a part of main submissions, but since there is no way of tracking changes to these artifacts, we just take the time of the system when the link is added or removed.&lt;br /&gt;
*Peer Reviews, Author feedback: Peer reviews and author feedbacks are updated into the submission history table for every edit that takes place. The “updated_at” field acts as the current timestamp for edits in the Peer Reviews and Author feedbacks and the “created_at” field marks the start of these Events.&lt;br /&gt;
'''Data retrieved from existing tables'''&lt;br /&gt;
*Reviews: Timestamp for assignment reviews are taken from “responses” and “response_maps” table. The responses table contains round field and when “is_submitted” flag is true, the submission appears on the reviewee timeline where the “reviewee_id” retrieved from response_maps table. The reviews attached to the respective reviewee are collected and updated_at field gives the submission timestamp which is used on the timeline. Each review is collected and is added to the single Event map.&lt;br /&gt;
*Timeline Parameters: Values corresponding to an assignment which are common for a given Assignment are retrieved from the assignments table. And the timeline parameters are obtained by calculating from the created_at which is the start date for the assignment and  the field rounds_of_reviews determines the deadline by adding up the value stored in days_between_submission field of the same table. The Events - Start Date, Submission Deadline and Revision Deadline and Final assignment deadline exists for each assignment.&lt;br /&gt;
All the components are then added into one single map - Event -&amp;gt; Timestamp which is sorted on timestamp values and is displayed on screen.&lt;br /&gt;
&lt;br /&gt;
== Files Added/Modified ==&lt;br /&gt;
Models&lt;br /&gt;
* assignment&lt;br /&gt;
 require 'rufus-scheduler'&lt;br /&gt;
 after_save :record_submission&lt;br /&gt;
&lt;br /&gt;
 +private&lt;br /&gt;
 +  def record_submission&lt;br /&gt;
 +    # whenever a new assignment is added, add a job on each of its deadlines, to update the&lt;br /&gt;
 +    # timestamps of teams' submissions.&lt;br /&gt;
 +    scheduler = Rufus::Scheduler.singleton&lt;br /&gt;
 +&lt;br /&gt;
 +    self.due_dates.each do |due_date|&lt;br /&gt;
 +      if due_date.deadline_type.name == 'submission'&lt;br /&gt;
 +        scheduler.at(due_date.due_at.to_s, &amp;quot;assignment&amp;quot;=&amp;gt;self) do |job, time, arg|&lt;br /&gt;
 +          LinkSubmissionHistory.add_submission(job.opts['assignment'].id)&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
* files_submission_history&lt;br /&gt;
 +class FileSubmissionHistory &amp;lt; SubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = FileSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_pull_request_submission_history&lt;br /&gt;
 +class GithubPullRequestSubmissionHistory &amp;lt; GithubSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    link_path = uri.path&lt;br /&gt;
 +    git_user_details = link_path.split(&amp;quot;/&amp;quot;)&lt;br /&gt;
 +    github = Github.new&lt;br /&gt;
 +    a = github.pulls.get git_user_details[1], git_user_details[2], git_user_details[4]&lt;br /&gt;
 +    return a.updated_at&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_repo_submission_history&lt;br /&gt;
 +class GithubRepoSubmissionHistory &amp;lt; GithubSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    link_path = uri.path&lt;br /&gt;
 +    git_user_details = link_path.split(&amp;quot;/&amp;quot;)&lt;br /&gt;
 +    github = Github.new&lt;br /&gt;
 +    a = github.repos.get git_user_details[1], git_user_details[2]&lt;br /&gt;
 +    return a.pushed_at&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_submission_history&lt;br /&gt;
 +class GithubSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    if link.include? &amp;quot;pull&amp;quot;&lt;br /&gt;
 +      history_obj = GithubPullRequestSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = GithubRepoSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* googledoc_submission_history&lt;br /&gt;
 +class GoogledocSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GoogledocSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* link_submission_history&lt;br /&gt;
 +class LinkSubmissionHistory &amp;lt; SubmissionHistory&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    # lets assume link of type http://docs.google.com  or   http://wiki.expertiza.ncsu.edu  or http://github.com/goeltanmay/&lt;br /&gt;
 +    if link.include? &amp;quot;docs.google.com&amp;quot;&lt;br /&gt;
 +      history_obj = GoogledocSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    elsif link.include? &amp;quot;wiki.expertiza.ncsu.edu&amp;quot;&lt;br /&gt;
 +      history_obj = WikipediaSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    elsif link.include? &amp;quot;github.com&amp;quot;&lt;br /&gt;
 +      history_obj = GithubSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      # some random link has been given&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.new&lt;br /&gt;
 +      history_obj.team = team&lt;br /&gt;
 +      history_obj.submitted_detail = link&lt;br /&gt;
 +      history_obj.action = action&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.add_submission(assignment_id)&lt;br /&gt;
 +    @assignment = Assignment.find_by_id(assignment_id)&lt;br /&gt;
 +    teams = @assignment.teams&lt;br /&gt;
 +    teams.each do |team|&lt;br /&gt;
 +      submitted_links = team.hyperlinks&lt;br /&gt;
 +      submitted_links.each do |link|&lt;br /&gt;
 +        submission_history = SubmissionHistory.create(team, link)&lt;br /&gt;
 +        timestamp = submission_history.get_submitted_at_time(link)&lt;br /&gt;
 +        submission_history.submitted_at = timestamp&lt;br /&gt;
 +        begin&lt;br /&gt;
 +          submission_history.save&lt;br /&gt;
 +        rescue&lt;br /&gt;
 +          @error_message = &amp;quot;No new updates&amp;quot;&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* submission_history&lt;br /&gt;
 +class SubmissionHistory &amp;lt; ActiveRecord::Base&lt;br /&gt;
 +  belongs_to :team&lt;br /&gt;
 +  validates_uniqueness_of :submitted_detail, scope: [:team_id, :submitted_at]&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.create(team, link)&lt;br /&gt;
 +    # for file, the link will be? - put this as default condition&lt;br /&gt;
 +    # determine whether this is a file or a link&lt;br /&gt;
 +    existing_submission = SubmissionHistory.where([&amp;quot;team_id = ? and submitted_detail = ?&amp;quot;, team, link])&lt;br /&gt;
 +    if existing_submission.size&amp;gt;0&lt;br /&gt;
 +      action = &amp;quot;edit&amp;quot;&lt;br /&gt;
 +    else&lt;br /&gt;
 +      action = &amp;quot;add&amp;quot;&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    if link.start_with?(&amp;quot;http&amp;quot;)&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = FileSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.delete_submission(team, link)&lt;br /&gt;
 +    # just add a delete record&lt;br /&gt;
 +    if link.start_with?(&amp;quot;http&amp;quot;)&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.create(link, team, &amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = FileSubmissionHistory.create(link, team, &amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    return Time.current&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +end&lt;br /&gt;
* wikipedia_submission_history&lt;br /&gt;
 +class WikipediaSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = WikipediaSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    wiki_title = uri.path&lt;br /&gt;
 +    wiki_title.slice! &amp;quot;/index.php/&amp;quot;&lt;br /&gt;
 +    url = URI.parse('http://wiki.expertiza.ncsu.edu/api.php?action=query&amp;amp;prop=info&amp;amp;titles='+ wiki_title +'&amp;amp;format=json')&lt;br /&gt;
 +    req = Net::HTTP::Get.new(url.to_s)&lt;br /&gt;
 +    res = Net::HTTP.start(url.host, url.port) {|http|&lt;br /&gt;
 +      http.request(req)&lt;br /&gt;
 +    }&lt;br /&gt;
 +    hash= JSON.parse res.body&lt;br /&gt;
 +    id = hash[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;].keys&lt;br /&gt;
 +    return hash[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;][id[0]][&amp;quot;touched&amp;quot;]&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
* submitted_content_controller&lt;br /&gt;
 +    #create timeline for generalized map to just loop in the html&lt;br /&gt;
 +    @timeline = Hash.new()&lt;br /&gt;
 +    #Get timeline entries from submission_histories table&lt;br /&gt;
 +    @submission_history = SubmissionHistory.where(team: @participant.team.id).order(:submitted_at)&lt;br /&gt;
 +    #reviews&lt;br /&gt;
 +    @review_maps = ResponseMap.where(reviewee_id: @participant.team.id)&lt;br /&gt;
 +    @review_maps.each do |map|&lt;br /&gt;
 +      if &amp;quot;ReviewResponseMap&amp;quot;.eql?map.type&lt;br /&gt;
 +        @response = Response.find_by(map_id: map.id)&lt;br /&gt;
 +        @timeline[@response.updated_at]={:heading =&amp;gt; map.type.chomp('ResponseMap') , :description =&amp;gt; '', :color =&amp;gt; 'green'}&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +    #feedbacks&lt;br /&gt;
 +    @feedback_maps = ResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
 +    @feedback_maps.each do |map|&lt;br /&gt;
 +      if &amp;quot;FeedbackResponseMap&amp;quot;.eql?map.type&lt;br /&gt;
 +        @response = Response.find_by(map_id: map.id)&lt;br /&gt;
 +        @timeline[@response.updated_at]={:heading =&amp;gt; map.type.chomp('ResponseMap') , :description =&amp;gt; '', :color =&amp;gt; 'info'}&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +    @submission_history.each do |submission|&lt;br /&gt;
 +      @timeline[submission.submitted_at]={:heading =&amp;gt; submission.type+' '+submission.action, :description =&amp;gt; submission.submitted_detail}&lt;br /&gt;
 +    end&lt;br /&gt;
 +    @assignment.due_dates.each do |due_date|&lt;br /&gt;
 +      @timeline[due_date.due_at]={:heading =&amp;gt; ' Due Date ', :description =&amp;gt; due_date.deadline_type.name+' deadline', :color =&amp;gt; 'danger'}&lt;br /&gt;
 +    end&lt;br /&gt;
&lt;br /&gt;
Views&lt;br /&gt;
* submitted_content/_main.html.erb&lt;br /&gt;
 + &amp;lt;%if !@timeline.nil? %&amp;gt;&lt;br /&gt;
 +      &amp;lt;%= render partial: 'submitted_content/submission_history', locals: {timeline: @timeline, origin: ''} %&amp;gt;&lt;br /&gt;
 +  &amp;lt;%end%&amp;gt;&lt;br /&gt;
 +   &lt;br /&gt;
* submitted_content/_submission_history.html.erb&lt;br /&gt;
 + &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/assets/timeline.css&amp;quot; &amp;gt;&lt;br /&gt;
 +  &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;&lt;br /&gt;
 +        &amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
 +        &amp;lt;div class=&amp;quot;col-md-12&amp;quot;&amp;gt;&lt;br /&gt;
 +          &amp;lt;div class=&amp;quot;page-header&amp;quot;&amp;gt;&lt;br /&gt;
 +            &amp;lt;h1&amp;gt;Submission History&amp;lt;/h1&amp;gt;&lt;br /&gt;
 +          &amp;lt;/div&amp;gt;&lt;br /&gt;
 +          &amp;lt;div style=&amp;quot;display:inline-block;width:100%;overflow-y:auto;&amp;quot;&amp;gt;&lt;br /&gt;
 +            &amp;lt;ul class=&amp;quot;timeline timeline-horizontal&amp;quot;&amp;gt;&lt;br /&gt;
 +              &amp;lt;% @timeline.sort.map do |key, timemark| %&amp;gt;&lt;br /&gt;
 +              &amp;lt;%# Display timestamps from timeline hash! %&amp;gt;&lt;br /&gt;
 +                &amp;lt;li class=&amp;quot;timeline-item&amp;quot;&amp;gt;&lt;br /&gt;
 +                  &amp;lt;div class=&amp;quot;timeline-badge &amp;lt;%= timemark[:color] %&amp;gt;&amp;quot;&amp;gt;&amp;lt;i class=&amp;quot;glyphicon glyphicon-check&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
 +                  &amp;lt;div class=&amp;quot;timeline-panel&amp;quot;&amp;gt;&lt;br /&gt;
 +                    &amp;lt;div class=&amp;quot;timeline-heading&amp;quot;&amp;gt;&lt;br /&gt;
 +                      &amp;lt;h4 class=&amp;quot;timeline-title&amp;quot;&amp;gt;&amp;lt;%= timemark[:heading] %&amp;gt;&amp;lt;/h4&amp;gt;&lt;br /&gt;
 +                      &amp;lt;p&amp;gt;&amp;lt;small class=&amp;quot;text-muted&amp;quot;&amp;gt;&amp;lt;i class=&amp;quot;glyphicon glyphicon-time&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; &amp;lt;%= key %&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
 +                    &amp;lt;/div&amp;gt;&lt;br /&gt;
 +                    &amp;lt;div class=&amp;quot;timeline-body&amp;quot;&amp;gt;&lt;br /&gt;
 +                      &amp;lt;p&amp;gt;&amp;lt;%= timemark[:description] %&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
 +                    &amp;lt;/div&amp;gt;&lt;br /&gt;
 +                  &amp;lt;/div&amp;gt;&lt;br /&gt;
 +                &amp;lt;/li&amp;gt;&lt;br /&gt;
 +              &amp;lt;% end %&amp;gt;&lt;br /&gt;
 +            &amp;lt;/ul&amp;gt;&lt;br /&gt;
 +          &amp;lt;/div&amp;gt;&lt;br /&gt;
 +        &amp;lt;/div&amp;gt;&lt;br /&gt;
 +      &amp;lt;/div&amp;gt;&lt;br /&gt;
 +    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
spec&lt;br /&gt;
* models/github_pull_request_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubPullRequestSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github pull request was updated&amp;quot; do&lt;br /&gt;
 +      history_object = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/github_repo_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubRepoSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github repo was pushed&amp;quot; do&lt;br /&gt;
 +      history_object = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/link_submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe LinkSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;add submission&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add GithubRepoSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubRepoSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add GithubPullRequestSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubPullRequestSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add WikipediaSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(WikipediaSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe SubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;create method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should create link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://www.youtube.com/watch?v=dQw4w9WgXcQ&amp;amp;ab_channel=RickAstleyVEVO&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(LinkSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubRepoSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubPullRequestSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create wikipedia link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(WikipediaSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create google doc link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GoogledocSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create file submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(FileSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  describe &amp;quot;delete method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a link submission history with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as edit&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history.submitted_at = Time.current&lt;br /&gt;
 +      submission_history.save&lt;br /&gt;
 +&lt;br /&gt;
 +      submission_history2 = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history2.submitted_at = Time.current&lt;br /&gt;
 +      submission_history2.save&lt;br /&gt;
 +      expect(submission_history2.action).to eq(&amp;quot;edit&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/wikipedia_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe WikipediaSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a wiki page was updated&amp;quot; do&lt;br /&gt;
 +      history_object = WikipediaSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Factory Pattern'''&lt;br /&gt;
We are planning to use factory pattern for the type of link submitted. We will create an interface Type then we will create individual concrete classes like GitHubLink, GoogleDocLink, WikiLink which will implement our Type interface. To use factory pattern we will define TypeFactory class which will have static getType method that returns a Type that depends on the criteria that has been supplied.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''UML Diagram:'''&lt;br /&gt;
[[File:Class.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
'''Testing Plan:'''&lt;br /&gt;
*Unit Testing of controllers&lt;br /&gt;
This involves unit testing of following controllers: TeamsController, because we will have to change some methods.&lt;br /&gt;
*Unit Testing of Models&lt;br /&gt;
This involves writing rspec test for all the newly created models like submission_history, google_doc_submission_history, etc. Tests for team model are already written.&lt;br /&gt;
*UI Testing&lt;br /&gt;
**Login as student/instructor.&lt;br /&gt;
**Go to Assignments Home Page.&lt;br /&gt;
**Here you will find a timeline with several tags like submission, review, resubmission, rereview. &lt;br /&gt;
**Also, There will be a tags for the authors submitting and updating their artifacts, reviewers submitting peer-reviews, reviewees sending author feedback and reviewers updating their peer reviews.&lt;br /&gt;
**As UI would be modified a lot, more testing part would be added after the implementation.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
*https://www.tutorialspoint.com/design_pattern/factory_pattern.htm&lt;br /&gt;
*https://developers.google.com/drive/v3/web/quickstart/ruby&lt;br /&gt;
*https://www.mediawiki.org/wiki/API:Main_page&lt;br /&gt;
*https://github.com/octokit/octokit.rb&lt;br /&gt;
*https://github.com/piotrmurach/github&lt;br /&gt;
Doubts:&lt;br /&gt;
Significance of submission record table&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106647</id>
		<title>CSC/ECE 517 Fall 2016/E1686-Timestamps for students' submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106647"/>
		<updated>2016-12-07T19:07:43Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Files Added/Modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
In this project, We will keep track of timestamp records for students' submissions and updates of artifacts (links to google doc/wikipedia/github), reviewers' submissions and edits of peer-reviews and author feedbacks.We will also create a timeline view for each artifact, showing when it was submitted/resubmitted and when it was reviewed. With our work, users (students and instructors) can see:&lt;br /&gt;
* when do the authors submit and update their artifacts.&lt;br /&gt;
* when do reviewers submit peer-reviews.&lt;br /&gt;
* when do reviewees send author feedback.&lt;br /&gt;
* when do reviewers update their peer reviews.&lt;br /&gt;
== Approach ==&lt;br /&gt;
[[File:appraoch.JPG|center]]&lt;br /&gt;
From a perspective (both instructors and students), users should be able to see such a timeline with all the events for each submission of an assignment. The events can be - &lt;br /&gt;
*add/edit events of various submission links/files&lt;br /&gt;
*Reviews&lt;br /&gt;
*author feedbacks&lt;br /&gt;
*peer reviews&lt;br /&gt;
Each of these artifacts can be edited and updated multiple times. Because we want to track when these artifacts are updated, we have to store their information in the database. We use the table suggested in the problem description “submission_histories”- &lt;br /&gt;
*Id :: integer- primary key for this table. &lt;br /&gt;
*team_id :: integer ← foreign key to the teams table&lt;br /&gt;
*submitted_detail :: string ← details of the event. This can be one of x values.&lt;br /&gt;
**Link  - if it is a assignment submission link. This can further be of 4 types - &lt;br /&gt;
**Google Docs&lt;br /&gt;
**Wikipedia&lt;br /&gt;
**Github repository &lt;br /&gt;
**Any other web link&lt;br /&gt;
*Review ids - if the event is a review submission&lt;br /&gt;
*Author feedback id - if the event is an add or edit operation on author feedback.&lt;br /&gt;
*Peer review id - if the event is an add or edit operation on peer review.&lt;br /&gt;
*Submitted_at  :: datetime ← to store the timestamp of the event&lt;br /&gt;
*Type :: string ← field which distinguish between different types of events - to be used for polymorphism.&lt;br /&gt;
*Action :: string - add / edit / delete based on the event.&lt;br /&gt;
These are the common components under which each component in the timeline can be classified. Each of these components are explained in detail on how it fits into the timeline and its significance and types listed. &lt;br /&gt;
&lt;br /&gt;
'''Data stored in submission_histories table'''&lt;br /&gt;
*Google Document, Wikipedia article, Github repository url : All of these are types of links given by the team during their submission. Through the url, we will identify which type of a submission is this, and then create an object of the particular class using the factory pattern. Each of these classes will implement their own “getLastUpdatedTimestamp” method, using the suggested APIs, through which we can get the required timestamp.&lt;br /&gt;
*File path and any other web link - These are also a part of main submissions, but since there is no way of tracking changes to these artifacts, we just take the time of the system when the link is added or removed.&lt;br /&gt;
*Peer Reviews, Author feedback: Peer reviews and author feedbacks are updated into the submission history table for every edit that takes place. The “updated_at” field acts as the current timestamp for edits in the Peer Reviews and Author feedbacks and the “created_at” field marks the start of these Events.&lt;br /&gt;
'''Data retrieved from existing tables'''&lt;br /&gt;
*Reviews: Timestamp for assignment reviews are taken from “responses” and “response_maps” table. The responses table contains round field and when “is_submitted” flag is true, the submission appears on the reviewee timeline where the “reviewee_id” retrieved from response_maps table. The reviews attached to the respective reviewee are collected and updated_at field gives the submission timestamp which is used on the timeline. Each review is collected and is added to the single Event map.&lt;br /&gt;
*Timeline Parameters: Values corresponding to an assignment which are common for a given Assignment are retrieved from the assignments table. And the timeline parameters are obtained by calculating from the created_at which is the start date for the assignment and  the field rounds_of_reviews determines the deadline by adding up the value stored in days_between_submission field of the same table. The Events - Start Date, Submission Deadline and Revision Deadline and Final assignment deadline exists for each assignment.&lt;br /&gt;
All the components are then added into one single map - Event -&amp;gt; Timestamp which is sorted on timestamp values and is displayed on screen.&lt;br /&gt;
&lt;br /&gt;
== Files Added/Modified ==&lt;br /&gt;
Models&lt;br /&gt;
* assignment&lt;br /&gt;
 require 'rufus-scheduler'&lt;br /&gt;
 after_save :record_submission&lt;br /&gt;
&lt;br /&gt;
 +private&lt;br /&gt;
 +  def record_submission&lt;br /&gt;
 +    # whenever a new assignment is added, add a job on each of its deadlines, to update the&lt;br /&gt;
 +    # timestamps of teams' submissions.&lt;br /&gt;
 +    scheduler = Rufus::Scheduler.singleton&lt;br /&gt;
 +&lt;br /&gt;
 +    self.due_dates.each do |due_date|&lt;br /&gt;
 +      if due_date.deadline_type.name == 'submission'&lt;br /&gt;
 +        scheduler.at(due_date.due_at.to_s, &amp;quot;assignment&amp;quot;=&amp;gt;self) do |job, time, arg|&lt;br /&gt;
 +          LinkSubmissionHistory.add_submission(job.opts['assignment'].id)&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
* files_submission_history&lt;br /&gt;
 +class FileSubmissionHistory &amp;lt; SubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = FileSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_pull_request_submission_history&lt;br /&gt;
 +class GithubPullRequestSubmissionHistory &amp;lt; GithubSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    link_path = uri.path&lt;br /&gt;
 +    git_user_details = link_path.split(&amp;quot;/&amp;quot;)&lt;br /&gt;
 +    github = Github.new&lt;br /&gt;
 +    a = github.pulls.get git_user_details[1], git_user_details[2], git_user_details[4]&lt;br /&gt;
 +    return a.updated_at&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_repo_submission_history&lt;br /&gt;
 +class GithubRepoSubmissionHistory &amp;lt; GithubSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    link_path = uri.path&lt;br /&gt;
 +    git_user_details = link_path.split(&amp;quot;/&amp;quot;)&lt;br /&gt;
 +    github = Github.new&lt;br /&gt;
 +    a = github.repos.get git_user_details[1], git_user_details[2]&lt;br /&gt;
 +    return a.pushed_at&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* github_submission_history&lt;br /&gt;
 +class GithubSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    if link.include? &amp;quot;pull&amp;quot;&lt;br /&gt;
 +      history_obj = GithubPullRequestSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      history_obj = GithubRepoSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* googledoc_submission_history&lt;br /&gt;
 +class GoogledocSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = GoogledocSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* link_submission_history&lt;br /&gt;
 +class LinkSubmissionHistory &amp;lt; SubmissionHistory&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    # lets assume link of type http://docs.google.com  or   http://wiki.expertiza.ncsu.edu  or http://github.com/goeltanmay/&lt;br /&gt;
 +    if link.include? &amp;quot;docs.google.com&amp;quot;&lt;br /&gt;
 +      history_obj = GoogledocSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    elsif link.include? &amp;quot;wiki.expertiza.ncsu.edu&amp;quot;&lt;br /&gt;
 +      history_obj = WikipediaSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    elsif link.include? &amp;quot;github.com&amp;quot;&lt;br /&gt;
 +      history_obj = GithubSubmissionHistory.create(link, team, action)&lt;br /&gt;
 +    else&lt;br /&gt;
 +      # some random link has been given&lt;br /&gt;
 +      history_obj = LinkSubmissionHistory.new&lt;br /&gt;
 +      history_obj.team = team&lt;br /&gt;
 +      history_obj.submitted_detail = link&lt;br /&gt;
 +      history_obj.action = action&lt;br /&gt;
 +    end&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def self.add_submission(assignment_id)&lt;br /&gt;
 +    @assignment = Assignment.find_by_id(assignment_id)&lt;br /&gt;
 +    teams = @assignment.teams&lt;br /&gt;
 +    teams.each do |team|&lt;br /&gt;
 +      submitted_links = team.hyperlinks&lt;br /&gt;
 +      submitted_links.each do |link|&lt;br /&gt;
 +        submission_history = SubmissionHistory.create(team, link)&lt;br /&gt;
 +        timestamp = submission_history.get_submitted_at_time(link)&lt;br /&gt;
 +        submission_history.submitted_at = timestamp&lt;br /&gt;
 +        begin&lt;br /&gt;
 +          submission_history.save&lt;br /&gt;
 +        rescue&lt;br /&gt;
 +          @error_message = &amp;quot;No new updates&amp;quot;&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* submission_history&lt;br /&gt;
* wikipedia_submission_history&lt;br /&gt;
 +class WikipediaSubmissionHistory &amp;lt; LinkSubmissionHistory&lt;br /&gt;
 +  def self.create(link, team, action)&lt;br /&gt;
 +    history_obj = WikipediaSubmissionHistory.new&lt;br /&gt;
 +    history_obj.submitted_detail = link&lt;br /&gt;
 +    history_obj.team = team&lt;br /&gt;
 +    history_obj.action = action&lt;br /&gt;
 +    return history_obj&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  def get_submitted_at_time(link)&lt;br /&gt;
 +    uri = URI(link)&lt;br /&gt;
 +    wiki_title = uri.path&lt;br /&gt;
 +    wiki_title.slice! &amp;quot;/index.php/&amp;quot;&lt;br /&gt;
 +    url = URI.parse('http://wiki.expertiza.ncsu.edu/api.php?action=query&amp;amp;prop=info&amp;amp;titles='+ wiki_title +'&amp;amp;format=json')&lt;br /&gt;
 +    req = Net::HTTP::Get.new(url.to_s)&lt;br /&gt;
 +    res = Net::HTTP.start(url.host, url.port) {|http|&lt;br /&gt;
 +      http.request(req)&lt;br /&gt;
 +    }&lt;br /&gt;
 +    hash= JSON.parse res.body&lt;br /&gt;
 +    id = hash[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;].keys&lt;br /&gt;
 +    return hash[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;][id[0]][&amp;quot;touched&amp;quot;]&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
* submitted_content_controller&lt;br /&gt;
&lt;br /&gt;
Views&lt;br /&gt;
* submitted_content/_main.html.erb&lt;br /&gt;
 + &amp;lt;%if !@timeline.nil? %&amp;gt;&lt;br /&gt;
 +      &amp;lt;%= render partial: 'submitted_content/submission_history', locals: {timeline: @timeline, origin: ''} %&amp;gt;&lt;br /&gt;
 +  &amp;lt;%end%&amp;gt;&lt;br /&gt;
 +   &lt;br /&gt;
* submitted_content/_submission_history.html.erb&lt;br /&gt;
 +&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/assets/timeline.css&amp;quot; &amp;gt;&lt;br /&gt;
 +  &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;&lt;br /&gt;
 +        &amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
 +        &amp;lt;div class=&amp;quot;col-md-12&amp;quot;&amp;gt;&lt;br /&gt;
 +          &amp;lt;div class=&amp;quot;page-header&amp;quot;&amp;gt;&lt;br /&gt;
 +            &amp;lt;h1&amp;gt;Submission History&amp;lt;/h1&amp;gt;&lt;br /&gt;
 +          &amp;lt;/div&amp;gt;&lt;br /&gt;
 +          &amp;lt;div style=&amp;quot;display:inline-block;width:100%;overflow-y:auto;&amp;quot;&amp;gt;&lt;br /&gt;
 +            &amp;lt;ul class=&amp;quot;timeline timeline-horizontal&amp;quot;&amp;gt;&lt;br /&gt;
 +              &amp;lt;% @timeline.sort.map do |key, timemark| %&amp;gt;&lt;br /&gt;
 +              &amp;lt;%# Display timestamps from timeline hash! %&amp;gt;&lt;br /&gt;
 +                &amp;lt;li class=&amp;quot;timeline-item&amp;quot;&amp;gt;&lt;br /&gt;
 +                  &amp;lt;div class=&amp;quot;timeline-badge &amp;lt;%= timemark[:color] %&amp;gt;&amp;quot;&amp;gt;&amp;lt;i class=&amp;quot;glyphicon glyphicon-check&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
 +                  &amp;lt;div class=&amp;quot;timeline-panel&amp;quot;&amp;gt;&lt;br /&gt;
 +                    &amp;lt;div class=&amp;quot;timeline-heading&amp;quot;&amp;gt;&lt;br /&gt;
 +                      &amp;lt;h4 class=&amp;quot;timeline-title&amp;quot;&amp;gt;&amp;lt;%= timemark[:heading] %&amp;gt;&amp;lt;/h4&amp;gt;&lt;br /&gt;
 +                      &amp;lt;p&amp;gt;&amp;lt;small class=&amp;quot;text-muted&amp;quot;&amp;gt;&amp;lt;i class=&amp;quot;glyphicon glyphicon-time&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; &amp;lt;%= key %&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
 +                    &amp;lt;/div&amp;gt;&lt;br /&gt;
 +                    &amp;lt;div class=&amp;quot;timeline-body&amp;quot;&amp;gt;&lt;br /&gt;
 +                      &amp;lt;p&amp;gt;&amp;lt;%= timemark[:description] %&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
 +                    &amp;lt;/div&amp;gt;&lt;br /&gt;
 +                  &amp;lt;/div&amp;gt;&lt;br /&gt;
 +                &amp;lt;/li&amp;gt;&lt;br /&gt;
 +              &amp;lt;% end %&amp;gt;&lt;br /&gt;
 +            &amp;lt;/ul&amp;gt;&lt;br /&gt;
 +          &amp;lt;/div&amp;gt;&lt;br /&gt;
 +        &amp;lt;/div&amp;gt;&lt;br /&gt;
 +      &amp;lt;/div&amp;gt;&lt;br /&gt;
 +    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
spec&lt;br /&gt;
* models/github_pull_request_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubPullRequestSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github pull request was updated&amp;quot; do&lt;br /&gt;
 +      history_object = GithubPullRequestSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/github_repo_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubRepoSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github repo was pushed&amp;quot; do&lt;br /&gt;
 +      history_object = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/link_submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe LinkSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;add submission&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add GithubRepoSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubRepoSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add GithubPullRequestSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubPullRequestSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add WikipediaSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(WikipediaSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe SubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;create method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should create link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://www.youtube.com/watch?v=dQw4w9WgXcQ&amp;amp;ab_channel=RickAstleyVEVO&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(LinkSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubRepoSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubPullRequestSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create wikipedia link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(WikipediaSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create google doc link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GoogledocSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create file submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(FileSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  describe &amp;quot;delete method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a link submission history with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as edit&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history.submitted_at = Time.current&lt;br /&gt;
 +      submission_history.save&lt;br /&gt;
 +&lt;br /&gt;
 +      submission_history2 = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history2.submitted_at = Time.current&lt;br /&gt;
 +      submission_history2.save&lt;br /&gt;
 +      expect(submission_history2.action).to eq(&amp;quot;edit&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/wikipedia_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe WikipediaSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a wiki page was updated&amp;quot; do&lt;br /&gt;
 +      history_object = WikipediaSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Factory Pattern'''&lt;br /&gt;
We are planning to use factory pattern for the type of link submitted. We will create an interface Type then we will create individual concrete classes like GitHubLink, GoogleDocLink, WikiLink which will implement our Type interface. To use factory pattern we will define TypeFactory class which will have static getType method that returns a Type that depends on the criteria that has been supplied.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''UML Diagram:'''&lt;br /&gt;
[[File:Class.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
'''Testing Plan:'''&lt;br /&gt;
*Unit Testing of controllers&lt;br /&gt;
This involves unit testing of following controllers: TeamsController, because we will have to change some methods.&lt;br /&gt;
*Unit Testing of Models&lt;br /&gt;
This involves writing rspec test for all the newly created models like submission_history, google_doc_submission_history, etc. Tests for team model are already written.&lt;br /&gt;
*UI Testing&lt;br /&gt;
**Login as student/instructor.&lt;br /&gt;
**Go to Assignments Home Page.&lt;br /&gt;
**Here you will find a timeline with several tags like submission, review, resubmission, rereview. &lt;br /&gt;
**Also, There will be a tags for the authors submitting and updating their artifacts, reviewers submitting peer-reviews, reviewees sending author feedback and reviewers updating their peer reviews.&lt;br /&gt;
**As UI would be modified a lot, more testing part would be added after the implementation.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
*https://www.tutorialspoint.com/design_pattern/factory_pattern.htm&lt;br /&gt;
*https://developers.google.com/drive/v3/web/quickstart/ruby&lt;br /&gt;
*https://www.mediawiki.org/wiki/API:Main_page&lt;br /&gt;
*https://github.com/octokit/octokit.rb&lt;br /&gt;
*https://github.com/piotrmurach/github&lt;br /&gt;
Doubts:&lt;br /&gt;
Significance of submission record table&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106645</id>
		<title>CSC/ECE 517 Fall 2016/E1686-Timestamps for students' submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106645"/>
		<updated>2016-12-07T19:04:42Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Files Added/Modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
In this project, We will keep track of timestamp records for students' submissions and updates of artifacts (links to google doc/wikipedia/github), reviewers' submissions and edits of peer-reviews and author feedbacks.We will also create a timeline view for each artifact, showing when it was submitted/resubmitted and when it was reviewed. With our work, users (students and instructors) can see:&lt;br /&gt;
* when do the authors submit and update their artifacts.&lt;br /&gt;
* when do reviewers submit peer-reviews.&lt;br /&gt;
* when do reviewees send author feedback.&lt;br /&gt;
* when do reviewers update their peer reviews.&lt;br /&gt;
== Approach ==&lt;br /&gt;
[[File:appraoch.JPG|center]]&lt;br /&gt;
From a perspective (both instructors and students), users should be able to see such a timeline with all the events for each submission of an assignment. The events can be - &lt;br /&gt;
*add/edit events of various submission links/files&lt;br /&gt;
*Reviews&lt;br /&gt;
*author feedbacks&lt;br /&gt;
*peer reviews&lt;br /&gt;
Each of these artifacts can be edited and updated multiple times. Because we want to track when these artifacts are updated, we have to store their information in the database. We use the table suggested in the problem description “submission_histories”- &lt;br /&gt;
*Id :: integer- primary key for this table. &lt;br /&gt;
*team_id :: integer ← foreign key to the teams table&lt;br /&gt;
*submitted_detail :: string ← details of the event. This can be one of x values.&lt;br /&gt;
**Link  - if it is a assignment submission link. This can further be of 4 types - &lt;br /&gt;
**Google Docs&lt;br /&gt;
**Wikipedia&lt;br /&gt;
**Github repository &lt;br /&gt;
**Any other web link&lt;br /&gt;
*Review ids - if the event is a review submission&lt;br /&gt;
*Author feedback id - if the event is an add or edit operation on author feedback.&lt;br /&gt;
*Peer review id - if the event is an add or edit operation on peer review.&lt;br /&gt;
*Submitted_at  :: datetime ← to store the timestamp of the event&lt;br /&gt;
*Type :: string ← field which distinguish between different types of events - to be used for polymorphism.&lt;br /&gt;
*Action :: string - add / edit / delete based on the event.&lt;br /&gt;
These are the common components under which each component in the timeline can be classified. Each of these components are explained in detail on how it fits into the timeline and its significance and types listed. &lt;br /&gt;
&lt;br /&gt;
'''Data stored in submission_histories table'''&lt;br /&gt;
*Google Document, Wikipedia article, Github repository url : All of these are types of links given by the team during their submission. Through the url, we will identify which type of a submission is this, and then create an object of the particular class using the factory pattern. Each of these classes will implement their own “getLastUpdatedTimestamp” method, using the suggested APIs, through which we can get the required timestamp.&lt;br /&gt;
*File path and any other web link - These are also a part of main submissions, but since there is no way of tracking changes to these artifacts, we just take the time of the system when the link is added or removed.&lt;br /&gt;
*Peer Reviews, Author feedback: Peer reviews and author feedbacks are updated into the submission history table for every edit that takes place. The “updated_at” field acts as the current timestamp for edits in the Peer Reviews and Author feedbacks and the “created_at” field marks the start of these Events.&lt;br /&gt;
'''Data retrieved from existing tables'''&lt;br /&gt;
*Reviews: Timestamp for assignment reviews are taken from “responses” and “response_maps” table. The responses table contains round field and when “is_submitted” flag is true, the submission appears on the reviewee timeline where the “reviewee_id” retrieved from response_maps table. The reviews attached to the respective reviewee are collected and updated_at field gives the submission timestamp which is used on the timeline. Each review is collected and is added to the single Event map.&lt;br /&gt;
*Timeline Parameters: Values corresponding to an assignment which are common for a given Assignment are retrieved from the assignments table. And the timeline parameters are obtained by calculating from the created_at which is the start date for the assignment and  the field rounds_of_reviews determines the deadline by adding up the value stored in days_between_submission field of the same table. The Events - Start Date, Submission Deadline and Revision Deadline and Final assignment deadline exists for each assignment.&lt;br /&gt;
All the components are then added into one single map - Event -&amp;gt; Timestamp which is sorted on timestamp values and is displayed on screen.&lt;br /&gt;
&lt;br /&gt;
== Files Added/Modified ==&lt;br /&gt;
Models&lt;br /&gt;
* assignment&lt;br /&gt;
 require 'rufus-scheduler'&lt;br /&gt;
 after_save :record_submission&lt;br /&gt;
&lt;br /&gt;
 +private&lt;br /&gt;
 +  def record_submission&lt;br /&gt;
 +    # whenever a new assignment is added, add a job on each of its deadlines, to update the&lt;br /&gt;
 +    # timestamps of teams' submissions.&lt;br /&gt;
 +    scheduler = Rufus::Scheduler.singleton&lt;br /&gt;
 +&lt;br /&gt;
 +    self.due_dates.each do |due_date|&lt;br /&gt;
 +      if due_date.deadline_type.name == 'submission'&lt;br /&gt;
 +        scheduler.at(due_date.due_at.to_s, &amp;quot;assignment&amp;quot;=&amp;gt;self) do |job, time, arg|&lt;br /&gt;
 +          LinkSubmissionHistory.add_submission(job.opts['assignment'].id)&lt;br /&gt;
 +        end&lt;br /&gt;
 +      end&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
* files_submission_history&lt;br /&gt;
* github_pull_request_submission_history&lt;br /&gt;
* github_repo_submission_history&lt;br /&gt;
* github_submission_history&lt;br /&gt;
* googledoc_submission_history&lt;br /&gt;
* link_submission_history&lt;br /&gt;
* submission_history&lt;br /&gt;
* wikipedia_submission_history&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
* submitted_content_controller&lt;br /&gt;
&lt;br /&gt;
Views&lt;br /&gt;
* submitted_content/_main.html.erb&lt;br /&gt;
* submitted_content/_submission_history.html.erb&lt;br /&gt;
&lt;br /&gt;
spec&lt;br /&gt;
* models/github_repo_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe GithubRepoSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a github repo was pushed&amp;quot; do&lt;br /&gt;
 +      history_object = GithubRepoSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;https://github.com/prerit2803/expertiza/&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/link_submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe LinkSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;add submission&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add GithubRepoSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubRepoSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add GithubPullRequestSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(GithubPullRequestSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add WikipediaSubmissionHistory&amp;quot; do&lt;br /&gt;
 +      assignment = build(Assignment)&lt;br /&gt;
 +      assignment.save&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      assignment_team.parent_id = assignment.id&lt;br /&gt;
 +      assignment_team.submit_hyperlink(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      assignment_team.save&lt;br /&gt;
 +      expect_any_instance_of(WikipediaSubmissionHistory).to receive(:get_submitted_at_time)&lt;br /&gt;
 +      LinkSubmissionHistory.add_submission(assignment.id)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/submission_history_spec.rb&lt;br /&gt;
 +require 'rails_helper'&lt;br /&gt;
 +&lt;br /&gt;
 +describe SubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;create method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should create link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://www.youtube.com/watch?v=dQw4w9WgXcQ&amp;amp;ab_channel=RickAstleyVEVO&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(LinkSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubRepoSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create github link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://github.com/prerit2803/expertiza/pull/1&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GithubPullRequestSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create wikipedia link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(WikipediaSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create google doc link submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(GoogledocSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should create file submission history&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history).to be_a(FileSubmissionHistory)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +&lt;br /&gt;
 +  describe &amp;quot;delete method&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a link submission history with action as delete&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;https://docs.google.com/document/d/1fI5KbPXCJ8dSUyLynnqC__A3MtZ47enNfMcki3Vf3uk/edit&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.delete_submission(assignment_team, link)&lt;br /&gt;
 +      expect(submission_history.action).to eq(&amp;quot;delete&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +&lt;br /&gt;
 +    it &amp;quot;should add a row to submission history table with action as edit&amp;quot; do&lt;br /&gt;
 +      assignment_team = build(AssignmentTeam)&lt;br /&gt;
 +      link = &amp;quot;/user/home/Expertiza_gemfile&amp;quot;&lt;br /&gt;
 +      submission_history = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history.submitted_at = Time.current&lt;br /&gt;
 +      submission_history.save&lt;br /&gt;
 +&lt;br /&gt;
 +      submission_history2 = SubmissionHistory.create(assignment_team, link)&lt;br /&gt;
 +      submission_history2.submitted_at = Time.current&lt;br /&gt;
 +      submission_history2.save&lt;br /&gt;
 +      expect(submission_history2.action).to eq(&amp;quot;edit&amp;quot;)&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
* models/wikipedia_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe WikipediaSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a wiki page was updated&amp;quot; do&lt;br /&gt;
 +      history_object = WikipediaSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Factory Pattern'''&lt;br /&gt;
We are planning to use factory pattern for the type of link submitted. We will create an interface Type then we will create individual concrete classes like GitHubLink, GoogleDocLink, WikiLink which will implement our Type interface. To use factory pattern we will define TypeFactory class which will have static getType method that returns a Type that depends on the criteria that has been supplied.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''UML Diagram:'''&lt;br /&gt;
[[File:Class.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
'''Testing Plan:'''&lt;br /&gt;
*Unit Testing of controllers&lt;br /&gt;
This involves unit testing of following controllers: TeamsController, because we will have to change some methods.&lt;br /&gt;
*Unit Testing of Models&lt;br /&gt;
This involves writing rspec test for all the newly created models like submission_history, google_doc_submission_history, etc. Tests for team model are already written.&lt;br /&gt;
*UI Testing&lt;br /&gt;
**Login as student/instructor.&lt;br /&gt;
**Go to Assignments Home Page.&lt;br /&gt;
**Here you will find a timeline with several tags like submission, review, resubmission, rereview. &lt;br /&gt;
**Also, There will be a tags for the authors submitting and updating their artifacts, reviewers submitting peer-reviews, reviewees sending author feedback and reviewers updating their peer reviews.&lt;br /&gt;
**As UI would be modified a lot, more testing part would be added after the implementation.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
*https://www.tutorialspoint.com/design_pattern/factory_pattern.htm&lt;br /&gt;
*https://developers.google.com/drive/v3/web/quickstart/ruby&lt;br /&gt;
*https://www.mediawiki.org/wiki/API:Main_page&lt;br /&gt;
*https://github.com/octokit/octokit.rb&lt;br /&gt;
*https://github.com/piotrmurach/github&lt;br /&gt;
Doubts:&lt;br /&gt;
Significance of submission record table&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106643</id>
		<title>CSC/ECE 517 Fall 2016/E1686-Timestamps for students' submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106643"/>
		<updated>2016-12-07T19:03:08Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Files Added/Modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
In this project, We will keep track of timestamp records for students' submissions and updates of artifacts (links to google doc/wikipedia/github), reviewers' submissions and edits of peer-reviews and author feedbacks.We will also create a timeline view for each artifact, showing when it was submitted/resubmitted and when it was reviewed. With our work, users (students and instructors) can see:&lt;br /&gt;
* when do the authors submit and update their artifacts.&lt;br /&gt;
* when do reviewers submit peer-reviews.&lt;br /&gt;
* when do reviewees send author feedback.&lt;br /&gt;
* when do reviewers update their peer reviews.&lt;br /&gt;
== Approach ==&lt;br /&gt;
[[File:appraoch.JPG|center]]&lt;br /&gt;
From a perspective (both instructors and students), users should be able to see such a timeline with all the events for each submission of an assignment. The events can be - &lt;br /&gt;
*add/edit events of various submission links/files&lt;br /&gt;
*Reviews&lt;br /&gt;
*author feedbacks&lt;br /&gt;
*peer reviews&lt;br /&gt;
Each of these artifacts can be edited and updated multiple times. Because we want to track when these artifacts are updated, we have to store their information in the database. We use the table suggested in the problem description “submission_histories”- &lt;br /&gt;
*Id :: integer- primary key for this table. &lt;br /&gt;
*team_id :: integer ← foreign key to the teams table&lt;br /&gt;
*submitted_detail :: string ← details of the event. This can be one of x values.&lt;br /&gt;
**Link  - if it is a assignment submission link. This can further be of 4 types - &lt;br /&gt;
**Google Docs&lt;br /&gt;
**Wikipedia&lt;br /&gt;
**Github repository &lt;br /&gt;
**Any other web link&lt;br /&gt;
*Review ids - if the event is a review submission&lt;br /&gt;
*Author feedback id - if the event is an add or edit operation on author feedback.&lt;br /&gt;
*Peer review id - if the event is an add or edit operation on peer review.&lt;br /&gt;
*Submitted_at  :: datetime ← to store the timestamp of the event&lt;br /&gt;
*Type :: string ← field which distinguish between different types of events - to be used for polymorphism.&lt;br /&gt;
*Action :: string - add / edit / delete based on the event.&lt;br /&gt;
These are the common components under which each component in the timeline can be classified. Each of these components are explained in detail on how it fits into the timeline and its significance and types listed. &lt;br /&gt;
&lt;br /&gt;
'''Data stored in submission_histories table'''&lt;br /&gt;
*Google Document, Wikipedia article, Github repository url : All of these are types of links given by the team during their submission. Through the url, we will identify which type of a submission is this, and then create an object of the particular class using the factory pattern. Each of these classes will implement their own “getLastUpdatedTimestamp” method, using the suggested APIs, through which we can get the required timestamp.&lt;br /&gt;
*File path and any other web link - These are also a part of main submissions, but since there is no way of tracking changes to these artifacts, we just take the time of the system when the link is added or removed.&lt;br /&gt;
*Peer Reviews, Author feedback: Peer reviews and author feedbacks are updated into the submission history table for every edit that takes place. The “updated_at” field acts as the current timestamp for edits in the Peer Reviews and Author feedbacks and the “created_at” field marks the start of these Events.&lt;br /&gt;
'''Data retrieved from existing tables'''&lt;br /&gt;
*Reviews: Timestamp for assignment reviews are taken from “responses” and “response_maps” table. The responses table contains round field and when “is_submitted” flag is true, the submission appears on the reviewee timeline where the “reviewee_id” retrieved from response_maps table. The reviews attached to the respective reviewee are collected and updated_at field gives the submission timestamp which is used on the timeline. Each review is collected and is added to the single Event map.&lt;br /&gt;
*Timeline Parameters: Values corresponding to an assignment which are common for a given Assignment are retrieved from the assignments table. And the timeline parameters are obtained by calculating from the created_at which is the start date for the assignment and  the field rounds_of_reviews determines the deadline by adding up the value stored in days_between_submission field of the same table. The Events - Start Date, Submission Deadline and Revision Deadline and Final assignment deadline exists for each assignment.&lt;br /&gt;
All the components are then added into one single map - Event -&amp;gt; Timestamp which is sorted on timestamp values and is displayed on screen.&lt;br /&gt;
&lt;br /&gt;
== Files Added/Modified ==&lt;br /&gt;
Models&lt;br /&gt;
* assignment&lt;br /&gt;
 require 'rufus-scheduler'&lt;br /&gt;
 after_save :record_submission&lt;br /&gt;
* files_submission_history&lt;br /&gt;
* github_pull_request_submission_history&lt;br /&gt;
* github_repo_submission_history&lt;br /&gt;
* github_submission_history&lt;br /&gt;
* googledoc_submission_history&lt;br /&gt;
* link_submission_history&lt;br /&gt;
* submission_history&lt;br /&gt;
* wikipedia_submission_history&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
* submitted_content_controller&lt;br /&gt;
&lt;br /&gt;
Views&lt;br /&gt;
* submitted_content/_main.html.erb&lt;br /&gt;
* submitted_content/_submission_history.html.erb&lt;br /&gt;
&lt;br /&gt;
spec&lt;br /&gt;
* models/github_repo_submission_history_spec.rb&lt;br /&gt;
* models/link_submission_history_spec.rb&lt;br /&gt;
* models/submission_history_spec.rb&lt;br /&gt;
* models/wikipedia_submission_history_spec.rb&lt;br /&gt;
 +require &amp;quot;rails_helper&amp;quot;&lt;br /&gt;
 +&lt;br /&gt;
 +describe WikipediaSubmissionHistory do&lt;br /&gt;
 +  describe &amp;quot;get_submitted_at_time&amp;quot; do&lt;br /&gt;
 +    it &amp;quot;should return the last time a wiki page was updated&amp;quot; do&lt;br /&gt;
 +      history_object = WikipediaSubmissionHistory.new&lt;br /&gt;
 +      time_stamp = history_object.get_submitted_at_time(&amp;quot;http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2016/oss_E1663&amp;quot;)&lt;br /&gt;
 +      expect(time_stamp).not_to be_empty&lt;br /&gt;
 +    end&lt;br /&gt;
 +  end&lt;br /&gt;
 +end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Factory Pattern'''&lt;br /&gt;
We are planning to use factory pattern for the type of link submitted. We will create an interface Type then we will create individual concrete classes like GitHubLink, GoogleDocLink, WikiLink which will implement our Type interface. To use factory pattern we will define TypeFactory class which will have static getType method that returns a Type that depends on the criteria that has been supplied.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''UML Diagram:'''&lt;br /&gt;
[[File:Class.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
'''Testing Plan:'''&lt;br /&gt;
*Unit Testing of controllers&lt;br /&gt;
This involves unit testing of following controllers: TeamsController, because we will have to change some methods.&lt;br /&gt;
*Unit Testing of Models&lt;br /&gt;
This involves writing rspec test for all the newly created models like submission_history, google_doc_submission_history, etc. Tests for team model are already written.&lt;br /&gt;
*UI Testing&lt;br /&gt;
**Login as student/instructor.&lt;br /&gt;
**Go to Assignments Home Page.&lt;br /&gt;
**Here you will find a timeline with several tags like submission, review, resubmission, rereview. &lt;br /&gt;
**Also, There will be a tags for the authors submitting and updating their artifacts, reviewers submitting peer-reviews, reviewees sending author feedback and reviewers updating their peer reviews.&lt;br /&gt;
**As UI would be modified a lot, more testing part would be added after the implementation.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
*https://www.tutorialspoint.com/design_pattern/factory_pattern.htm&lt;br /&gt;
*https://developers.google.com/drive/v3/web/quickstart/ruby&lt;br /&gt;
*https://www.mediawiki.org/wiki/API:Main_page&lt;br /&gt;
*https://github.com/octokit/octokit.rb&lt;br /&gt;
*https://github.com/piotrmurach/github&lt;br /&gt;
Doubts:&lt;br /&gt;
Significance of submission record table&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106640</id>
		<title>CSC/ECE 517 Fall 2016/E1686-Timestamps for students' submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106640"/>
		<updated>2016-12-07T19:02:00Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Files Added/Modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
In this project, We will keep track of timestamp records for students' submissions and updates of artifacts (links to google doc/wikipedia/github), reviewers' submissions and edits of peer-reviews and author feedbacks.We will also create a timeline view for each artifact, showing when it was submitted/resubmitted and when it was reviewed. With our work, users (students and instructors) can see:&lt;br /&gt;
* when do the authors submit and update their artifacts.&lt;br /&gt;
* when do reviewers submit peer-reviews.&lt;br /&gt;
* when do reviewees send author feedback.&lt;br /&gt;
* when do reviewers update their peer reviews.&lt;br /&gt;
== Approach ==&lt;br /&gt;
[[File:appraoch.JPG|center]]&lt;br /&gt;
From a perspective (both instructors and students), users should be able to see such a timeline with all the events for each submission of an assignment. The events can be - &lt;br /&gt;
*add/edit events of various submission links/files&lt;br /&gt;
*Reviews&lt;br /&gt;
*author feedbacks&lt;br /&gt;
*peer reviews&lt;br /&gt;
Each of these artifacts can be edited and updated multiple times. Because we want to track when these artifacts are updated, we have to store their information in the database. We use the table suggested in the problem description “submission_histories”- &lt;br /&gt;
*Id :: integer- primary key for this table. &lt;br /&gt;
*team_id :: integer ← foreign key to the teams table&lt;br /&gt;
*submitted_detail :: string ← details of the event. This can be one of x values.&lt;br /&gt;
**Link  - if it is a assignment submission link. This can further be of 4 types - &lt;br /&gt;
**Google Docs&lt;br /&gt;
**Wikipedia&lt;br /&gt;
**Github repository &lt;br /&gt;
**Any other web link&lt;br /&gt;
*Review ids - if the event is a review submission&lt;br /&gt;
*Author feedback id - if the event is an add or edit operation on author feedback.&lt;br /&gt;
*Peer review id - if the event is an add or edit operation on peer review.&lt;br /&gt;
*Submitted_at  :: datetime ← to store the timestamp of the event&lt;br /&gt;
*Type :: string ← field which distinguish between different types of events - to be used for polymorphism.&lt;br /&gt;
*Action :: string - add / edit / delete based on the event.&lt;br /&gt;
These are the common components under which each component in the timeline can be classified. Each of these components are explained in detail on how it fits into the timeline and its significance and types listed. &lt;br /&gt;
&lt;br /&gt;
'''Data stored in submission_histories table'''&lt;br /&gt;
*Google Document, Wikipedia article, Github repository url : All of these are types of links given by the team during their submission. Through the url, we will identify which type of a submission is this, and then create an object of the particular class using the factory pattern. Each of these classes will implement their own “getLastUpdatedTimestamp” method, using the suggested APIs, through which we can get the required timestamp.&lt;br /&gt;
*File path and any other web link - These are also a part of main submissions, but since there is no way of tracking changes to these artifacts, we just take the time of the system when the link is added or removed.&lt;br /&gt;
*Peer Reviews, Author feedback: Peer reviews and author feedbacks are updated into the submission history table for every edit that takes place. The “updated_at” field acts as the current timestamp for edits in the Peer Reviews and Author feedbacks and the “created_at” field marks the start of these Events.&lt;br /&gt;
'''Data retrieved from existing tables'''&lt;br /&gt;
*Reviews: Timestamp for assignment reviews are taken from “responses” and “response_maps” table. The responses table contains round field and when “is_submitted” flag is true, the submission appears on the reviewee timeline where the “reviewee_id” retrieved from response_maps table. The reviews attached to the respective reviewee are collected and updated_at field gives the submission timestamp which is used on the timeline. Each review is collected and is added to the single Event map.&lt;br /&gt;
*Timeline Parameters: Values corresponding to an assignment which are common for a given Assignment are retrieved from the assignments table. And the timeline parameters are obtained by calculating from the created_at which is the start date for the assignment and  the field rounds_of_reviews determines the deadline by adding up the value stored in days_between_submission field of the same table. The Events - Start Date, Submission Deadline and Revision Deadline and Final assignment deadline exists for each assignment.&lt;br /&gt;
All the components are then added into one single map - Event -&amp;gt; Timestamp which is sorted on timestamp values and is displayed on screen.&lt;br /&gt;
&lt;br /&gt;
== Files Added/Modified ==&lt;br /&gt;
Models&lt;br /&gt;
* assignment&lt;br /&gt;
 require 'rufus-scheduler'&lt;br /&gt;
* files_submission_history&lt;br /&gt;
* github_pull_request_submission_history&lt;br /&gt;
* github_repo_submission_history&lt;br /&gt;
* github_submission_history&lt;br /&gt;
* googledoc_submission_history&lt;br /&gt;
* link_submission_history&lt;br /&gt;
* submission_history&lt;br /&gt;
* wikipedia_submission_history&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
* submitted_content_controller&lt;br /&gt;
&lt;br /&gt;
Views&lt;br /&gt;
* submitted_content/_main.html.erb&lt;br /&gt;
* submitted_content/_submission_history.html.erb&lt;br /&gt;
&lt;br /&gt;
spec&lt;br /&gt;
* models/github_repo_submission_history_spec.rb&lt;br /&gt;
* models/link_submission_history_spec.rb&lt;br /&gt;
* models/submission_history_spec.rb&lt;br /&gt;
* models/wikipedia_submission_history_spec.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Factory Pattern'''&lt;br /&gt;
We are planning to use factory pattern for the type of link submitted. We will create an interface Type then we will create individual concrete classes like GitHubLink, GoogleDocLink, WikiLink which will implement our Type interface. To use factory pattern we will define TypeFactory class which will have static getType method that returns a Type that depends on the criteria that has been supplied.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''UML Diagram:'''&lt;br /&gt;
[[File:Class.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
'''Testing Plan:'''&lt;br /&gt;
*Unit Testing of controllers&lt;br /&gt;
This involves unit testing of following controllers: TeamsController, because we will have to change some methods.&lt;br /&gt;
*Unit Testing of Models&lt;br /&gt;
This involves writing rspec test for all the newly created models like submission_history, google_doc_submission_history, etc. Tests for team model are already written.&lt;br /&gt;
*UI Testing&lt;br /&gt;
**Login as student/instructor.&lt;br /&gt;
**Go to Assignments Home Page.&lt;br /&gt;
**Here you will find a timeline with several tags like submission, review, resubmission, rereview. &lt;br /&gt;
**Also, There will be a tags for the authors submitting and updating their artifacts, reviewers submitting peer-reviews, reviewees sending author feedback and reviewers updating their peer reviews.&lt;br /&gt;
**As UI would be modified a lot, more testing part would be added after the implementation.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
*https://www.tutorialspoint.com/design_pattern/factory_pattern.htm&lt;br /&gt;
*https://developers.google.com/drive/v3/web/quickstart/ruby&lt;br /&gt;
*https://www.mediawiki.org/wiki/API:Main_page&lt;br /&gt;
*https://github.com/octokit/octokit.rb&lt;br /&gt;
*https://github.com/piotrmurach/github&lt;br /&gt;
Doubts:&lt;br /&gt;
Significance of submission record table&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106637</id>
		<title>CSC/ECE 517 Fall 2016/E1686-Timestamps for students' submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106637"/>
		<updated>2016-12-07T18:59:24Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Design Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
In this project, We will keep track of timestamp records for students' submissions and updates of artifacts (links to google doc/wikipedia/github), reviewers' submissions and edits of peer-reviews and author feedbacks.We will also create a timeline view for each artifact, showing when it was submitted/resubmitted and when it was reviewed. With our work, users (students and instructors) can see:&lt;br /&gt;
* when do the authors submit and update their artifacts.&lt;br /&gt;
* when do reviewers submit peer-reviews.&lt;br /&gt;
* when do reviewees send author feedback.&lt;br /&gt;
* when do reviewers update their peer reviews.&lt;br /&gt;
== Approach ==&lt;br /&gt;
[[File:appraoch.JPG|center]]&lt;br /&gt;
From a perspective (both instructors and students), users should be able to see such a timeline with all the events for each submission of an assignment. The events can be - &lt;br /&gt;
*add/edit events of various submission links/files&lt;br /&gt;
*Reviews&lt;br /&gt;
*author feedbacks&lt;br /&gt;
*peer reviews&lt;br /&gt;
Each of these artifacts can be edited and updated multiple times. Because we want to track when these artifacts are updated, we have to store their information in the database. We use the table suggested in the problem description “submission_histories”- &lt;br /&gt;
*Id :: integer- primary key for this table. &lt;br /&gt;
*team_id :: integer ← foreign key to the teams table&lt;br /&gt;
*submitted_detail :: string ← details of the event. This can be one of x values.&lt;br /&gt;
**Link  - if it is a assignment submission link. This can further be of 4 types - &lt;br /&gt;
**Google Docs&lt;br /&gt;
**Wikipedia&lt;br /&gt;
**Github repository &lt;br /&gt;
**Any other web link&lt;br /&gt;
*Review ids - if the event is a review submission&lt;br /&gt;
*Author feedback id - if the event is an add or edit operation on author feedback.&lt;br /&gt;
*Peer review id - if the event is an add or edit operation on peer review.&lt;br /&gt;
*Submitted_at  :: datetime ← to store the timestamp of the event&lt;br /&gt;
*Type :: string ← field which distinguish between different types of events - to be used for polymorphism.&lt;br /&gt;
*Action :: string - add / edit / delete based on the event.&lt;br /&gt;
These are the common components under which each component in the timeline can be classified. Each of these components are explained in detail on how it fits into the timeline and its significance and types listed. &lt;br /&gt;
&lt;br /&gt;
'''Data stored in submission_histories table'''&lt;br /&gt;
*Google Document, Wikipedia article, Github repository url : All of these are types of links given by the team during their submission. Through the url, we will identify which type of a submission is this, and then create an object of the particular class using the factory pattern. Each of these classes will implement their own “getLastUpdatedTimestamp” method, using the suggested APIs, through which we can get the required timestamp.&lt;br /&gt;
*File path and any other web link - These are also a part of main submissions, but since there is no way of tracking changes to these artifacts, we just take the time of the system when the link is added or removed.&lt;br /&gt;
*Peer Reviews, Author feedback: Peer reviews and author feedbacks are updated into the submission history table for every edit that takes place. The “updated_at” field acts as the current timestamp for edits in the Peer Reviews and Author feedbacks and the “created_at” field marks the start of these Events.&lt;br /&gt;
'''Data retrieved from existing tables'''&lt;br /&gt;
*Reviews: Timestamp for assignment reviews are taken from “responses” and “response_maps” table. The responses table contains round field and when “is_submitted” flag is true, the submission appears on the reviewee timeline where the “reviewee_id” retrieved from response_maps table. The reviews attached to the respective reviewee are collected and updated_at field gives the submission timestamp which is used on the timeline. Each review is collected and is added to the single Event map.&lt;br /&gt;
*Timeline Parameters: Values corresponding to an assignment which are common for a given Assignment are retrieved from the assignments table. And the timeline parameters are obtained by calculating from the created_at which is the start date for the assignment and  the field rounds_of_reviews determines the deadline by adding up the value stored in days_between_submission field of the same table. The Events - Start Date, Submission Deadline and Revision Deadline and Final assignment deadline exists for each assignment.&lt;br /&gt;
All the components are then added into one single map - Event -&amp;gt; Timestamp which is sorted on timestamp values and is displayed on screen.&lt;br /&gt;
&lt;br /&gt;
== Files Added/Modified ==&lt;br /&gt;
Models&lt;br /&gt;
* assignment&lt;br /&gt;
* files_submission_history&lt;br /&gt;
* github_pull_request_submission_history&lt;br /&gt;
* github_repo_submission_history&lt;br /&gt;
* github_submission_history&lt;br /&gt;
* googledoc_submission_history&lt;br /&gt;
* link_submission_history&lt;br /&gt;
* submission_history&lt;br /&gt;
* wikipedia_submission_history&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
* submitted_content_controller&lt;br /&gt;
&lt;br /&gt;
Views&lt;br /&gt;
* submitted_content/_main.html.erb&lt;br /&gt;
* submitted_content/_submission_history.html.erb&lt;br /&gt;
&lt;br /&gt;
spec&lt;br /&gt;
* models/github&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Factory Pattern'''&lt;br /&gt;
We are planning to use factory pattern for the type of link submitted. We will create an interface Type then we will create individual concrete classes like GitHubLink, GoogleDocLink, WikiLink which will implement our Type interface. To use factory pattern we will define TypeFactory class which will have static getType method that returns a Type that depends on the criteria that has been supplied.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''UML Diagram:'''&lt;br /&gt;
[[File:Class.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
'''Testing Plan:'''&lt;br /&gt;
*Unit Testing of controllers&lt;br /&gt;
This involves unit testing of following controllers: TeamsController, because we will have to change some methods.&lt;br /&gt;
*Unit Testing of Models&lt;br /&gt;
This involves writing rspec test for all the newly created models like submission_history, google_doc_submission_history, etc. Tests for team model are already written.&lt;br /&gt;
*UI Testing&lt;br /&gt;
**Login as student/instructor.&lt;br /&gt;
**Go to Assignments Home Page.&lt;br /&gt;
**Here you will find a timeline with several tags like submission, review, resubmission, rereview. &lt;br /&gt;
**Also, There will be a tags for the authors submitting and updating their artifacts, reviewers submitting peer-reviews, reviewees sending author feedback and reviewers updating their peer reviews.&lt;br /&gt;
**As UI would be modified a lot, more testing part would be added after the implementation.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
*https://www.tutorialspoint.com/design_pattern/factory_pattern.htm&lt;br /&gt;
*https://developers.google.com/drive/v3/web/quickstart/ruby&lt;br /&gt;
*https://www.mediawiki.org/wiki/API:Main_page&lt;br /&gt;
*https://github.com/octokit/octokit.rb&lt;br /&gt;
*https://github.com/piotrmurach/github&lt;br /&gt;
Doubts:&lt;br /&gt;
Significance of submission record table&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106630</id>
		<title>CSC/ECE 517 Fall 2016/E1686-Timestamps for students' submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1686-Timestamps_for_students%27_submissions&amp;diff=106630"/>
		<updated>2016-12-07T18:34:25Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Concerns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
In this project, We will keep track of timestamp records for students' submissions and updates of artifacts (links to google doc/wikipedia/github), reviewers' submissions and edits of peer-reviews and author feedbacks.We will also create a timeline view for each artifact, showing when it was submitted/resubmitted and when it was reviewed. With our work, users (students and instructors) can see:&lt;br /&gt;
* when do the authors submit and update their artifacts.&lt;br /&gt;
* when do reviewers submit peer-reviews.&lt;br /&gt;
* when do reviewees send author feedback.&lt;br /&gt;
* when do reviewers update their peer reviews.&lt;br /&gt;
== Approach ==&lt;br /&gt;
[[File:appraoch.JPG|center]]&lt;br /&gt;
From a perspective (both instructors and students), users should be able to see such a timeline with all the events for each submission of an assignment. The events can be - &lt;br /&gt;
*add/edit events of various submission links/files&lt;br /&gt;
*Reviews&lt;br /&gt;
*author feedbacks&lt;br /&gt;
*peer reviews&lt;br /&gt;
Each of these artifacts can be edited and updated multiple times. Because we want to track when these artifacts are updated, we have to store their information in the database. We use the table suggested in the problem description “submission_histories”- &lt;br /&gt;
*Id :: integer- primary key for this table. &lt;br /&gt;
*team_id :: integer ← foreign key to the teams table&lt;br /&gt;
*submitted_detail :: string ← details of the event. This can be one of x values.&lt;br /&gt;
**Link  - if it is a assignment submission link. This can further be of 4 types - &lt;br /&gt;
**Google Docs&lt;br /&gt;
**Wikipedia&lt;br /&gt;
**Github repository &lt;br /&gt;
**Any other web link&lt;br /&gt;
*Review ids - if the event is a review submission&lt;br /&gt;
*Author feedback id - if the event is an add or edit operation on author feedback.&lt;br /&gt;
*Peer review id - if the event is an add or edit operation on peer review.&lt;br /&gt;
*Submitted_at  :: datetime ← to store the timestamp of the event&lt;br /&gt;
*Type :: string ← field which distinguish between different types of events - to be used for polymorphism.&lt;br /&gt;
*Action :: string - add / edit / delete based on the event.&lt;br /&gt;
These are the common components under which each component in the timeline can be classified. Each of these components are explained in detail on how it fits into the timeline and its significance and types listed. &lt;br /&gt;
&lt;br /&gt;
'''Data stored in submission_histories table'''&lt;br /&gt;
*Google Document, Wikipedia article, Github repository url : All of these are types of links given by the team during their submission. Through the url, we will identify which type of a submission is this, and then create an object of the particular class using the factory pattern. Each of these classes will implement their own “getLastUpdatedTimestamp” method, using the suggested APIs, through which we can get the required timestamp.&lt;br /&gt;
*File path and any other web link - These are also a part of main submissions, but since there is no way of tracking changes to these artifacts, we just take the time of the system when the link is added or removed.&lt;br /&gt;
*Peer Reviews, Author feedback: Peer reviews and author feedbacks are updated into the submission history table for every edit that takes place. The “updated_at” field acts as the current timestamp for edits in the Peer Reviews and Author feedbacks and the “created_at” field marks the start of these Events.&lt;br /&gt;
'''Data retrieved from existing tables'''&lt;br /&gt;
*Reviews: Timestamp for assignment reviews are taken from “responses” and “response_maps” table. The responses table contains round field and when “is_submitted” flag is true, the submission appears on the reviewee timeline where the “reviewee_id” retrieved from response_maps table. The reviews attached to the respective reviewee are collected and updated_at field gives the submission timestamp which is used on the timeline. Each review is collected and is added to the single Event map.&lt;br /&gt;
*Timeline Parameters: Values corresponding to an assignment which are common for a given Assignment are retrieved from the assignments table. And the timeline parameters are obtained by calculating from the created_at which is the start date for the assignment and  the field rounds_of_reviews determines the deadline by adding up the value stored in days_between_submission field of the same table. The Events - Start Date, Submission Deadline and Revision Deadline and Final assignment deadline exists for each assignment.&lt;br /&gt;
All the components are then added into one single map - Event -&amp;gt; Timestamp which is sorted on timestamp values and is displayed on screen.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
'''Factory Pattern'''&lt;br /&gt;
We are planning to use factory pattern for the type of link submitted. We will create an interface Type then we will create individual concrete classes like GitHubLink, GoogleDocLink, WikiLink which will implement our Type interface. To use factory pattern we will define TypeFactory class which will have static getType method that returns a Type that depends on the criteria that has been supplied.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''UML Diagram:'''&lt;br /&gt;
[[File:class.JPG|center]]&lt;br /&gt;
&lt;br /&gt;
'''Testing Plan:'''&lt;br /&gt;
*Unit Testing of controllers&lt;br /&gt;
This involves unit testing of following controllers: TeamsController, because we will have to change some methods.&lt;br /&gt;
*Unit Testing of Models&lt;br /&gt;
This involves writing rspec test for all the newly created models like submission_history, google_doc_submission_history, etc. Tests for team model are already written.&lt;br /&gt;
*UI Testing&lt;br /&gt;
**Login as student/instructor.&lt;br /&gt;
**Go to Assignments Home Page.&lt;br /&gt;
**Here you will find a timeline with several tags like submission, review, resubmission, rereview. &lt;br /&gt;
**Also, There will be a tags for the authors submitting and updating their artifacts, reviewers submitting peer-reviews, reviewees sending author feedback and reviewers updating their peer reviews.&lt;br /&gt;
**As UI would be modified a lot, more testing part would be added after the implementation.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
*https://www.tutorialspoint.com/design_pattern/factory_pattern.htm&lt;br /&gt;
*https://developers.google.com/drive/v3/web/quickstart/ruby&lt;br /&gt;
*https://www.mediawiki.org/wiki/API:Main_page&lt;br /&gt;
*https://github.com/octokit/octokit.rb&lt;br /&gt;
*https://github.com/piotrmurach/github&lt;br /&gt;
Doubts:&lt;br /&gt;
Significance of submission record table&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104453</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104453"/>
		<updated>2016-11-04T20:21:47Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and its code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add/Delete TA (Teaching Assistants): Once a course has been created, an instructor can Add/Delete TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
*** list.html.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
*** _user_list.html.erb&lt;br /&gt;
** questionnaires&lt;br /&gt;
*** _ajax_partial.html.erb&lt;br /&gt;
*** add_new_questions.js.erb&lt;br /&gt;
*** edit.js.erb&lt;br /&gt;
&lt;br /&gt;
== Participants Controller/ Course Controller ==&lt;br /&gt;
&lt;br /&gt;
We have added respond_to method in add method of participants controller and add_ta/remove_ta methods of course controller, which will allow us to render both javascript and html requests from these methods. &lt;br /&gt;
&lt;br /&gt;
In course controller the function looked something like this:&lt;br /&gt;
 &lt;br /&gt;
  respond_to do |format|&lt;br /&gt;
      format.html { redirect_to action: 'view_teaching_assistants', id: @course.id }&lt;br /&gt;
      format.js &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== Questionnaire Controller ==&lt;br /&gt;
&lt;br /&gt;
The same methods added in participants were added in questionnaire controller, the difference being in the action the controller takes after receiving a JS request. &lt;br /&gt;
&lt;br /&gt;
In the partial _questionnaire.html.erb, the attribute remote was set to true. This is rendered as the attribute &amp;quot;data-remote&amp;quot; being set to true in HTML, which allows the rails UJS (unobtrusive JS) to make AJAX calls without needing any jQuery statements. &lt;br /&gt;
&lt;br /&gt;
To implement the functionality, the controller renders a JavaScript file in place of the usual .html.erb. The JavaScript file then takes action on the webpage it is called on. In the case of adding new questions, the page is updated with the new questions by the JavaScript file that is called. This is achieved by rendering a partial in the JavaScript file and then using jQuery to update the page with the rendered HTML. This seemed like a good approach as we are reusing the render method. Although new partials had to be created, the JavaScript functionality is easy to understand. Additional divs were added in the HTML to serve as hooks for the jQuery statements to update HTML on the page.&lt;br /&gt;
&lt;br /&gt;
Additionally, saving questions in the edit questionnaire section also works on AJAX, and flashes the standard rails success message without refreshing the page.&lt;br /&gt;
&lt;br /&gt;
== _add_individual.html.erb/_ta_list.html.erb ==&lt;br /&gt;
We have put the :remote =&amp;gt; true flag on the link or form tag in our .html.erb files (view) for the element where we wanted to trigger the AJAX call, like,&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= form_tag(&amp;quot;/course/add_ta&amp;quot;, :method =&amp;gt; 'post', :remote =&amp;gt; true) do %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= link_to &amp;quot;Delete&amp;quot;, { :action =&amp;gt; 'remove_ta', :controller =&amp;gt;'course', :id =&amp;gt; ta.id, :course_id =&amp;gt; ta.course_id }, method: :post,&lt;br /&gt;
     :remote =&amp;gt; true, :class =&amp;gt; 'delete_ta' %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With :remote =&amp;gt; true, rails will not automatically switch views, which allows the JQuery to be run instead. This can be used with a form_tag, a link_tag, or other types of tags.&lt;br /&gt;
&lt;br /&gt;
== Testing Details ==&lt;br /&gt;
&lt;br /&gt;
RSpec Testing&lt;br /&gt;
&lt;br /&gt;
There were no existing test cases for the course controller. We have added some related to the functionality which we have worked on. &lt;br /&gt;
The following test verifies mapping between TA and course:&lt;br /&gt;
&lt;br /&gt;
 it &amp;quot;is able to create mapping between TA and the course&amp;quot; do&lt;br /&gt;
      ta = build(User)&lt;br /&gt;
      ta.save&lt;br /&gt;
      course = build(Course)&lt;br /&gt;
      course.save&lt;br /&gt;
      taMapping = TaMapping.create(ta.id,course.id)&lt;br /&gt;
      expect(taMapping).to be_kind_of(TaMapping)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Below test verifies whether error message is displayed or not when TA does not exist:&lt;br /&gt;
&lt;br /&gt;
 it &amp;quot;displays error message if TA does not exist&amp;quot; do&lt;br /&gt;
    ta = build(User)&lt;br /&gt;
    ta.ta_id=nil&lt;br /&gt;
    ta.save&lt;br /&gt;
    expect(ta.nil?).to be true&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
The test below verifies whether TA is removed from the course or not:&lt;br /&gt;
 it &amp;quot;is able to delete TA from the course&amp;quot; do&lt;br /&gt;
      ta = build(User)&lt;br /&gt;
      taMapping = TaMapping.find(ta.id)&lt;br /&gt;
      taMapping.destroy&lt;br /&gt;
      expect(response).to redirect_to action: 'view_teaching_assistants'&lt;br /&gt;
 end&lt;br /&gt;
UI Testing&lt;br /&gt;
&lt;br /&gt;
Following steps needs to be performed to test this code from UI:&lt;br /&gt;
&lt;br /&gt;
* Login as an instructor.&lt;br /&gt;
* You will land on Manage Content page with list of courses and related actions to it.&lt;br /&gt;
* Under action column try to Add TA for any course.&lt;br /&gt;
* It will take you to Teaching Assistants page.&lt;br /&gt;
* Try to add a valid TA for eg. teaching_assistant5549. As soon as you press Add TA button, list will get updated with the newly added TA without refreshing the page.&lt;br /&gt;
* If you try to delete any TA, a popup will open to confirm your action, press ok and you will see that particular TA is deleted in the background.&lt;br /&gt;
* Similarly, for perform these actions for Add participant action for any course. Table will be updated with newly added participant without refreshing the page.&lt;br /&gt;
* To test add questionnaire, switch to questionnaire tab from courses tab and click on add questionnaire.&lt;br /&gt;
* As you add questions, page would not refresh and questions would be added as expected.&lt;br /&gt;
* If you try to delete any question, delete action would also not refresh the page and perform the required action.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104207</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104207"/>
		<updated>2016-11-03T05:44:30Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and its code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add/Delete TA (Teaching Assistants): Once a course has been created, an instructor can Add/Delete TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
*** list.html.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
*** _user_list.html.erb&lt;br /&gt;
** questionnaires&lt;br /&gt;
*** _ajax_partial.html.erb&lt;br /&gt;
*** add_new_questions.js.erb&lt;br /&gt;
*** edit.js.erb&lt;br /&gt;
&lt;br /&gt;
== Participants Controller/ Course Controller ==&lt;br /&gt;
&lt;br /&gt;
We have added respond_to method in add method of participants controller and add_ta/remove_ta methods of course controller, which will allow us to render both javascript and html requests from these methods. &lt;br /&gt;
&lt;br /&gt;
In course controller the function looked something like this:&lt;br /&gt;
 &lt;br /&gt;
  respond_to do |format|&lt;br /&gt;
      format.html { redirect_to action: 'view_teaching_assistants', id: @course.id }&lt;br /&gt;
      format.js &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== Questionnaire Controller ==&lt;br /&gt;
&lt;br /&gt;
The same methods added in participants were added in questionnaire controller, the difference being in the action the controller takes after receiving a JS request. &lt;br /&gt;
&lt;br /&gt;
In the partial _questionnaire.html.erb, the attribute remote was set to true. This is rendered as the attribute &amp;quot;data-remote&amp;quot; being set to true in HTML, which allows the rails UJS (unobtrusive JS) to make AJAX calls without needing any jQuery statements. &lt;br /&gt;
&lt;br /&gt;
To implement the functionality, the controller renders a JavaScript file in place of the usual .html.erb. The JavaScript file then takes action on the webpage it is called on. In the case of adding new questions, the page is updated with the new questions by the JavaScript file that is called. This is achieved by rendering a partial in the JavaScript file and then using jQuery to update the page with the rendered HTML. This seemed like a good approach as we are reusing the render method. Although new partials had to be created, the JavaScript functionality is easy to understand. Additional divs were added in the HTML to serve as hooks for the jQuery statements to update HTML on the page.&lt;br /&gt;
&lt;br /&gt;
Additionally, saving questions in the edit questionnaire section also works on AJAX, and flashes the standard rails success message without refreshing the page.&lt;br /&gt;
&lt;br /&gt;
== _add_individual.html.erb/_ta_list.html.erb ==&lt;br /&gt;
We have put the :remote =&amp;gt; true flag on the link or form tag in our .html.erb files (view) for the element where we wanted to trigger the AJAX call, like,&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= form_tag(&amp;quot;/course/add_ta&amp;quot;, :method =&amp;gt; 'post', :remote =&amp;gt; true) do %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= link_to &amp;quot;Delete&amp;quot;, { :action =&amp;gt; 'remove_ta', :controller =&amp;gt;'course', :id =&amp;gt; ta.id, :course_id =&amp;gt; ta.course_id }, method: :post,&lt;br /&gt;
     :remote =&amp;gt; true, :class =&amp;gt; 'delete_ta' %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With :remote =&amp;gt; true, rails will not automatically switch views, which allows the JQuery to be run instead. This can be used with a form_tag, a link_tag, or other types of tags.&lt;br /&gt;
&lt;br /&gt;
== Testing Details ==&lt;br /&gt;
&lt;br /&gt;
RSpec Testing&lt;br /&gt;
&lt;br /&gt;
There were no existing test cases for the course controller. We have added some related to the functionality which we have worked on. &lt;br /&gt;
The following test verifies mapping between TA and course:&lt;br /&gt;
&lt;br /&gt;
 it &amp;quot;is able to create mapping between TA and the course&amp;quot; do&lt;br /&gt;
      ta = build(User)&lt;br /&gt;
      ta.save&lt;br /&gt;
      course = build(Course)&lt;br /&gt;
      course.save&lt;br /&gt;
      taMapping = TaMapping.create(ta.id,course.id)&lt;br /&gt;
      expect(taMapping).to be_kind_of(TaMapping)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Below test verifies whether error message is displayed or not when TA does not exist:&lt;br /&gt;
&lt;br /&gt;
 it &amp;quot;displays error message if TA does not exist&amp;quot; do&lt;br /&gt;
    ta = build(User)&lt;br /&gt;
    ta.ta_id=nil&lt;br /&gt;
    ta.save&lt;br /&gt;
    expect(ta.nil?).to be true&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
The test below verifies whether TA is removed from the course or not:&lt;br /&gt;
 it &amp;quot;is able to delete TA from the course&amp;quot; do&lt;br /&gt;
      ta = build(User)&lt;br /&gt;
      taMapping = TaMapping.find(ta.id)&lt;br /&gt;
      taMapping.destroy&lt;br /&gt;
      expect(response).to redirect_to action: 'view_teaching_assistants'&lt;br /&gt;
 end&lt;br /&gt;
UI Testing&lt;br /&gt;
&lt;br /&gt;
Following steps needs to be performed to test this code from UI:&lt;br /&gt;
&lt;br /&gt;
* Login as an instructor.&lt;br /&gt;
* You will land on Manage Content page with list of courses and related actions to it.&lt;br /&gt;
* Under action column try to Add TA for any course.&lt;br /&gt;
* It will take you to Teaching Assistants page.&lt;br /&gt;
* Try to add a valid TA for eg. teaching_assistant5549. As soon as you press Add TA button, list will get updated with the newly added TA without refreshing the page.&lt;br /&gt;
* If you try to delete any TA, a popup will open to confirm your action, press ok and you will see that particular TA is deleted in the background.&lt;br /&gt;
* Similarly, for perform these actions for Add participant action for any course. Table will be updated with newly added participant without refreshing the page.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104200</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104200"/>
		<updated>2016-11-03T05:00:44Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Testing Details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and its code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add/Delete TA (Teaching Assistants): Once a course has been created, an instructor can Add/Delete TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
*** list.html.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
*** _user_list.html.erb&lt;br /&gt;
** questionnaires&lt;br /&gt;
*** _ajax_partial.html.erb&lt;br /&gt;
*** add_new_questions.js.erb&lt;br /&gt;
*** edit.js.erb&lt;br /&gt;
&lt;br /&gt;
== Participants Controller/ Course Controller ==&lt;br /&gt;
&lt;br /&gt;
We have added respond_to method in add method of participants controller and add_ta/remove_ta methods of course controller, which will allow us to render both javascript and html requests from these methods. &lt;br /&gt;
&lt;br /&gt;
In course controller the function looked something like this:&lt;br /&gt;
 &lt;br /&gt;
  respond_to do |format|&lt;br /&gt;
      format.html { redirect_to action: 'view_teaching_assistants', id: @course.id }&lt;br /&gt;
      format.js &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== Questionnaire Controller ==&lt;br /&gt;
&lt;br /&gt;
The same methods added in participants were added in questionnaire controller, the difference being in the action the controller takes after receiving a JS request. &lt;br /&gt;
&lt;br /&gt;
In the partial _questionnaire.html.erb, the attribute remote was set to true. This is rendered as the attribute &amp;quot;data-remote&amp;quot; being set to true in HTML, which allows the rails UJS (unobtrusive JS) to make AJAX calls without needing any jQuery statements. &lt;br /&gt;
&lt;br /&gt;
To implement the functionality, the controller renders a JavaScript file in place of the usual .html.erb. The JavaScript file then takes action on the webpage it is called on. In the case of adding new questions, the page is updated with the new questions by the JavaScript file that is called. This is achieved by rendering a partial in the JavaScript file and then using jQuery to update the page with the rendered HTML. This seemed like a good approach as we are reusing the render method. Although new partials had to be created, the JavaScript functionality is easy to understand. Additional divs were added in the HTML to serve as hooks for the jQuery statements to update HTML on the page.&lt;br /&gt;
&lt;br /&gt;
Additionally, saving questions in the edit questionnaire section also works on AJAX, and flashes the standard rails success message without refreshing the page.&lt;br /&gt;
&lt;br /&gt;
== _add_individual.html.erb/_ta_list.html.erb ==&lt;br /&gt;
We have put the :remote =&amp;gt; true flag on the link or form tag in our .html.erb files (view) for the element where we wanted to trigger the AJAX call, like,&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= form_tag(&amp;quot;/course/add_ta&amp;quot;, :method =&amp;gt; 'post', :remote =&amp;gt; true) do %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= link_to &amp;quot;Delete&amp;quot;, { :action =&amp;gt; 'remove_ta', :controller =&amp;gt;'course', :id =&amp;gt; ta.id, :course_id =&amp;gt; ta.course_id }, method: :post,&lt;br /&gt;
     :remote =&amp;gt; true, :class =&amp;gt; 'delete_ta' %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With :remote =&amp;gt; true, rails will not automatically switch views, which allows the JQuery to be run instead. This can be used with a form_tag, a link_tag, or other types of tags.&lt;br /&gt;
&lt;br /&gt;
== Testing Details ==&lt;br /&gt;
&lt;br /&gt;
RSpec Testing&lt;br /&gt;
&lt;br /&gt;
There were no existing test cases for the course controller. We have added some related to the functionality which we have worked on. &lt;br /&gt;
The following test verifies mapping between TA and course:&lt;br /&gt;
&lt;br /&gt;
 it &amp;quot;is able to create mapping between TA and the course&amp;quot; do&lt;br /&gt;
      ta = build(User)&lt;br /&gt;
      ta.save&lt;br /&gt;
      course = build(Course)&lt;br /&gt;
      course.save&lt;br /&gt;
      taMapping = TaMapping.create(ta.id,course.id)&lt;br /&gt;
      expect(taMapping).to be_kind_of(TaMapping)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Below test verifies whether error message is displayed or not when TA does not exist:&lt;br /&gt;
&lt;br /&gt;
 it &amp;quot;displays error message if TA does not exist&amp;quot; do&lt;br /&gt;
    ta = build(User)&lt;br /&gt;
    ta.ta_id=nil&lt;br /&gt;
    ta.save&lt;br /&gt;
    expect(ta.nil?).to be true&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
UI Testing&lt;br /&gt;
&lt;br /&gt;
Following steps needs to be performed to test this code from UI:&lt;br /&gt;
&lt;br /&gt;
* Login as an instructor.&lt;br /&gt;
* You will land on Manage Content page with list of courses and related actions to it.&lt;br /&gt;
* Under action column try to Add TA for any course.&lt;br /&gt;
* It will take you to Teaching Assistants page.&lt;br /&gt;
* Try to add a valid TA for eg. teaching_assistant5549. As soon as you press Add TA button, list will get updated with the newly added TA without refreshing the page.&lt;br /&gt;
* If you try to delete any TA, a popup will open to confirm your action, press ok and you will see that particular TA is deleted in the background.&lt;br /&gt;
* Similarly, for perform these actions for Add participant action for any course. Table will be updated with newly added participant without refreshing the page.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104199</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104199"/>
		<updated>2016-11-03T04:58:45Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Testing Details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and its code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add/Delete TA (Teaching Assistants): Once a course has been created, an instructor can Add/Delete TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
*** list.html.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
*** _user_list.html.erb&lt;br /&gt;
** questionnaires&lt;br /&gt;
*** _ajax_partial.html.erb&lt;br /&gt;
*** add_new_questions.js.erb&lt;br /&gt;
*** edit.js.erb&lt;br /&gt;
&lt;br /&gt;
== Participants Controller/ Course Controller ==&lt;br /&gt;
&lt;br /&gt;
We have added respond_to method in add method of participants controller and add_ta/remove_ta methods of course controller, which will allow us to render both javascript and html requests from these methods. &lt;br /&gt;
&lt;br /&gt;
In course controller the function looked something like this:&lt;br /&gt;
 &lt;br /&gt;
  respond_to do |format|&lt;br /&gt;
      format.html { redirect_to action: 'view_teaching_assistants', id: @course.id }&lt;br /&gt;
      format.js &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== Questionnaire Controller ==&lt;br /&gt;
&lt;br /&gt;
The same methods added in participants were added in questionnaire controller, the difference being in the action the controller takes after receiving a JS request. &lt;br /&gt;
&lt;br /&gt;
In the partial _questionnaire.html.erb, the attribute remote was set to true. This is rendered as the attribute &amp;quot;data-remote&amp;quot; being set to true in HTML, which allows the rails UJS (unobtrusive JS) to make AJAX calls without needing any jQuery statements. &lt;br /&gt;
&lt;br /&gt;
To implement the functionality, the controller renders a JavaScript file in place of the usual .html.erb. The JavaScript file then takes action on the webpage it is called on. In the case of adding new questions, the page is updated with the new questions by the JavaScript file that is called. This is achieved by rendering a partial in the JavaScript file and then using jQuery to update the page with the rendered HTML. This seemed like a good approach as we are reusing the render method. Although new partials had to be created, the JavaScript functionality is easy to understand. Additional divs were added in the HTML to serve as hooks for the jQuery statements to update HTML on the page.&lt;br /&gt;
&lt;br /&gt;
Additionally, saving questions in the edit questionnaire section also works on AJAX, and flashes the standard rails success message without refreshing the page.&lt;br /&gt;
&lt;br /&gt;
== _add_individual.html.erb/_ta_list.html.erb ==&lt;br /&gt;
We have put the :remote =&amp;gt; true flag on the link or form tag in our .html.erb files (view) for the element where we wanted to trigger the AJAX call, like,&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= form_tag(&amp;quot;/course/add_ta&amp;quot;, :method =&amp;gt; 'post', :remote =&amp;gt; true) do %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= link_to &amp;quot;Delete&amp;quot;, { :action =&amp;gt; 'remove_ta', :controller =&amp;gt;'course', :id =&amp;gt; ta.id, :course_id =&amp;gt; ta.course_id }, method: :post,&lt;br /&gt;
     :remote =&amp;gt; true, :class =&amp;gt; 'delete_ta' %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With :remote =&amp;gt; true, rails will not automatically switch views, which allows the JQuery to be run instead. This can be used with a form_tag, a link_tag, or other types of tags.&lt;br /&gt;
&lt;br /&gt;
== Testing Details ==&lt;br /&gt;
&lt;br /&gt;
RSpec Testing&lt;br /&gt;
&lt;br /&gt;
There were no existing test cases for the course controller. We have added some related to the functionality which we have worked on.&lt;br /&gt;
&lt;br /&gt;
 it &amp;quot;is able to create mapping between TA and the course&amp;quot; do&lt;br /&gt;
      ta = build(User)&lt;br /&gt;
      ta.save&lt;br /&gt;
      course = build(Course)&lt;br /&gt;
      course.save&lt;br /&gt;
      taMapping = TaMapping.create(ta.id,course.id)&lt;br /&gt;
      expect(taMapping).to be_kind_of(TaMapping)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
  	&lt;br /&gt;
 it &amp;quot;displays error message if TA does not exist&amp;quot; do&lt;br /&gt;
    ta = build(User)&lt;br /&gt;
    ta.ta_id=nil&lt;br /&gt;
    ta.save&lt;br /&gt;
    expect(ta.nil??).to be true&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
UI Testing&lt;br /&gt;
&lt;br /&gt;
Following steps needs to be performed to test this code from UI:&lt;br /&gt;
&lt;br /&gt;
* Login as an instructor.&lt;br /&gt;
* You will land on Manage Content page with list of courses and related actions to it.&lt;br /&gt;
* Under action column try to Add TA for any course.&lt;br /&gt;
* It will take you to Teaching Assistants page.&lt;br /&gt;
* Try to add a valid TA for eg. teaching_assistant5549. As soon as you press Add TA button, list will get updated with the newly added TA without refreshing the page.&lt;br /&gt;
* If you try to delete any TA, a popup will open to confirm your action, press ok and you will see that particular TA is deleted in the background.&lt;br /&gt;
* Similarly, for perform these actions for Add participant action for any course. Table will be updated with newly added participant without refreshing the page.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104198</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104198"/>
		<updated>2016-11-03T04:58:16Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Testing Details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and its code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add/Delete TA (Teaching Assistants): Once a course has been created, an instructor can Add/Delete TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
*** list.html.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
*** _user_list.html.erb&lt;br /&gt;
** questionnaires&lt;br /&gt;
*** _ajax_partial.html.erb&lt;br /&gt;
*** add_new_questions.js.erb&lt;br /&gt;
*** edit.js.erb&lt;br /&gt;
&lt;br /&gt;
== Participants Controller/ Course Controller ==&lt;br /&gt;
&lt;br /&gt;
We have added respond_to method in add method of participants controller and add_ta/remove_ta methods of course controller, which will allow us to render both javascript and html requests from these methods. &lt;br /&gt;
&lt;br /&gt;
In course controller the function looked something like this:&lt;br /&gt;
 &lt;br /&gt;
  respond_to do |format|&lt;br /&gt;
      format.html { redirect_to action: 'view_teaching_assistants', id: @course.id }&lt;br /&gt;
      format.js &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== Questionnaire Controller ==&lt;br /&gt;
&lt;br /&gt;
The same methods added in participants were added in questionnaire controller, the difference being in the action the controller takes after receiving a JS request. &lt;br /&gt;
&lt;br /&gt;
In the partial _questionnaire.html.erb, the attribute remote was set to true. This is rendered as the attribute &amp;quot;data-remote&amp;quot; being set to true in HTML, which allows the rails UJS (unobtrusive JS) to make AJAX calls without needing any jQuery statements. &lt;br /&gt;
&lt;br /&gt;
To implement the functionality, the controller renders a JavaScript file in place of the usual .html.erb. The JavaScript file then takes action on the webpage it is called on. In the case of adding new questions, the page is updated with the new questions by the JavaScript file that is called. This is achieved by rendering a partial in the JavaScript file and then using jQuery to update the page with the rendered HTML. This seemed like a good approach as we are reusing the render method. Although new partials had to be created, the JavaScript functionality is easy to understand. Additional divs were added in the HTML to serve as hooks for the jQuery statements to update HTML on the page.&lt;br /&gt;
&lt;br /&gt;
Additionally, saving questions in the edit questionnaire section also works on AJAX, and flashes the standard rails success message without refreshing the page.&lt;br /&gt;
&lt;br /&gt;
== _add_individual.html.erb/_ta_list.html.erb ==&lt;br /&gt;
We have put the :remote =&amp;gt; true flag on the link or form tag in our .html.erb files (view) for the element where we wanted to trigger the AJAX call, like,&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= form_tag(&amp;quot;/course/add_ta&amp;quot;, :method =&amp;gt; 'post', :remote =&amp;gt; true) do %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= link_to &amp;quot;Delete&amp;quot;, { :action =&amp;gt; 'remove_ta', :controller =&amp;gt;'course', :id =&amp;gt; ta.id, :course_id =&amp;gt; ta.course_id }, method: :post,&lt;br /&gt;
     :remote =&amp;gt; true, :class =&amp;gt; 'delete_ta' %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With :remote =&amp;gt; true, rails will not automatically switch views, which allows the JQuery to be run instead. This can be used with a form_tag, a link_tag, or other types of tags.&lt;br /&gt;
&lt;br /&gt;
== Testing Details ==&lt;br /&gt;
&lt;br /&gt;
RSpec Testing&lt;br /&gt;
&lt;br /&gt;
There were no existing test cases for the course controller. We have added some related to the functionality which we have worked on.&lt;br /&gt;
&lt;br /&gt;
 it &amp;quot;is able to create mapping between TA and the course&amp;quot; do&lt;br /&gt;
      ta = build(User)&lt;br /&gt;
      ta.save&lt;br /&gt;
      course = build(Course)&lt;br /&gt;
      course.save&lt;br /&gt;
      taMapping = TaMapping.create(ta.id,course.id)&lt;br /&gt;
      expect(taMapping).to be_kind_of(TaMapping)&lt;br /&gt;
 end&lt;br /&gt;
  	&lt;br /&gt;
 it &amp;quot;displays error message if TA does not exist&amp;quot; do&lt;br /&gt;
    ta = build(User)&lt;br /&gt;
    ta.ta_id=nil&lt;br /&gt;
    ta.save&lt;br /&gt;
    expect(ta.nil??).to be true&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
UI Testing&lt;br /&gt;
&lt;br /&gt;
Following steps needs to be performed to test this code from UI:&lt;br /&gt;
&lt;br /&gt;
* Login as an instructor.&lt;br /&gt;
* You will land on Manage Content page with list of courses and related actions to it.&lt;br /&gt;
* Under action column try to Add TA for any course.&lt;br /&gt;
* It will take you to Teaching Assistants page.&lt;br /&gt;
* Try to add a valid TA for eg. teaching_assistant5549. As soon as you press Add TA button, list will get updated with the newly added TA without refreshing the page.&lt;br /&gt;
* If you try to delete any TA, a popup will open to confirm your action, press ok and you will see that particular TA is deleted in the background.&lt;br /&gt;
* Similarly, for perform these actions for Add participant action for any course. Table will be updated with newly added participant without refreshing the page.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104197</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104197"/>
		<updated>2016-11-03T04:53:12Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* _add_individual.html.erb/_ta_list.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and its code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add/Delete TA (Teaching Assistants): Once a course has been created, an instructor can Add/Delete TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
*** list.html.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
*** _user_list.html.erb&lt;br /&gt;
** questionnaires&lt;br /&gt;
*** _ajax_partial.html.erb&lt;br /&gt;
*** add_new_questions.js.erb&lt;br /&gt;
*** edit.js.erb&lt;br /&gt;
&lt;br /&gt;
== Participants Controller/ Course Controller ==&lt;br /&gt;
&lt;br /&gt;
We have added respond_to method in add method of participants controller and add_ta/remove_ta methods of course controller, which will allow us to render both javascript and html requests from these methods. &lt;br /&gt;
&lt;br /&gt;
In course controller the function looked something like this:&lt;br /&gt;
 &lt;br /&gt;
  respond_to do |format|&lt;br /&gt;
      format.html { redirect_to action: 'view_teaching_assistants', id: @course.id }&lt;br /&gt;
      format.js &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== Questionnaire Controller ==&lt;br /&gt;
&lt;br /&gt;
The same methods added in participants were added in questionnaire controller, the difference being in the action the controller takes after receiving a JS request. &lt;br /&gt;
&lt;br /&gt;
In the partial _questionnaire.html.erb, the attribute remote was set to true. This is rendered as the attribute &amp;quot;data-remote&amp;quot; being set to true in HTML, which allows the rails UJS (unobtrusive JS) to make AJAX calls without needing any jQuery statements. &lt;br /&gt;
&lt;br /&gt;
To implement the functionality, the controller renders a JavaScript file in place of the usual .html.erb. The JavaScript file then takes action on the webpage it is called on. In the case of adding new questions, the page is updated with the new questions by the JavaScript file that is called. This is achieved by rendering a partial in the JavaScript file and then using jQuery to update the page with the rendered HTML. This seemed like a good approach as we are reusing the render method. Although new partials had to be created, the JavaScript functionality is easy to understand. Additional divs were added in the HTML to serve as hooks for the jQuery statements to update HTML on the page.&lt;br /&gt;
&lt;br /&gt;
Additionally, saving questions in the edit questionnaire section also works on AJAX, and flashes the standard rails success message without refreshing the page.&lt;br /&gt;
&lt;br /&gt;
== _add_individual.html.erb/_ta_list.html.erb ==&lt;br /&gt;
We have put the :remote =&amp;gt; true flag on the link or form tag in our .html.erb files (view) for the element where we wanted to trigger the AJAX call, like,&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= form_tag(&amp;quot;/course/add_ta&amp;quot;, :method =&amp;gt; 'post', :remote =&amp;gt; true) do %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= link_to &amp;quot;Delete&amp;quot;, { :action =&amp;gt; 'remove_ta', :controller =&amp;gt;'course', :id =&amp;gt; ta.id, :course_id =&amp;gt; ta.course_id }, method: :post,&lt;br /&gt;
     :remote =&amp;gt; true, :class =&amp;gt; 'delete_ta' %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With :remote =&amp;gt; true, rails will not automatically switch views, which allows the JQuery to be run instead. This can be used with a form_tag, a link_tag, or other types of tags.&lt;br /&gt;
&lt;br /&gt;
== Testing Details ==&lt;br /&gt;
&lt;br /&gt;
UI Testing&lt;br /&gt;
&lt;br /&gt;
Following steps needs to be performed to test this code from UI:&lt;br /&gt;
&lt;br /&gt;
* Login as an instructor.&lt;br /&gt;
* You will land on Manage Content page with list of courses and related actions to it.&lt;br /&gt;
* Under action column try to Add TA for any course.&lt;br /&gt;
* It will take you to Teaching Assistants page.&lt;br /&gt;
* Try to add a valid TA for eg. teaching_assistant5549. As soon as you press Add TA button, list will get updated with the newly added TA without refreshing the page.&lt;br /&gt;
* If you try to delete any TA, a popup will open to confirm your action, press ok and you will see that particular TA is deleted in the background.&lt;br /&gt;
* Similarly, for perform these actions for Add participant action for any course. Table will be updated with newly added participant without refreshing the page.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104196</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104196"/>
		<updated>2016-11-03T04:52:43Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* _add_individual.html.erb/_ta_list.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and its code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add/Delete TA (Teaching Assistants): Once a course has been created, an instructor can Add/Delete TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
*** list.html.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
*** _user_list.html.erb&lt;br /&gt;
** questionnaires&lt;br /&gt;
*** _ajax_partial.html.erb&lt;br /&gt;
*** add_new_questions.js.erb&lt;br /&gt;
*** edit.js.erb&lt;br /&gt;
&lt;br /&gt;
== Participants Controller/ Course Controller ==&lt;br /&gt;
&lt;br /&gt;
We have added respond_to method in add method of participants controller and add_ta/remove_ta methods of course controller, which will allow us to render both javascript and html requests from these methods. &lt;br /&gt;
&lt;br /&gt;
In course controller the function looked something like this:&lt;br /&gt;
 &lt;br /&gt;
  respond_to do |format|&lt;br /&gt;
      format.html { redirect_to action: 'view_teaching_assistants', id: @course.id }&lt;br /&gt;
      format.js &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== Questionnaire Controller ==&lt;br /&gt;
&lt;br /&gt;
The same methods added in participants were added in questionnaire controller, the difference being in the action the controller takes after receiving a JS request. &lt;br /&gt;
&lt;br /&gt;
In the partial _questionnaire.html.erb, the attribute remote was set to true. This is rendered as the attribute &amp;quot;data-remote&amp;quot; being set to true in HTML, which allows the rails UJS (unobtrusive JS) to make AJAX calls without needing any jQuery statements. &lt;br /&gt;
&lt;br /&gt;
To implement the functionality, the controller renders a JavaScript file in place of the usual .html.erb. The JavaScript file then takes action on the webpage it is called on. In the case of adding new questions, the page is updated with the new questions by the JavaScript file that is called. This is achieved by rendering a partial in the JavaScript file and then using jQuery to update the page with the rendered HTML. This seemed like a good approach as we are reusing the render method. Although new partials had to be created, the JavaScript functionality is easy to understand. Additional divs were added in the HTML to serve as hooks for the jQuery statements to update HTML on the page.&lt;br /&gt;
&lt;br /&gt;
Additionally, saving questions in the edit questionnaire section also works on AJAX, and flashes the standard rails success message without refreshing the page.&lt;br /&gt;
&lt;br /&gt;
== _add_individual.html.erb/_ta_list.html.erb ==&lt;br /&gt;
We have put the :remote =&amp;gt; true flag on the link or form tag in our .html.erb files (view) for the element where we wanted to trigger the AJAX call, like&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= form_tag(&amp;quot;/course/add_ta&amp;quot;, :method =&amp;gt; 'post', :remote =&amp;gt; true) do %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= link_to &amp;quot;Delete&amp;quot;, { :action =&amp;gt; 'remove_ta', :controller =&amp;gt;'course', :id =&amp;gt; ta.id, :course_id =&amp;gt; ta.course_id }, method: :post,&lt;br /&gt;
     :remote =&amp;gt; true, :class =&amp;gt; 'delete_ta' %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with :remote =&amp;gt; true, rails will not automatically switch views, which allows the JQuery to be run instead. This can be used with a form_tag, a link_tag, or other types of tags.&lt;br /&gt;
&lt;br /&gt;
== Testing Details ==&lt;br /&gt;
&lt;br /&gt;
UI Testing&lt;br /&gt;
&lt;br /&gt;
Following steps needs to be performed to test this code from UI:&lt;br /&gt;
&lt;br /&gt;
* Login as an instructor.&lt;br /&gt;
* You will land on Manage Content page with list of courses and related actions to it.&lt;br /&gt;
* Under action column try to Add TA for any course.&lt;br /&gt;
* It will take you to Teaching Assistants page.&lt;br /&gt;
* Try to add a valid TA for eg. teaching_assistant5549. As soon as you press Add TA button, list will get updated with the newly added TA without refreshing the page.&lt;br /&gt;
* If you try to delete any TA, a popup will open to confirm your action, press ok and you will see that particular TA is deleted in the background.&lt;br /&gt;
* Similarly, for perform these actions for Add participant action for any course. Table will be updated with newly added participant without refreshing the page.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104195</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104195"/>
		<updated>2016-11-03T04:50:28Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and its code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add/Delete TA (Teaching Assistants): Once a course has been created, an instructor can Add/Delete TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
*** list.html.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
*** _user_list.html.erb&lt;br /&gt;
** questionnaires&lt;br /&gt;
*** _ajax_partial.html.erb&lt;br /&gt;
*** add_new_questions.js.erb&lt;br /&gt;
*** edit.js.erb&lt;br /&gt;
&lt;br /&gt;
== Participants Controller/ Course Controller ==&lt;br /&gt;
&lt;br /&gt;
We have added respond_to method in add method of participants controller and add_ta/remove_ta methods of course controller, which will allow us to render both javascript and html requests from these methods. &lt;br /&gt;
&lt;br /&gt;
In course controller the function looked something like this:&lt;br /&gt;
 &lt;br /&gt;
  respond_to do |format|&lt;br /&gt;
      format.html { redirect_to action: 'view_teaching_assistants', id: @course.id }&lt;br /&gt;
      format.js &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== Questionnaire Controller ==&lt;br /&gt;
&lt;br /&gt;
The same methods added in participants were added in questionnaire controller, the difference being in the action the controller takes after receiving a JS request. &lt;br /&gt;
&lt;br /&gt;
In the partial _questionnaire.html.erb, the attribute remote was set to true. This is rendered as the attribute &amp;quot;data-remote&amp;quot; being set to true in HTML, which allows the rails UJS (unobtrusive JS) to make AJAX calls without needing any jQuery statements. &lt;br /&gt;
&lt;br /&gt;
To implement the functionality, the controller renders a JavaScript file in place of the usual .html.erb. The JavaScript file then takes action on the webpage it is called on. In the case of adding new questions, the page is updated with the new questions by the JavaScript file that is called. This is achieved by rendering a partial in the JavaScript file and then using jQuery to update the page with the rendered HTML. This seemed like a good approach as we are reusing the render method. Although new partials had to be created, the JavaScript functionality is easy to understand. Additional divs were added in the HTML to serve as hooks for the jQuery statements to update HTML on the page.&lt;br /&gt;
&lt;br /&gt;
Additionally, saving questions in the edit questionnaire section also works on AJAX, and flashes the standard rails success message without refreshing the page.&lt;br /&gt;
&lt;br /&gt;
== _add_individual.html.erb/_ta_list.html.erb ==&lt;br /&gt;
We have put the :remote =&amp;gt; true flag on the link or form tag in our .html.erb files (view) for the element where we wanted to trigger the AJAX call, like&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= link_to &amp;quot;Delete&amp;quot;, { :action =&amp;gt; 'remove_ta', :controller =&amp;gt;'course', :id =&amp;gt; ta.id, :course_id =&amp;gt; ta.course_id }, method: :post,&lt;br /&gt;
     :remote =&amp;gt; true, :class =&amp;gt; 'delete_ta' %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing Details ==&lt;br /&gt;
&lt;br /&gt;
UI Testing&lt;br /&gt;
&lt;br /&gt;
Following steps needs to be performed to test this code from UI:&lt;br /&gt;
&lt;br /&gt;
* Login as an instructor.&lt;br /&gt;
* You will land on Manage Content page with list of courses and related actions to it.&lt;br /&gt;
* Under action column try to Add TA for any course.&lt;br /&gt;
* It will take you to Teaching Assistants page.&lt;br /&gt;
* Try to add a valid TA for eg. teaching_assistant5549. As soon as you press Add TA button, list will get updated with the newly added TA without refreshing the page.&lt;br /&gt;
* If you try to delete any TA, a popup will open to confirm your action, press ok and you will see that particular TA is deleted in the background.&lt;br /&gt;
* Similarly, for perform these actions for Add participant action for any course. Table will be updated with newly added participant without refreshing the page.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104073</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104073"/>
		<updated>2016-10-30T19:55:38Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Files Created/Changed in the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and its code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add/Delete TA (Teaching Assistants): Once a course has been created, an instructor can Add/Delete TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
*** list.html.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
*** _user_list.html.erb&lt;br /&gt;
** questionnaires&lt;br /&gt;
*** _ajax_partial.html.erb&lt;br /&gt;
*** add_new_questions.js.erb&lt;br /&gt;
*** edit.js.erb&lt;br /&gt;
&lt;br /&gt;
== Participants Controller/ Course Controller ==&lt;br /&gt;
&lt;br /&gt;
We have added respond_to method in add method of participants controller and add_ta/remove_ta methods of course controller, which will allow us to render both javascript and html requests from these methods. &lt;br /&gt;
&lt;br /&gt;
In course controller the function looked something like this:&lt;br /&gt;
 &lt;br /&gt;
  respond_to do |format|&lt;br /&gt;
      format.html { redirect_to action: 'view_teaching_assistants', id: @course.id }&lt;br /&gt;
      format.js &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== Questionnaire Controller ==&lt;br /&gt;
&lt;br /&gt;
The same methods added in participants were added in questionnaire controller, the difference being in the action the controller takes after receiving a JS request. &lt;br /&gt;
&lt;br /&gt;
In the partial _questionnaire.html.erb, the attribute remote was set to true. This is rendered as the attribute &amp;quot;data-remote&amp;quot; being set to true in HTML, which allows the rails UJS (unobtrusive JS) to make AJAX calls without needing any jQuery statements. &lt;br /&gt;
&lt;br /&gt;
To implement the functionality, the controller renders a JavaScript file in place of the usual .html.erb. The JavaScript file then takes action on the webpage it is called on. In the case of adding new questions, the page is updated with the new questions by the JavaScript file that is called. This is achieved by rendering a partial in the JavaScript file and then using jQuery to update the page with the rendered HTML. This seemed like a good approach as we are reusing the render method. Although new partials had to be created, the JavaScript functionality is easy to understand. Additional divs were added in the HTML to serve as hooks for the jQuery statements to update HTML on the page.&lt;br /&gt;
&lt;br /&gt;
Additionally, saving questions in the edit questionnaire section also works on AJAX, and flashes the standard rails success message without refreshing the page.&lt;br /&gt;
&lt;br /&gt;
== Testing Details ==&lt;br /&gt;
&lt;br /&gt;
UI Testing&lt;br /&gt;
&lt;br /&gt;
Following steps needs to be performed to test this code from UI:&lt;br /&gt;
&lt;br /&gt;
* Login as an instructor.&lt;br /&gt;
* You will land on Manage Content page with list of courses and related actions to it.&lt;br /&gt;
* Under action column try to Add TA for any course.&lt;br /&gt;
* It will take you to Teaching Assistants page.&lt;br /&gt;
* Try to add a valid TA for eg. teaching_assistant5549. As soon as you press Add TA button, list will get updated with the newly added TA without refreshing the page.&lt;br /&gt;
* If you try to delete any TA, a popup will open to confirm your action, press ok and you will see that particular TA is deleted in the background.&lt;br /&gt;
* Similarly, for perform these actions for Add participant action for any course. Table will be updated with newly added participant without refreshing the page.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104072</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104072"/>
		<updated>2016-10-30T19:51:35Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Description of the current project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and its code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add/Delete TA (Teaching Assistants): Once a course has been created, an instructor can Add/Delete TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
** questionnaires&lt;br /&gt;
*** _ajax_partial.html.erb&lt;br /&gt;
*** add_new_questions.js.erb&lt;br /&gt;
*** edit.js.erb&lt;br /&gt;
&lt;br /&gt;
== Participants Controller/ Course Controller ==&lt;br /&gt;
&lt;br /&gt;
We have added respond_to method in add method of participants controller and add_ta/remove_ta methods of course controller, which will allow us to render both javascript and html requests from these methods. &lt;br /&gt;
&lt;br /&gt;
In course controller the function looked something like this:&lt;br /&gt;
 &lt;br /&gt;
  respond_to do |format|&lt;br /&gt;
      format.html { redirect_to action: 'view_teaching_assistants', id: @course.id }&lt;br /&gt;
      format.js &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== Questionnaire Controller ==&lt;br /&gt;
&lt;br /&gt;
The same methods added in participants were added in questionnaire controller, the difference being in the action the controller takes after receiving a JS request. &lt;br /&gt;
&lt;br /&gt;
In the partial _questionnaire.html.erb, the attribute remote was set to true. This is rendered as the attribute &amp;quot;data-remote&amp;quot; being set to true in HTML, which allows the rails UJS (unobtrusive JS) to make AJAX calls without needing any jQuery statements. &lt;br /&gt;
&lt;br /&gt;
To implement the functionality, the controller renders a JavaScript file in place of the usual .html.erb. The JavaScript file then takes action on the webpage it is called on. In the case of adding new questions, the page is updated with the new questions by the JavaScript file that is called. This is achieved by rendering a partial in the JavaScript file and then using jQuery to update the page with the rendered HTML. This seemed like a good approach as we are reusing the render method. Although new partials had to be created, the JavaScript functionality is easy to understand. Additional divs were added in the HTML to serve as hooks for the jQuery statements to update HTML on the page.&lt;br /&gt;
&lt;br /&gt;
Additionally, saving questions in the edit questionnaire section also works on AJAX, and flashes the standard rails success message without refreshing the page.&lt;br /&gt;
&lt;br /&gt;
== Testing Details ==&lt;br /&gt;
&lt;br /&gt;
UI Testing&lt;br /&gt;
&lt;br /&gt;
Following steps needs to be performed to test this code from UI:&lt;br /&gt;
&lt;br /&gt;
* Login as an instructor.&lt;br /&gt;
* You will land on Manage Content page with list of courses and related actions to it.&lt;br /&gt;
* Under action column try to Add TA for any course.&lt;br /&gt;
* It will take you to Teaching Assistants page.&lt;br /&gt;
* Try to add a valid TA for eg. teaching_assistant5549. As soon as you press Add TA button, list will get updated with the newly added TA without refreshing the page.&lt;br /&gt;
* If you try to delete any TA, a popup will open to confirm your action, press ok and you will see that particular TA is deleted in the background.&lt;br /&gt;
* Similarly, for perform these actions for Add participant action for any course. Table will be updated with newly added participant without refreshing the page.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104071</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104071"/>
		<updated>2016-10-30T19:49:59Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Participants Controller/ Course Controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and its code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add TA (Teaching Assistants): Once a course has been created, an instructor can Add TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
* Un-submit reviews: Instructor should be able to un-submit a review.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
** questionnaires&lt;br /&gt;
*** _ajax_partial.html.erb&lt;br /&gt;
*** add_new_questions.js.erb&lt;br /&gt;
*** edit.js.erb&lt;br /&gt;
&lt;br /&gt;
== Participants Controller/ Course Controller ==&lt;br /&gt;
&lt;br /&gt;
We have added respond_to method in add method of participants controller and add_ta/remove_ta methods of course controller, which will allow us to render both javascript and html requests from these methods. &lt;br /&gt;
&lt;br /&gt;
In course controller the function looked something like this:&lt;br /&gt;
 &lt;br /&gt;
  respond_to do |format|&lt;br /&gt;
      format.html { redirect_to action: 'view_teaching_assistants', id: @course.id }&lt;br /&gt;
      format.js &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== Questionnaire Controller ==&lt;br /&gt;
&lt;br /&gt;
The same methods added in participants were added in questionnaire controller, the difference being in the action the controller takes after receiving a JS request. &lt;br /&gt;
&lt;br /&gt;
In the partial _questionnaire.html.erb, the attribute remote was set to true. This is rendered as the attribute &amp;quot;data-remote&amp;quot; being set to true in HTML, which allows the rails UJS (unobtrusive JS) to make AJAX calls without needing any jQuery statements. &lt;br /&gt;
&lt;br /&gt;
To implement the functionality, the controller renders a JavaScript file in place of the usual .html.erb. The JavaScript file then takes action on the webpage it is called on. In the case of adding new questions, the page is updated with the new questions by the JavaScript file that is called. This is achieved by rendering a partial in the JavaScript file and then using jQuery to update the page with the rendered HTML. This seemed like a good approach as we are reusing the render method. Although new partials had to be created, the JavaScript functionality is easy to understand. Additional divs were added in the HTML to serve as hooks for the jQuery statements to update HTML on the page.&lt;br /&gt;
&lt;br /&gt;
Additionally, saving questions in the edit questionnaire section also works on AJAX, and flashes the standard rails success message without refreshing the page.&lt;br /&gt;
&lt;br /&gt;
== Testing Details ==&lt;br /&gt;
&lt;br /&gt;
UI Testing&lt;br /&gt;
&lt;br /&gt;
Following steps needs to be performed to test this code from UI:&lt;br /&gt;
&lt;br /&gt;
* Login as an instructor.&lt;br /&gt;
* You will land on Manage Content page with list of courses and related actions to it.&lt;br /&gt;
* Under action column try to Add TA for any course.&lt;br /&gt;
* It will take you to Teaching Assistants page.&lt;br /&gt;
* Try to add a valid TA for eg. teaching_assistant5549. As soon as you press Add TA button, list will get updated with the newly added TA without refreshing the page.&lt;br /&gt;
* If you try to delete any TA, a popup will open to confirm your action, press ok and you will see that particular TA is deleted in the background.&lt;br /&gt;
* Similarly, for perform these actions for Add participant action for any course. Table will be updated with newly added participant without refreshing the page.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104070</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=104070"/>
		<updated>2016-10-30T18:54:03Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and its code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add TA (Teaching Assistants): Once a course has been created, an instructor can Add TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
* Un-submit reviews: Instructor should be able to un-submit a review.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
** questionnaires&lt;br /&gt;
*** _ajax_partial.html.erb&lt;br /&gt;
*** add_new_questions.js.erb&lt;br /&gt;
*** edit.js.erb&lt;br /&gt;
&lt;br /&gt;
== Participants Controller/ Course Controller ==&lt;br /&gt;
&lt;br /&gt;
We have added respond_to method in add method of participants controller and add_ta/remove_ta methods of course controller, which will allow us to render both javascript and html requests from these methods.&lt;br /&gt;
&lt;br /&gt;
== Questionnaire Controller ==&lt;br /&gt;
&lt;br /&gt;
The same methods added in participants were added in questionnaire controller, the difference being in the action the controller takes after receiving a JS request. &lt;br /&gt;
&lt;br /&gt;
In the partial _questionnaire.html.erb, the attribute remote was set to true. This is rendered as the attribute &amp;quot;data-remote&amp;quot; being set to true in HTML, which allows the rails UJS (unobtrusive JS) to make AJAX calls without needing any jQuery statements. &lt;br /&gt;
&lt;br /&gt;
To implement the functionality, the controller renders a JavaScript file in place of the usual .html.erb. The JavaScript file then takes action on the webpage it is called on. In the case of adding new questions, the page is updated with the new questions by the JavaScript file that is called. This is achieved by rendering a partial in the JavaScript file and then using jQuery to update the page with the rendered HTML. This seemed like a good approach as we are reusing the render method. Although new partials had to be created, the JavaScript functionality is easy to understand. Additional divs were added in the HTML to serve as hooks for the jQuery statements to update HTML on the page.&lt;br /&gt;
&lt;br /&gt;
Additionally, saving questions in the edit questionnaire section also works on AJAX, and flashes the standard rails success message without refreshing the page.&lt;br /&gt;
&lt;br /&gt;
== Testing Details ==&lt;br /&gt;
&lt;br /&gt;
UI Testing&lt;br /&gt;
&lt;br /&gt;
Following steps needs to be performed to test this code from UI:&lt;br /&gt;
&lt;br /&gt;
* Login as an instructor.&lt;br /&gt;
* You will land on Manage Content page with list of courses and related actions to it.&lt;br /&gt;
* Under action column try to Add TA for any course.&lt;br /&gt;
* It will take you to Teaching Assistants page.&lt;br /&gt;
* Try to add a valid TA for eg. teaching_assistant5549. As soon as you press Add TA button, list will get updated with the newly added TA without refreshing the page.&lt;br /&gt;
* If you try to delete any TA, a popup will open to confirm your action, press ok and you will see that particular TA is deleted in the background.&lt;br /&gt;
* Similarly, for perform these actions for Add participant action for any course. Table will be updated with newly added participant without refreshing the page.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=103888</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=103888"/>
		<updated>2016-10-29T04:43:12Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Participants Controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and its code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add TA (Teaching Assistants): Once a course has been created, an instructor can Add TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
* Un-submit reviews: Instructor should be able to un-submit a review.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
** questionnaires&lt;br /&gt;
*** _ajax_partial.html.erb&lt;br /&gt;
*** add_new_questions.js.erb&lt;br /&gt;
*** edit.js.erb&lt;br /&gt;
&lt;br /&gt;
== Participants Controller/ Course Controller ==&lt;br /&gt;
&lt;br /&gt;
We have added respond_to method in add method of participants controller and add_ta/remove_ta methods of course controller, which will allow us to render both javascript and html requests from these methods.&lt;br /&gt;
&lt;br /&gt;
== Questionnaire Controller ==&lt;br /&gt;
&lt;br /&gt;
The same methods added in participants were added in questionnaire controller, the difference being in the action the controller takes after receiving a JS request. &lt;br /&gt;
&lt;br /&gt;
In the partial _questionnaire.html.erb, the attribute remote was set to true. This is rendered as the attribute &amp;quot;data-remote&amp;quot; being set to true in HTML, which allows the rails UJS (unobtrusive JS) to make AJAX calls without needing any jQuery statements. &lt;br /&gt;
&lt;br /&gt;
To implement the functionality, the controller renders a JavaScript file in place of the usual .html.erb. The JavaScript file then takes action on the webpage it is called on. In the case of adding new questions, the page is updated with the new questions by the JavaScript file that is called. This is achieved by rendering a partial in the JavaScript file and then using jQuery to update the page with the rendered HTML. This seemed like a good approach as we are reusing the render method. Although new partials had to be created, the JavaScript functionality is easy to understand. Additional divs were added in the HTML to serve as hooks for the jQuery statements to update HTML on the page.&lt;br /&gt;
&lt;br /&gt;
Additionally, saving questions in the edit questionnaire section also works on AJAX, and flashes the standard rails success message without refreshing the page.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=103682</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=103682"/>
		<updated>2016-10-29T02:31:47Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* participants_controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and it’s code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add TA (Teaching Assistants): Once a course has been created, an instructor can Add TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
* Un-submit reviews: Instructor should be able to un-submit a review.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
&lt;br /&gt;
== Participants Controller ==&lt;br /&gt;
&lt;br /&gt;
We have added respond_to method in add method of this controller which will allow us to render both javascript and html requests.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=103647</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=103647"/>
		<updated>2016-10-29T02:10:26Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Peer Review Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and it’s code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add TA (Teaching Assistants): Once a course has been created, an instructor can Add TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
* Un-submit reviews: Instructor should be able to un-submit a review.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
&lt;br /&gt;
== participants_controller ==&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=103528</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=103528"/>
		<updated>2016-10-29T01:08:12Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and it’s code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add TA (Teaching Assistants): Once a course has been created, an instructor can Add TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
* Un-submit reviews: Instructor should be able to un-submit a review.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;br /&gt;
&lt;br /&gt;
== participants_controller ==&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=103249</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=103249"/>
		<updated>2016-10-28T23:05:48Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: /* Files Created/Changed in the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and it’s code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add TA (Teaching Assistants): Once a course has been created, an instructor can Add TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
* Un-submit reviews: Instructor should be able to un-submit a review.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
** course&lt;br /&gt;
*** _add_individual.html.erb&lt;br /&gt;
*** _ta_list.html.erb&lt;br /&gt;
*** add_ta.js.erb&lt;br /&gt;
*** remove_ta.js.erb&lt;br /&gt;
*** view_teaching_assistants.html.erb&lt;br /&gt;
** participants&lt;br /&gt;
*** add.js.erb&lt;br /&gt;
** shared_scripts&lt;br /&gt;
*** add_individual.html.erb&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=102887</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=102887"/>
		<updated>2016-10-28T19:34:49Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and it’s code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
* Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
* Add TA (Teaching Assistants): Once a course has been created, an instructor can Add TAs to the course.  &lt;br /&gt;
* Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
* Un-submit reviews: Instructor should be able to un-submit a review.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=102882</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=102882"/>
		<updated>2016-10-28T19:31:31Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and it’s code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
1. Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
 &lt;br /&gt;
2. Add TA (Teaching Assistants): Once a course has been created, an instructor can Add TAs to the course.  &lt;br /&gt;
&lt;br /&gt;
3. Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
&lt;br /&gt;
4. Un-submit reviews: Instructor should be able to un-submit a review.&lt;br /&gt;
&lt;br /&gt;
== Files Created/Changed in the project ==&lt;br /&gt;
&lt;br /&gt;
* Controllers&lt;br /&gt;
&lt;br /&gt;
** participants_controller.rb&lt;br /&gt;
** course_controller.rb&lt;br /&gt;
** questionnaires_controller.rb&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=102854</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=102854"/>
		<updated>2016-10-28T19:23:05Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
&lt;br /&gt;
Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and it’s code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
1. Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment.&lt;br /&gt;
 &lt;br /&gt;
2. Add TA (Teaching Assistants): Once a course has been created, an instructor can Add TAs to the course.  &lt;br /&gt;
&lt;br /&gt;
3. Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
&lt;br /&gt;
4. Un-submit reviews: Instructor should be able to un-submit a review.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=102849</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=102849"/>
		<updated>2016-10-28T19:20:20Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
 Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and it’s code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
1. Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment. &lt;br /&gt;
2. Add TA (Teaching Assistants): Once a course has been created, an instructor can Add TAs to the course.  &lt;br /&gt;
3. Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
4. Un-submit reviews: Instructor should be able to un-submit a review.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=102848</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=102848"/>
		<updated>2016-10-28T19:19:13Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
  Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
Student login: username -&amp;gt; student4340, password -&amp;gt; password&lt;br /&gt;
Student login: username -&amp;gt; student4405, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== Expertiza Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and it’s code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The current project deals with addition of AJAX whenever we add a new record or modify an existing record. In the current scenario, we submit the entire page to save a record and reload the entire page back again. Using Ajax, we should only submit the newly added record information to server instead of submitting the entire page. This project takes care of below scenarios:&lt;br /&gt;
&lt;br /&gt;
1. Add Participants: Once an assignment has been created, an instructor can Add Participants to the assignment. &lt;br /&gt;
2. Add TA (Teaching Assistants): Once a course has been created, an instructor can Add TAs to the course.  &lt;br /&gt;
3. Edit Questionnaire: Modify the Edit Questionnaire screen to use ajax while adding new questions to the questionnaires.&lt;br /&gt;
4. Un-submit reviews: Instructor should be able to un-submit a review.&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=102808</id>
		<title>CSC/ECE 517 Fall 2016/oss E1663</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/oss_E1663&amp;diff=102808"/>
		<updated>2016-10-28T18:50:25Z</updated>

		<summary type="html">&lt;p&gt;Pagrawa2: Created page with &amp;quot;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.   == Peer Review Information ==  For users intending to view the depl...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1663 OSS assignment for Fall 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
Student login: username -&amp;gt; student4340, password -&amp;gt; password&lt;br /&gt;
Student login: username -&amp;gt; student4405, password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Pagrawa2</name></author>
	</entry>
</feed>