<?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=Sddhyade</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=Sddhyade"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Sddhyade"/>
	<updated>2026-05-09T04:15:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121437</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121437"/>
		<updated>2018-12-09T23:06:49Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Use Case Diagram Details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
Previously, view submission does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
==='''Use Case Diagram'''===&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for viewing GitHub metrics of teams and team members of an assignment. &lt;br /&gt;
&lt;br /&gt;
'''Pre-Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Team should have submitted the assignment with a PR link or GitHub repository.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The instructor should login.&lt;br /&gt;
&lt;br /&gt;
*The instructor should browse teams for an assignment.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Ooddafter4.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
&lt;br /&gt;
[[File:Ooddafter3.png|none|frame|&lt;br /&gt;
At present, view submission shows group assignments are submitted as a single submission and 'view github metric' link shows work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
[[File:Ooddafter10.png|none|frame|The Github summary]]&lt;br /&gt;
&lt;br /&gt;
===='''Code Change in Grades_Controller'''====&lt;br /&gt;
* Added below new functions to implement Github Integration in View Submission page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def get_statuses_for_pull_request(ref)&lt;br /&gt;
    url = &amp;quot;https://api.github.com/repos/expertiza/expertiza/commits/&amp;quot; + ref + &amp;quot;/status&amp;quot;&lt;br /&gt;
    ActiveSupport::JSON.decode(Net::HTTP.get(URI(url)))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def retrieve_pull_request_data(pull_links)&lt;br /&gt;
    pull_links.each do |hyperlink|&lt;br /&gt;
      submission_hyperlink_tokens = hyperlink.split('/')&lt;br /&gt;
      hyperlink_data = {}&lt;br /&gt;
      hyperlink_data[&amp;quot;pull_request_number&amp;quot;] = submission_hyperlink_tokens.pop&lt;br /&gt;
      submission_hyperlink_tokens.pop&lt;br /&gt;
      hyperlink_data[&amp;quot;repository_name&amp;quot;] = submission_hyperlink_tokens.pop&lt;br /&gt;
      hyperlink_data[&amp;quot;owner_name&amp;quot;] = submission_hyperlink_tokens.pop&lt;br /&gt;
      github_data = get_pull_request_details(hyperlink_data)&lt;br /&gt;
      parse_github_data_pull(github_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def retrieve_repository_data(repo_links)&lt;br /&gt;
    repo_links.each do |hyperlink|&lt;br /&gt;
      submission_hyperlink_tokens = hyperlink.split('/')&lt;br /&gt;
      hyperlink_data = {}&lt;br /&gt;
      hyperlink_data[&amp;quot;repository_name&amp;quot;] = submission_hyperlink_tokens[4]&lt;br /&gt;
      next if hyperlink_data[&amp;quot;repository_name&amp;quot;] == &amp;quot;servo&amp;quot; || hyperlink_data[&amp;quot;repository_name&amp;quot;] == &amp;quot;expertiza&amp;quot;&lt;br /&gt;
      hyperlink_data[&amp;quot;owner_name&amp;quot;] = submission_hyperlink_tokens[3]&lt;br /&gt;
      github_data = get_github_data_repo(hyperlink_data)&lt;br /&gt;
      parse_github_data_repo(github_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def retrieve_github_data&lt;br /&gt;
    team_links = @team.hyperlinks&lt;br /&gt;
    pull_links = team_links.select do |link|&lt;br /&gt;
      link.match(/pull/) &amp;amp;&amp;amp; link.match(/github.com/)&lt;br /&gt;
    end&lt;br /&gt;
    if !pull_links.empty?&lt;br /&gt;
      retrieve_pull_request_data(pull_links)&lt;br /&gt;
    else&lt;br /&gt;
      repo_links = team_links.select do |link|&lt;br /&gt;
        link.match(/github.com/)&lt;br /&gt;
      end&lt;br /&gt;
      retrieve_repository_data(repo_links)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def retrieve_check_run_statuses&lt;br /&gt;
    @head_refs.each do |pull_number, ref|&lt;br /&gt;
      @check_statuses[pull_number] = get_statuses_for_pull_request(ref)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def view_github_metrics&lt;br /&gt;
    if session[&amp;quot;github_access_token&amp;quot;].nil?&lt;br /&gt;
      session[&amp;quot;participant_id&amp;quot;] = params[:id]&lt;br /&gt;
      session[&amp;quot;github_view_type&amp;quot;] = &amp;quot;view_submissions&amp;quot;&lt;br /&gt;
      redirect_to authorize_github_grades_path&lt;br /&gt;
      return&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    @head_refs = {}&lt;br /&gt;
    @parsed_data = {}&lt;br /&gt;
    @authors = {}&lt;br /&gt;
    @dates = {}&lt;br /&gt;
    @total_additions = 0&lt;br /&gt;
    @total_deletions = 0&lt;br /&gt;
    @total_commits = 0&lt;br /&gt;
    @total_files_changed = 0&lt;br /&gt;
    @merge_status = {}&lt;br /&gt;
    @check_statuses = {}&lt;br /&gt;
&lt;br /&gt;
    @token = session[&amp;quot;github_access_token&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    @assignment = @participant.assignment&lt;br /&gt;
    @team = @participant.team&lt;br /&gt;
    @team_id = @team.id&lt;br /&gt;
&lt;br /&gt;
    retrieve_github_data&lt;br /&gt;
    retrieve_check_run_statuses&lt;br /&gt;
&lt;br /&gt;
    @authors = @authors.keys&lt;br /&gt;
    @dates = @dates.keys.sort&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def authorize_github&lt;br /&gt;
    redirect_to &amp;quot;https://github.com/login/oauth/authorize?client_id=#{GITHUB_CONFIG['client_key']}&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def get_github_data_repo(hyperlink_data)&lt;br /&gt;
    data = {&lt;br /&gt;
      query: &amp;quot;query {&lt;br /&gt;
        repository(owner: \&amp;quot;&amp;quot; + hyperlink_data[&amp;quot;owner_name&amp;quot;] + &amp;quot;\&amp;quot;, name: \&amp;quot;&amp;quot; + hyperlink_data[&amp;quot;repository_name&amp;quot;] + &amp;quot;\&amp;quot;) {&lt;br /&gt;
          ref(qualifiedName: \&amp;quot;master\&amp;quot;) {&lt;br /&gt;
            target {&lt;br /&gt;
              ... on Commit {&lt;br /&gt;
                id&lt;br /&gt;
                  history(first: 100) {&lt;br /&gt;
                    edges {&lt;br /&gt;
                      node {&lt;br /&gt;
                        id author {&lt;br /&gt;
                          name email date&lt;br /&gt;
                        }&lt;br /&gt;
                      }&lt;br /&gt;
                    }&lt;br /&gt;
                  }&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
        }&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    make_github_api_request(data)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def get_pull_request_details(hyperlink_data)&lt;br /&gt;
    response_data = make_github_api_request(get_query(true, hyperlink_data))&lt;br /&gt;
&lt;br /&gt;
    @has_next_page = response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;pageInfo&amp;quot;][&amp;quot;hasNextPage&amp;quot;]&lt;br /&gt;
    @end_cursor = response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;pageInfo&amp;quot;][&amp;quot;endCursor&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
    while @has_next_page&lt;br /&gt;
      new_response_data = make_github_api_request(get_query(false, hyperlink_data))&lt;br /&gt;
      response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;edges&amp;quot;].push(*new_response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;edges&amp;quot;])&lt;br /&gt;
      @has_next_page = new_response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;pageInfo&amp;quot;][&amp;quot;hasNextPage&amp;quot;]&lt;br /&gt;
      @end_cursor = new_response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;pageInfo&amp;quot;][&amp;quot;endCursor&amp;quot;]&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    response_data&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def process_github_authors_and_dates(author_name, commit_date)&lt;br /&gt;
    @authors[author_name] ||= 1&lt;br /&gt;
    @dates[commit_date] ||= 1&lt;br /&gt;
    @parsed_data[author_name] ||= {}&lt;br /&gt;
    @parsed_data[author_name][commit_date] = if @parsed_data[author_name][commit_date]&lt;br /&gt;
                                               @parsed_data[author_name][commit_date] + 1&lt;br /&gt;
                                             else&lt;br /&gt;
                                               1&lt;br /&gt;
                                             end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def parse_github_data_pull(github_data)&lt;br /&gt;
    team_statistics(github_data)&lt;br /&gt;
    pull_request_object = github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;]&lt;br /&gt;
    commit_objects = pull_request_object[&amp;quot;commits&amp;quot;][&amp;quot;edges&amp;quot;]&lt;br /&gt;
    commit_objects.each do |commit_object|&lt;br /&gt;
      commit = commit_object[&amp;quot;node&amp;quot;][&amp;quot;commit&amp;quot;]&lt;br /&gt;
      author_name = commit[&amp;quot;author&amp;quot;][&amp;quot;name&amp;quot;]&lt;br /&gt;
      commit_date = commit[&amp;quot;committedDate&amp;quot;].to_s&lt;br /&gt;
      process_github_authors_and_dates(author_name, commit_date[0, 10])&lt;br /&gt;
    end&lt;br /&gt;
    organize_commit_dates&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def parse_github_data_repo(github_data)&lt;br /&gt;
    commit_history = github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;ref&amp;quot;][&amp;quot;target&amp;quot;][&amp;quot;history&amp;quot;]&lt;br /&gt;
    commit_objects = commit_history[&amp;quot;edges&amp;quot;]&lt;br /&gt;
    commit_objects.each do |commit_object|&lt;br /&gt;
      commit_author = commit_object[&amp;quot;node&amp;quot;][&amp;quot;author&amp;quot;]&lt;br /&gt;
      author_name = commit_author[&amp;quot;name&amp;quot;]&lt;br /&gt;
      commit_date = commit_author[&amp;quot;date&amp;quot;].to_s&lt;br /&gt;
      process_github_authors_and_dates(author_name, commit_date[0, 10])&lt;br /&gt;
    end&lt;br /&gt;
    organize_commit_dates&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def make_github_api_request(data)&lt;br /&gt;
    uri = URI.parse(&amp;quot;https://api.github.com/graphql&amp;quot;)&lt;br /&gt;
    http = Net::HTTP.new(uri.host, uri.port)&lt;br /&gt;
    http.use_ssl = true&lt;br /&gt;
    http.verify_mode = OpenSSL::SSL::VERIFY_PEER&lt;br /&gt;
    request = Net::HTTP::Post.new(uri.path, 'Authorization' =&amp;gt; 'Bearer' + ' ' + session[&amp;quot;github_access_token&amp;quot;])&lt;br /&gt;
    request.body = data.to_json&lt;br /&gt;
    http.request(request)&lt;br /&gt;
    response = http.request(request)&lt;br /&gt;
    ActiveSupport::JSON.decode(response.body.to_s)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def organize_commit_dates&lt;br /&gt;
    @dates.each_key do |date|&lt;br /&gt;
      @parsed_data.each_value do |commits|&lt;br /&gt;
        commits[date] ||= 0&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @parsed_data.each {|author, commits| @parsed_data[author] = Hash[commits.sort_by {|date, _commit_count| date }] }&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def team_statistics(github_data)&lt;br /&gt;
    @total_additions += github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;additions&amp;quot;]&lt;br /&gt;
    @total_deletions += github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;deletions&amp;quot;]&lt;br /&gt;
    @total_files_changed += github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;changedFiles&amp;quot;]&lt;br /&gt;
    @total_commits += github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;totalCount&amp;quot;]&lt;br /&gt;
    pull_request_number = github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;number&amp;quot;]&lt;br /&gt;
    @head_refs[pull_request_number] = github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;headRefOid&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
    @merge_status[pull_request_number] = if github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;merged&amp;quot;]&lt;br /&gt;
                                           &amp;quot;MERGED&amp;quot;&lt;br /&gt;
                                         else&lt;br /&gt;
                                           github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;mergeable&amp;quot;]&lt;br /&gt;
                                         end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def get_query(is_initial_page, hyperlink_data)&lt;br /&gt;
    commit_query_line = if is_initial_page&lt;br /&gt;
                          &amp;quot;commits(first:100){&amp;quot;&lt;br /&gt;
                        else&lt;br /&gt;
                          &amp;quot;commits(first:100, after:&amp;quot; + @end_cursor + &amp;quot;){&amp;quot;&lt;br /&gt;
                        end&lt;br /&gt;
    {&lt;br /&gt;
      query: &amp;quot;query {&lt;br /&gt;
        repository(owner: \&amp;quot;&amp;quot; + hyperlink_data[&amp;quot;owner_name&amp;quot;] + &amp;quot;\&amp;quot;, name:\&amp;quot;&amp;quot; + hyperlink_data[&amp;quot;repository_name&amp;quot;] + &amp;quot;\&amp;quot;) {&lt;br /&gt;
          pullRequest(number: &amp;quot; + hyperlink_data[&amp;quot;pull_request_number&amp;quot;] + &amp;quot;) {&lt;br /&gt;
            number additions deletions changedFiles mergeable merged headRefOid&lt;br /&gt;
              &amp;quot; + commit_query_line + &amp;quot;&lt;br /&gt;
                totalCount&lt;br /&gt;
                  pageInfo{&lt;br /&gt;
                    hasNextPage startCursor endCursor&lt;br /&gt;
                    }&lt;br /&gt;
                      edges{&lt;br /&gt;
                        node{&lt;br /&gt;
                          id  commit{&lt;br /&gt;
                                author{&lt;br /&gt;
                                  name&lt;br /&gt;
                                }&lt;br /&gt;
                               additions deletions changedFiles committedDate&lt;br /&gt;
                        }}}}}}}&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Change 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate Reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Change 2: Bar chart for # of commits changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of commits changed per team member since the start of the assignment, also bottom of the page shows summary from Github submissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''RSpec Tests'''===&lt;br /&gt;
