<?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=Skaalam</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=Skaalam"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Skaalam"/>
	<updated>2026-10-07T10:48:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2324._Github_metrics_integration&amp;diff=150390</id>
		<title>CSC/ECE 517 Spring 2023 - E2324. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2324._Github_metrics_integration&amp;diff=150390"/>
		<updated>2023-05-03T10:04:15Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
Expertiza provides teammate reviews to gauge how much each team member contributed, but we would like to augment this data with data from external tools like Github (for example, number of commits, number of lines of code modified, number of lines added, number of lines deleted.) from each group’s submitted repo link.  This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like 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;
=== Project Overview and Mission ===&lt;br /&gt;
&lt;br /&gt;
*The first step is to extract Github metadata of the submitted repos and pull requests.&lt;br /&gt;
*The metadata should be stored in the local Expertiza DB. For each participant, record should include at least  include:&lt;br /&gt;
   -Committer id&lt;br /&gt;
   -Total number of commits&lt;br /&gt;
   -Number of files changed&lt;br /&gt;
   -Lines of code changed&lt;br /&gt;
   -Lines of code added&lt;br /&gt;
   -Lines of code removed&lt;br /&gt;
   -Lines of code added that survived until final submission [if available from Github]&lt;br /&gt;
*The code should sync the data with Github whenever someone (student or instructor) looks at a view that shows Github data.&lt;br /&gt;
*The data for teams should be shown in the instructor’s View Scores window, in a new tab, probably between Reviews and Author Feedback:&lt;br /&gt;
   -Design a good view for showing data on individuals&lt;br /&gt;
   -This should be on the Teammate Reviews tab, right below the grid for teammate reviews.  The reason for this is that we’d like to see all the data on an individual&lt;br /&gt;
    in a single view.  For teams, by contrast, there is already a pretty large grid, and potentially multiple grids for multiple rounds, so adding a new grid is more&lt;br /&gt;
    likely to clutter the display&lt;br /&gt;
*Create a bar chart for the # of lines changed for each assignment team on “view_submissions” page. The x-axis should be the time starting from the assignment creation time, till the last deadline of the assignment, or current time, whichever is earlier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation===&lt;br /&gt;
&lt;br /&gt;
====Use Case Diagram====&lt;br /&gt;
[[File:use_case_diagram1.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Use Github Metrics Functionality ====&lt;br /&gt;
&lt;br /&gt;
*This functionality gives the instructor the option to use Github metrics when creating an assignment.&lt;br /&gt;
*In the below screenshot, while creating an assignment, Use github metrics? option pointed by the red arrow is not selected&lt;br /&gt;
&lt;br /&gt;
[[File:FinalProject_1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*As you can see below, if the Use github metrics? option is not selected, the instructor cannot see the github metrics for the project submissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:FinalProject_2.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*In the below screenshot, while creating an assignment, Use github metrics? option is selected to be able see the github metrics for that assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Expertiza_srihitha.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Now the instructor has the option &amp;quot;GitHub metrics&amp;quot; under each team as indicated by the red arrow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:FinalProject_3.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the instructor clicks on the &amp;quot;GitHub metrics&amp;quot; option, he/she can see the following:&lt;br /&gt;
*A graph which shows the no. of commits made by each contributor on a particular date.&lt;br /&gt;
*A pie chart which depicts the total no. of commits made by each contributor.&lt;br /&gt;
*Team statistics, which includes total no. of commits, total no. of code lines added and deleted, total no. of files changed, merge statutes, and check statuses.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:FinalProject_4.png|900px]]&lt;br /&gt;
&lt;br /&gt;
====Refactored Files====&lt;br /&gt;
&lt;br /&gt;
The following files have been refactored:&lt;br /&gt;
*github_metric_uses_controller.rb&lt;br /&gt;
*metrics_controller.rb&lt;br /&gt;
*grades_helper.rb&lt;br /&gt;
*metrics_helper.rb&lt;br /&gt;
*metric.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''github_metric_uses_controller.rb :'''&lt;br /&gt;
*The code has been refactored to improve readability and reduce duplication. &lt;br /&gt;
*The refactored code has replaced the self methods with instance methods, which makes the code more object-oriented. &lt;br /&gt;
*The delete method has been simplified by using the safe navigation operator (&amp;amp;.) to avoid raising an exception if the record is not found. &lt;br /&gt;
*Finally, the code has been restructured to remove unnecessary comments and improve overall clarity.&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class GithubMetricUsesController &amp;lt; ApplicationController&lt;br /&gt;
&lt;br /&gt;
  skip_before_action :authorize&lt;br /&gt;
  helper_method :exist&lt;br /&gt;
&lt;br /&gt;
  #check if assignment_id exists in the table github_metric_uses&lt;br /&gt;
  def self.exist(assignment_id)&lt;br /&gt;
    github_use = GithubMetricUses.find_by(assignment_id: assignment_id)&lt;br /&gt;
    !github_use.nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  #if assignment_id does not exist in the table github_metric_uses, save it&lt;br /&gt;
  def self.save(assignment_id)&lt;br /&gt;
    unless exist(assignment_id)&lt;br /&gt;
      github_use = GithubMetricUses.new(assignment_id)&lt;br /&gt;
      github_use.assignment_id = assignment_id&lt;br /&gt;
      github_use.save&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  #if assignment_id exists in the table github_metric_uses, delete it&lt;br /&gt;
  def self.delete(assignment_id)&lt;br /&gt;
    if exist(assignment_id)&lt;br /&gt;
      github_use = GithubMetricUses.find_by(assignment_id: assignment_id)&lt;br /&gt;
      github_use.destroy&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  #check if assignment_id exists in the table github_metric_uses&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    GithubMetricUsesController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  #if assignment_id does not exist in the table github_metric_uses, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    GithubMetricUsesController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  #if assignment_id exists in the table github_metric_uses, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    GithubMetricUsesController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class GithubMetricUsesController &amp;lt; ApplicationController&lt;br /&gt;
  skip_before_action :authorize&lt;br /&gt;
  &lt;br /&gt;
  # Check if a record with the given assignment_id exists in the GithubMetricUses table&lt;br /&gt;
  def record_exists?&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    github_use = GithubMetricUses.find_by(assignment_id: assignment_id)&lt;br /&gt;
    render json: !github_use.nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Save a new record with the given assignment_id to the GithubMetricUses table&lt;br /&gt;
  # if a record with the same assignment_id doesn't already exist&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    github_use = GithubMetricUses.find_or_create_by(assignment_id: assignment_id)&lt;br /&gt;
    render json: assignment_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Delete the record with the given assignment_id from the GithubMetricUses table&lt;br /&gt;
  # if it exists&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    github_use = GithubMetricUses.find_by(assignment_id: assignment_id)&lt;br /&gt;
    github_use&amp;amp;.destroy&lt;br /&gt;
    render json: assignment_id&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''metrics_controller.rb:'''&lt;br /&gt;
&lt;br /&gt;
*Extracting methods - Several large and complex methods were extracted into smaller and more specific methods, which improved the code's readability and made it easier to understand and maintain.&lt;br /&gt;
&lt;br /&gt;
*Removing repetitive code - The refactored code removed duplicated code by using helper methods and inheritance.&lt;br /&gt;
&lt;br /&gt;
*Better naming conventions - The naming conventions used in the refactored code are more consistent and descriptive, making it easier to understand what the code is doing.&lt;br /&gt;
&lt;br /&gt;
*Improved use of Rails features - The refactored code takes advantage of features built into the Rails framework, such as the use of scopes to simplify queries and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
*Better organization of code - The refactored code is organized into sections that group related methods and functionality together, making it easier to navigate and understand the codebase.&lt;br /&gt;
&lt;br /&gt;
*We moved few methods to metrics_helper.rb, as business logic should be in helper. &lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb:'''&lt;br /&gt;
&lt;br /&gt;
*Comments were removed or updated to better reflect the intent of the code.&lt;br /&gt;
&lt;br /&gt;
*A guard clause was added at the beginning of the method to return nil if there are no metrics for the given team.&lt;br /&gt;
&lt;br /&gt;
*The logic to find a user associated with a metric was simplified and made more efficient by chaining multiple &amp;quot;find_by&amp;quot; methods.&lt;br /&gt;
&lt;br /&gt;
*The use of &amp;quot;unless&amp;quot; was replaced with &amp;quot;if&amp;quot; to improve the readability of the code.&lt;br /&gt;
&lt;br /&gt;
*The key creation and commit aggregation logic was updated to use the &amp;quot;||=&amp;quot; operator to create a new sub-hash if the user key does not yet exist in the hash and to increment the total number of commits for the current user.&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# E2111 This method creates the code to display the metrics heatgrid in view_team in grades.&lt;br /&gt;
  def metrics_table(team)&lt;br /&gt;
    metrics = Metric.where(&amp;quot;team_id = ?&amp;quot;, team)&lt;br /&gt;
&lt;br /&gt;
    unless metrics.nil?&lt;br /&gt;
      data_array = {}&lt;br /&gt;
      metrics.each do |metric|&lt;br /&gt;
        unless metric.participant_id.nil?&lt;br /&gt;
          #Lookup user if ID was stored at query time&lt;br /&gt;
          user = User.find(metric.participant_id)&lt;br /&gt;
        else&lt;br /&gt;
          # If not, try to find user by recently-entered github ID&lt;br /&gt;
          user = User.find_by_github_id(metric.github_id)&lt;br /&gt;
          # If still not, try to find user by their NCSU email if it's the same as github.com&lt;br /&gt;
          user = User.find_by_email(metric.github_id) if user.nil?&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        #Finally, if user was not found, handle by using github email in the&lt;br /&gt;
        # Student Name field, or Student Fullname if found.&lt;br /&gt;
        user_fullname = user.nil? ? &amp;quot;Github Email: &amp;quot; + metric.github_id : user.fullname&lt;br /&gt;
        if data_array[user_fullname]&lt;br /&gt;
          data_array[user_fullname][:commits] += metric.total_commits&lt;br /&gt;
        else&lt;br /&gt;
          data_array[user_fullname] = {}&lt;br /&gt;
          data_array[user_fullname][:commits] = metric.total_commits&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # This method generates a metrics table for a given team and returns it as a hash&lt;br /&gt;
  def metrics_table(team)&lt;br /&gt;
    # Find all metrics associated with the given team&lt;br /&gt;
    metrics = Metric.where(&amp;quot;team_id = ?&amp;quot;, team)&lt;br /&gt;
    &lt;br /&gt;
    # Return nil if no metrics are found&lt;br /&gt;
    return nil if metrics.empty?&lt;br /&gt;
    &lt;br /&gt;
    # Initialize an empty hash to store the table data&lt;br /&gt;
    data_array = {}&lt;br /&gt;
&lt;br /&gt;
    # Loop through each metric and extract relevant data&lt;br /&gt;
    metrics.each do |metric|&lt;br /&gt;
      # Try to find a user by participant_id, github_id, or email&lt;br /&gt;
      user = User.find_by(participant_id: metric.participant_id) || User.find_by_github_id(metric.github_id) || User.find_by_email(metric.github_id)&lt;br /&gt;
      &lt;br /&gt;
      # Use the user's full name or Github email address as the key in the hash&lt;br /&gt;
      user_fullname = user.nil? ? &amp;quot;Github Email: #{metric.github_id}&amp;quot; : user.fullname&lt;br /&gt;
      &lt;br /&gt;
      # If the user key is not yet present in the hash, create a new sub-hash&lt;br /&gt;
      data_array[user_fullname] ||= {}&lt;br /&gt;
      &lt;br /&gt;
      # Increment the total number of commits for the current user&lt;br /&gt;
      data_array[user_fullname][:commits] ||= 0&lt;br /&gt;
      data_array[user_fullname][:commits] += metric.total_commits&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''metrics_helper.rb :'''&lt;br /&gt;
*The methods &amp;quot;parse_hyperlink_data&amp;quot; and &amp;quot;sort_commit_dates&amp;quot; were moved from metrics_controller.rb to metrics_helper.rb&lt;br /&gt;
&lt;br /&gt;
'''metric.rb :'''&lt;br /&gt;
&lt;br /&gt;
*Constants for GraphQL queries: In the refactored code, the GraphQL query text is stored as constants within the Metric class. This makes the code more readable and easier to modify in case the GraphQL queries need to be changed.&lt;br /&gt;
&lt;br /&gt;
*Interpolation: The code uses string interpolation to substitute values in the GraphQL queries. This approach is more concise and readable than string concatenation, which the previous implementation uses.&lt;br /&gt;
&lt;br /&gt;
*Query text format: The code uses the format method to substitute placeholders in the GraphQL query text with the actual values. This improves the readability of the code and reduces the risk of syntax errors.&lt;br /&gt;
&lt;br /&gt;
*Default parameters: In the refactored code, the after parameter in both pull_query and repo_query methods have been made optional and are given default values of nil. This allows the code to handle both cases where after is present and where it is not, without the need for conditional statements.&lt;br /&gt;
&lt;br /&gt;
*Date format: The refactored code formats the date parameter in the repo_query method as a ISO 8601 string using the DateTime class. This ensures that the date is formatted correctly for use in the GraphQL query.&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Metric &amp;lt; ActiveRecord::Base&lt;br /&gt;
  # Constants for GraphQL queries.&lt;br /&gt;
  PULL_REQUEST_QUERY = &amp;lt;&amp;lt;~QUERY&lt;br /&gt;
    query {&lt;br /&gt;
      repository(owner: &amp;quot;%&amp;lt;owner_name&amp;gt;s&amp;quot;, name: &amp;quot;%&amp;lt;repository_name&amp;gt;s&amp;quot;) {&lt;br /&gt;
        pullRequest(number: %&amp;lt;pull_request_number&amp;gt;s) {&lt;br /&gt;
          number additions deletions changedFiles mergeable merged headRefOid&lt;br /&gt;
          commits(first: 100 %&amp;lt;after_clause&amp;gt;s) {&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 email&lt;br /&gt;
                  }&lt;br /&gt;
                  additions deletions changedFiles committedDate&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  QUERY&lt;br /&gt;
&lt;br /&gt;
  REPO_QUERY = &amp;lt;&amp;lt;~QUERY&lt;br /&gt;
    query {&lt;br /&gt;
      repository(owner: &amp;quot;%&amp;lt;owner_name&amp;gt;s&amp;quot;, name: &amp;quot;%&amp;lt;repository_name&amp;gt;s&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(%&amp;lt;after_clause&amp;gt;s since: &amp;quot;%&amp;lt;start_date&amp;gt;s&amp;quot;) {&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;
                pageInfo {&lt;br /&gt;
                  endCursor&lt;br /&gt;
                  hasNextPage&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  QUERY&lt;br /&gt;
&lt;br /&gt;
  # Generate the GraphQL query text for a PULL REQUEST link.&lt;br /&gt;
  #&lt;br /&gt;
  # hyperlink_data - a hash containing the owner name, repository name, and pull request number.&lt;br /&gt;
  # after - a pointer provided by the Github API to where the last query left off.&lt;br /&gt;
  #&lt;br /&gt;
  # Returns a hash containing the query text.&lt;br /&gt;
  def self.pull_query(hyperlink_data, after: nil)&lt;br /&gt;
    format(PULL_REQUEST_QUERY, {&lt;br /&gt;
      owner_name: hyperlink_data[&amp;quot;owner_name&amp;quot;],&lt;br /&gt;
      repository_name: hyperlink_data[&amp;quot;repository_name&amp;quot;],&lt;br /&gt;
      pull_request_number: hyperlink_data[&amp;quot;pull_request_number&amp;quot;],&lt;br /&gt;
      after_clause: after ? &amp;quot;after: \&amp;quot;#{after}\&amp;quot;&amp;quot; : &amp;quot;&amp;quot;&lt;br /&gt;
    })&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Generate the GraphQL query text for a REPOSITORY link.&lt;br /&gt;
  #&lt;br /&gt;
  # hyperlink_data - a hash containing the owner name and repository name.&lt;br /&gt;
  # date - the assignment start date, in the format &amp;quot;YYYY-MM-DD&amp;quot;.&lt;br /&gt;
  # after - a pointer provided by the Github API to where the last query left off.&lt;br /&gt;
  #&lt;br /&gt;
  # Returns a hash containing the query text.&lt;br /&gt;
  def self.repo_query(hyperlink_data, date, after: nil)&lt;br /&gt;
    format(REPO_QUERY, {&lt;br /&gt;
      owner_name: hyperlink_data[&amp;quot;owner_name&amp;quot;],&lt;br /&gt;
      repository_name: hyperlink_data[&amp;quot;repository_name&amp;quot;],&lt;br /&gt;
      start_date: DateTime.parse(date).to_time.iso8601(3),&lt;br /&gt;
      after_clause: after ? &amp;quot;after: \&amp;quot;#{after}\&amp;quot;&amp;quot; : &amp;quot;&amp;quot;&lt;br /&gt;
    })&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Metric &amp;lt; ActiveRecord::Base&lt;br /&gt;
&lt;br /&gt;
  # Generate the graphQL query text for a PULL REQUEST link, based on the link data and &amp;quot;after&amp;quot;, which is a pointer&lt;br /&gt;
  # provided by the Github API to where the last query left off. Used to handle pulls containing more than 100 commits.&lt;br /&gt;
  def self.pull_query(hyperlink_data, after)&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;
              commits(first:100 #{ &amp;quot;after:\&amp;quot;&amp;quot;+ after + &amp;quot;\&amp;quot;&amp;quot; unless after.nil? }){&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 email&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;
  # Generate the graphQL query text for a REPOSITORY link, based on the link data and &amp;quot;after&amp;quot;, which is a pointer&lt;br /&gt;
  # provided by the Github API to where the last query left off. Used to handle repositories containing more than 100 commits.&lt;br /&gt;
  def self.repo_query(hyperlink_data, date, after=nil)&lt;br /&gt;
    date = date.to_time.iso8601.to_s[0..18] # Format assignment start date for github api&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(#{ &amp;quot;after:\&amp;quot;&amp;quot;+ after + &amp;quot;\&amp;quot;&amp;quot; unless after.nil? } since:\&amp;quot;#{date}\&amp;quot;) {&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;
                  pageInfo {&lt;br /&gt;
                    endCursor&lt;br /&gt;
                    hasNextPage&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;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn off functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Using Github Testing&lt;br /&gt;
first, go to the assignment edit page and check the checkbox of use github metric, then go to the list submission page check the page if has the content about ithub data.&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;check the box of the use github metrics? and the list_submissions page will have the content 'Github data'  &amp;quot; do&lt;br /&gt;
         visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
    	check('Use github metrics?', allow_label_click: true)&lt;br /&gt;
         visit &amp;quot;/assignments/list_submissions?id=#{@assignment.id}&amp;quot;&lt;br /&gt;
         expect(page).to have_content(&amp;quot;Github data&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;uncheck the checkbox of the use github metrics? and the list_submissions page will not have the content 'Github data' &amp;quot; do&lt;br /&gt;
         visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
         check('Use github metrics?', allow_label_click: false)&lt;br /&gt;
         page.uncheck('Use github metrics?')&lt;br /&gt;
         visit &amp;quot;/assignments/list_submissions?id=#{@assignment.id}&amp;quot;&lt;br /&gt;
         expect(page).to have_no_content(&amp;quot;Github data&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Future Implementation ==&lt;br /&gt;
&lt;br /&gt;
*Add more test cases.&lt;br /&gt;
*Successfully pass all tests for pull request to expertiza repository.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
Ed Gehringer [[(efg@ncsu.edu)]]&lt;br /&gt;
&lt;br /&gt;
==Contributors to this project==&lt;br /&gt;
&lt;br /&gt;
Soham Bapat [[(sbapat2@ncsu.edu)]]&lt;br /&gt;
Srihitha Reddy Kaalam [[(skaalam@ncsu.edu)]]&lt;br /&gt;
Sukruthi Modem [[(smodem@ncsu.edu)]]&lt;br /&gt;
&lt;br /&gt;
==Pull Request Link==&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2524&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:FinalProject_1.jpg&amp;diff=150389</id>
		<title>File:FinalProject 1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:FinalProject_1.jpg&amp;diff=150389"/>
		<updated>2023-05-03T05:42:40Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: Skaalam uploaded a new version of File:FinalProject 1.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:FinalProject_4.png&amp;diff=150388</id>
		<title>File:FinalProject 4.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:FinalProject_4.png&amp;diff=150388"/>
		<updated>2023-05-03T05:34:23Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:FinalProject_3.jpg&amp;diff=150387</id>
		<title>File:FinalProject 3.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:FinalProject_3.jpg&amp;diff=150387"/>
		<updated>2023-05-03T05:32:02Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:FinalProject_2.jpg&amp;diff=150386</id>
		<title>File:FinalProject 2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:FinalProject_2.jpg&amp;diff=150386"/>
		<updated>2023-05-03T05:28:40Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:FinalProject_1.jpg&amp;diff=150385</id>
		<title>File:FinalProject 1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:FinalProject_1.jpg&amp;diff=150385"/>
		<updated>2023-05-03T05:19:45Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2324._Github_metrics_integration&amp;diff=149125</id>
		<title>CSC/ECE 517 Spring 2023 - E2324. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2324._Github_metrics_integration&amp;diff=149125"/>
		<updated>2023-04-07T21:13:49Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: /* Some methods in metrics_controller.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
Expertiza provides teammate reviews to gauge how much each team member contributed, but we would like to augment this data with data from external tools like Github (for example, number of commits, number of lines of code modified, number of lines added, number of lines deleted.) from each group’s submitted repo link.  This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like 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;
=== Project Overview and Mission ===&lt;br /&gt;
&lt;br /&gt;
*The first step is to extract Github metadata of the submitted repos and pull requests.&lt;br /&gt;
*The metadata should be stored in the local Expertiza DB. For each participant, record should include at least  include:&lt;br /&gt;
   -Committer id&lt;br /&gt;
   -Total number of commits&lt;br /&gt;
   -Number of files changed&lt;br /&gt;
   -Lines of code changed&lt;br /&gt;
   -Lines of code added&lt;br /&gt;
   -Lines of code removed&lt;br /&gt;
   -Lines of code added that survived until final submission [if available from Github]&lt;br /&gt;
*The code should sync the data with Github whenever someone (student or instructor) looks at a view that shows Github data.&lt;br /&gt;
*The data for teams should be shown in the instructor’s View Scores window, in a new tab, probably between Reviews and Author Feedback:&lt;br /&gt;
   -Design a good view for showing data on individuals&lt;br /&gt;
   -This should be on the Teammate Reviews tab, right below the grid for teammate reviews.  The reason for this is that we’d like to see all the data on an individual&lt;br /&gt;
    in a single view.  For teams, by contrast, there is already a pretty large grid, and potentially multiple grids for multiple rounds, so adding a new grid is more&lt;br /&gt;
    likely to clutter the display&lt;br /&gt;
*Create a bar chart for the # of lines changed for each assignment team on “view_submissions” page. The x-axis should be the time starting from the assignment creation time, till the last deadline of the assignment, or current time, whichever is earlier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation===&lt;br /&gt;
*Because we encountered errors while integrating the previous implementation into the expertiza application, we had to spend a significant amount of time resolving them. However, now that the integration is complete, we can finally shift our focus back to the current requirements and make progress on them.&lt;br /&gt;
&lt;br /&gt;
*We added test cases and refactored metrics_controller.rb&lt;br /&gt;
&lt;br /&gt;
====Changes in metrics_controller.rb====&lt;br /&gt;
&lt;br /&gt;
*Instead of controller: 'assignments', we used the list_submissions_assignment_path helper method to generate the correct path for redirect_to.&lt;br /&gt;
*The unless statement in require_instructor_privileges are simplified to a one-liner.&lt;br /&gt;
*Removed the only: [:action_allowed?] from require_instructor_privileges, since there is no action_allowed? method defined in the controller.&lt;br /&gt;
*Removed the comments that were not providing any additional value.&lt;br /&gt;
*Extracted some code to private methods to improve readability and organization.&lt;br /&gt;
*Removed unnecessary instance variables and local variables.&lt;br /&gt;
*Simplified the retrieve_github_data and create_github_metrics methods.&lt;br /&gt;
*Removed unnecessary @total_* instance variables.&lt;br /&gt;
*Removed the @check_statuses instance variable, which isn't used in this method.&lt;br /&gt;
*The retrieve_github_data method has been refactored to use partition instead of select, simplifying the code.&lt;br /&gt;
*In query_all_pull_requests, we've combined two lines of code to simplify the creation of the head_refs hash. We've also passed hyperlink_data to parse_pull_request_data instead of github_data to match the method's expected argument.&lt;br /&gt;
*We've refactored extract_hyperlink_data to use slice and zip to create the hash, which is shorter and easier to read.&lt;br /&gt;
*In pull_request_data, We replaced the while loop with a loop do construct and used break to exit the loop instead of modifying a flag variable. We also used the safe navigation operator (&amp;amp;.) to avoid NoMethodError exceptions when accessing nested hashes that may be nil.&lt;br /&gt;
*In parse_pull_request_data, we used the safe navigation operator to avoid NoMethodError exceptions when accessing nested hashes that may be nil. We also added some nil checks to skip over commits or commit data that is missing or invalid. Finally, we simplified the date-slicing logic by chaining the to_s and slice methods.&lt;br /&gt;
*retrieve_repository_data now calls parse_hyperlink to extract the owner and repository names from the GitHub repository URL. It also uses a loop instead of a while to simplify the code and avoid unnecessary variables.&lt;br /&gt;
*query_and_parse_repository_data now returns the page info hash instead of modifying it in place, to make it clearer and less error-prone.&lt;br /&gt;
*parse_repository_data now uses dig to access nested hashes safely, avoiding errors if any of the expected keys are missing. It also simplifies the date string extraction by using a slice instead of a regex.&lt;br /&gt;
*Used the dig method to access nested keys in the hash, which returns nil if any intermediate key is nil instead of raising an exception.&lt;br /&gt;
*Removed unnecessary comments and made the existing ones more concise.&lt;br /&gt;
*Used ternary operator to simplify the if statement.&lt;br /&gt;
*Used dig instead of nested hash indexing with square brackets. This makes the code more concise and avoids NoMethodError exceptions when a hash key is missing.&lt;br /&gt;
*Used return to exit early from count_github_authors_and_dates if the author is a collaborator. This avoids unnecessary code execution and improves performance.&lt;br /&gt;
*Used Hash.new(0) to initialize the hash for each author's commits. This simplifies the code and avoids the need for if...else logic.&lt;br /&gt;
*Used default to set the default value for each author's commits to 0. This avoids the need for if...else logic when incrementing the commit count.&lt;br /&gt;
*Used to_h to convert the sorted array of commits back to a hash. This is more concise than building a new hash with Hash[].&lt;br /&gt;
*Used dig to access nested hash keys in team_statistics. This avoids NoMethodError exceptions and makes the code more concise.&lt;br /&gt;
*Used ternary operator to simplify&lt;br /&gt;
*Used the find_by method instead of where and first for simplicity.&lt;br /&gt;
*Used the safe navigation operator (&amp;amp;.) to avoid errors when trying to call a method on a nil object.&lt;br /&gt;
*Used present? instead of nil? to check if a record exists.&lt;br /&gt;
*Used update instead of assigning values and calling save separately for readability.&lt;br /&gt;
*Used string interpolation to concatenate the @ncsu.edu suffix to the email prefix.&lt;br /&gt;
*Removed unnecessary comments and code.&lt;br /&gt;
&lt;br /&gt;
=====Some of the refactored methods in metrics_controller.rb=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 1.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 2.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 3.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 4.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 5.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 6.jpg|1000px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 7.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 8.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
==== Use Github Metrics Functionality ====&lt;br /&gt;
This functionality gives the instructor the option to use Github metrics when creating an assignment.&lt;br /&gt;
[[File:Expertiza_srihitha.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Design UML ===&lt;br /&gt;
[[File:Expertiza UML E2324.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn off functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Using Github Testing&lt;br /&gt;
first, go to the assignment edit page and check the checkbox of use github metric, then go to the list submission page check the page if has the content about ithub data.&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;check the box of the use github metrics? and the list_submissions page will have the content 'Github data'  &amp;quot; do&lt;br /&gt;
         visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
    	check('Use github metrics?', allow_label_click: true)&lt;br /&gt;
         visit &amp;quot;/assignments/list_submissions?id=#{@assignment.id}&amp;quot;&lt;br /&gt;
         expect(page).to have_content(&amp;quot;Github data&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;uncheck the checkbox of the use github metrics? and the list_submissions page will not have the content 'Github data' &amp;quot; do&lt;br /&gt;
         visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
         check('Use github metrics?', allow_label_click: false)&lt;br /&gt;
         page.uncheck('Use github metrics?')&lt;br /&gt;
         visit &amp;quot;/assignments/list_submissions?id=#{@assignment.id}&amp;quot;&lt;br /&gt;
         expect(page).to have_no_content(&amp;quot;Github data&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Future Implementation ==&lt;br /&gt;
*Change the method names in metrics_controller.rb and add appropriate comments.&lt;br /&gt;
*Add more test cases.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
Ed Gehringer [[(efg@ncsu.edu)]]&lt;br /&gt;
&lt;br /&gt;
==Contributors to this project==&lt;br /&gt;
&lt;br /&gt;
Soham Bapat [[(sbapat2@ncsu.edu)]]&lt;br /&gt;
Srihitha Reddy Kaalam [[(skaalam@ncsu.edu)]]&lt;br /&gt;
Sukruthi Modem [[(smodem@ncsu.edu)]]&lt;br /&gt;
&lt;br /&gt;
==Pull Request Link==&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2524&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2324._Github_metrics_integration&amp;diff=149119</id>
		<title>CSC/ECE 517 Spring 2023 - E2324. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2324._Github_metrics_integration&amp;diff=149119"/>
		<updated>2023-04-07T20:58:58Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
Expertiza provides teammate reviews to gauge how much each team member contributed, but we would like to augment this data with data from external tools like Github (for example, number of commits, number of lines of code modified, number of lines added, number of lines deleted.) from each group’s submitted repo link.  This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like 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;
=== Project Overview and Mission ===&lt;br /&gt;
&lt;br /&gt;
*The first step is to extract Github metadata of the submitted repos and pull requests.&lt;br /&gt;
*The metadata should be stored in the local Expertiza DB. For each participant, record should include at least  include:&lt;br /&gt;
   -Committer id&lt;br /&gt;
   -Total number of commits&lt;br /&gt;
   -Number of files changed&lt;br /&gt;
   -Lines of code changed&lt;br /&gt;
   -Lines of code added&lt;br /&gt;
   -Lines of code removed&lt;br /&gt;
   -Lines of code added that survived until final submission [if available from Github]&lt;br /&gt;
*The code should sync the data with Github whenever someone (student or instructor) looks at a view that shows Github data.&lt;br /&gt;
*The data for teams should be shown in the instructor’s View Scores window, in a new tab, probably between Reviews and Author Feedback:&lt;br /&gt;
   -Design a good view for showing data on individuals&lt;br /&gt;
   -This should be on the Teammate Reviews tab, right below the grid for teammate reviews.  The reason for this is that we’d like to see all the data on an individual&lt;br /&gt;
    in a single view.  For teams, by contrast, there is already a pretty large grid, and potentially multiple grids for multiple rounds, so adding a new grid is more&lt;br /&gt;
    likely to clutter the display&lt;br /&gt;
*Create a bar chart for the # of lines changed for each assignment team on “view_submissions” page. The x-axis should be the time starting from the assignment creation time, till the last deadline of the assignment, or current time, whichever is earlier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation===&lt;br /&gt;
*Because we encountered errors while integrating the previous implementation into the expertiza application, we had to spend a significant amount of time resolving them. However, now that the integration is complete, we can finally shift our focus back to the current requirements and make progress on them.&lt;br /&gt;
&lt;br /&gt;
*We added test cases and refactored metrics_controller.rb&lt;br /&gt;
&lt;br /&gt;
====Changes in metrics_controller.rb====&lt;br /&gt;
&lt;br /&gt;
*Instead of controller: 'assignments', we used the list_submissions_assignment_path helper method to generate the correct path for redirect_to.&lt;br /&gt;
*The unless statement in require_instructor_privileges are simplified to a one-liner.&lt;br /&gt;
*Removed the only: [:action_allowed?] from require_instructor_privileges, since there is no action_allowed? method defined in the controller.&lt;br /&gt;
*Removed the comments that were not providing any additional value.&lt;br /&gt;
*Extracted some code to private methods to improve readability and organization.&lt;br /&gt;
*Removed unnecessary instance variables and local variables.&lt;br /&gt;
*Simplified the retrieve_github_data and create_github_metrics methods.&lt;br /&gt;
*Removed unnecessary @total_* instance variables.&lt;br /&gt;
*Removed the @check_statuses instance variable, which isn't used in this method.&lt;br /&gt;
*The retrieve_github_data method has been refactored to use partition instead of select, simplifying the code.&lt;br /&gt;
*In query_all_pull_requests, we've combined two lines of code to simplify the creation of the head_refs hash. We've also passed hyperlink_data to parse_pull_request_data instead of github_data to match the method's expected argument.&lt;br /&gt;
*We've refactored extract_hyperlink_data to use slice and zip to create the hash, which is shorter and easier to read.&lt;br /&gt;
*In pull_request_data, We replaced the while loop with a loop do construct and used break to exit the loop instead of modifying a flag variable. We also used the safe navigation operator (&amp;amp;.) to avoid NoMethodError exceptions when accessing nested hashes that may be nil.&lt;br /&gt;
*In parse_pull_request_data, we used the safe navigation operator to avoid NoMethodError exceptions when accessing nested hashes that may be nil. We also added some nil checks to skip over commits or commit data that is missing or invalid. Finally, we simplified the date-slicing logic by chaining the to_s and slice methods.&lt;br /&gt;
*retrieve_repository_data now calls parse_hyperlink to extract the owner and repository names from the GitHub repository URL. It also uses a loop instead of a while to simplify the code and avoid unnecessary variables.&lt;br /&gt;
*query_and_parse_repository_data now returns the page info hash instead of modifying it in place, to make it clearer and less error-prone.&lt;br /&gt;
*parse_repository_data now uses dig to access nested hashes safely, avoiding errors if any of the expected keys are missing. It also simplifies the date string extraction by using a slice instead of a regex.&lt;br /&gt;
*Used the dig method to access nested keys in the hash, which returns nil if any intermediate key is nil instead of raising an exception.&lt;br /&gt;
*Removed unnecessary comments and made the existing ones more concise.&lt;br /&gt;
*Used ternary operator to simplify the if statement.&lt;br /&gt;
*Used dig instead of nested hash indexing with square brackets. This makes the code more concise and avoids NoMethodError exceptions when a hash key is missing.&lt;br /&gt;
*Used return to exit early from count_github_authors_and_dates if the author is a collaborator. This avoids unnecessary code execution and improves performance.&lt;br /&gt;
*Used Hash.new(0) to initialize the hash for each author's commits. This simplifies the code and avoids the need for if...else logic.&lt;br /&gt;
*Used default to set the default value for each author's commits to 0. This avoids the need for if...else logic when incrementing the commit count.&lt;br /&gt;
*Used to_h to convert the sorted array of commits back to a hash. This is more concise than building a new hash with Hash[].&lt;br /&gt;
*Used dig to access nested hash keys in team_statistics. This avoids NoMethodError exceptions and makes the code more concise.&lt;br /&gt;
*Used ternary operator to simplify&lt;br /&gt;
*Used the find_by method instead of where and first for simplicity.&lt;br /&gt;
*Used the safe navigation operator (&amp;amp;.) to avoid errors when trying to call a method on a nil object.&lt;br /&gt;
*Used present? instead of nil? to check if a record exists.&lt;br /&gt;
*Used update instead of assigning values and calling save separately for readability.&lt;br /&gt;
*Used string interpolation to concatenate the @ncsu.edu suffix to the email prefix.&lt;br /&gt;
*Removed unnecessary comments and code.&lt;br /&gt;
&lt;br /&gt;
=====Some methods in metrics_controller.rb=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 1.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 2.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 3.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 4.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 5.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 6.jpg|1000px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 7.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2324 8.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Use Github Metrics Functionality ====&lt;br /&gt;
This functionality gives the instructor the option to use Github metrics when creating an assignment.&lt;br /&gt;
[[File:Expertiza_srihitha.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Design UML ===&lt;br /&gt;
[[File:Expertiza UML E2324.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn off functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Using Github Testing&lt;br /&gt;
first, go to the assignment edit page and check the checkbox of use github metric, then go to the list submission page check the page if has the content about ithub data.&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;check the box of the use github metrics? and the list_submissions page will have the content 'Github data'  &amp;quot; do&lt;br /&gt;
         visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
    	check('Use github metrics?', allow_label_click: true)&lt;br /&gt;
         visit &amp;quot;/assignments/list_submissions?id=#{@assignment.id}&amp;quot;&lt;br /&gt;
         expect(page).to have_content(&amp;quot;Github data&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;uncheck the checkbox of the use github metrics? and the list_submissions page will not have the content 'Github data' &amp;quot; do&lt;br /&gt;
         visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
         check('Use github metrics?', allow_label_click: false)&lt;br /&gt;
         page.uncheck('Use github metrics?')&lt;br /&gt;
         visit &amp;quot;/assignments/list_submissions?id=#{@assignment.id}&amp;quot;&lt;br /&gt;
         expect(page).to have_no_content(&amp;quot;Github data&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Future Implementation ==&lt;br /&gt;
*Change the method names in metrics_controller.rb and add appropriate comments.&lt;br /&gt;
*Add more test cases.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
Ed Gehringer [[(efg@ncsu.edu)]]&lt;br /&gt;
&lt;br /&gt;
==Contributors to this project==&lt;br /&gt;
&lt;br /&gt;
Soham Bapat [[(sbapat2@ncsu.edu)]]&lt;br /&gt;
Srihitha Reddy Kaalam [[(skaalam@ncsu.edu)]]&lt;br /&gt;
Sukruthi Modem [[(smodem@ncsu.edu)]]&lt;br /&gt;
&lt;br /&gt;
==Pull Request Link==&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2524&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_8.jpg&amp;diff=149113</id>
		<title>File:E2324 8.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_8.jpg&amp;diff=149113"/>
		<updated>2023-04-07T20:45:16Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_7.jpg&amp;diff=149112</id>
		<title>File:E2324 7.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_7.jpg&amp;diff=149112"/>
		<updated>2023-04-07T20:44:58Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_6.jpg&amp;diff=149111</id>
		<title>File:E2324 6.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_6.jpg&amp;diff=149111"/>
		<updated>2023-04-07T20:44:35Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_5.jpg&amp;diff=149109</id>
		<title>File:E2324 5.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_5.jpg&amp;diff=149109"/>
		<updated>2023-04-07T20:44:04Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_4.jpg&amp;diff=149108</id>
		<title>File:E2324 4.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_4.jpg&amp;diff=149108"/>
		<updated>2023-04-07T20:43:43Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_3.jpg&amp;diff=149107</id>
		<title>File:E2324 3.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_3.jpg&amp;diff=149107"/>
		<updated>2023-04-07T20:43:05Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_2.jpg&amp;diff=149105</id>
		<title>File:E2324 2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_2.jpg&amp;diff=149105"/>
		<updated>2023-04-07T20:42:03Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_1.jpg&amp;diff=149104</id>
		<title>File:E2324 1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2324_1.jpg&amp;diff=149104"/>
		<updated>2023-04-07T20:39:51Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Expertiza_UML_E2324.jpg&amp;diff=149093</id>
		<title>File:Expertiza UML E2324.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Expertiza_UML_E2324.jpg&amp;diff=149093"/>
		<updated>2023-04-07T20:13:38Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2324._Github_metrics_integration&amp;diff=149091</id>
		<title>CSC/ECE 517 Spring 2023 - E2324. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2324._Github_metrics_integration&amp;diff=149091"/>
		<updated>2023-04-07T20:12:59Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: Created page with &amp;quot;__TOC__  ===About Expertiza===  [http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows t...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
Expertiza provides teammate reviews to gauge how much each team member contributed, but we would like to augment this data with data from external tools like Github (for example, number of commits, number of lines of code modified, number of lines added, number of lines deleted.) from each group’s submitted repo link.  This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like 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;
=== Project Overview and Mission ===&lt;br /&gt;
&lt;br /&gt;
*The first step is to extract Github metadata of the submitted repos and pull requests.&lt;br /&gt;
*The metadata should be stored in the local Expertiza DB. For each participant, record should include at least  include:&lt;br /&gt;
   -Committer id&lt;br /&gt;
   -Total number of commits&lt;br /&gt;
   -Number of files changed&lt;br /&gt;
   -Lines of code changed&lt;br /&gt;
   -Lines of code added&lt;br /&gt;
   -Lines of code removed&lt;br /&gt;
   -Lines of code added that survived until final submission [if available from Github]&lt;br /&gt;
*The code should sync the data with Github whenever someone (student or instructor) looks at a view that shows Github data.&lt;br /&gt;
*The data for teams should be shown in the instructor’s View Scores window, in a new tab, probably between Reviews and Author Feedback:&lt;br /&gt;
   -Design a good view for showing data on individuals&lt;br /&gt;
   -This should be on the Teammate Reviews tab, right below the grid for teammate reviews.  The reason for this is that we’d like to see all the data on an individual&lt;br /&gt;
    in a single view.  For teams, by contrast, there is already a pretty large grid, and potentially multiple grids for multiple rounds, so adding a new grid is more&lt;br /&gt;
    likely to clutter the display&lt;br /&gt;
*Create a bar chart for the # of lines changed for each assignment team on “view_submissions” page. The x-axis should be the time starting from the assignment creation time, till the last deadline of the assignment, or current time, whichever is earlier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation===&lt;br /&gt;
*Because we encountered errors while integrating the previous implementation into the expertiza application, we had to spend a significant amount of time resolving them. However, now that the integration is complete, we can finally shift our focus back to the current requirements and make progress on them.&lt;br /&gt;
&lt;br /&gt;
*We added test cases and refactored metrics_controller.rb&lt;br /&gt;
&lt;br /&gt;
====Changes in metrics_controller.rb====&lt;br /&gt;
&lt;br /&gt;
*Instead of controller: 'assignments', we used the list_submissions_assignment_path helper method to generate the correct path for redirect_to.&lt;br /&gt;
*The unless statement in require_instructor_privileges are simplified to a one-liner.&lt;br /&gt;
*Removed the only: [:action_allowed?] from require_instructor_privileges, since there is no action_allowed? method defined in the controller.&lt;br /&gt;
*Removed the comments that were not providing any additional value.&lt;br /&gt;
*Extracted some code to private methods to improve readability and organization.&lt;br /&gt;
*Removed unnecessary instance variables and local variables.&lt;br /&gt;
*Simplified the retrieve_github_data and create_github_metrics methods.&lt;br /&gt;
*Removed unnecessary @total_* instance variables.&lt;br /&gt;
*Removed the @check_statuses instance variable, which isn't used in this method.&lt;br /&gt;
*The retrieve_github_data method has been refactored to use partition instead of select, simplifying the code.&lt;br /&gt;
*In query_all_pull_requests, we've combined two lines of code to simplify the creation of the head_refs hash. We've also passed hyperlink_data to parse_pull_request_data instead of github_data to match the method's expected argument.&lt;br /&gt;
*We've refactored extract_hyperlink_data to use slice and zip to create the hash, which is shorter and easier to read.&lt;br /&gt;
*In pull_request_data, We replaced the while loop with a loop do construct and used break to exit the loop instead of modifying a flag variable. We also used the safe navigation operator (&amp;amp;.) to avoid NoMethodError exceptions when accessing nested hashes that may be nil.&lt;br /&gt;
*In parse_pull_request_data, we used the safe navigation operator to avoid NoMethodError exceptions when accessing nested hashes that may be nil. We also added some nil checks to skip over commits or commit data that is missing or invalid. Finally, we simplified the date-slicing logic by chaining the to_s and slice methods.&lt;br /&gt;
*retrieve_repository_data now calls parse_hyperlink to extract the owner and repository names from the GitHub repository URL. It also uses a loop instead of a while to simplify the code and avoid unnecessary variables.&lt;br /&gt;
*query_and_parse_repository_data now returns the page info hash instead of modifying it in place, to make it clearer and less error-prone.&lt;br /&gt;
*parse_repository_data now uses dig to access nested hashes safely, avoiding errors if any of the expected keys are missing. It also simplifies the date string extraction by using a slice instead of a regex.&lt;br /&gt;
*Used the dig method to access nested keys in the hash, which returns nil if any intermediate key is nil instead of raising an exception.&lt;br /&gt;
*Removed unnecessary comments and made the existing ones more concise.&lt;br /&gt;
*Used ternary operator to simplify the if statement.&lt;br /&gt;
*Used dig instead of nested hash indexing with square brackets. This makes the code more concise and avoids NoMethodError exceptions when a hash key is missing.&lt;br /&gt;
*Used return to exit early from count_github_authors_and_dates if the author is a collaborator. This avoids unnecessary code execution and improves performance.&lt;br /&gt;
*Used Hash.new(0) to initialize the hash for each author's commits. This simplifies the code and avoids the need for if...else logic.&lt;br /&gt;
*Used default to set the default value for each author's commits to 0. This avoids the need for if...else logic when incrementing the commit count.&lt;br /&gt;
*Used to_h to convert the sorted array of commits back to a hash. This is more concise than building a new hash with Hash[].&lt;br /&gt;
*Used dig to access nested hash keys in team_statistics. This avoids NoMethodError exceptions and makes the code more concise.&lt;br /&gt;
*Used ternary operator to simplify&lt;br /&gt;
*Used the find_by method instead of where and first for simplicity.&lt;br /&gt;
*Used the safe navigation operator (&amp;amp;.) to avoid errors when trying to call a method on a nil object.&lt;br /&gt;
*Used present? instead of nil? to check if a record exists.&lt;br /&gt;
*Used update instead of assigning values and calling save separately for readability.&lt;br /&gt;
*Used string interpolation to concatenate the @ncsu.edu suffix to the email prefix.&lt;br /&gt;
*Removed unnecessary comments and code.&lt;br /&gt;
&lt;br /&gt;
==== Use Github Metrics Functionality ====&lt;br /&gt;
This functionality gives the instructor the option to use Github metrics when creating an assignment.&lt;br /&gt;
[[File:Expertiza_srihitha.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Design UML ===&lt;br /&gt;
[[File:Expertiza UML E2324.jpg|thumb|UML Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn off functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Using Github Testing&lt;br /&gt;
first, go to the assignment edit page and check the checkbox of use github metric, then go to the list submission page check the page if has the content about ithub data.&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;check the box of the use github metrics? and the list_submissions page will have the content 'Github data'  &amp;quot; do&lt;br /&gt;
         visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
    	check('Use github metrics?', allow_label_click: true)&lt;br /&gt;
         visit &amp;quot;/assignments/list_submissions?id=#{@assignment.id}&amp;quot;&lt;br /&gt;
         expect(page).to have_content(&amp;quot;Github data&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;uncheck the checkbox of the use github metrics? and the list_submissions page will not have the content 'Github data' &amp;quot; do&lt;br /&gt;
         visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
         check('Use github metrics?', allow_label_click: false)&lt;br /&gt;
         page.uncheck('Use github metrics?')&lt;br /&gt;
         visit &amp;quot;/assignments/list_submissions?id=#{@assignment.id}&amp;quot;&lt;br /&gt;
         expect(page).to have_no_content(&amp;quot;Github data&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Future Implementation ==&lt;br /&gt;
*Add the functionality to turn on and turn off the GitHub usage function.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
Ed Gehringer [[(efg@ncsu.edu)]]&lt;br /&gt;
&lt;br /&gt;
==Contributors to this project==&lt;br /&gt;
&lt;br /&gt;
Soham Bapat [[(sbapat2@ncsu.edu)]]&lt;br /&gt;
Srihitha Reddy Kaalam [[(skaalam@ncsu.edu)]]&lt;br /&gt;
Sukruthi Modem [[(smodem@ncsu.edu)]]&lt;br /&gt;
&lt;br /&gt;
==Pull Request Link==&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2524&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2300._Refactor_E1858._Github_metrics_integration&amp;diff=148326</id>
		<title>CSC/ECE 517 Spring 2023 - E2300. Refactor E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2300._Refactor_E1858._Github_metrics_integration&amp;diff=148326"/>
		<updated>2023-03-25T23:25:44Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: /* Current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
Expertiza provides teammate reviews to gauge how much each team member contributed, but we would like to augment this data with data from external tools like Github (for example, number of commits, number of lines of code modified, number of lines added, number of lines deleted.) from each group’s submitted repo link.  This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like 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;
=== Project Overview and Mission ===&lt;br /&gt;
&lt;br /&gt;
*The first step is to extract Github metadata of the submitted repos and pull requests.&lt;br /&gt;
*The metadata should be stored in the local Expertiza DB. For each participant, record should include at least  include:&lt;br /&gt;
   -Committer id&lt;br /&gt;
   -Total number of commits&lt;br /&gt;
   -Number of files changed&lt;br /&gt;
   -Lines of code changed&lt;br /&gt;
   -Lines of code added&lt;br /&gt;
   -Lines of code removed&lt;br /&gt;
   -Lines of code added that survived until final submission [if available from Github]&lt;br /&gt;
*The code should sync the data with Github whenever someone (student or instructor) looks at a view that shows Github data.&lt;br /&gt;
*The data for teams should be shown in the instructor’s View Scores window, in a new tab, probably between Reviews and Author Feedback:&lt;br /&gt;
   -Design a good view for showing data on individuals&lt;br /&gt;
   -This should be on the Teammate Reviews tab, right below the grid for teammate reviews.  The reason for this is that we’d like to see all the data on an individual&lt;br /&gt;
    in a single view.  For teams, by contrast, there is already a pretty large grid, and potentially multiple grids for multiple rounds, so adding a new grid is more&lt;br /&gt;
    likely to clutter the display&lt;br /&gt;
*Create a bar chart for the # of lines changed for each assignment team on “view_submissions” page. The x-axis should be the time starting from the assignment creation time, till the last deadline of the assignment, or current time, whichever is earlier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation===&lt;br /&gt;
Because we encountered errors while integrating the previous implementation into the expertiza application, we had to spend a significant amount of time resolving them. However, now that the integration is complete, we can finally shift our focus back to the current requirements and make progress on them.&lt;br /&gt;
&lt;br /&gt;
==== Use Github Metrics Functionality ====&lt;br /&gt;
This functionality gives the instructor the option to use Github metrics when creating an assignment.&lt;br /&gt;
[[File:Expertiza_srihitha.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Future Implementation ===&lt;br /&gt;
* In the previous implementation all parsing is done in the controller, which leads to 350 lines in the controller. We plan to simplify the controller implementation by refactoring it.&lt;br /&gt;
*Add the functionality to turn on and turn off the GitHub usage function.&lt;br /&gt;
*Add more test cases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
Ed Gehringer [[(efg@ncsu.edu)]]&lt;br /&gt;
&lt;br /&gt;
==Contributors to this project==&lt;br /&gt;
&lt;br /&gt;
Soham Bapat [[(sbapat2@ncsu.edu)]]&lt;br /&gt;
Srihitha Reddy Kaalam [[(skaalam@ncsu.edu)]]&lt;br /&gt;
Sukruthi Modem [[(smodem@ncsu.edu)]]&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023&amp;diff=148123</id>
		<title>CSC/ECE 517 Spring 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023&amp;diff=148123"/>
		<updated>2023-03-23T01:38:34Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: /* OSS Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OSS Projects ==&lt;br /&gt;
[[CSC/ECE 517 Spring_2023 -E2306. Refactor user_controller.rb, user.rb and its child classes]]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring_2023 - E2320. Reimplement the Question hierarchy]]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring_2023 - E2312 + E2313. Reimplement response.rb and responses_controller.rb]]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring_2023 - NTNX-1. Support provisioning MongoDb via NDB Kubernetes Operator]]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring_2023 - E2316. Reimplement sign_up_sheet_controller.rb]]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring_2023 - E2315. Reimplement signed_up_team.rb, sign_up_topic.rb, sign_up_sheet.rb]]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring_2023 - E2323. Refactor DueDate functionality from assignment.rb]]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring 2023 - E2317. Reimplement participant.rb]]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring 2023 - E2314. Reimplement the response map hierarchy]]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring 2023- NTNX-4. Extend NDB operator provision postregresql aws]]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring 2023 - E2321. Reimplement QuestionnairesController and QuestionsController]]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring 2023 - E2305. Grading audit trail]]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring 2023 - E2309. Refactor Node model and its subclasses]]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring 2023 - NTNX-2. Support provisioning mySQL databases via NDB Kubernetes Operator]]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring 2023 - E2300. Refactor E1858. Github metrics integration]]&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2300._Refactor_E1858._Github_metrics_integration&amp;diff=148118</id>
		<title>CSC/ECE 517 Spring 2023 - E2300. Refactor E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2300._Refactor_E1858._Github_metrics_integration&amp;diff=148118"/>
		<updated>2023-03-23T01:36:44Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: /* Project Overview and Mission */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
Expertiza provides teammate reviews to gauge how much each team member contributed, but we would like to augment this data with data from external tools like Github (for example, number of commits, number of lines of code modified, number of lines added, number of lines deleted.) from each group’s submitted repo link.  This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like 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;
=== Project Overview and Mission ===&lt;br /&gt;
&lt;br /&gt;
*The first step is to extract Github metadata of the submitted repos and pull requests.&lt;br /&gt;
*The metadata should be stored in the local Expertiza DB. For each participant, record should include at least  include:&lt;br /&gt;
   -Committer id&lt;br /&gt;
   -Total number of commits&lt;br /&gt;
   -Number of files changed&lt;br /&gt;
   -Lines of code changed&lt;br /&gt;
   -Lines of code added&lt;br /&gt;
   -Lines of code removed&lt;br /&gt;
   -Lines of code added that survived until final submission [if available from Github]&lt;br /&gt;
*The code should sync the data with Github whenever someone (student or instructor) looks at a view that shows Github data.&lt;br /&gt;
*The data for teams should be shown in the instructor’s View Scores window, in a new tab, probably between Reviews and Author Feedback:&lt;br /&gt;
   -Design a good view for showing data on individuals&lt;br /&gt;
   -This should be on the Teammate Reviews tab, right below the grid for teammate reviews.  The reason for this is that we’d like to see all the data on an individual&lt;br /&gt;
    in a single view.  For teams, by contrast, there is already a pretty large grid, and potentially multiple grids for multiple rounds, so adding a new grid is more&lt;br /&gt;
    likely to clutter the display&lt;br /&gt;
*Create a bar chart for the # of lines changed for each assignment team on “view_submissions” page. The x-axis should be the time starting from the assignment creation time, till the last deadline of the assignment, or current time, whichever is earlier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation===&lt;br /&gt;
&lt;br /&gt;
==== Use Github Metrics Functionality ====&lt;br /&gt;
This functionality gives the instructor the option to use Github metrics when creating an assignment.&lt;br /&gt;
[[File:Expertiza_srihitha.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Future Implementation ===&lt;br /&gt;
* In the previous implementation all parsing is done in the controller, which leads to 350 lines in the controller. We plan to simplify the controller implementation by refactoring it.&lt;br /&gt;
*Add the functionality to turn on and turn off the GitHub usage function.&lt;br /&gt;
*Add more test cases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
Ed Gehringer [[(efg@ncsu.edu)]]&lt;br /&gt;
&lt;br /&gt;
==Contributors to this project==&lt;br /&gt;
&lt;br /&gt;
Soham Bapat [[(sbapat2@ncsu.edu)]]&lt;br /&gt;
Srihitha Reddy Kaalam [[(skaalam@ncsu.edu)]]&lt;br /&gt;
Sukruthi Modem [[(smodem@ncsu.edu)]]&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2300._Refactor_E1858._Github_metrics_integration&amp;diff=148115</id>
		<title>CSC/ECE 517 Spring 2023 - E2300. Refactor E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2300._Refactor_E1858._Github_metrics_integration&amp;diff=148115"/>
		<updated>2023-03-23T01:36:02Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: /* Project Overview and Mission */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
Expertiza provides teammate reviews to gauge how much each team member contributed, but we would like to augment this data with data from external tools like Github (for example, number of commits, number of lines of code modified, number of lines added, number of lines deleted.) from each group’s submitted repo link.  This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like 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;
=== Project Overview and Mission ===&lt;br /&gt;
&lt;br /&gt;
*The first step is to extract Github metadata of the submitted repos and pull requests.&lt;br /&gt;
*The metadata should be stored in the local Expertiza DB. For each participant, record should include at least  include:&lt;br /&gt;
   -Committer id&lt;br /&gt;
   -Total number of commits&lt;br /&gt;
   -Number of files changed&lt;br /&gt;
   -Lines of code changed&lt;br /&gt;
   -Lines of code added&lt;br /&gt;
   -Lines of code removed&lt;br /&gt;
   -Lines of code added that survived until final submission [if available from Github]&lt;br /&gt;
*The code should sync the data with Github whenever someone (student or instructor) looks at a view that shows Github data.&lt;br /&gt;
*The data for teams should be shown in the instructor’s View Scores window, in a new tab, probably between Reviews and Author Feedback:&lt;br /&gt;
   -Design a good view for showing data on individuals&amp;lt;br&amp;gt;&lt;br /&gt;
   -This should be on the Teammate Reviews tab, right below the grid for teammate reviews.  The reason for this is that we’d like to see all the data on an individual&lt;br /&gt;
    in a single view.  For teams, by contrast, there is already a pretty large grid, and potentially multiple grids for multiple rounds, so adding a new grid is more&lt;br /&gt;
    likely to clutter the display.&amp;lt;br&amp;gt;&lt;br /&gt;
*Create a bar chart for the # of lines changed for each assignment team on “view_submissions” page. The x-axis should be the time starting from the assignment creation time, till the last deadline of the assignment, or current time, whichever is earlier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation===&lt;br /&gt;
&lt;br /&gt;
==== Use Github Metrics Functionality ====&lt;br /&gt;
This functionality gives the instructor the option to use Github metrics when creating an assignment.&lt;br /&gt;
[[File:Expertiza_srihitha.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Future Implementation ===&lt;br /&gt;
* In the previous implementation all parsing is done in the controller, which leads to 350 lines in the controller. We plan to simplify the controller implementation by refactoring it.&lt;br /&gt;
*Add the functionality to turn on and turn off the GitHub usage function.&lt;br /&gt;
*Add more test cases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
Ed Gehringer [[(efg@ncsu.edu)]]&lt;br /&gt;
&lt;br /&gt;
==Contributors to this project==&lt;br /&gt;
&lt;br /&gt;
Soham Bapat [[(sbapat2@ncsu.edu)]]&lt;br /&gt;
Srihitha Reddy Kaalam [[(skaalam@ncsu.edu)]]&lt;br /&gt;
Sukruthi Modem [[(smodem@ncsu.edu)]]&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2300._Refactor_E1858._Github_metrics_integration&amp;diff=148110</id>
		<title>CSC/ECE 517 Spring 2023 - E2300. Refactor E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2300._Refactor_E1858._Github_metrics_integration&amp;diff=148110"/>
		<updated>2023-03-23T01:34:13Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
Expertiza provides teammate reviews to gauge how much each team member contributed, but we would like to augment this data with data from external tools like Github (for example, number of commits, number of lines of code modified, number of lines added, number of lines deleted.) from each group’s submitted repo link.  This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like 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;
=== Project Overview and Mission ===&lt;br /&gt;
&lt;br /&gt;
*The first step is to extract Github metadata of the submitted repos and pull requests.&lt;br /&gt;
*The metadata should be stored in the local Expertiza DB. For each participant, record should include at least  include:&lt;br /&gt;
   -Committer id&lt;br /&gt;
   -Total number of commits&lt;br /&gt;
   -Number of files changed&lt;br /&gt;
   -Lines of code changed&lt;br /&gt;
   -Lines of code added&lt;br /&gt;
   -Lines of code removed&lt;br /&gt;
   -Lines of code added that survived until final submission [if available from Github]&lt;br /&gt;
*The code should sync the data with Github whenever someone (student or instructor) looks at a view that shows Github data.&lt;br /&gt;
*The data for teams should be shown in the instructor’s View Scores window, in a new tab, probably between Reviews and Author Feedback:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   -Design a good view for showing data on individuals&lt;br /&gt;
   -This should be on the Teammate Reviews tab, right below the grid for teammate reviews.  The reason for this is that we’d like to see all the data on an individual&lt;br /&gt;
    in a single view.  For teams, by contrast, there is already a pretty large grid, and potentially multiple grids for multiple rounds, so adding a new grid is more&lt;br /&gt;
    likely to clutter the display.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Create a bar chart for the # of lines changed for each assignment team on “view_submissions” page. The x-axis should be the time starting from the assignment creation time, till the last deadline of the assignment, or current time, whichever is earlier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation===&lt;br /&gt;
&lt;br /&gt;
==== Use Github Metrics Functionality ====&lt;br /&gt;
This functionality gives the instructor the option to use Github metrics when creating an assignment.&lt;br /&gt;
[[File:Expertiza_srihitha.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Future Implementation ===&lt;br /&gt;
* In the previous implementation all parsing is done in the controller, which leads to 350 lines in the controller. We plan to simplify the controller implementation by refactoring it.&lt;br /&gt;
*Add the functionality to turn on and turn off the GitHub usage function.&lt;br /&gt;
*Add more test cases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
Ed Gehringer [[(efg@ncsu.edu)]]&lt;br /&gt;
&lt;br /&gt;
==Contributors to this project==&lt;br /&gt;
&lt;br /&gt;
Soham Bapat [[(sbapat2@ncsu.edu)]]&lt;br /&gt;
Srihitha Reddy Kaalam [[(skaalam@ncsu.edu)]]&lt;br /&gt;
Sukruthi Modem [[(smodem@ncsu.edu)]]&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2300._Refactor_E1858._Github_metrics_integration&amp;diff=148105</id>
		<title>CSC/ECE 517 Spring 2023 - E2300. Refactor E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2300._Refactor_E1858._Github_metrics_integration&amp;diff=148105"/>
		<updated>2023-03-23T01:28:37Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: Created Wiki page for E2300&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
Expertiza provides teammate reviews to gauge how much each team member contributed, but we would like to augment this data with data from external tools like Github (for example, number of commits, number of lines of code modified, number of lines added, number of lines deleted.) from each group’s submitted repo link.  This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like 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;
=== Project Overview and Mission ===&lt;br /&gt;
&lt;br /&gt;
*The first step is to extract Github metadata of the submitted repos and pull requests.&lt;br /&gt;
*The metadata should be stored in the local Expertiza DB. For each participant, record should include at least  include:&lt;br /&gt;
   -Committer id&lt;br /&gt;
   -Total number of commits&lt;br /&gt;
   -Number of files changed&lt;br /&gt;
   -Lines of code changed&lt;br /&gt;
   -Lines of code added&lt;br /&gt;
   -Lines of code removed&lt;br /&gt;
   -Lines of code added that survived until final submission [if available from Github]&lt;br /&gt;
*The code should sync the data with Github whenever someone (student or instructor) looks at a view that shows Github data.&lt;br /&gt;
*The data for teams should be shown in the instructor’s View Scores window, in a new tab, probably between Reviews and Author Feedback:&lt;br /&gt;
   -Design a good view for showing data on individuals&lt;br /&gt;
   -This should be on the Teammate Reviews tab, right below the grid for teammate reviews.  The reason for this is that we’d like to see all the data on an individual&lt;br /&gt;
    in a single view.  For teams, by contrast, there is already a pretty large grid, and potentially multiple grids for multiple rounds, so adding a new grid is more&lt;br /&gt;
    likely to clutter the display.&lt;br /&gt;
*Create a bar chart for the # of lines changed for each assignment team on “view_submissions” page. The x-axis should be the time starting from the assignment creation time, till the last deadline of the assignment, or current time, whichever is earlier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== Current Implementation===&lt;br /&gt;
&lt;br /&gt;
==== Use Github Metrics Functionality ====&lt;br /&gt;
This functionality gives the instructor the option to use Github metrics when creating an assignment.&lt;br /&gt;
[[File:Expertiza_srihitha.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Future Implementation ===&lt;br /&gt;
* In the previous implementation all parsing is done in the controller, which leads to 350 lines in the controller. We plan to simplify the controller implementation by refactoring it.&lt;br /&gt;
*Add the functionality to turn on and turn off the GitHub usage function.&lt;br /&gt;
*Add more test cases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
Ed Gehringer [[(efg@ncsu.edu)]]&lt;br /&gt;
&lt;br /&gt;
==Contributors to this project==&lt;br /&gt;
&lt;br /&gt;
Soham Bapat [[(sbapat2@ncsu.edu)]]&lt;br /&gt;
Srihitha Reddy Kaalam [[(skaalam@ncsu.edu)]]&lt;br /&gt;
Sukruthi Modem [[(smodem@ncsu.edu)]]&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2023_-_E2300._Refactor_E1858._Github_metrics_integration&amp;diff=147983</id>
		<title>Https://expertiza.csc.ncsu.edu/index.php/CSC/ECE 517 Spring 2023 - E2300. Refactor E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2023_-_E2300._Refactor_E1858._Github_metrics_integration&amp;diff=147983"/>
		<updated>2023-03-22T21:58:37Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: Created page with &amp;quot;__TOC__  ===About Expertiza===  [http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows t...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
Expertiza provides teammate reviews to gauge how much each team member contributed, but we would like to augment this data with data from external tools like Github (for example, number of commits, number of lines of code modified, number of lines added, number of lines deleted.) from each group’s submitted repo link.  This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like 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;
=== Project Overview and Mission ===&lt;br /&gt;
&lt;br /&gt;
*The first step is to extract Github metadata of the submitted repos and pull requests.&lt;br /&gt;
*The metadata should be stored in the local Expertiza DB. For each participant, record should include at least  include:&lt;br /&gt;
   -Committer id&lt;br /&gt;
   -Total number of commits&lt;br /&gt;
   -Number of files changed&lt;br /&gt;
   -Lines of code changed&lt;br /&gt;
   -Lines of code added&lt;br /&gt;
   -Lines of code removed&lt;br /&gt;
   -Lines of code added that survived until final submission [if available from Github]&lt;br /&gt;
*The code should sync the data with Github whenever someone (student or instructor) looks at a view that shows Github data.&lt;br /&gt;
*The data for teams should be shown in the instructor’s View Scores window, in a new tab, probably between Reviews and Author Feedback:&lt;br /&gt;
   -Design a good view for showing data on individuals&lt;br /&gt;
   -This should be on the Teammate Reviews tab, right below the grid for teammate reviews.  The reason for this is that we’d like to see all the data on an individual in a single view.  For teams, by contrast, there is already a pretty large grid, and potentially multiple grids for multiple rounds, so adding a new grid is more likely to clutter the display.&lt;br /&gt;
*Create a bar chart for the # of lines changed for each assignment team on “view_submissions” page. The x-axis should be the time starting from the assignment creation time, till the last deadline of the assignment, or current time, whichever is earlier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== Current Implementation===&lt;br /&gt;
&lt;br /&gt;
==== Use Github Metrics Functionality ====&lt;br /&gt;
This functionality gives the instructor the option to use Github metrics when creating an assignment.&lt;br /&gt;
[[File:Expertiza_srihitha.png]]&lt;br /&gt;
&lt;br /&gt;
=== Future Implementation ===&lt;br /&gt;
* In the previous implementation all parsing is done in the controller, which leads to 350 lines in the controller. We plan to simplify the controller implementation by refactoring it.&lt;br /&gt;
*Add the functionality to turn on and turn off the GitHub usage function.&lt;br /&gt;
*Add more test cases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
Ed Gehringer [[(efg@ncsu.edu)]]&lt;br /&gt;
&lt;br /&gt;
==Contributors to this project==&lt;br /&gt;
&lt;br /&gt;
Soham Bapat [[(sbapat2@ncsu.edu)]]&lt;br /&gt;
Srihitha Reddy Kaalam [[(skaalam@ncsu.edu)]]&lt;br /&gt;
Sukruthi Modem [[(smodem@ncsu.edu)]]&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Expertiza_srihitha.png&amp;diff=147980</id>
		<title>File:Expertiza srihitha.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Expertiza_srihitha.png&amp;diff=147980"/>
		<updated>2023-03-22T21:42:36Z</updated>

		<summary type="html">&lt;p&gt;Skaalam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Skaalam</name></author>
	</entry>
</feed>