&lt;br /&gt;
* Following feature tests were added to the Grades_Controller_Spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  describe '#get_statuses_for_pull_request' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(Net::HTTP).to receive(:get) {&amp;quot;{\&amp;quot;team\&amp;quot;:\&amp;quot;rails\&amp;quot;,\&amp;quot;players\&amp;quot;:\&amp;quot;36\&amp;quot;}&amp;quot;}&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'makes a call to the GitHub API to get status of the head commit passed' do&lt;br /&gt;
      expect(controller.get_statuses_for_pull_request('qwerty123')).to eq({&amp;quot;team&amp;quot; =&amp;gt; &amp;quot;rails&amp;quot;, &amp;quot;players&amp;quot; =&amp;gt; &amp;quot;36&amp;quot;})&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#retrieve_pull_request_data' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(controller).to receive(:get_pull_request_details).and_return({&amp;quot;pr&amp;quot; =&amp;gt; &amp;quot;details&amp;quot;})&lt;br /&gt;
      allow(controller).to receive(:parse_github_data_pull)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'gets pull request details for each PR link submitted' do&lt;br /&gt;
      expect(controller).to receive(:get_pull_request_details).with(&lt;br /&gt;
          {&lt;br /&gt;
              &amp;quot;pull_request_number&amp;quot; =&amp;gt; &amp;quot;1261&amp;quot;,&lt;br /&gt;
              &amp;quot;repository_name&amp;quot; =&amp;gt; &amp;quot;expertiza&amp;quot;,&lt;br /&gt;
              &amp;quot;owner_name&amp;quot; =&amp;gt; &amp;quot;expertiza&amp;quot;&lt;br /&gt;
          })&lt;br /&gt;
      expect(controller).to receive(:get_pull_request_details).with(&lt;br /&gt;
          {&lt;br /&gt;
              &amp;quot;pull_request_number&amp;quot; =&amp;gt; &amp;quot;1293&amp;quot;,&lt;br /&gt;
              &amp;quot;repository_name&amp;quot; =&amp;gt; &amp;quot;mamaMiya&amp;quot;,&lt;br /&gt;
              &amp;quot;owner_name&amp;quot; =&amp;gt; &amp;quot;Shantanu&amp;quot;&lt;br /&gt;
          })&lt;br /&gt;
      controller.retrieve_pull_request_data([&amp;quot;https://github.com/expertiza/expertiza/pull/1261&amp;quot;, &amp;quot;https://github.com/Shantanu/mamaMiya/pull/1293&amp;quot;])&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'calls parse_github_data_pull on each of the PR details' do&lt;br /&gt;
      expect(controller).to receive(:parse_github_data_pull).with({&amp;quot;pr&amp;quot; =&amp;gt; &amp;quot;details&amp;quot;}).twice&lt;br /&gt;
      controller.retrieve_pull_request_data([&amp;quot;https://github.com/expertiza/expertiza/pull/1261&amp;quot;, &amp;quot;https://github.com/Shantanu/mamaMiya/pull/1293&amp;quot;])&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#retrieve_repository_data' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(controller).to receive(:get_github_data_repo).and_return({&amp;quot;pr&amp;quot; =&amp;gt; &amp;quot;details&amp;quot;})&lt;br /&gt;
      allow(controller).to receive(:parse_github_data_repo)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'gets details for each repo link submitted, excluding those for expertiza and servo' do&lt;br /&gt;
      expect(controller).to receive(:get_github_data_repo).with(&lt;br /&gt;
          {&lt;br /&gt;
              &amp;quot;repository_name&amp;quot; =&amp;gt; &amp;quot;website&amp;quot;,&lt;br /&gt;
              &amp;quot;owner_name&amp;quot; =&amp;gt; &amp;quot;Shantanu&amp;quot;&lt;br /&gt;
          })&lt;br /&gt;
      expect(controller).to receive(:get_github_data_repo).with(&lt;br /&gt;
          {&lt;br /&gt;
              &amp;quot;repository_name&amp;quot; =&amp;gt; &amp;quot;OODD&amp;quot;,&lt;br /&gt;
              &amp;quot;owner_name&amp;quot; =&amp;gt; &amp;quot;Edward&amp;quot;&lt;br /&gt;
          })&lt;br /&gt;
      controller.retrieve_repository_data([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/Edward/OODD&amp;quot;, &amp;quot;https://github.com/expertiza/expertiza&amp;quot;, &amp;quot;https://github.com/Shantanu/expertiza]&amp;quot;])&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'calls parse_github_data_repo on each of the PR details' do&lt;br /&gt;
      expect(controller).to receive(:parse_github_data_repo).with({&amp;quot;pr&amp;quot; =&amp;gt; &amp;quot;details&amp;quot;}).twice&lt;br /&gt;
      controller.retrieve_repository_data([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/Edward/OODD&amp;quot;])&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#retrieve_github_data' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(controller).to receive(:retrieve_pull_request_data)&lt;br /&gt;
      allow(controller).to receive(:retrieve_repository_data)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when pull request links have been submitted' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        teams_mock = double&lt;br /&gt;
        allow(teams_mock).to receive(:hyperlinks).and_return([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/Shantanu/website/pull/1123&amp;quot;])&lt;br /&gt;
        controller.instance_variable_set(:@team, teams_mock)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'retrieves PR data only' do&lt;br /&gt;
        expect(controller).to receive(:retrieve_pull_request_data).with([&amp;quot;https://github.com/Shantanu/website/pull/1123&amp;quot;])&lt;br /&gt;
        controller.retrieve_github_data&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when pull request links have not been submitted' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        teams_mock = double&lt;br /&gt;
        allow(teams_mock).to receive(:hyperlinks).and_return([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/expertiza/expertiza&amp;quot;])&lt;br /&gt;
        controller.instance_variable_set(:@team, teams_mock)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'retrieves repo details ' do&lt;br /&gt;
        expect(controller).to receive(:retrieve_repository_data).with([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/expertiza/expertiza&amp;quot;])&lt;br /&gt;
        controller.retrieve_github_data&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#retrieve_check_run_statuses' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(controller).to receive(:get_statuses_for_pull_request).and_return(&amp;quot;check_status&amp;quot;)&lt;br /&gt;
      controller.instance_variable_set(:@headRefs, {&amp;quot;1234&amp;quot; =&amp;gt; &amp;quot;qwerty&amp;quot;, &amp;quot;5678&amp;quot; =&amp;gt; &amp;quot;asdfg&amp;quot;})&lt;br /&gt;
      controller.instance_variable_set(:@check_statuses, {})&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'gets and stores the statuses associated with head commits of PRs' do&lt;br /&gt;
      expect(controller).to receive(:get_statuses_for_pull_request).with(&amp;quot;qwerty&amp;quot;)&lt;br /&gt;
      expect(controller).to receive(:get_statuses_for_pull_request).with(&amp;quot;asdfg&amp;quot;)&lt;br /&gt;
      controller.retrieve_check_run_statuses&lt;br /&gt;
      expect(controller.instance_variable_get(:@check_statuses)).to eq({&amp;quot;1234&amp;quot; =&amp;gt; &amp;quot;check_status&amp;quot;, &amp;quot;5678&amp;quot; =&amp;gt; &amp;quot;check_status&amp;quot;})&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#view_github_metrics' do&lt;br /&gt;
    context 'when user hasn\'t logged in to GitHub' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        @params = {id: 900}&lt;br /&gt;
        session[&amp;quot;github_access_token&amp;quot;] = nil&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'stores the current participant id and the view action' do&lt;br /&gt;
        get :view_github_metrics, @params&lt;br /&gt;
        expect(session[&amp;quot;participant_id&amp;quot;]).to eq(&amp;quot;900&amp;quot;)&lt;br /&gt;
        expect(session[&amp;quot;github_view_type&amp;quot;]).to eq(&amp;quot;view_submissions&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'redirects user to GitHub authorization page' do&lt;br /&gt;
        get :view_github_metrics, @params&lt;br /&gt;
        expect(response).to redirect_to(authorize_github_grades_path)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when user has logged in to GitHub' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        session[&amp;quot;github_access_token&amp;quot;] = &amp;quot;qwerty&amp;quot;&lt;br /&gt;
        allow(controller).to receive(:get_statuses_for_pull_request).and_return(&amp;quot;status&amp;quot;)&lt;br /&gt;
        allow(controller).to receive(:retrieve_github_data)&lt;br /&gt;
        allow(controller).to receive(:retrieve_check_run_statuses)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'stores the GitHub access token for later use' do&lt;br /&gt;
        get :view_github_metrics, {id: '1'}&lt;br /&gt;
        expect(controller.instance_variable_get(:@token)).to eq(&amp;quot;qwerty&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'calls retrieve_github_data to retrieve data from GitHub' do&lt;br /&gt;
        expect(controller).to receive(:retrieve_github_data)&lt;br /&gt;
        get :view_github_metrics, {id: '1'}&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'calls retrieve_check_run_statuses to retrieve check runs data' do&lt;br /&gt;
        expect(controller).to receive(:retrieve_check_run_statuses)&lt;br /&gt;
        get :view_github_metrics, {id: '1'}&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Added''' Solution Design for the final implemented design&lt;br /&gt;
* '''Added''' Implemented Solution to show feature additions to Expertiza&lt;br /&gt;
* '''Added''' Feature test cases for Grades controller&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121413</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121413"/>
		<updated>2018-12-08T05:10:26Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
==='''Use Case Diagram'''===&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Change 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate Reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Change 2: Bar chart for # of commits changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of commits changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''RSpec Tests'''===&lt;br /&gt;
&lt;br /&gt;
* Following feature tests were added to the Grades_Controller_Spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe &amp;quot;#get_statuses_for_pull_request&amp;quot; do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(Net::HTTP).to receive(:get) {&amp;quot;{\&amp;quot;team\&amp;quot;:\&amp;quot;rails\&amp;quot;,\&amp;quot;players\&amp;quot;:\&amp;quot;36\&amp;quot;}&amp;quot;}&lt;br /&gt;
    end&lt;br /&gt;
     it 'makes a call to the GitHub API to get status of the head commit passed' do&lt;br /&gt;
      expect(controller.get_statuses_for_pull_request('qwerty123')).to eq({&amp;quot;team&amp;quot; =&amp;gt; &amp;quot;rails&amp;quot;, &amp;quot;players&amp;quot; =&amp;gt; &amp;quot;36&amp;quot;})&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  describe '#view_github_metrics' do&lt;br /&gt;
    context 'when user hasn\'t logged in to GitHub' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        @params = {id: 900}&lt;br /&gt;
        session[&amp;quot;github_access_token&amp;quot;] = nil&lt;br /&gt;
      end&lt;br /&gt;
       it 'stores the current participant id and the view action' do&lt;br /&gt;
        get :view_github_metrics, @params&lt;br /&gt;
        expect(session[&amp;quot;participant_id&amp;quot;]).to eq(&amp;quot;900&amp;quot;)&lt;br /&gt;
        expect(session[&amp;quot;github_view_type&amp;quot;]).to eq(&amp;quot;view_submissions&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
       it 'redirects user to GitHub authorization page' do&lt;br /&gt;
        get :view_github_metrics, @params&lt;br /&gt;
        expect(response).to redirect_to(authorize_github_grades_path)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#view' do  &lt;br /&gt;
    context 'when user hasn\'t logged in to GitHub' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        @params = {id: 900}&lt;br /&gt;
        session[&amp;quot;github_access_token&amp;quot;] = nil&lt;br /&gt;
      end&lt;br /&gt;
       it 'stores the current assignment id and the view action' do&lt;br /&gt;
        get :view, @params&lt;br /&gt;
        expect(session[&amp;quot;assignment_id&amp;quot;]).to eq(&amp;quot;900&amp;quot;)&lt;br /&gt;
        expect(session[&amp;quot;github_view_type&amp;quot;]).to eq(&amp;quot;view_scores&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
       it 'redirects user to GitHub authorization page' do&lt;br /&gt;
        get :view, @params&lt;br /&gt;
        expect(response).to redirect_to(authorize_github_grades_path)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Added''' Solution Design for the final implemented design&lt;br /&gt;
* '''Added''' Implemented Solution to show feature additions to Expertiza&lt;br /&gt;
* '''Added''' Feature test cases for Grades controller&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121403</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121403"/>
		<updated>2018-12-08T04:38:05Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Change-log for Reviewers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
==='''Use Case Diagram'''===&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Change 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate Reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Change 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''RSpec Tests'''===&lt;br /&gt;
&lt;br /&gt;
* Following feature tests were added to the Grades_Controller_Spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe &amp;quot;#get_statuses_for_pull_request&amp;quot; do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(Net::HTTP).to receive(:get) {&amp;quot;{\&amp;quot;team\&amp;quot;:\&amp;quot;rails\&amp;quot;,\&amp;quot;players\&amp;quot;:\&amp;quot;36\&amp;quot;}&amp;quot;}&lt;br /&gt;
    end&lt;br /&gt;
     it 'makes a call to the GitHub API to get status of the head commit passed' do&lt;br /&gt;
      expect(controller.get_statuses_for_pull_request('qwerty123')).to eq({&amp;quot;team&amp;quot; =&amp;gt; &amp;quot;rails&amp;quot;, &amp;quot;players&amp;quot; =&amp;gt; &amp;quot;36&amp;quot;})&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  describe '#view_github_metrics' do&lt;br /&gt;
    context 'when user hasn\'t logged in to GitHub' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        @params = {id: 900}&lt;br /&gt;
        session[&amp;quot;github_access_token&amp;quot;] = nil&lt;br /&gt;
      end&lt;br /&gt;
       it 'stores the current participant id and the view action' do&lt;br /&gt;
        get :view_github_metrics, @params&lt;br /&gt;
        expect(session[&amp;quot;participant_id&amp;quot;]).to eq(&amp;quot;900&amp;quot;)&lt;br /&gt;
        expect(session[&amp;quot;github_view_type&amp;quot;]).to eq(&amp;quot;view_submissions&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
       it 'redirects user to GitHub authorization page' do&lt;br /&gt;
        get :view_github_metrics, @params&lt;br /&gt;
        expect(response).to redirect_to(authorize_github_grades_path)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#view' do  &lt;br /&gt;
    context 'when user hasn\'t logged in to GitHub' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        @params = {id: 900}&lt;br /&gt;
        session[&amp;quot;github_access_token&amp;quot;] = nil&lt;br /&gt;
      end&lt;br /&gt;
       it 'stores the current assignment id and the view action' do&lt;br /&gt;
        get :view, @params&lt;br /&gt;
        expect(session[&amp;quot;assignment_id&amp;quot;]).to eq(&amp;quot;900&amp;quot;)&lt;br /&gt;
        expect(session[&amp;quot;github_view_type&amp;quot;]).to eq(&amp;quot;view_scores&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
       it 'redirects user to GitHub authorization page' do&lt;br /&gt;
        get :view, @params&lt;br /&gt;
        expect(response).to redirect_to(authorize_github_grades_path)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Added''' Solution Design for the final implemented design&lt;br /&gt;
* '''Added''' Implemented Solution to show feature additions to Expertiza&lt;br /&gt;
* '''Added''' Feature test cases for Grades controller&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121401</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121401"/>
		<updated>2018-12-08T04:36:49Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
==='''Use Case Diagram'''===&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Change 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate Reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Change 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''RSpec Tests'''===&lt;br /&gt;
&lt;br /&gt;
* Following feature tests were added to the Grades_Controller_Spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe &amp;quot;#get_statuses_for_pull_request&amp;quot; do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(Net::HTTP).to receive(:get) {&amp;quot;{\&amp;quot;team\&amp;quot;:\&amp;quot;rails\&amp;quot;,\&amp;quot;players\&amp;quot;:\&amp;quot;36\&amp;quot;}&amp;quot;}&lt;br /&gt;
    end&lt;br /&gt;
     it 'makes a call to the GitHub API to get status of the head commit passed' do&lt;br /&gt;
      expect(controller.get_statuses_for_pull_request('qwerty123')).to eq({&amp;quot;team&amp;quot; =&amp;gt; &amp;quot;rails&amp;quot;, &amp;quot;players&amp;quot; =&amp;gt; &amp;quot;36&amp;quot;})&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  describe '#view_github_metrics' do&lt;br /&gt;
    context 'when user hasn\'t logged in to GitHub' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        @params = {id: 900}&lt;br /&gt;
        session[&amp;quot;github_access_token&amp;quot;] = nil&lt;br /&gt;
      end&lt;br /&gt;
       it 'stores the current participant id and the view action' do&lt;br /&gt;
        get :view_github_metrics, @params&lt;br /&gt;
        expect(session[&amp;quot;participant_id&amp;quot;]).to eq(&amp;quot;900&amp;quot;)&lt;br /&gt;
        expect(session[&amp;quot;github_view_type&amp;quot;]).to eq(&amp;quot;view_submissions&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
       it 'redirects user to GitHub authorization page' do&lt;br /&gt;
        get :view_github_metrics, @params&lt;br /&gt;
        expect(response).to redirect_to(authorize_github_grades_path)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#view' do  &lt;br /&gt;
    context 'when user hasn\'t logged in to GitHub' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        @params = {id: 900}&lt;br /&gt;
        session[&amp;quot;github_access_token&amp;quot;] = nil&lt;br /&gt;
      end&lt;br /&gt;
       it 'stores the current assignment id and the view action' do&lt;br /&gt;
        get :view, @params&lt;br /&gt;
        expect(session[&amp;quot;assignment_id&amp;quot;]).to eq(&amp;quot;900&amp;quot;)&lt;br /&gt;
        expect(session[&amp;quot;github_view_type&amp;quot;]).to eq(&amp;quot;view_scores&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
       it 'redirects user to GitHub authorization page' do&lt;br /&gt;
        get :view, @params&lt;br /&gt;
        expect(response).to redirect_to(authorize_github_grades_path)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Added''' Solution Design for the final implemented design&lt;br /&gt;
* '''Added''' Implemented Solution to show feature additions to Expertiza&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121338</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121338"/>
		<updated>2018-12-08T01:52:23Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
==='''Use Case Diagram'''===&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Change 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate Reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Change 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Added''' Solution Design for the final implemented design&lt;br /&gt;
* '''Added''' Implemented Solution to show feature additions to Expertiza&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121337</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121337"/>
		<updated>2018-12-08T01:51:44Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
==='''Use Case Diagram'''===&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Added''' Solution Design for the final implemented design&lt;br /&gt;
* '''Added''' Implemented Solution to show feature additions to Expertiza&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121336</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121336"/>
		<updated>2018-12-08T01:50:40Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Change-log for Reviewers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
==='''Use Case Diagram'''===&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Added''' Solution Design for the final implemented design&lt;br /&gt;
* '''Added''' Implemented Solution to show feature additions to Expertiza&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121334</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121334"/>
		<updated>2018-12-08T01:48:11Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Implemented Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
==='''Use Case Diagram'''===&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121333</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121333"/>
		<updated>2018-12-08T01:47:56Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Solution Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
==='''Use Case Diagram'''===&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121332</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121332"/>
		<updated>2018-12-08T01:47:25Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: Undo revision 121329 by Sddhyade (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121329</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121329"/>
		<updated>2018-12-08T01:46:43Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Solution Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121325</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121325"/>
		<updated>2018-12-08T01:46:01Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Plan of action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121322</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121322"/>
		<updated>2018-12-08T01:44:45Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Second Change */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121320</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121320"/>
		<updated>2018-12-08T01:44:26Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Database Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UC_1.png&amp;diff=121317</id>
		<title>File:UC 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UC_1.png&amp;diff=121317"/>
		<updated>2018-12-08T01:43:59Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121316</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121316"/>
		<updated>2018-12-08T01:43:45Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Use Case Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UseCase_New_1.png&amp;diff=121311</id>
		<title>File:UseCase New 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UseCase_New_1.png&amp;diff=121311"/>
		<updated>2018-12-08T01:40:38Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121310</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121310"/>
		<updated>2018-12-08T01:40:30Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Use Case Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:UseCase_New_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UseCase_New.png&amp;diff=121307</id>
		<title>File:UseCase New.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UseCase_New.png&amp;diff=121307"/>
		<updated>2018-12-08T01:39:07Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121305</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121305"/>
		<updated>2018-12-08T01:35:35Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Use Case Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:UseCase_New.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121303</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121303"/>
		<updated>2018-12-08T01:34:51Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Use Case Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:UseCase.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UseCase_0.2.png&amp;diff=121302</id>
		<title>File:UseCase 0.2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UseCase_0.2.png&amp;diff=121302"/>
		<updated>2018-12-08T01:33:06Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UseCase_0.1.png&amp;diff=121301</id>
		<title>File:UseCase 0.1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UseCase_0.1.png&amp;diff=121301"/>
		<updated>2018-12-08T01:32:49Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121300</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121300"/>
		<updated>2018-12-08T01:32:37Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Use Case Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:UseCase_0.1.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:UseCase_0.2.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Capture_0_1.png&amp;diff=121298</id>
		<title>File:Capture 0 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Capture_0_1.png&amp;diff=121298"/>
		<updated>2018-12-08T01:28:38Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121297</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121297"/>
		<updated>2018-12-08T01:28:23Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Use Case Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Capture_0_1.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Capture_0_2.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Capture_0.1.png&amp;diff=121295</id>
		<title>File:Capture 0.1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Capture_0.1.png&amp;diff=121295"/>
		<updated>2018-12-08T01:27:04Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121294</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121294"/>
		<updated>2018-12-08T01:26:48Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Use Case Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Capture_0.1.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Capture_0.2.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Capture_3.png&amp;diff=121291</id>
		<title>File:Capture 3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Capture_3.png&amp;diff=121291"/>
		<updated>2018-12-08T01:24:12Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Capture_2.png&amp;diff=121290</id>
		<title>File:Capture 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Capture_2.png&amp;diff=121290"/>
		<updated>2018-12-08T01:23:50Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121287</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121287"/>
		<updated>2018-12-08T01:20:34Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* First Change */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Capture_0.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
[[File:Capture_2.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Capture_0.png&amp;diff=121280</id>
		<title>File:Capture 0.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Capture_0.png&amp;diff=121280"/>
		<updated>2018-12-08T01:13:30Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Capture_1.png&amp;diff=121279</id>
		<title>File:Capture 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Capture_1.png&amp;diff=121279"/>
		<updated>2018-12-08T01:13:10Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121278</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121278"/>
		<updated>2018-12-08T01:12:44Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* First Change */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Capture_0.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121277</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121277"/>
		<updated>2018-12-08T01:12:24Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Use Case Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Capture_0.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(99)_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121275</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121275"/>
		<updated>2018-12-08T01:08:39Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* First Change */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Usecase_1.2_Updated.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(99)_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121272</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121272"/>
		<updated>2018-12-08T01:06:08Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Files Modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Usecase_1.2_Updated.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* We will add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and results.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(99)_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121271</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121271"/>
		<updated>2018-12-08T01:05:35Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Files Changed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Usecase_1.2_Updated.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified'''==&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* We will add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and results.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(99)_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121270</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121270"/>
		<updated>2018-12-08T01:05:14Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Implemented Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Usecase_1.2_Updated.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Changed'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified'''==&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* We will add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and results.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(99)_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121269</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121269"/>
		<updated>2018-12-08T01:04:51Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Files Changed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Usecase_1.2_Updated.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Implemented Solution'''===&lt;br /&gt;
&lt;br /&gt;
===='''Files Changed'''====&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified'''==&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* We will add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and results.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(99)_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121268</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121268"/>
		<updated>2018-12-08T01:04:28Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Solution Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Usecase_1.2_Updated.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Implemented Solution'''===&lt;br /&gt;
&lt;br /&gt;
=='''Files Changed'''==&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified'''==&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* We will add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and results.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(99)_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121261</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121261"/>
		<updated>2018-12-08T00:56:00Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Solution Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Usecase_1.2_Updated.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* We have finalized the approach for first change. We will add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and results.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(99)_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Usecase_1.2_Updated.png&amp;diff=121258</id>
		<title>File:Usecase 1.2 Updated.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Usecase_1.2_Updated.png&amp;diff=121258"/>
		<updated>2018-12-08T00:54:24Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121257</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121257"/>
		<updated>2018-12-08T00:54:03Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Use Case Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR and also have handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Usecase_1.2_Updated.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* We have finalized the approach for first change. We will add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and results.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(99)_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UseCase_1.2_updated.png&amp;diff=121255</id>
		<title>File:UseCase 1.2 updated.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UseCase_1.2_updated.png&amp;diff=121255"/>
		<updated>2018-12-08T00:53:24Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121253</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121253"/>
		<updated>2018-12-08T00:50:44Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Solution Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR and also have handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* We have finalized the approach for first change. We will add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and results.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(99)_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121252</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121252"/>
		<updated>2018-12-08T00:50:27Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Solution Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
:In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR and also have handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* We have finalized the approach for first change. We will add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and results.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(99)_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121251</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121251"/>
		<updated>2018-12-08T00:50:04Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Solution Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
:A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
:In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR and also have handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* We have finalized the approach for first change. We will add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and results.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(99)_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121250</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121250"/>
		<updated>2018-12-08T00:49:46Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Solution Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*### User Github metrics:&lt;br /&gt;
*### Committer ID&lt;br /&gt;
*### Committer Name&lt;br /&gt;
*### Committer email ID&lt;br /&gt;
	&lt;br /&gt;
:A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
:In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR and also have handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* We have finalized the approach for first change. We will add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and results.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(99)_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121248</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121248"/>
		<updated>2018-12-08T00:48:48Z</updated>

		<summary type="html">&lt;p&gt;Sddhyade: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.&lt;br /&gt;
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.&lt;br /&gt;
&lt;br /&gt;
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
&lt;br /&gt;
User Github metrics:&lt;br /&gt;
*# Committer ID&lt;br /&gt;
*# Committer Name&lt;br /&gt;
*# Committer email ID&lt;br /&gt;
	&lt;br /&gt;
:A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
:In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used OAuth gem for authentication purpose.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR and also have handled projects which do not have PR link, but just a link to the repository.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* We have finalized the approach for first change. We will add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and results.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(99)_1.png|none|frame|The GitHub metrics tables shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a link &amp;quot;Github Metrics&amp;quot; to a new page that shows a lines of code chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(96)_new.png|none|frame|The GitHub metrics link can be seen below Assign Grade link]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, The bar chart portrays lines of code per team member for each day throughout the timeline.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_(97)_1.png|none|frame|Proposed view of the bar chart]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs (lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller (grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of lines changed per team member since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements (by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* '''Updated''' &amp;quot;Proposed Solution and test plan&amp;quot; section to include modified views after discussing with the mentor.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sddhyade</name></author>
	</entry>
</feed>