<?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=Lcmcconn</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=Lcmcconn"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Lcmcconn"/>
	<updated>2026-09-15T20:51:53Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=136730</id>
		<title>CSC/ECE 517 Fall 2020 - E2080. Track the time students look at other submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=136730"/>
		<updated>2020-11-12T04:34:27Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: /*  Code Changes  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' Introduction ''' ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. Tracking the time that a student spends on each submitted resources is meaningful to instructors to study and improve the teaching experience. Unfortunately, most peer assessment systems do not manage the content of students’ submission within the systems. They usually allow the authors submit external links to the submission (e.g. GitHub code / deployed application), which makes it difficult for the system to track the time that the reviewers spend on the submissions.&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
Expertiza allows students to peer review the work of other students in their course. To ensure the quality of the peer reviews, instructors would like to have the ability to track the time a student spends on a peer-review. These metrics need to be tracked and displayed in a way that the instructor  is able to gain valuable insight into the quality of a review or set of reviews.&lt;br /&gt;
&lt;br /&gt;
Various metrics will be tracked including&lt;br /&gt;
# The time spent on the primary review page&lt;br /&gt;
# The time spent on secondary/external links and downloadables&lt;br /&gt;
&lt;br /&gt;
=== Previous Implementations ===&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1791._Track_the_time_that_students_look_at_the_other_submissions_-_logging_improvement E1791] were able to implement the tracking mechanism for recording the time spent on looking at submissions that were of the type of links and downloadable files. The time spent on links were tracked using window popups when they are opened and closed. The downloadable files of the type text and images were displayed on a new HTML page to track the time spent on viewing that. Each time a submission link or downloadable file is clicked by the reviewer, a new record is created in the database. This causes a lot of database operations which degrades the performance of the application. Also, the way in which the results are displayed is not user-friendly. Other than these issues, the team provided a good [https://github.com/expertiza/expertiza/pull/1124 implementation] of the feature.&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions E1872] started with E1971's implementation as their base and tried to display the results in a tabular format. The table included useful statistics but it is being displayed outside the review report to the right side which does not blend in with the review report table. Also, the table is hard to read as a lot of information is presented in a cluttered manner. It is hard to map each statistic with its corresponding review. Furthermore, the team did not include any tests.  &lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is the most recent implementation, built from earlier designs, features a solid UI and ample tracking of review time across the board. They started off with project E1791 as their base and focused on displaying the results in a user-friendly manner. For this purpose, the results are displayed in a new window so that it does not look cluttered. The issue of extensive database operations still remains as future work in their [https://github.com/expertiza/expertiza/pull/1662 project].&lt;br /&gt;
&lt;br /&gt;
== ''' Proposed Solution ''' ==&lt;br /&gt;
*From the suggestions of the previous team, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989], we plan to improve their implementation by reducing the frequency of database queries and insertions. In [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989's] current implementation every time a start time is logged for expertiza/link/file, a new entry is created in the database. As a result the submission_viewing_event table increases in size very rapidly as it stores start and end times for each link if a particular event occurs. The solution is to save all entries locally on the users system and once the user presses Save or Submit, save the entry in the database.&lt;br /&gt;
*Secondly, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989's] implementation has a decent UI that effectively displays the necessary information to the user. We plan to add minor improvements to their UI to try to improve usability.&lt;br /&gt;
*The previous team also mentioned other issues involving the &amp;quot;Save review after 60 seconds&amp;quot; checkbox feature, that may be looked into in the case of extra time.&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
The following is the flowchart presented by E1989 that does a good job outlining the logic for tracking the time students spend reviewing:&lt;br /&gt;
&lt;br /&gt;
[[File:E1989_Student_flowchart_modified.png | center]]&lt;br /&gt;
[[File:flowchart2.png | center]]&lt;br /&gt;
&lt;br /&gt;
== ''' Code Changes ''' ==&lt;br /&gt;
&lt;br /&gt;
Our implementation is centered around two different classes and the default 'pstore' gem&lt;br /&gt;
&lt;br /&gt;
Our two classes work together to limit data written directly to the database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;'''Local Submitted Content'''&amp;lt;/h4&amp;gt;&lt;br /&gt;
This class serves as a sort of &amp;quot;instance&amp;quot; or a standard for representing the tracking of the time for a single link which was visited.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class LocalSubmittedContent&lt;br /&gt;
    attr_accessor :map_id, :round, :link , :start_at, :end_at, :created_at, :updated_at&lt;br /&gt;
&lt;br /&gt;
    def initialize(**args)&lt;br /&gt;
      @map_id = args.fetch(:map_id,nil)&lt;br /&gt;
      @round = args.fetch(:round,nil)&lt;br /&gt;
      @link = args.fetch(:link,nil)&lt;br /&gt;
      @start_at = args.fetch(:start_at,nil)&lt;br /&gt;
      @end_at = args.fetch(:end_at,nil)&lt;br /&gt;
      @created_at = args.fetch(:created_at,nil)&lt;br /&gt;
      @updated_at = args.fetch(:updated_at,nil)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    def initialize(args)&lt;br /&gt;
      @map_id = args.fetch(:map_id,nil)&lt;br /&gt;
      @round = args.fetch(:round,nil)&lt;br /&gt;
      @link = args.fetch(:link,nil)&lt;br /&gt;
      @start_at = args.fetch(:start_at,nil)&lt;br /&gt;
      @end_at = args.fetch(:end_at,nil)&lt;br /&gt;
      @created_at = args.fetch(:created_at,nil)&lt;br /&gt;
      @updated_at = args.fetch(:updated_at,nil)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def to_h()&lt;br /&gt;
        return {map_id: @map_id, round: @round, link: @link, start_at: @start_at, end_at: @end_at, created_at: @created_at, updated_at: @updated_at}&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    def ==(other)&lt;br /&gt;
      return @map_id = other.map_id &amp;amp;&amp;amp; @round == other.round &amp;amp;&amp;amp; @link == other.link &amp;amp;&amp;amp;&lt;br /&gt;
      @start_at == other.start_at &amp;amp;&amp;amp; @end_at == other.end_at &amp;amp;&amp;amp;&lt;br /&gt;
      @created_at == other.created_at &amp;amp;&amp;amp; @updated_at == other.updated_at&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;
&amp;lt;h4&amp;gt;'''LocalStorage'''&amp;lt;/h4&amp;gt;&lt;br /&gt;
This class serves as the medium for transaction of data between the local @registry instance variable, pstore and the database&lt;br /&gt;
&lt;br /&gt;
It manages the pstore &amp;quot;hash&amp;quot; by restricting access and saving instances of LocalSubmittedContent when required.&lt;br /&gt;
&lt;br /&gt;
It has a lookup feature with .where() where the user can search for LocalSubmittedContent given specified parameters&lt;br /&gt;
&lt;br /&gt;
Lastly it provides the functionality to save the entries from pstore into the database&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class LocalStorage&lt;br /&gt;
&lt;br /&gt;
    def initialize()&lt;br /&gt;
      @registry = []&lt;br /&gt;
      @pstore = PStore.new(&amp;quot;local_submitted_content.pstore&amp;quot;)&lt;br /&gt;
      @pstore.transaction do&lt;br /&gt;
        @pstore[:registry] ||= []&lt;br /&gt;
      end&lt;br /&gt;
      @registry = read()&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    def save(instance)&lt;br /&gt;
        @pstore.transaction do&lt;br /&gt;
          @registry &amp;lt;&amp;lt; instance&lt;br /&gt;
          @pstore[:registry] = @registry&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    def sync()&lt;br /&gt;
      @pstore.transaction do&lt;br /&gt;
        @pstore[:registry] = @registry&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Find all entries that meet every field in the params hash&lt;br /&gt;
    # return list of matching entries &lt;br /&gt;
    def where(params)&lt;br /&gt;
        found = []&lt;br /&gt;
&lt;br /&gt;
        @registry.each do |item|&lt;br /&gt;
          if item.to_h().values_at(*params.keys) == params.values&lt;br /&gt;
            found &amp;lt;&amp;lt; item&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
        return found&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Reads and returns data from Pstore registry&lt;br /&gt;
    def read()&lt;br /&gt;
      @pstore.transaction do &lt;br /&gt;
        return @pstore[:registry]&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Actually saves into the database&lt;br /&gt;
    def hard_save(instance)&lt;br /&gt;
        return SubmissionViewingEvent.create(instance.to_h())&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    def hard_save_all()&lt;br /&gt;
      @registry.each do |item|&lt;br /&gt;
        SubmissionViewingEvent.create(item.to_h())&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    def remove(instance)&lt;br /&gt;
      @registry.each_with_index do |item,i|&lt;br /&gt;
        if item.to_h() == instance.to_h()&lt;br /&gt;
          @registry.delete_at(i)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
      sync()&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    def remove_all()&lt;br /&gt;
      @registry = []&lt;br /&gt;
      sync()&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;
==  ''' Test Plan ''' ==&lt;br /&gt;
=== Automated Testing Using RSpec ===&lt;br /&gt;
The main feature that we want to test is that the intermediate review timings that we are planning to store on the browser's local storage are being accurately stored or not. There are already tests written to test the total time tracking feature. We will be adding additional tests to test the storage and retrieval of the intermediate timings.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Our major focus for this project is to change the current implementation to use significantly less number of database operations by storing the intermediate timings in the local storage of the browser and write only the final time spent on viewing the submissions. So, the only manual UI testing that can be performed is to check if the total time spent by students is accurately tracked and can be viewed by the instructor.  &lt;br /&gt;
&lt;br /&gt;
This can be tested using the following steps:&lt;br /&gt;
# Log in to Expertiza as a student and go to the assignments tab.   &lt;br /&gt;
# Click on a particular assignment and review the submission by click on links and spending some time viewing them.   &lt;br /&gt;
# After reviewing is done, submit the review.   &lt;br /&gt;
# Log out from the student account.   &lt;br /&gt;
# To look at the time spent on the reviews, log in as the instructor.   &lt;br /&gt;
# Click on the assignments tab.   &lt;br /&gt;
# Click on the review report icon beside the specific assignment that you reviewed using the student's account.   &lt;br /&gt;
# You should be able to see the total time spent on the submissions by the student.&lt;br /&gt;
&lt;br /&gt;
== ''' Helpful Links ''' ==&lt;br /&gt;
#[https://github.com/LukeMccon/expertiza Our Fork]&lt;br /&gt;
== ''' Identified Issues ''' ==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
== ''' Team Information ''' ==&lt;br /&gt;
#Luke McConnaughey (lcmcconn)&lt;br /&gt;
#Pedro Benitez (pbenite)&lt;br /&gt;
#Rohit Nair (rnair2)&lt;br /&gt;
#Surbhi Jha (sjha6)&lt;br /&gt;
&lt;br /&gt;
Mentor: Yunkai 'Kai' Xiao (yxiao28)&lt;br /&gt;
&amp;lt;br&amp;gt;Professor: Dr. Edward F. Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=136729</id>
		<title>CSC/ECE 517 Fall 2020 - E2080. Track the time students look at other submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=136729"/>
		<updated>2020-11-12T04:23:02Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: /*  Flowchart  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' Introduction ''' ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. Tracking the time that a student spends on each submitted resources is meaningful to instructors to study and improve the teaching experience. Unfortunately, most peer assessment systems do not manage the content of students’ submission within the systems. They usually allow the authors submit external links to the submission (e.g. GitHub code / deployed application), which makes it difficult for the system to track the time that the reviewers spend on the submissions.&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
Expertiza allows students to peer review the work of other students in their course. To ensure the quality of the peer reviews, instructors would like to have the ability to track the time a student spends on a peer-review. These metrics need to be tracked and displayed in a way that the instructor  is able to gain valuable insight into the quality of a review or set of reviews.&lt;br /&gt;
&lt;br /&gt;
Various metrics will be tracked including&lt;br /&gt;
# The time spent on the primary review page&lt;br /&gt;
# The time spent on secondary/external links and downloadables&lt;br /&gt;
&lt;br /&gt;
=== Previous Implementations ===&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1791._Track_the_time_that_students_look_at_the_other_submissions_-_logging_improvement E1791] were able to implement the tracking mechanism for recording the time spent on looking at submissions that were of the type of links and downloadable files. The time spent on links were tracked using window popups when they are opened and closed. The downloadable files of the type text and images were displayed on a new HTML page to track the time spent on viewing that. Each time a submission link or downloadable file is clicked by the reviewer, a new record is created in the database. This causes a lot of database operations which degrades the performance of the application. Also, the way in which the results are displayed is not user-friendly. Other than these issues, the team provided a good [https://github.com/expertiza/expertiza/pull/1124 implementation] of the feature.&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions E1872] started with E1971's implementation as their base and tried to display the results in a tabular format. The table included useful statistics but it is being displayed outside the review report to the right side which does not blend in with the review report table. Also, the table is hard to read as a lot of information is presented in a cluttered manner. It is hard to map each statistic with its corresponding review. Furthermore, the team did not include any tests.  &lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is the most recent implementation, built from earlier designs, features a solid UI and ample tracking of review time across the board. They started off with project E1791 as their base and focused on displaying the results in a user-friendly manner. For this purpose, the results are displayed in a new window so that it does not look cluttered. The issue of extensive database operations still remains as future work in their [https://github.com/expertiza/expertiza/pull/1662 project].&lt;br /&gt;
&lt;br /&gt;
== ''' Proposed Solution ''' ==&lt;br /&gt;
*From the suggestions of the previous team, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989], we plan to improve their implementation by reducing the frequency of database queries and insertions. In [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989's] current implementation every time a start time is logged for expertiza/link/file, a new entry is created in the database. As a result the submission_viewing_event table increases in size very rapidly as it stores start and end times for each link if a particular event occurs. The solution is to save all entries locally on the users system and once the user presses Save or Submit, save the entry in the database.&lt;br /&gt;
*Secondly, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989's] implementation has a decent UI that effectively displays the necessary information to the user. We plan to add minor improvements to their UI to try to improve usability.&lt;br /&gt;
*The previous team also mentioned other issues involving the &amp;quot;Save review after 60 seconds&amp;quot; checkbox feature, that may be looked into in the case of extra time.&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
The following is the flowchart presented by E1989 that does a good job outlining the logic for tracking the time students spend reviewing:&lt;br /&gt;
&lt;br /&gt;
[[File:E1989_Student_flowchart_modified.png | center]]&lt;br /&gt;
[[File:flowchart2.png | center]]&lt;br /&gt;
&lt;br /&gt;
== ''' Code Changes ''' ==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==  ''' Test Plan ''' ==&lt;br /&gt;
=== Automated Testing Using RSpec ===&lt;br /&gt;
The main feature that we want to test is that the intermediate review timings that we are planning to store on the browser's local storage are being accurately stored or not. There are already tests written to test the total time tracking feature. We will be adding additional tests to test the storage and retrieval of the intermediate timings.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Our major focus for this project is to change the current implementation to use significantly less number of database operations by storing the intermediate timings in the local storage of the browser and write only the final time spent on viewing the submissions. So, the only manual UI testing that can be performed is to check if the total time spent by students is accurately tracked and can be viewed by the instructor.  &lt;br /&gt;
&lt;br /&gt;
This can be tested using the following steps:&lt;br /&gt;
# Log in to Expertiza as a student and go to the assignments tab.   &lt;br /&gt;
# Click on a particular assignment and review the submission by click on links and spending some time viewing them.   &lt;br /&gt;
# After reviewing is done, submit the review.   &lt;br /&gt;
# Log out from the student account.   &lt;br /&gt;
# To look at the time spent on the reviews, log in as the instructor.   &lt;br /&gt;
# Click on the assignments tab.   &lt;br /&gt;
# Click on the review report icon beside the specific assignment that you reviewed using the student's account.   &lt;br /&gt;
# You should be able to see the total time spent on the submissions by the student.&lt;br /&gt;
&lt;br /&gt;
== ''' Helpful Links ''' ==&lt;br /&gt;
#[https://github.com/LukeMccon/expertiza Our Fork]&lt;br /&gt;
== ''' Identified Issues ''' ==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
== ''' Team Information ''' ==&lt;br /&gt;
#Luke McConnaughey (lcmcconn)&lt;br /&gt;
#Pedro Benitez (pbenite)&lt;br /&gt;
#Rohit Nair (rnair2)&lt;br /&gt;
#Surbhi Jha (sjha6)&lt;br /&gt;
&lt;br /&gt;
Mentor: Yunkai 'Kai' Xiao (yxiao28)&lt;br /&gt;
&amp;lt;br&amp;gt;Professor: Dr. Edward F. Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Flowchart2.png&amp;diff=136728</id>
		<title>File:Flowchart2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Flowchart2.png&amp;diff=136728"/>
		<updated>2020-11-12T04:20:41Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=136199</id>
		<title>CSC/ECE 517 Fall 2020 - E2080. Track the time students look at other submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=136199"/>
		<updated>2020-10-23T03:34:25Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' Introduction ''' ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. Tracking the time that a student spends on each submitted resources is meaningful to instructors to study and improve the teaching experience. Unfortunately, most peer assessment systems do not manage the content of students’ submission within the systems. They usually allow the authors submit external links to the submission (e.g. GitHub code / deployed application), which makes it difficult for the system to track the time that the reviewers spend on the submissions.&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
Expertiza allows students to peer review the work of other students in their course. To ensure the quality of the peer reviews, instructors would like to have the ability to track the time a student spends on a peer-review. These metrics need to be tracked and displayed in a way that the instructor  is able to gain valuable insight into the quality of a review or set of reviews.&lt;br /&gt;
&lt;br /&gt;
Various metrics will be tracked including&lt;br /&gt;
# The time spent on the primary review page&lt;br /&gt;
# The time spent on secondary/external links and downloadables&lt;br /&gt;
&lt;br /&gt;
=== Previous Implementations ===&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1791._Track_the_time_that_students_look_at_the_other_submissions_-_logging_improvement E1791] were able to implement the tracking mechanism for recording the time spent on looking at submissions that were of the type of links and downloadable files. The time spent on links were tracked using window popups when they are opened and closed. The downloadable files of the type text and images were displayed on a new HTML page to track the time spent on viewing that. Each time a submission link or downloadable file is clicked by the reviewer, a new record is created in the database. This causes a lot of database operations which degrades the performance of the application. Also, the way in which the results are displayed is not user-friendly. Other than these issues, the team provided a good [https://github.com/expertiza/expertiza/pull/1124 implementation] of the feature.&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1872_Track_Time_Students_Look_At_Other_Submissions E1872] started with E1971's implementation as their base and tried to display the results in a tabular format. The table included useful statistics but it is being displayed outside the review report to the right side which does not blend in with the review report table. Also, the table is hard to read as a lot of information is presented in a cluttered manner. It is hard to map each statistic with its corresponding review. Furthermore, the team did not include any tests.  &lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989] is the most recent implementation, built from earlier designs, features a solid UI and ample tracking of review time across the board. They started off with project E1791 as their base and focused on displaying the results in a user-friendly manner. For this purpose, the results are displayed in a new window so that it does not look cluttered. The issue of extensive database operations still remains as future work in their [https://github.com/expertiza/expertiza/pull/1662 project].&lt;br /&gt;
&lt;br /&gt;
== ''' Proposed Solution ''' ==&lt;br /&gt;
*From the suggestions of the previous team, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989], we plan to improve their implementation by reducing the frequency of database queries and insertions. In [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989's] current implementation every time a start time is logged for expertiza/link/file, a new entry is created in the database. As a result the submission_viewing_event table increases in size very rapidly as it stores start and end times for each link if a particular event occurs. The solution is to save all entries locally on the users system and once the user presses Save or Submit, save the entry in the database.&lt;br /&gt;
*Secondly, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1989._Track_the_time_students_look_at_other_submissions E1989's] implementation has a decent UI that effectively displays the necessary information to the user. We plan to add minor improvements to their UI to try to improve usability.&lt;br /&gt;
*The previous team also mentioned other issues involving the &amp;quot;Save review after 60 seconds&amp;quot; checkbox feature, that may be looked into in the case of extra time.&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
The following is the flowchart presented by E1989 that does a good job outlining the logic for tracking the time students spend reviewing:&lt;br /&gt;
&lt;br /&gt;
[[File:E1989_Student_flowchart_modified.png | center]]&lt;br /&gt;
&lt;br /&gt;
== ''' Code Changes ''' ==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==  ''' Test Plan ''' ==&lt;br /&gt;
=== Automated Testing Using RSpec ===&lt;br /&gt;
TBD&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
== ''' Helpful Links ''' ==&lt;br /&gt;
#[https://github.com/LukeMccon/expertiza Our Fork]&lt;br /&gt;
== ''' Identified Issues ''' ==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
== ''' Team Information ''' ==&lt;br /&gt;
#Luke McConnaughey (lcmcconn)&lt;br /&gt;
#Pedro Benitez (pbenite)&lt;br /&gt;
#Rohit Nair (rnair2)&lt;br /&gt;
#Surbhi Jha (sjha6)&lt;br /&gt;
&lt;br /&gt;
Mentor: Sanket Pai (sgpai2)&lt;br /&gt;
&amp;lt;br&amp;gt;Professor: Dr. Edward F. Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E1989_Student_flowchart_modified.png&amp;diff=136198</id>
		<title>File:E1989 Student flowchart modified.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E1989_Student_flowchart_modified.png&amp;diff=136198"/>
		<updated>2020-10-23T03:33:02Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=136069</id>
		<title>CSC/ECE 517 Fall 2020 - E2080. Track the time students look at other submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=136069"/>
		<updated>2020-10-22T19:38:23Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' Introduction ''' ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. Tracking the time that a student spends on each submitted resources is meaningful to instructors to study and improve the teaching experience. Unfortunately, most peer assessment systems do not manage the content of students’ submission within the systems. They usually allow the authors submit external links to the submission (e.g. GitHub code / deployed application), which makes it difficult for the system to track the time that the reviewers spend on the submissions.&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
Expertiza allows students to peer review the work of other students in their course. To ensure the quality of the peer reviews, instructors would like to have the ability to track the time a student spends on a peer-review. These metrics need to be tracked and displayed in a way that the instructor  is able to gain valuable insight into the quality of a review or set of reviews.&lt;br /&gt;
&lt;br /&gt;
Various metrics will be tracked including&lt;br /&gt;
# The time spent on the primary review page&lt;br /&gt;
# The time spent on secondary/external links and downloadables&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
The most recent implementation, built from earlier designs features a solid UI and ample tracking of review time across the board. The main issue with this implementation is that it frequently carries out &amp;quot;expensive&amp;quot; operations on the database.&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1607 E1989]&lt;br /&gt;
== ''' Proposed Solution ''' ==&lt;br /&gt;
From the suggestions of the previous team, E1989, we plan to improve their implementation by reducing the frequency of database queries and insertions.&lt;br /&gt;
Secondly, we plan to add minor improvements to their UI. TBD&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
&lt;br /&gt;
== ''' Code Changes ''' ==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==  ''' Test Plan ''' ==&lt;br /&gt;
=== Automated Testing Using RSpec ===&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
&lt;br /&gt;
== ''' Helpful Links ''' ==&lt;br /&gt;
#[https://github.com/LukeMccon/expertiza Our Fork]&lt;br /&gt;
== ''' Identified Issues ''' ==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
== ''' Team Information ''' ==&lt;br /&gt;
#Luke McConnaughey (lcmcconn)&lt;br /&gt;
#Pedro Benitez (pbenite)&lt;br /&gt;
#Rohit Nair (rnair2)&lt;br /&gt;
#Surbhi Jha (sjha6)&lt;br /&gt;
&lt;br /&gt;
Mentor: Sanket Pai (sgpai2)&lt;br /&gt;
&amp;lt;br&amp;gt;Professor: Dr. Edward F. Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=136068</id>
		<title>CSC/ECE 517 Fall 2020 - E2080. Track the time students look at other submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=136068"/>
		<updated>2020-10-22T19:38:02Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' Introduction ''' ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. Tracking the time that a student spends on each submitted resources is meaningful to instructors to study and improve the teaching experience. Unfortunately, most peer assessment systems do not manage the content of students’ submission within the systems. They usually allow the authors submit external links to the submission (e.g. GitHub code / deployed application), which makes it difficult for the system to track the time that the reviewers spend on the submissions.&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
Expertiza allows students to peer review the work of other students in their course. To ensure the quality of the peer reviews, instructors would like to have the ability to track the time a student spends on a peer-review. These metrics need to be tracked and displayed in a way that the instructor  is able to gain valuable insight into the quality of a review or set of reviews.&lt;br /&gt;
&lt;br /&gt;
Various metrics will be tracked including&lt;br /&gt;
# The time spent on the primary review page&lt;br /&gt;
# The time spent on secondary/external links and downloadables&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
The most recent implementation, built from earlier designs features a solid UI and ample tracking of review time across the board. The main issue with this implementation is that it frequently carries out &amp;quot;expensive&amp;quot; operations on the database.&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1607 E1989]&lt;br /&gt;
== ''' Proposed Solution ''' ==&lt;br /&gt;
From the suggestions of the previous team, E1989, we plan to improve their implementation by reducing the frequency of database queries and insertions.&lt;br /&gt;
Secondly, we plan to add minor improvements to their UI. TBD&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
&lt;br /&gt;
== ''' Code Changes ''' ==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==  ''' Test Plan ''' ==&lt;br /&gt;
=== Automated Testing Using RSpec ===&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
&lt;br /&gt;
== ''' Helpful Links ''' ==&lt;br /&gt;
#[https://github.com/LukeMccon/expertiza repo]&lt;br /&gt;
== ''' Identified Issues ''' ==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
== ''' Team Information ''' ==&lt;br /&gt;
#Luke McConnaughey (lcmcconn)&lt;br /&gt;
#Pedro Benitez (pbenite)&lt;br /&gt;
#Rohit Nair (rnair2)&lt;br /&gt;
#Surbhi Jha (sjha6)&lt;br /&gt;
&lt;br /&gt;
Mentor: Sanket Pai (sgpai2)&lt;br /&gt;
&amp;lt;br&amp;gt;Professor: Dr. Edward F. Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=136055</id>
		<title>CSC/ECE 517 Fall 2020 - E2080. Track the time students look at other submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=136055"/>
		<updated>2020-10-22T19:10:08Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: /*  Identified Issues  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' Introduction ''' ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. Tracking the time that a student spends on each submitted resources is meaningful to instructors to study and improve the teaching experience. Unfortunately, most peer assessment systems do not manage the content of students’ submission within the systems. They usually allow the authors submit external links to the submission (e.g. GitHub code / deployed application), which makes it difficult for the system to track the time that the reviewers spend on the submissions.&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
Expertiza allows students to peer review the work of other students in their course. To ensure the quality of the peer reviews, instructors would like to have the ability to track the time a student spends on a peer-review. These metrics need to be tracked and displayed in a way that the instructor  is able to gain valuable insight into the quality of a review or set of reviews.&lt;br /&gt;
&lt;br /&gt;
Various metrics will be tracked including&lt;br /&gt;
# The time spent on the primary review page&lt;br /&gt;
# The time spent on secondary/external links and downloadables&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
The most recent implementation, built from earlier designs features a solid UI and ample tracking of review time across the board. The main issue with this implementation is that it frequently carries out &amp;quot;expensive&amp;quot; operations on the database.&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1607 E1989]&lt;br /&gt;
== ''' Proposed Solution ''' ==&lt;br /&gt;
From the suggestions of the previous team, E1989, we plan to improve their implementation by reducing the frequency of database queries and insertions.&lt;br /&gt;
Secondly, we plan to add minor improvements to their UI. TBD&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
&lt;br /&gt;
== ''' Code Changes ''' ==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==  ''' Test Plan ''' ==&lt;br /&gt;
=== Automated Testing Using RSpec ===&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
&lt;br /&gt;
== ''' Helpful Links ''' ==&lt;br /&gt;
&lt;br /&gt;
== ''' Identified Issues ''' ==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
== ''' Team Information ''' ==&lt;br /&gt;
#Luke McConnaughey (lcmcconn)&lt;br /&gt;
#Pedro Benitez (pbenite)&lt;br /&gt;
#Rohit Nair (rnair2)&lt;br /&gt;
#Surbhi Jha (sjha6)&lt;br /&gt;
&lt;br /&gt;
Mentor: Sanket Pai (sgpai2)&lt;br /&gt;
&amp;lt;br&amp;gt;Professor: Dr. Edward F. Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=136054</id>
		<title>CSC/ECE 517 Fall 2020 - E2080. Track the time students look at other submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=136054"/>
		<updated>2020-10-22T19:10:00Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: /*  Code Changes  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' Introduction ''' ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. Tracking the time that a student spends on each submitted resources is meaningful to instructors to study and improve the teaching experience. Unfortunately, most peer assessment systems do not manage the content of students’ submission within the systems. They usually allow the authors submit external links to the submission (e.g. GitHub code / deployed application), which makes it difficult for the system to track the time that the reviewers spend on the submissions.&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
Expertiza allows students to peer review the work of other students in their course. To ensure the quality of the peer reviews, instructors would like to have the ability to track the time a student spends on a peer-review. These metrics need to be tracked and displayed in a way that the instructor  is able to gain valuable insight into the quality of a review or set of reviews.&lt;br /&gt;
&lt;br /&gt;
Various metrics will be tracked including&lt;br /&gt;
# The time spent on the primary review page&lt;br /&gt;
# The time spent on secondary/external links and downloadables&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
The most recent implementation, built from earlier designs features a solid UI and ample tracking of review time across the board. The main issue with this implementation is that it frequently carries out &amp;quot;expensive&amp;quot; operations on the database.&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1607 E1989]&lt;br /&gt;
== ''' Proposed Solution ''' ==&lt;br /&gt;
From the suggestions of the previous team, E1989, we plan to improve their implementation by reducing the frequency of database queries and insertions.&lt;br /&gt;
Secondly, we plan to add minor improvements to their UI. TBD&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
&lt;br /&gt;
== ''' Code Changes ''' ==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==  ''' Test Plan ''' ==&lt;br /&gt;
=== Automated Testing Using RSpec ===&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
&lt;br /&gt;
== ''' Helpful Links ''' ==&lt;br /&gt;
&lt;br /&gt;
== ''' Identified Issues ''' ==&lt;br /&gt;
&lt;br /&gt;
== ''' Team Information ''' ==&lt;br /&gt;
#Luke McConnaughey (lcmcconn)&lt;br /&gt;
#Pedro Benitez (pbenite)&lt;br /&gt;
#Rohit Nair (rnair2)&lt;br /&gt;
#Surbhi Jha (sjha6)&lt;br /&gt;
&lt;br /&gt;
Mentor: Sanket Pai (sgpai2)&lt;br /&gt;
&amp;lt;br&amp;gt;Professor: Dr. Edward F. Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=135978</id>
		<title>CSC/ECE 517 Fall 2020 - E2080. Track the time students look at other submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=135978"/>
		<updated>2020-10-22T04:23:31Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: /*  Algorithm For Precise Timing Accuracy  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' Introduction ''' ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. Tracking the time that a student spends on each submitted resources is meaningful to instructors to study and improve the teaching experience. Unfortunately, most peer assessment systems do not manage the content of students’ submission within the systems. They usually allow the authors submit external links to the submission (e.g. GitHub code / deployed application), which makes it difficult for the system to track the time that the reviewers spend on the submissions.&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
Expertiza allows students to peer review the work of other students in their course. To ensure the quality of the peer reviews, instructors would like to have the ability to track the time a student spends on a peer-review. These metrics need to be tracked and displayed in a way that the instructor  is able to gain valuable insight into the quality of a review or set of reviews.&lt;br /&gt;
&lt;br /&gt;
Various metrics will be tracked including&lt;br /&gt;
# The time spent on the primary review page&lt;br /&gt;
# The time spent on secondary/external links and downloadables&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
The most recent implementation, built from earlier designs features a solid UI and ample tracking of review time across the board. The main issue with this implementation is that it frequently carries out &amp;quot;expensive&amp;quot; operations on the database.&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1607 E1989]&lt;br /&gt;
== ''' Proposed Solution ''' ==&lt;br /&gt;
From the suggestions of the previous team, E1989, we plan to improve their implementation by reducing the frequency of database queries and insertions.&lt;br /&gt;
Secondly, we plan to add minor improvements to their UI. TBD&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
&lt;br /&gt;
== ''' Code Changes ''' ==&lt;br /&gt;
&lt;br /&gt;
==  ''' Test Plan ''' ==&lt;br /&gt;
=== Automated Testing Using RSpec ===&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
&lt;br /&gt;
== ''' Helpful Links ''' ==&lt;br /&gt;
&lt;br /&gt;
== ''' Identified Issues ''' ==&lt;br /&gt;
&lt;br /&gt;
== ''' Team Information ''' ==&lt;br /&gt;
#Luke McConnaughey (lcmcconn)&lt;br /&gt;
#Pedro Benitez (pbenite)&lt;br /&gt;
#Rohit Nair (rnair2)&lt;br /&gt;
#Surbhi Jha (sjha6)&lt;br /&gt;
&lt;br /&gt;
Mentor: Sanket Pai (sgpai2)&lt;br /&gt;
&amp;lt;br&amp;gt;Professor: Dr. Edward F. Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=135977</id>
		<title>CSC/ECE 517 Fall 2020 - E2080. Track the time students look at other submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=135977"/>
		<updated>2020-10-22T04:23:04Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: /*  Team Information  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' Introduction ''' ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. Tracking the time that a student spends on each submitted resources is meaningful to instructors to study and improve the teaching experience. Unfortunately, most peer assessment systems do not manage the content of students’ submission within the systems. They usually allow the authors submit external links to the submission (e.g. GitHub code / deployed application), which makes it difficult for the system to track the time that the reviewers spend on the submissions.&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
Expertiza allows students to peer review the work of other students in their course. To ensure the quality of the peer reviews, instructors would like to have the ability to track the time a student spends on a peer-review. These metrics need to be tracked and displayed in a way that the instructor  is able to gain valuable insight into the quality of a review or set of reviews.&lt;br /&gt;
&lt;br /&gt;
Various metrics will be tracked including&lt;br /&gt;
# The time spent on the primary review page&lt;br /&gt;
# The time spent on secondary/external links and downloadables&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
The most recent implementation, built from earlier designs features a solid UI and ample tracking of review time across the board. The main issue with this implementation is that it frequently carries out &amp;quot;expensive&amp;quot; operations on the database.&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1607 E1989]&lt;br /&gt;
== ''' Proposed Solution ''' ==&lt;br /&gt;
From the suggestions of the previous team, E1989, we plan to improve their implementation by reducing the frequency of database queries and insertions.&lt;br /&gt;
Secondly, we plan to add minor improvements to their UI. TBD&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
&lt;br /&gt;
== ''' Code Changes ''' ==&lt;br /&gt;
&lt;br /&gt;
=== ''' Algorithm For Precise Timing Accuracy ''' ===&lt;br /&gt;
&lt;br /&gt;
==  ''' Test Plan ''' ==&lt;br /&gt;
=== Automated Testing Using RSpec ===&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
&lt;br /&gt;
== ''' Helpful Links ''' ==&lt;br /&gt;
&lt;br /&gt;
== ''' Identified Issues ''' ==&lt;br /&gt;
&lt;br /&gt;
== ''' Team Information ''' ==&lt;br /&gt;
#Luke McConnaughey (lcmcconn)&lt;br /&gt;
#Pedro Benitez (pbenite)&lt;br /&gt;
#Rohit Nair (rnair2)&lt;br /&gt;
#Surbhi Jha (sjha6)&lt;br /&gt;
&lt;br /&gt;
Mentor: Sanket Pai (sgpai2)&lt;br /&gt;
&amp;lt;br&amp;gt;Professor: Dr. Edward F. Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=135976</id>
		<title>CSC/ECE 517 Fall 2020 - E2080. Track the time students look at other submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=135976"/>
		<updated>2020-10-22T04:22:52Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: /*  Team Information  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' Introduction ''' ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. Tracking the time that a student spends on each submitted resources is meaningful to instructors to study and improve the teaching experience. Unfortunately, most peer assessment systems do not manage the content of students’ submission within the systems. They usually allow the authors submit external links to the submission (e.g. GitHub code / deployed application), which makes it difficult for the system to track the time that the reviewers spend on the submissions.&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
Expertiza allows students to peer review the work of other students in their course. To ensure the quality of the peer reviews, instructors would like to have the ability to track the time a student spends on a peer-review. These metrics need to be tracked and displayed in a way that the instructor  is able to gain valuable insight into the quality of a review or set of reviews.&lt;br /&gt;
&lt;br /&gt;
Various metrics will be tracked including&lt;br /&gt;
# The time spent on the primary review page&lt;br /&gt;
# The time spent on secondary/external links and downloadables&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
The most recent implementation, built from earlier designs features a solid UI and ample tracking of review time across the board. The main issue with this implementation is that it frequently carries out &amp;quot;expensive&amp;quot; operations on the database.&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1607 E1989]&lt;br /&gt;
== ''' Proposed Solution ''' ==&lt;br /&gt;
From the suggestions of the previous team, E1989, we plan to improve their implementation by reducing the frequency of database queries and insertions.&lt;br /&gt;
Secondly, we plan to add minor improvements to their UI. TBD&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
&lt;br /&gt;
== ''' Code Changes ''' ==&lt;br /&gt;
&lt;br /&gt;
=== ''' Algorithm For Precise Timing Accuracy ''' ===&lt;br /&gt;
&lt;br /&gt;
==  ''' Test Plan ''' ==&lt;br /&gt;
=== Automated Testing Using RSpec ===&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
&lt;br /&gt;
== ''' Helpful Links ''' ==&lt;br /&gt;
&lt;br /&gt;
== ''' Identified Issues ''' ==&lt;br /&gt;
&lt;br /&gt;
== ''' Team Information ''' ==&lt;br /&gt;
#Luke McConnaughey (lcmcconn)&lt;br /&gt;
#Pedro Benitez (pbenite)&lt;br /&gt;
#Rohit Nair (rnair2)&lt;br /&gt;
#Surbhi Jha(sjha6)&lt;br /&gt;
&lt;br /&gt;
Mentor: Sanket Pai (sgpai2)&lt;br /&gt;
&amp;lt;br&amp;gt;Professor: Dr. Edward F. Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=135975</id>
		<title>CSC/ECE 517 Fall 2020 - E2080. Track the time students look at other submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=135975"/>
		<updated>2020-10-22T04:22:08Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' Introduction ''' ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. Tracking the time that a student spends on each submitted resources is meaningful to instructors to study and improve the teaching experience. Unfortunately, most peer assessment systems do not manage the content of students’ submission within the systems. They usually allow the authors submit external links to the submission (e.g. GitHub code / deployed application), which makes it difficult for the system to track the time that the reviewers spend on the submissions.&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
Expertiza allows students to peer review the work of other students in their course. To ensure the quality of the peer reviews, instructors would like to have the ability to track the time a student spends on a peer-review. These metrics need to be tracked and displayed in a way that the instructor  is able to gain valuable insight into the quality of a review or set of reviews.&lt;br /&gt;
&lt;br /&gt;
Various metrics will be tracked including&lt;br /&gt;
# The time spent on the primary review page&lt;br /&gt;
# The time spent on secondary/external links and downloadables&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
The most recent implementation, built from earlier designs features a solid UI and ample tracking of review time across the board. The main issue with this implementation is that it frequently carries out &amp;quot;expensive&amp;quot; operations on the database.&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1607 E1989]&lt;br /&gt;
== ''' Proposed Solution ''' ==&lt;br /&gt;
From the suggestions of the previous team, E1989, we plan to improve their implementation by reducing the frequency of database queries and insertions.&lt;br /&gt;
Secondly, we plan to add minor improvements to their UI. TBD&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
&lt;br /&gt;
== ''' Code Changes ''' ==&lt;br /&gt;
&lt;br /&gt;
=== ''' Algorithm For Precise Timing Accuracy ''' ===&lt;br /&gt;
&lt;br /&gt;
==  ''' Test Plan ''' ==&lt;br /&gt;
=== Automated Testing Using RSpec ===&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
&lt;br /&gt;
== ''' Helpful Links ''' ==&lt;br /&gt;
&lt;br /&gt;
== ''' Identified Issues ''' ==&lt;br /&gt;
&lt;br /&gt;
== ''' Team Information ''' ==&lt;br /&gt;
#Luke McConnaughey (lcmcconn)&lt;br /&gt;
#Pedro Benitez (pbenite)&lt;br /&gt;
#RohitNair (rnair2)&lt;br /&gt;
#Surbhi Jha(sjha6)&lt;br /&gt;
&lt;br /&gt;
Mentor: Sanket Pai (sgpai2)&lt;br /&gt;
&amp;lt;br&amp;gt;Professor: Dr. Edward F. Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=135972</id>
		<title>CSC/ECE 517 Fall 2020 - E2080. Track the time students look at other submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=135972"/>
		<updated>2020-10-22T03:48:30Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' Introduction ''' ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. Tracking the time that a student spends on each submitted resources is meaningful to instructors to study and improve the teaching experience. Unfortunately, most peer assessment systems do not manage the content of students’ submission within the systems. They usually allow the authors submit external links to the submission (e.g. GitHub code / deployed application), which makes it difficult for the system to track the time that the reviewers spend on the submissions.&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
&lt;br /&gt;
== ''' Proposed Solution ''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design pattern ===&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
&lt;br /&gt;
== ''' Code Changes ''' ==&lt;br /&gt;
&lt;br /&gt;
=== ''' Algorithm For Precise Timing Accuracy ''' ===&lt;br /&gt;
&lt;br /&gt;
==  ''' Test Plan ''' ==&lt;br /&gt;
=== Automated Testing Using RSpec ===&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
&lt;br /&gt;
== ''' Our Work ''' ==&lt;br /&gt;
&lt;br /&gt;
== ''' Issues found and fixes ''' ==&lt;br /&gt;
&lt;br /&gt;
== ''' Team Information ''' ==&lt;br /&gt;
#Luke McConnaughey (lcmcconn)&lt;br /&gt;
#Pedro Benitez (pbenite)&lt;br /&gt;
#RohitNair (rnair2)&lt;br /&gt;
#Surbhi Jha(sjha6)&lt;br /&gt;
&lt;br /&gt;
Mentor: Sanket Pai (sgpai2)&lt;br /&gt;
&amp;lt;br&amp;gt;Professor: Dr. Edward F. Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=135971</id>
		<title>CSC/ECE 517 Fall 2020 - E2080. Track the time students look at other submissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2080._Track_the_time_students_look_at_other_submissions&amp;diff=135971"/>
		<updated>2020-10-22T03:39:01Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: Created page with &amp;quot;Intial edit&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Intial edit&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2055_write_unit_tests_for_student_task.rb&amp;diff=135768</id>
		<title>CSC/ECE 517 Fall 2020 - E2055 write unit tests for student task.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2055_write_unit_tests_for_student_task.rb&amp;diff=135768"/>
		<updated>2020-10-20T05:29:40Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project based on [https://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;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About RSpec ==&lt;br /&gt;
&lt;br /&gt;
RSpec is a unit test framework for the Ruby programming language. RSpec is different than traditional xUnit frameworks like JUnit because RSpec is a Behavior driven development tool. What this means is that, tests written in RSpec focus on the &amp;quot;behavior&amp;quot; of an application being tested. RSpec does not put emphasis on, how the application works but instead on how it behaves, in other words, what the application actually does.Each RSpec file contains one or more tests. Each test ensures if a particular feature of our website is working properly.The output of an RSpec run will tell you exactly what features aren't working. The benefit is that tested code is unlikely to break unnoticed.The tests are run every time someone makes, or updates, a [https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests Pull Request].&lt;br /&gt;
&lt;br /&gt;
== DB Schema ==&lt;br /&gt;
Below are the tables that are related ti student task functionality&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/images/7/7a/ExpertizaDbSchema.jpg DB Schema]&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The following is an Expertiza based OSS project which deals primarily with the student_task.rb and student_task_spec.rb. It focuses on writing RSpec unit tests for the code affected or added. The goal of this project is to attempt to add sufficient unit tests to this part of the application and increase its path coverage to above 90 percent.&lt;br /&gt;
The following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
* Complete the insufficient unit tests for student_task.rb. &lt;br /&gt;
* Increase path coverage from only 31.91% with 30 lines covered to above 90% coverage&lt;br /&gt;
* Cover edge cases.&lt;br /&gt;
* High branch coverage to be achieved.&lt;br /&gt;
&lt;br /&gt;
There are different tasks that a student can perform. &lt;br /&gt;
* They can see all the assignments that they have been assigned to.&lt;br /&gt;
* They can see details of each assignment like marks, their team, send invitation to student to join a team&lt;br /&gt;
* Review other students' work&lt;br /&gt;
&lt;br /&gt;
== Tests Plan ==&lt;br /&gt;
*Mock Objects to test: Create a series of mock objects that will be used throughout the testing process&lt;br /&gt;
*The following are a list of the functions that were tested:&lt;br /&gt;
*Topic name&lt;br /&gt;
**Retrieves the topic name of an assignment&lt;br /&gt;
*Complete?&lt;br /&gt;
**Checks if a student task is complete&lt;br /&gt;
*Incomplete?&lt;br /&gt;
**If the assignment is not complete return true&lt;br /&gt;
*Not started?&lt;br /&gt;
**Checks if a student task is available to be worked on (i.e in submission/review/metareview stage) and if so has it been started&lt;br /&gt;
*Revision?&lt;br /&gt;
**Checks if a student task is now in the revision stage&lt;br /&gt;
*Met reviews given&lt;br /&gt;
*Teamed students&lt;br /&gt;
**Returns a list of students that an individual has teamed up with&lt;br /&gt;
*Get due date&lt;br /&gt;
**Gets the due date for each assignment assigned to a student&lt;br /&gt;
*Get peer review data&lt;br /&gt;
*Get author feedback&lt;br /&gt;
*Get submission data&lt;br /&gt;
*Get timeline data&lt;br /&gt;
&lt;br /&gt;
== Implementation == &lt;br /&gt;
The following are our written tests in the order listed above:&lt;br /&gt;
&lt;br /&gt;
Details regarding what the test is testing can be seen as comments above each example block&lt;br /&gt;
&lt;br /&gt;
'''Here were are creating all of the mock objects to test the functionality of the student_task model. We are using these from the previous implementation&lt;br /&gt;
''' describe StudentTask do&lt;br /&gt;
  let(:participant) { build(:participant, id: 1, user_id: user.id, parent_id: assignment.id) }&lt;br /&gt;
  let(:participant2) { build(:participant, id: 2, user_id: user2.id, parent_id: assignment.id) }&lt;br /&gt;
  let(:participant3) { build(:participant, id: 3, user_id: user3.id, parent_id: assignment2.id) }&lt;br /&gt;
  let(:user) { create(:student) }&lt;br /&gt;
  let(:user2) { create(:student, name: &amp;quot;qwertyui&amp;quot;, id: 5) }&lt;br /&gt;
  let(:user3) { create(:student, name: &amp;quot;qwertyui1234&amp;quot;, id: 6) }&lt;br /&gt;
  let(:course) { build(:course) }&lt;br /&gt;
  let(:assignment) { build(:assignment, name: 'assignment 1') }&lt;br /&gt;
  let(:assignment2) { create(:assignment, name: 'assignment 2', is_calibrated: true) }&lt;br /&gt;
  let(:team) { create(:assignment_team, id: 1, name: 'team 1', parent_id: assignment.id, users: [user, user2]) }&lt;br /&gt;
  let(:team2) { create(:assignment_team, id: 2, name: 'team 2', parent_id: assignment2.id, users: [user3]) }&lt;br /&gt;
  let(:team_user) { create(:team_user, id: 3, team_id: team.id, user_id: user.id) }&lt;br /&gt;
  let(:team_user2) { create(:team_user, id: 4, team_id: team.id, user_id: user2.id) }&lt;br /&gt;
  let(:team2_user3) { create(:team_user, id: 5, team_id: team2.id, user_id: user3.id) }&lt;br /&gt;
  let(:course_team) { create(:course_team, id: 3, name: 'course team 1', parent_id: course.id) }&lt;br /&gt;
  let(:cource_team_user) { create(:team_user, id: 6, team_id: course_team.id, user_id: user.id) }&lt;br /&gt;
  let(:cource_team_user2) { create(:team_user, id: 7, team_id: course_team.id, user_id: user2.id) }&lt;br /&gt;
  let(:topic) { build(:topic) }&lt;br /&gt;
  let(:topic2) { create(:topic, topic_name: &amp;quot;TestReview&amp;quot;) }&lt;br /&gt;
  let(:topic3) { create(:topic) }&lt;br /&gt;
  let(:due_date) { build(:assignment_due_date, deadline_type_id: 1) }&lt;br /&gt;
  let(:deadline_type) { build(:deadline_type, id: 1) }&lt;br /&gt;
  let(:review_response_map) { build(:review_response_map, assignment: assignment, reviewer: participant, reviewee: team2) }&lt;br /&gt;
  let(:metareview_response_map) { build(:meta_review_response_map, reviewed_object_id: 1) }&lt;br /&gt;
  let(:response) { build(:response, id: 1, map_id: 1, response_map: review_response_map) }&lt;br /&gt;
  let(:response2) { build(:response, id: 2, map_id: 1, response_map: review_response_map) }&lt;br /&gt;
  let(:submission_record) {build(:submission_record, id:1, team_id: 1, assignment_id: 1) }&lt;br /&gt;
  let(:student_task) do&lt;br /&gt;
    StudentTask.new(&lt;br /&gt;
      user: user,&lt;br /&gt;
      participant: participant,&lt;br /&gt;
      assignment: assignment,&lt;br /&gt;
      topic: topic3,&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
  let(:student_task2) do&lt;br /&gt;
    StudentTask.new(&lt;br /&gt;
      user: user,&lt;br /&gt;
      participant: participant2,&lt;br /&gt;
      assignment: assignment,&lt;br /&gt;
      topic: topic2,&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
''' Here we just verify that topic name is stored and that any values for topic name that are falsey will be set to &amp;quot;-&amp;quot;'''&lt;br /&gt;
  # Tests topic name to ensure it is stored or set as &amp;quot;-&amp;quot;&lt;br /&gt;
  describe &amp;quot;#topic_name&amp;quot; do&lt;br /&gt;
    it 'returns the topic name if given one' do&lt;br /&gt;
      allow(student_task2).to receive(:topic).and_return(topic2)&lt;br /&gt;
      expect(student_task2.topic_name).to eq(&amp;quot;TestReview&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns - for blank name' do&lt;br /&gt;
      expect(student_task.topic_name).to eq(&amp;quot;-&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
'''Here we are testing the different values that the student tasks status can take on'''&lt;br /&gt;
  # Verifies completion status of a student task&lt;br /&gt;
  describe &amp;quot;#complete?&amp;quot; do&lt;br /&gt;
    it 'verifies a student task is complete' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return('Complete')&lt;br /&gt;
      expect(student_task.complete?).to be true&lt;br /&gt;
    end&lt;br /&gt;
    it 'verifies a nil stage_deadline to not be complete' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return('')&lt;br /&gt;
      expect(student_task.complete?).to be false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
'''Here we are making sure the content has been submitted during the current stage of the process, only occurss when current_stage is equal to &amp;quot;submission&amp;quot;'''&lt;br /&gt;
  # tests if hyperlinks or other content is submitted during the submission stage&lt;br /&gt;
  # current stage must be submission&lt;br /&gt;
  # participant has to belong to a team&lt;br /&gt;
  # the team has submitted some content&lt;br /&gt;
  describe &amp;quot;content_submitted_in_current_stage?&amp;quot; do&lt;br /&gt;
    it 'checks if hyperlinks is submitted during submission stage'do&lt;br /&gt;
       student_task.current_stage = &amp;quot;submission&amp;quot;&lt;br /&gt;
       allow(student_task).to receive_message_chain(:hyperlinks, :present).and_return(true)&lt;br /&gt;
       expect(student_task.content_submitted_in_current_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
'''Hyperlinks is modified based on the teams that a user is in. This will be updated if they are in a team or they already have hyperlinks it will remain the same'''&lt;br /&gt;
  # Tests the updating of the @hyperlinks instance variable based on participant's team&lt;br /&gt;
  # Does not verify operation of ||= call, only tests cases of right hand side&lt;br /&gt;
  describe &amp;quot;#hyperlinks&amp;quot; do&lt;br /&gt;
    it 'returns empty array if participant has no team' do&lt;br /&gt;
      allow(student_task).to receive_message_chain(:participant, :team, :nil?).and_return(true)&lt;br /&gt;
      expect(student_task.hyperlinks).to eq([])&lt;br /&gt;
    end&lt;br /&gt;
    it 'assigns returns populated hyperlinks instance if participant has team' do&lt;br /&gt;
      allow(student_task).to receive_message_chain(:participant, :team, :hyperlinks).and_return(['something'])&lt;br /&gt;
      allow(student_task).to receive_message_chain(:participant, :team, :nil?).and_return(false)&lt;br /&gt;
      expect(student_task.hyperlinks).to eq(['something'])&lt;br /&gt;
    end 	&lt;br /&gt;
  end&lt;br /&gt;
'''Simply testing to see if the incomplete status is checked correctly'''&lt;br /&gt;
  # Verifies incomplete status of student task&lt;br /&gt;
  describe &amp;quot;#incomplete?&amp;quot; do&lt;br /&gt;
    it 'checks a student_task is incomplete' do&lt;br /&gt;
      expect(student_task.incomplete?).to be true&lt;br /&gt;
    end 	&lt;br /&gt;
  end&lt;br /&gt;
'''Verify the stage of a task and that a started task is evaluated correctly'''&lt;br /&gt;
  # Verifies that a task has not started&lt;br /&gt;
  describe &amp;quot;#not_started?&amp;quot; do&lt;br /&gt;
    it 'verfies started status' do&lt;br /&gt;
      allow(student_task).to receive(:in_work_stage?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:started?).and_return(true)&lt;br /&gt;
      expect(student_task.not_started?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
    it 'is not started due to work stage' do&lt;br /&gt;
      allow(student_task).to receive(:in_work_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:started?).and_return(true)&lt;br /&gt;
      expect(student_task.not_started?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests relative_deadline for proper assignment when stage_deadline is present&lt;br /&gt;
  describe &amp;quot;#relative_deadline&amp;quot; do&lt;br /&gt;
    it 'returns false without a valid stage deadline' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return(nil)&lt;br /&gt;
      expect(student_task.relative_deadline).to be_falsey&lt;br /&gt;
    end&lt;br /&gt;
    it 'verifies a valid case where stage_deadline is present' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:time_ago_in_words).and_return(&amp;quot;astring&amp;quot;)&lt;br /&gt;
      expect(student_task.relative_deadline).to eq(&amp;quot;astring&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Examines a task to determine if the task is a revision&lt;br /&gt;
  describe &amp;quot;#revision?&amp;quot; do&lt;br /&gt;
    it 'returns true if content is submitted' do&lt;br /&gt;
      allow(student_task).to receive(:content_submitted_in_current_stage?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:reviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      expect(student_task.revision?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns true if reviews given is true' do&lt;br /&gt;
      allow(student_task).to receive(:content_submitted_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:reviews_given_in_current_stage?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      expect(student_task.revision?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns true if metareviews given is true' do&lt;br /&gt;
      allow(student_task).to receive(:content_submitted_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:reviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given_in_current_stage?).and_return(true)&lt;br /&gt;
      expect(student_task.revision?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Checks if metareview was given in current task stage&lt;br /&gt;
  describe &amp;quot;#metreviews_given_in_current_stage?&amp;quot; do&lt;br /&gt;
    it 'return true' do&lt;br /&gt;
      student_task.current_stage = &amp;quot;metareview&amp;quot;&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given?).and_return(true)&lt;br /&gt;
      expect(student_task.metareviews_given_in_current_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # Checks if review was given in current task stage&lt;br /&gt;
  describe &amp;quot;#reviews_given_in_current_stage?&amp;quot; do&lt;br /&gt;
    it 'return true' do&lt;br /&gt;
      student_task.current_stage = &amp;quot;review&amp;quot;&lt;br /&gt;
      allow(student_task).to receive(:reviews_given?).and_return(true)&lt;br /&gt;
      expect(student_task.reviews_given_in_current_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # tests whether a student task has been started&lt;br /&gt;
  # if the task is not incomplete &amp;amp;&amp;amp; is not in the revision stage&lt;br /&gt;
  # started? returns false&lt;br /&gt;
  # if the task is incomplete &amp;amp;&amp;amp; is in the revision stage&lt;br /&gt;
  # started? returns true&lt;br /&gt;
  describe &amp;quot;#started?&amp;quot; do&lt;br /&gt;
    it 'is not started' do&lt;br /&gt;
      allow(student_task).to receive(:incomplete?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:revision?).and_return(false)&lt;br /&gt;
      expect(student_task.started?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
    it 'is started' do&lt;br /&gt;
      allow(student_task).to receive(:incomplete?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:revision?).and_return(true)&lt;br /&gt;
      expect(student_task.started?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests works stage to ensure state is represented correctly&lt;br /&gt;
  describe &amp;quot;#in_work_stage?&amp;quot; do&lt;br /&gt;
    it &amp;quot;is true, submission is a work stage&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;submission&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;is true, review is a work stage&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;is true, metareview is a work stage&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;metareview&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;is false, empty object&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
'''The following test returns a list of students that the user has teamed with up to this point. Returns an empty list if they have yet to team with anyone'''&lt;br /&gt;
  # Tests teamed students method which returns the unique students that are paired with the student at some point&lt;br /&gt;
  # within their course&lt;br /&gt;
  describe &amp;quot;#teamed_students&amp;quot; do&lt;br /&gt;
    context 'when not in any team' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        expect(StudentTask.teamed_students(user3)).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when assigned in a cource_team ' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        allow(user).to receive(:teams).and_return([course_team])&lt;br /&gt;
        expect(StudentTask.teamed_students(user)).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when assigned in a assignment_team ' do&lt;br /&gt;
      it 'returns the students they are teamed with' do&lt;br /&gt;
        allow(user).to receive(:teams).and_return([team])&lt;br /&gt;
        allow(AssignmentParticipant).to receive(:find_by).with(user_id: 1, parent_id: assignment.id).and_return(participant)&lt;br /&gt;
        allow(AssignmentParticipant).to receive(:find_by).with(user_id: 5, parent_id: assignment.id).and_return(participant2)&lt;br /&gt;
        allow(Assignment).to receive(:find_by).with(id: team.parent_id).and_return(assignment)&lt;br /&gt;
        expect(StudentTask.teamed_students(user)).to eq({assignment.course_id =&amp;gt; [user2.fullname]})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the due dates of an assigment&lt;br /&gt;
  describe &amp;quot;#get_due_date_data&amp;quot; do&lt;br /&gt;
    context 'when called with assignment having empty due dates' do&lt;br /&gt;
      it &amp;quot;return empty time_list array&amp;quot; do&lt;br /&gt;
        timeline_list = []&lt;br /&gt;
        StudentTask.get_due_date_data(assignment, timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  context 'when called with assignment having due date' do&lt;br /&gt;
    context 'and due_at value nil' do&lt;br /&gt;
      it &amp;quot;return empty time_list array&amp;quot; do&lt;br /&gt;
        allow(due_date).to receive(:deadline_type).and_return(deadline_type)&lt;br /&gt;
        timeline_list = []&lt;br /&gt;
        due_date.due_at=nil;&lt;br /&gt;
        assignment.due_dates = [due_date]&lt;br /&gt;
        StudentTask.get_due_date_data(assignment, timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'and due_at value not nil' do&lt;br /&gt;
      it &amp;quot;return time_list array&amp;quot; do&lt;br /&gt;
        allow(due_date).to receive(:deadline_type).and_return(deadline_type)&lt;br /&gt;
        timeline_list = []&lt;br /&gt;
        assignment.due_dates = [due_date]&lt;br /&gt;
        StudentTask.get_due_date_data(assignment, timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([{&lt;br /&gt;
                                          :label=&amp;gt;(due_date.deadline_type.name + ' Deadline').humanize,&lt;br /&gt;
                                          :updated_at=&amp;gt;due_date.due_at.strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
                                      }])&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
'''Here we fetch different timelines and account for edge cases where there are no reviews'''&lt;br /&gt;
  # Verifies fetching of peer review data of a user and a timeline&lt;br /&gt;
  describe &amp;quot;#get_peer_review_data&amp;quot; do&lt;br /&gt;
    context 'when no review response mapped' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        StudentTask.get_peer_review_data(user2,timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when mapped to review response map' do&lt;br /&gt;
      it 'returns timeline array' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(ReviewResponseMap).to receive_message_chain(:where, :find_each).with(reviewer_id: 1).with(no_args).and_yield(review_response_map)&lt;br /&gt;
        allow(review_response_map).to receive(:id).and_return(1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:where, :last).with(map_id: 1).with(no_args).and_return(response)&lt;br /&gt;
        allow(response).to receive(:round).and_return(1)&lt;br /&gt;
        allow(response).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_peer_review_data(1,timeline_list)).to eq([{:id=&amp;gt;1, :label=&amp;gt;&amp;quot;Round 1 peer review&amp;quot;, :updated_at=&amp;gt;timevalue}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies retrieval of feedback from author&lt;br /&gt;
  describe &amp;quot;#get_author_feedback_data&amp;quot; do&lt;br /&gt;
    context 'when no feedback response mapped' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        StudentTask.get_author_feedback_data(user2,timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when mapped to feedback response map' do&lt;br /&gt;
      it 'returns timeline array' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(FeedbackResponseMap).to receive_message_chain(:where, :find_each).with(reviewer_id: 1).with(no_args).and_yield(review_response_map)&lt;br /&gt;
        allow(review_response_map).to receive(:id).and_return(1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:where, :last).with(map_id: 1).with(no_args).and_return(response)&lt;br /&gt;
        allow(response).to receive(:updated_at).and_return(Time.now)&lt;br /&gt;
        timevalue = Time.now.strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_author_feedback_data(1,timeline_list)).to eq([{:id=&amp;gt;1, :label=&amp;gt;&amp;quot;Author feedback&amp;quot;, :updated_at=&amp;gt;timevalue}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
'''Here we verify different states of submission data and hyperlinks'''&lt;br /&gt;
  # Verrifies retrieval of submission data from submission&lt;br /&gt;
  describe '#get_submission_data' do&lt;br /&gt;
    context 'when no submission data mapped' do&lt;br /&gt;
      it 'returns nil' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq(nil)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when submission data mapped and not submit hyperlink or Remove hyperlink' do&lt;br /&gt;
      it 'returns timeline_list' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(SubmissionRecord).to receive_message_chain(:where, :find_each).with(team_id: 1, assignment_id: 1).with(no_args).and_yield(submission_record)&lt;br /&gt;
        allow(submission_record).to receive(:operation).and_return('testing_label')&lt;br /&gt;
        allow(submission_record).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq([{:label=&amp;gt;&amp;quot;Testing label&amp;quot;, :updated_at=&amp;gt;timevalue}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when submission data mapped and operation is submit_hyperlink' do&lt;br /&gt;
      it 'returns timeline_list with link' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(SubmissionRecord).to receive_message_chain(:where, :find_each).with(team_id: 1, assignment_id: 1).with(no_args).and_yield(submission_record)&lt;br /&gt;
        allow(submission_record).to receive(:operation).and_return('Submit Hyperlink')&lt;br /&gt;
        allow(submission_record).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq([{:label=&amp;gt;&amp;quot;Submit hyperlink&amp;quot;, :updated_at=&amp;gt;timevalue, :link=&amp;gt;&amp;quot;www.wolfware.edu&amp;quot;}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when submission data mapped and operation is Remove Hyperlink' do&lt;br /&gt;
      it 'returns timeline_list with link' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(SubmissionRecord).to receive_message_chain(:where, :find_each).with(team_id: 1, assignment_id: 1).with(no_args).and_yield(submission_record)&lt;br /&gt;
        allow(submission_record).to receive(:operation).and_return('Remove Hyperlink')&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        allow(submission_record).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq([{:label=&amp;gt;&amp;quot;Remove hyperlink&amp;quot;, :updated_at=&amp;gt;timevalue, :link=&amp;gt;&amp;quot;www.wolfware.edu&amp;quot;}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
''' Here we are ensuring that the timeline data is empty when data has not been mapped'''&lt;br /&gt;
  # Verifies retrieval of timeline data&lt;br /&gt;
  describe '#get_timeline_data' do&lt;br /&gt;
    context 'when no timeline data mapped' do&lt;br /&gt;
      it 'returns nil' do&lt;br /&gt;
        allow(participant).to receive(:get_reviewer).and_return(participant)&lt;br /&gt;
        expect(StudentTask.get_timeline_data(assignment, participant, team)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end                                                                                                                                   end&lt;br /&gt;
&lt;br /&gt;
== Line Coverage achieved ==&lt;br /&gt;
*94 relevant lines&lt;br /&gt;
*86 lines covered&lt;br /&gt;
*8 lines missed&lt;br /&gt;
*Coverage = 91.49%&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
Some of the tests were rather shallow, get_timeline_data specifically needs depth added.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://youtu.be/N6H1HtQ4eds/ YouTube Video Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/johnbumgardner/expertiza/ GitHub Repo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1811/ Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Team Members == &lt;br /&gt;
John Bumgardner, Pedro Benitez, Luke McConnaughey&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2055_write_unit_tests_for_student_task.rb&amp;diff=135766</id>
		<title>CSC/ECE 517 Fall 2020 - E2055 write unit tests for student task.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2055_write_unit_tests_for_student_task.rb&amp;diff=135766"/>
		<updated>2020-10-20T05:26:49Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project based on [https://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;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About RSpec ==&lt;br /&gt;
&lt;br /&gt;
RSpec is a unit test framework for the Ruby programming language. RSpec is different than traditional xUnit frameworks like JUnit because RSpec is a Behavior driven development tool. What this means is that, tests written in RSpec focus on the &amp;quot;behavior&amp;quot; of an application being tested. RSpec does not put emphasis on, how the application works but instead on how it behaves, in other words, what the application actually does.Each RSpec file contains one or more tests. Each test ensures if a particular feature of our website is working properly.The output of an RSpec run will tell you exactly what features aren't working. The benefit is that tested code is unlikely to break unnoticed.The tests are run every time someone makes, or updates, a [https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests Pull Request].&lt;br /&gt;
&lt;br /&gt;
== DB Schema ==&lt;br /&gt;
Below are the tables that are related ti student task functionality&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/images/7/7a/ExpertizaDbSchema.jpg DB Schema]&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The following is an Expertiza based OSS project which deals primarily with the student_task.rb and student_task_spec.rb. It focuses on writing RSpec unit tests for the code affected or added. The goal of this project is to attempt to add sufficient unit tests to this part of the application and increase its path coverage to above 90 percent.&lt;br /&gt;
The following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
* Complete the insufficient unit tests for student_task.rb. &lt;br /&gt;
* Increase path coverage from only 31.91% with 30 lines covered to above 90% coverage&lt;br /&gt;
* Cover edge cases.&lt;br /&gt;
* High branch coverage to be achieved.&lt;br /&gt;
&lt;br /&gt;
There are different tasks that a student can perform. &lt;br /&gt;
* They can see all the assignments that they have been assigned to.&lt;br /&gt;
* They can see details of each assignment like marks, their team, send invitation to student to join a team&lt;br /&gt;
* Review other students' work&lt;br /&gt;
&lt;br /&gt;
== Tests Plan ==&lt;br /&gt;
*Mock Objects to test: Create a series of mock objects that will be used throughout the testing process&lt;br /&gt;
*The following are a list of the functions that were tested:&lt;br /&gt;
*Topic name&lt;br /&gt;
**Retrieves the topic name of an assignment&lt;br /&gt;
*Complete?&lt;br /&gt;
**Checks if a student task is complete&lt;br /&gt;
*Incomplete?&lt;br /&gt;
**If the assignment is not complete return true&lt;br /&gt;
*Not started?&lt;br /&gt;
**Checks if a student task is available to be worked on (i.e in submission/review/metareview stage) and if so has it been started&lt;br /&gt;
*Revision?&lt;br /&gt;
**Checks if a student task is now in the revision stage&lt;br /&gt;
*Met reviews given&lt;br /&gt;
*Teamed students&lt;br /&gt;
**Returns a list of students that an individual has teamed up with&lt;br /&gt;
*Get due date&lt;br /&gt;
**Gets the due date for each assignment assigned to a student&lt;br /&gt;
*Get peer review data&lt;br /&gt;
*Get author feedback&lt;br /&gt;
*Get submission data&lt;br /&gt;
*Get timeline data&lt;br /&gt;
&lt;br /&gt;
== Implementation == &lt;br /&gt;
The following are our written tests in the order listed above:&lt;br /&gt;
&lt;br /&gt;
Details regarding what the test is testing can be seen as comments above each example block&lt;br /&gt;
&lt;br /&gt;
'''Here were are creating all of the mock objects to test the functionality of the student_task model. We are using these from the previous implementation&lt;br /&gt;
''' describe StudentTask do&lt;br /&gt;
  let(:participant) { build(:participant, id: 1, user_id: user.id, parent_id: assignment.id) }&lt;br /&gt;
  let(:participant2) { build(:participant, id: 2, user_id: user2.id, parent_id: assignment.id) }&lt;br /&gt;
  let(:participant3) { build(:participant, id: 3, user_id: user3.id, parent_id: assignment2.id) }&lt;br /&gt;
  let(:user) { create(:student) }&lt;br /&gt;
  let(:user2) { create(:student, name: &amp;quot;qwertyui&amp;quot;, id: 5) }&lt;br /&gt;
  let(:user3) { create(:student, name: &amp;quot;qwertyui1234&amp;quot;, id: 6) }&lt;br /&gt;
  let(:course) { build(:course) }&lt;br /&gt;
  let(:assignment) { build(:assignment, name: 'assignment 1') }&lt;br /&gt;
  let(:assignment2) { create(:assignment, name: 'assignment 2', is_calibrated: true) }&lt;br /&gt;
  let(:team) { create(:assignment_team, id: 1, name: 'team 1', parent_id: assignment.id, users: [user, user2]) }&lt;br /&gt;
  let(:team2) { create(:assignment_team, id: 2, name: 'team 2', parent_id: assignment2.id, users: [user3]) }&lt;br /&gt;
  let(:team_user) { create(:team_user, id: 3, team_id: team.id, user_id: user.id) }&lt;br /&gt;
  let(:team_user2) { create(:team_user, id: 4, team_id: team.id, user_id: user2.id) }&lt;br /&gt;
  let(:team2_user3) { create(:team_user, id: 5, team_id: team2.id, user_id: user3.id) }&lt;br /&gt;
  let(:course_team) { create(:course_team, id: 3, name: 'course team 1', parent_id: course.id) }&lt;br /&gt;
  let(:cource_team_user) { create(:team_user, id: 6, team_id: course_team.id, user_id: user.id) }&lt;br /&gt;
  let(:cource_team_user2) { create(:team_user, id: 7, team_id: course_team.id, user_id: user2.id) }&lt;br /&gt;
  let(:topic) { build(:topic) }&lt;br /&gt;
  let(:topic2) { create(:topic, topic_name: &amp;quot;TestReview&amp;quot;) }&lt;br /&gt;
  let(:topic3) { create(:topic) }&lt;br /&gt;
  let(:due_date) { build(:assignment_due_date, deadline_type_id: 1) }&lt;br /&gt;
  let(:deadline_type) { build(:deadline_type, id: 1) }&lt;br /&gt;
  let(:review_response_map) { build(:review_response_map, assignment: assignment, reviewer: participant, reviewee: team2) }&lt;br /&gt;
  let(:metareview_response_map) { build(:meta_review_response_map, reviewed_object_id: 1) }&lt;br /&gt;
  let(:response) { build(:response, id: 1, map_id: 1, response_map: review_response_map) }&lt;br /&gt;
  let(:response2) { build(:response, id: 2, map_id: 1, response_map: review_response_map) }&lt;br /&gt;
  let(:submission_record) {build(:submission_record, id:1, team_id: 1, assignment_id: 1) }&lt;br /&gt;
  let(:student_task) do&lt;br /&gt;
    StudentTask.new(&lt;br /&gt;
      user: user,&lt;br /&gt;
      participant: participant,&lt;br /&gt;
      assignment: assignment,&lt;br /&gt;
      topic: topic3,&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
  let(:student_task2) do&lt;br /&gt;
    StudentTask.new(&lt;br /&gt;
      user: user,&lt;br /&gt;
      participant: participant2,&lt;br /&gt;
      assignment: assignment,&lt;br /&gt;
      topic: topic2,&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests topic name to ensure it is stored or set as &amp;quot;-&amp;quot;&lt;br /&gt;
  describe &amp;quot;#topic_name&amp;quot; do&lt;br /&gt;
    it 'returns the topic name if given one' do&lt;br /&gt;
      allow(student_task2).to receive(:topic).and_return(topic2)&lt;br /&gt;
      expect(student_task2.topic_name).to eq(&amp;quot;TestReview&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns - for blank name' do&lt;br /&gt;
      expect(student_task.topic_name).to eq(&amp;quot;-&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
'''Here we are testing the different values that the student tasks status can take on'''&lt;br /&gt;
  # Verifies completion status of a student task&lt;br /&gt;
  describe &amp;quot;#complete?&amp;quot; do&lt;br /&gt;
    it 'verifies a student task is complete' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return('Complete')&lt;br /&gt;
      expect(student_task.complete?).to be true&lt;br /&gt;
    end&lt;br /&gt;
    it 'verifies a nil stage_deadline to not be complete' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return('')&lt;br /&gt;
      expect(student_task.complete?).to be false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
'''Here we are making sure the content has been submitted during the current stage of the process, only occurss when current_stage is equal to &amp;quot;submission&amp;quot;'''&lt;br /&gt;
  # tests if hyperlinks or other content is submitted during the submission stage&lt;br /&gt;
  # current stage must be submission&lt;br /&gt;
  # participant has to belong to a team&lt;br /&gt;
  # the team has submitted some content&lt;br /&gt;
  describe &amp;quot;content_submitted_in_current_stage?&amp;quot; do&lt;br /&gt;
    it 'checks if hyperlinks is submitted during submission stage'do&lt;br /&gt;
       student_task.current_stage = &amp;quot;submission&amp;quot;&lt;br /&gt;
       allow(student_task).to receive_message_chain(:hyperlinks, :present).and_return(true)&lt;br /&gt;
       expect(student_task.content_submitted_in_current_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
'''Hyperlinks is modified based on the teams that a user is in. This will be updated if they are in a team or they already have hyperlinks it will remain the same'''&lt;br /&gt;
  # Tests the updating of the @hyperlinks instance variable based on participant's team&lt;br /&gt;
  # Does not verify operation of ||= call, only tests cases of right hand side&lt;br /&gt;
  describe &amp;quot;#hyperlinks&amp;quot; do&lt;br /&gt;
    it 'returns empty array if participant has no team' do&lt;br /&gt;
      allow(student_task).to receive_message_chain(:participant, :team, :nil?).and_return(true)&lt;br /&gt;
      expect(student_task.hyperlinks).to eq([])&lt;br /&gt;
    end&lt;br /&gt;
    it 'assigns returns populated hyperlinks instance if participant has team' do&lt;br /&gt;
      allow(student_task).to receive_message_chain(:participant, :team, :hyperlinks).and_return(['something'])&lt;br /&gt;
      allow(student_task).to receive_message_chain(:participant, :team, :nil?).and_return(false)&lt;br /&gt;
      expect(student_task.hyperlinks).to eq(['something'])&lt;br /&gt;
    end 	&lt;br /&gt;
  end&lt;br /&gt;
'''Simply testing to see if the incomplete status is checked correctly'''&lt;br /&gt;
  # Verifies incomplete status of student task&lt;br /&gt;
  describe &amp;quot;#incomplete?&amp;quot; do&lt;br /&gt;
    it 'checks a student_task is incomplete' do&lt;br /&gt;
      expect(student_task.incomplete?).to be true&lt;br /&gt;
    end 	&lt;br /&gt;
  end&lt;br /&gt;
'''Verify the stage of a task and that a started task is evaluated correctly'''&lt;br /&gt;
  # Verifies that a task has not started&lt;br /&gt;
  describe &amp;quot;#not_started?&amp;quot; do&lt;br /&gt;
    it 'verfies started status' do&lt;br /&gt;
      allow(student_task).to receive(:in_work_stage?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:started?).and_return(true)&lt;br /&gt;
      expect(student_task.not_started?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
    it 'is not started due to work stage' do&lt;br /&gt;
      allow(student_task).to receive(:in_work_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:started?).and_return(true)&lt;br /&gt;
      expect(student_task.not_started?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests relative_deadline for proper assignment when stage_deadline is present&lt;br /&gt;
  describe &amp;quot;#relative_deadline&amp;quot; do&lt;br /&gt;
    it 'returns false without a valid stage deadline' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return(nil)&lt;br /&gt;
      expect(student_task.relative_deadline).to be_falsey&lt;br /&gt;
    end&lt;br /&gt;
    it 'verifies a valid case where stage_deadline is present' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:time_ago_in_words).and_return(&amp;quot;astring&amp;quot;)&lt;br /&gt;
      expect(student_task.relative_deadline).to eq(&amp;quot;astring&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Examines a task to determine if the task is a revision&lt;br /&gt;
  describe &amp;quot;#revision?&amp;quot; do&lt;br /&gt;
    it 'returns true if content is submitted' do&lt;br /&gt;
      allow(student_task).to receive(:content_submitted_in_current_stage?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:reviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      expect(student_task.revision?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns true if reviews given is true' do&lt;br /&gt;
      allow(student_task).to receive(:content_submitted_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:reviews_given_in_current_stage?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      expect(student_task.revision?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns true if metareviews given is true' do&lt;br /&gt;
      allow(student_task).to receive(:content_submitted_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:reviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given_in_current_stage?).and_return(true)&lt;br /&gt;
      expect(student_task.revision?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Checks if metareview was given in current task stage&lt;br /&gt;
  describe &amp;quot;#metreviews_given_in_current_stage?&amp;quot; do&lt;br /&gt;
    it 'return true' do&lt;br /&gt;
      student_task.current_stage = &amp;quot;metareview&amp;quot;&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given?).and_return(true)&lt;br /&gt;
      expect(student_task.metareviews_given_in_current_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # Checks if review was given in current task stage&lt;br /&gt;
  describe &amp;quot;#reviews_given_in_current_stage?&amp;quot; do&lt;br /&gt;
    it 'return true' do&lt;br /&gt;
      student_task.current_stage = &amp;quot;review&amp;quot;&lt;br /&gt;
      allow(student_task).to receive(:reviews_given?).and_return(true)&lt;br /&gt;
      expect(student_task.reviews_given_in_current_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # tests whether a student task has been started&lt;br /&gt;
  # if the task is not incomplete &amp;amp;&amp;amp; is not in the revision stage&lt;br /&gt;
  # started? returns false&lt;br /&gt;
  # if the task is incomplete &amp;amp;&amp;amp; is in the revision stage&lt;br /&gt;
  # started? returns true&lt;br /&gt;
  describe &amp;quot;#started?&amp;quot; do&lt;br /&gt;
    it 'is not started' do&lt;br /&gt;
      allow(student_task).to receive(:incomplete?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:revision?).and_return(false)&lt;br /&gt;
      expect(student_task.started?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
    it 'is started' do&lt;br /&gt;
      allow(student_task).to receive(:incomplete?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:revision?).and_return(true)&lt;br /&gt;
      expect(student_task.started?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests works stage to ensure state is represented correctly&lt;br /&gt;
  describe &amp;quot;#in_work_stage?&amp;quot; do&lt;br /&gt;
    it &amp;quot;is true, submission is a work stage&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;submission&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;is true, review is a work stage&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;is true, metareview is a work stage&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;metareview&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;is false, empty object&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests teamed students method which returns the unique students that are paired with the student at some point&lt;br /&gt;
  # within their course&lt;br /&gt;
  describe &amp;quot;#teamed_students&amp;quot; do&lt;br /&gt;
    context 'when not in any team' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        expect(StudentTask.teamed_students(user3)).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when assigned in a cource_team ' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        allow(user).to receive(:teams).and_return([course_team])&lt;br /&gt;
        expect(StudentTask.teamed_students(user)).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when assigned in a assignment_team ' do&lt;br /&gt;
      it 'returns the students they are teamed with' do&lt;br /&gt;
        allow(user).to receive(:teams).and_return([team])&lt;br /&gt;
        allow(AssignmentParticipant).to receive(:find_by).with(user_id: 1, parent_id: assignment.id).and_return(participant)&lt;br /&gt;
        allow(AssignmentParticipant).to receive(:find_by).with(user_id: 5, parent_id: assignment.id).and_return(participant2)&lt;br /&gt;
        allow(Assignment).to receive(:find_by).with(id: team.parent_id).and_return(assignment)&lt;br /&gt;
        expect(StudentTask.teamed_students(user)).to eq({assignment.course_id =&amp;gt; [user2.fullname]})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the due dates of an assigment&lt;br /&gt;
  describe &amp;quot;#get_due_date_data&amp;quot; do&lt;br /&gt;
    context 'when called with assignment having empty due dates' do&lt;br /&gt;
      it &amp;quot;return empty time_list array&amp;quot; do&lt;br /&gt;
        timeline_list = []&lt;br /&gt;
        StudentTask.get_due_date_data(assignment, timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  context 'when called with assignment having due date' do&lt;br /&gt;
    context 'and due_at value nil' do&lt;br /&gt;
      it &amp;quot;return empty time_list array&amp;quot; do&lt;br /&gt;
        allow(due_date).to receive(:deadline_type).and_return(deadline_type)&lt;br /&gt;
        timeline_list = []&lt;br /&gt;
        due_date.due_at=nil;&lt;br /&gt;
        assignment.due_dates = [due_date]&lt;br /&gt;
        StudentTask.get_due_date_data(assignment, timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'and due_at value not nil' do&lt;br /&gt;
      it &amp;quot;return time_list array&amp;quot; do&lt;br /&gt;
        allow(due_date).to receive(:deadline_type).and_return(deadline_type)&lt;br /&gt;
        timeline_list = []&lt;br /&gt;
        assignment.due_dates = [due_date]&lt;br /&gt;
        StudentTask.get_due_date_data(assignment, timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([{&lt;br /&gt;
                                          :label=&amp;gt;(due_date.deadline_type.name + ' Deadline').humanize,&lt;br /&gt;
                                          :updated_at=&amp;gt;due_date.due_at.strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
                                      }])&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies fetching of peer review data of a user and a timeline&lt;br /&gt;
  describe &amp;quot;#get_peer_review_data&amp;quot; do&lt;br /&gt;
    context 'when no review response mapped' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        StudentTask.get_peer_review_data(user2,timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when mapped to review response map' do&lt;br /&gt;
      it 'returns timeline array' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(ReviewResponseMap).to receive_message_chain(:where, :find_each).with(reviewer_id: 1).with(no_args).and_yield(review_response_map)&lt;br /&gt;
        allow(review_response_map).to receive(:id).and_return(1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:where, :last).with(map_id: 1).with(no_args).and_return(response)&lt;br /&gt;
        allow(response).to receive(:round).and_return(1)&lt;br /&gt;
        allow(response).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_peer_review_data(1,timeline_list)).to eq([{:id=&amp;gt;1, :label=&amp;gt;&amp;quot;Round 1 peer review&amp;quot;, :updated_at=&amp;gt;timevalue}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies retrieval of feedback from author&lt;br /&gt;
  describe &amp;quot;#get_author_feedback_data&amp;quot; do&lt;br /&gt;
    context 'when no feedback response mapped' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        StudentTask.get_author_feedback_data(user2,timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when mapped to feedback response map' do&lt;br /&gt;
      it 'returns timeline array' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(FeedbackResponseMap).to receive_message_chain(:where, :find_each).with(reviewer_id: 1).with(no_args).and_yield(review_response_map)&lt;br /&gt;
        allow(review_response_map).to receive(:id).and_return(1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:where, :last).with(map_id: 1).with(no_args).and_return(response)&lt;br /&gt;
        allow(response).to receive(:updated_at).and_return(Time.now)&lt;br /&gt;
        timevalue = Time.now.strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_author_feedback_data(1,timeline_list)).to eq([{:id=&amp;gt;1, :label=&amp;gt;&amp;quot;Author feedback&amp;quot;, :updated_at=&amp;gt;timevalue}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verrifies retrieval of submission data from submission&lt;br /&gt;
  describe '#get_submission_data' do&lt;br /&gt;
    context 'when no submission data mapped' do&lt;br /&gt;
      it 'returns nil' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq(nil)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when submission data mapped and not submit hyperlink or Remove hyperlink' do&lt;br /&gt;
      it 'returns timeline_list' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(SubmissionRecord).to receive_message_chain(:where, :find_each).with(team_id: 1, assignment_id: 1).with(no_args).and_yield(submission_record)&lt;br /&gt;
        allow(submission_record).to receive(:operation).and_return('testing_label')&lt;br /&gt;
        allow(submission_record).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq([{:label=&amp;gt;&amp;quot;Testing label&amp;quot;, :updated_at=&amp;gt;timevalue}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when submission data mapped and operation is submit_hyperlink' do&lt;br /&gt;
      it 'returns timeline_list with link' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(SubmissionRecord).to receive_message_chain(:where, :find_each).with(team_id: 1, assignment_id: 1).with(no_args).and_yield(submission_record)&lt;br /&gt;
        allow(submission_record).to receive(:operation).and_return('Submit Hyperlink')&lt;br /&gt;
        allow(submission_record).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq([{:label=&amp;gt;&amp;quot;Submit hyperlink&amp;quot;, :updated_at=&amp;gt;timevalue, :link=&amp;gt;&amp;quot;www.wolfware.edu&amp;quot;}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when submission data mapped and operation is Remove Hyperlink' do&lt;br /&gt;
      it 'returns timeline_list with link' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(SubmissionRecord).to receive_message_chain(:where, :find_each).with(team_id: 1, assignment_id: 1).with(no_args).and_yield(submission_record)&lt;br /&gt;
        allow(submission_record).to receive(:operation).and_return('Remove Hyperlink')&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        allow(submission_record).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq([{:label=&amp;gt;&amp;quot;Remove hyperlink&amp;quot;, :updated_at=&amp;gt;timevalue, :link=&amp;gt;&amp;quot;www.wolfware.edu&amp;quot;}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies retrieval of timeline data&lt;br /&gt;
  describe '#get_timeline_data' do&lt;br /&gt;
    context 'when no timeline data mapped' do&lt;br /&gt;
      it 'returns nil' do&lt;br /&gt;
        allow(participant).to receive(:get_reviewer).and_return(participant)&lt;br /&gt;
        expect(StudentTask.get_timeline_data(assignment, participant, team)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end                                                                                                                                   end&lt;br /&gt;
&lt;br /&gt;
== Line Coverage achieved ==&lt;br /&gt;
*94 relevant lines&lt;br /&gt;
*86 lines covered&lt;br /&gt;
*8 lines missed&lt;br /&gt;
*Coverage = 91.49%&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
Some of the tests were rather shallow, get_timeline_data specifically needs depth added.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://youtu.be/N6H1HtQ4eds/ YouTube Video Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/johnbumgardner/expertiza/ GitHub Repo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1811/ Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Team Members == &lt;br /&gt;
John Bumgardner, Pedro Benitez, Luke McConnaughey&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2055_write_unit_tests_for_student_task.rb&amp;diff=135764</id>
		<title>CSC/ECE 517 Fall 2020 - E2055 write unit tests for student task.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2055_write_unit_tests_for_student_task.rb&amp;diff=135764"/>
		<updated>2020-10-20T05:23:55Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project based on [https://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;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About RSpec ==&lt;br /&gt;
&lt;br /&gt;
RSpec is a unit test framework for the Ruby programming language. RSpec is different than traditional xUnit frameworks like JUnit because RSpec is a Behavior driven development tool. What this means is that, tests written in RSpec focus on the &amp;quot;behavior&amp;quot; of an application being tested. RSpec does not put emphasis on, how the application works but instead on how it behaves, in other words, what the application actually does.Each RSpec file contains one or more tests. Each test ensures if a particular feature of our website is working properly.The output of an RSpec run will tell you exactly what features aren't working. The benefit is that tested code is unlikely to break unnoticed.The tests are run every time someone makes, or updates, a [https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests Pull Request].&lt;br /&gt;
&lt;br /&gt;
== DB Schema ==&lt;br /&gt;
Below are the tables that are related ti student task functionality&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/images/7/7a/ExpertizaDbSchema.jpg DB Schema]&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The following is an Expertiza based OSS project which deals primarily with the student_task.rb and student_task_spec.rb. It focuses on writing RSpec unit tests for the code affected or added. The goal of this project is to attempt to add sufficient unit tests to this part of the application and increase its path coverage to above 90 percent.&lt;br /&gt;
The following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
* Complete the insufficient unit tests for student_task.rb. &lt;br /&gt;
* Increase path coverage from only 31.91% with 30 lines covered to above 90% coverage&lt;br /&gt;
* Cover edge cases.&lt;br /&gt;
* High branch coverage to be achieved.&lt;br /&gt;
&lt;br /&gt;
There are different tasks that a student can perform. &lt;br /&gt;
* They can see all the assignments that they have been assigned to.&lt;br /&gt;
* They can see details of each assignment like marks, their team, send invitation to student to join a team&lt;br /&gt;
* Review other students' work&lt;br /&gt;
&lt;br /&gt;
== Tests Plan ==&lt;br /&gt;
*Mock Objects to test: Create a series of mock objects that will be used throughout the testing process&lt;br /&gt;
*The following are a list of the functions that were tested:&lt;br /&gt;
*Topic name&lt;br /&gt;
**Retrieves the topic name of an assignment&lt;br /&gt;
*Complete?&lt;br /&gt;
**Checks if a student task is complete&lt;br /&gt;
*Incomplete?&lt;br /&gt;
**If the assignment is not complete return true&lt;br /&gt;
*Not started?&lt;br /&gt;
**Checks if a student task is available to be worked on (i.e in submission/review/metareview stage) and if so has it been started&lt;br /&gt;
*Revision?&lt;br /&gt;
**Checks if a student task is now in the revision stage&lt;br /&gt;
*Met reviews given&lt;br /&gt;
*Teamed students&lt;br /&gt;
**Returns a list of students that an individual has teamed up with&lt;br /&gt;
*Get due date&lt;br /&gt;
**Gets the due date for each assignment assigned to a student&lt;br /&gt;
*Get peer review data&lt;br /&gt;
*Get author feedback&lt;br /&gt;
*Get submission data&lt;br /&gt;
*Get timeline data&lt;br /&gt;
&lt;br /&gt;
== Implementation == &lt;br /&gt;
The following are our written tests in the order listed above:&lt;br /&gt;
&lt;br /&gt;
Details regarding what the test is testing can be seen as comments above each example block&lt;br /&gt;
&lt;br /&gt;
'''Here were are creating all of the mock objects to test the functionality of the student_task model. We are using these from the previous implementation&lt;br /&gt;
''' describe StudentTask do&lt;br /&gt;
  let(:participant) { build(:participant, id: 1, user_id: user.id, parent_id: assignment.id) }&lt;br /&gt;
  let(:participant2) { build(:participant, id: 2, user_id: user2.id, parent_id: assignment.id) }&lt;br /&gt;
  let(:participant3) { build(:participant, id: 3, user_id: user3.id, parent_id: assignment2.id) }&lt;br /&gt;
  let(:user) { create(:student) }&lt;br /&gt;
  let(:user2) { create(:student, name: &amp;quot;qwertyui&amp;quot;, id: 5) }&lt;br /&gt;
  let(:user3) { create(:student, name: &amp;quot;qwertyui1234&amp;quot;, id: 6) }&lt;br /&gt;
  let(:course) { build(:course) }&lt;br /&gt;
  let(:assignment) { build(:assignment, name: 'assignment 1') }&lt;br /&gt;
  let(:assignment2) { create(:assignment, name: 'assignment 2', is_calibrated: true) }&lt;br /&gt;
  let(:team) { create(:assignment_team, id: 1, name: 'team 1', parent_id: assignment.id, users: [user, user2]) }&lt;br /&gt;
  let(:team2) { create(:assignment_team, id: 2, name: 'team 2', parent_id: assignment2.id, users: [user3]) }&lt;br /&gt;
  let(:team_user) { create(:team_user, id: 3, team_id: team.id, user_id: user.id) }&lt;br /&gt;
  let(:team_user2) { create(:team_user, id: 4, team_id: team.id, user_id: user2.id) }&lt;br /&gt;
  let(:team2_user3) { create(:team_user, id: 5, team_id: team2.id, user_id: user3.id) }&lt;br /&gt;
  let(:course_team) { create(:course_team, id: 3, name: 'course team 1', parent_id: course.id) }&lt;br /&gt;
  let(:cource_team_user) { create(:team_user, id: 6, team_id: course_team.id, user_id: user.id) }&lt;br /&gt;
  let(:cource_team_user2) { create(:team_user, id: 7, team_id: course_team.id, user_id: user2.id) }&lt;br /&gt;
  let(:topic) { build(:topic) }&lt;br /&gt;
  let(:topic2) { create(:topic, topic_name: &amp;quot;TestReview&amp;quot;) }&lt;br /&gt;
  let(:topic3) { create(:topic) }&lt;br /&gt;
  let(:due_date) { build(:assignment_due_date, deadline_type_id: 1) }&lt;br /&gt;
  let(:deadline_type) { build(:deadline_type, id: 1) }&lt;br /&gt;
  let(:review_response_map) { build(:review_response_map, assignment: assignment, reviewer: participant, reviewee: team2) }&lt;br /&gt;
  let(:metareview_response_map) { build(:meta_review_response_map, reviewed_object_id: 1) }&lt;br /&gt;
  let(:response) { build(:response, id: 1, map_id: 1, response_map: review_response_map) }&lt;br /&gt;
  let(:response2) { build(:response, id: 2, map_id: 1, response_map: review_response_map) }&lt;br /&gt;
  let(:submission_record) {build(:submission_record, id:1, team_id: 1, assignment_id: 1) }&lt;br /&gt;
  let(:student_task) do&lt;br /&gt;
    StudentTask.new(&lt;br /&gt;
      user: user,&lt;br /&gt;
      participant: participant,&lt;br /&gt;
      assignment: assignment,&lt;br /&gt;
      topic: topic3,&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
  let(:student_task2) do&lt;br /&gt;
    StudentTask.new(&lt;br /&gt;
      user: user,&lt;br /&gt;
      participant: participant2,&lt;br /&gt;
      assignment: assignment,&lt;br /&gt;
      topic: topic2,&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests topic name to ensure it is stored or set as &amp;quot;-&amp;quot;&lt;br /&gt;
  describe &amp;quot;#topic_name&amp;quot; do&lt;br /&gt;
    it 'returns the topic name if given one' do&lt;br /&gt;
      allow(student_task2).to receive(:topic).and_return(topic2)&lt;br /&gt;
      expect(student_task2.topic_name).to eq(&amp;quot;TestReview&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns - for blank name' do&lt;br /&gt;
      expect(student_task.topic_name).to eq(&amp;quot;-&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
'''Here we are testing the different values that the student tasks status can take on'''&lt;br /&gt;
  # Verifies completion status of a student task&lt;br /&gt;
  describe &amp;quot;#complete?&amp;quot; do&lt;br /&gt;
    it 'verifies a student task is complete' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return('Complete')&lt;br /&gt;
      expect(student_task.complete?).to be true&lt;br /&gt;
    end&lt;br /&gt;
    it 'verifies a nil stage_deadline to not be complete' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return('')&lt;br /&gt;
      expect(student_task.complete?).to be false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # tests if hyperlinks or other content is submitted during the submission stage&lt;br /&gt;
  # current stage must be submission&lt;br /&gt;
  # participant has to belong to a team&lt;br /&gt;
  # the team has submitted some content&lt;br /&gt;
  describe &amp;quot;content_submitted_in_current_stage?&amp;quot; do&lt;br /&gt;
    it 'checks if hyperlinks is submitted during submission stage'do&lt;br /&gt;
       student_task.current_stage = &amp;quot;submission&amp;quot;&lt;br /&gt;
       allow(student_task).to receive_message_chain(:hyperlinks, :present).and_return(true)&lt;br /&gt;
       expect(student_task.content_submitted_in_current_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests the updating of the @hyperlinks instance variable based on participant's team&lt;br /&gt;
  # Does not verify operation of ||= call, only tests cases of right hand side&lt;br /&gt;
  describe &amp;quot;#hyperlinks&amp;quot; do&lt;br /&gt;
    it 'returns empty array if participant has no team' do&lt;br /&gt;
      allow(student_task).to receive_message_chain(:participant, :team, :nil?).and_return(true)&lt;br /&gt;
      expect(student_task.hyperlinks).to eq([])&lt;br /&gt;
    end&lt;br /&gt;
    it 'assigns returns populated hyperlinks instance if participant has team' do&lt;br /&gt;
      allow(student_task).to receive_message_chain(:participant, :team, :hyperlinks).and_return(['something'])&lt;br /&gt;
      allow(student_task).to receive_message_chain(:participant, :team, :nil?).and_return(false)&lt;br /&gt;
      expect(student_task.hyperlinks).to eq(['something'])&lt;br /&gt;
    end 	&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies incomplete status of student task&lt;br /&gt;
  describe &amp;quot;#incomplete?&amp;quot; do&lt;br /&gt;
    it 'checks a student_task is incomplete' do&lt;br /&gt;
      expect(student_task.incomplete?).to be true&lt;br /&gt;
    end 	&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies that a task has not started&lt;br /&gt;
  describe &amp;quot;#not_started?&amp;quot; do&lt;br /&gt;
    it 'verfies started status' do&lt;br /&gt;
      allow(student_task).to receive(:in_work_stage?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:started?).and_return(true)&lt;br /&gt;
      expect(student_task.not_started?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
    it 'is not started due to work stage' do&lt;br /&gt;
      allow(student_task).to receive(:in_work_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:started?).and_return(true)&lt;br /&gt;
      expect(student_task.not_started?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests relative_deadline for proper assignment when stage_deadline is present&lt;br /&gt;
  describe &amp;quot;#relative_deadline&amp;quot; do&lt;br /&gt;
    it 'returns false without a valid stage deadline' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return(nil)&lt;br /&gt;
      expect(student_task.relative_deadline).to be_falsey&lt;br /&gt;
    end&lt;br /&gt;
    it 'verifies a valid case where stage_deadline is present' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:time_ago_in_words).and_return(&amp;quot;astring&amp;quot;)&lt;br /&gt;
      expect(student_task.relative_deadline).to eq(&amp;quot;astring&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Examines a task to determine if the task is a revision&lt;br /&gt;
  describe &amp;quot;#revision?&amp;quot; do&lt;br /&gt;
    it 'returns true if content is submitted' do&lt;br /&gt;
      allow(student_task).to receive(:content_submitted_in_current_stage?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:reviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      expect(student_task.revision?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns true if reviews given is true' do&lt;br /&gt;
      allow(student_task).to receive(:content_submitted_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:reviews_given_in_current_stage?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      expect(student_task.revision?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns true if metareviews given is true' do&lt;br /&gt;
      allow(student_task).to receive(:content_submitted_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:reviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given_in_current_stage?).and_return(true)&lt;br /&gt;
      expect(student_task.revision?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Checks if metareview was given in current task stage&lt;br /&gt;
  describe &amp;quot;#metreviews_given_in_current_stage?&amp;quot; do&lt;br /&gt;
    it 'return true' do&lt;br /&gt;
      student_task.current_stage = &amp;quot;metareview&amp;quot;&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given?).and_return(true)&lt;br /&gt;
      expect(student_task.metareviews_given_in_current_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # Checks if review was given in current task stage&lt;br /&gt;
  describe &amp;quot;#reviews_given_in_current_stage?&amp;quot; do&lt;br /&gt;
    it 'return true' do&lt;br /&gt;
      student_task.current_stage = &amp;quot;review&amp;quot;&lt;br /&gt;
      allow(student_task).to receive(:reviews_given?).and_return(true)&lt;br /&gt;
      expect(student_task.reviews_given_in_current_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # tests whether a student task has been started&lt;br /&gt;
  # if the task is not incomplete &amp;amp;&amp;amp; is not in the revision stage&lt;br /&gt;
  # started? returns false&lt;br /&gt;
  # if the task is incomplete &amp;amp;&amp;amp; is in the revision stage&lt;br /&gt;
  # started? returns true&lt;br /&gt;
  describe &amp;quot;#started?&amp;quot; do&lt;br /&gt;
    it 'is not started' do&lt;br /&gt;
      allow(student_task).to receive(:incomplete?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:revision?).and_return(false)&lt;br /&gt;
      expect(student_task.started?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
    it 'is started' do&lt;br /&gt;
      allow(student_task).to receive(:incomplete?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:revision?).and_return(true)&lt;br /&gt;
      expect(student_task.started?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests works stage to ensure state is represented correctly&lt;br /&gt;
  describe &amp;quot;#in_work_stage?&amp;quot; do&lt;br /&gt;
    it &amp;quot;is true, submission is a work stage&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;submission&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;is true, review is a work stage&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;is true, metareview is a work stage&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;metareview&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;is false, empty object&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests teamed students method which returns the unique students that are paired with the student at some point&lt;br /&gt;
  # within their course&lt;br /&gt;
  describe &amp;quot;#teamed_students&amp;quot; do&lt;br /&gt;
    context 'when not in any team' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        expect(StudentTask.teamed_students(user3)).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when assigned in a cource_team ' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        allow(user).to receive(:teams).and_return([course_team])&lt;br /&gt;
        expect(StudentTask.teamed_students(user)).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when assigned in a assignment_team ' do&lt;br /&gt;
      it 'returns the students they are teamed with' do&lt;br /&gt;
        allow(user).to receive(:teams).and_return([team])&lt;br /&gt;
        allow(AssignmentParticipant).to receive(:find_by).with(user_id: 1, parent_id: assignment.id).and_return(participant)&lt;br /&gt;
        allow(AssignmentParticipant).to receive(:find_by).with(user_id: 5, parent_id: assignment.id).and_return(participant2)&lt;br /&gt;
        allow(Assignment).to receive(:find_by).with(id: team.parent_id).and_return(assignment)&lt;br /&gt;
        expect(StudentTask.teamed_students(user)).to eq({assignment.course_id =&amp;gt; [user2.fullname]})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the due dates of an assigment&lt;br /&gt;
  describe &amp;quot;#get_due_date_data&amp;quot; do&lt;br /&gt;
    context 'when called with assignment having empty due dates' do&lt;br /&gt;
      it &amp;quot;return empty time_list array&amp;quot; do&lt;br /&gt;
        timeline_list = []&lt;br /&gt;
        StudentTask.get_due_date_data(assignment, timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  context 'when called with assignment having due date' do&lt;br /&gt;
    context 'and due_at value nil' do&lt;br /&gt;
      it &amp;quot;return empty time_list array&amp;quot; do&lt;br /&gt;
        allow(due_date).to receive(:deadline_type).and_return(deadline_type)&lt;br /&gt;
        timeline_list = []&lt;br /&gt;
        due_date.due_at=nil;&lt;br /&gt;
        assignment.due_dates = [due_date]&lt;br /&gt;
        StudentTask.get_due_date_data(assignment, timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'and due_at value not nil' do&lt;br /&gt;
      it &amp;quot;return time_list array&amp;quot; do&lt;br /&gt;
        allow(due_date).to receive(:deadline_type).and_return(deadline_type)&lt;br /&gt;
        timeline_list = []&lt;br /&gt;
        assignment.due_dates = [due_date]&lt;br /&gt;
        StudentTask.get_due_date_data(assignment, timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([{&lt;br /&gt;
                                          :label=&amp;gt;(due_date.deadline_type.name + ' Deadline').humanize,&lt;br /&gt;
                                          :updated_at=&amp;gt;due_date.due_at.strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
                                      }])&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies fetching of peer review data of a user and a timeline&lt;br /&gt;
  describe &amp;quot;#get_peer_review_data&amp;quot; do&lt;br /&gt;
    context 'when no review response mapped' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        StudentTask.get_peer_review_data(user2,timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when mapped to review response map' do&lt;br /&gt;
      it 'returns timeline array' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(ReviewResponseMap).to receive_message_chain(:where, :find_each).with(reviewer_id: 1).with(no_args).and_yield(review_response_map)&lt;br /&gt;
        allow(review_response_map).to receive(:id).and_return(1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:where, :last).with(map_id: 1).with(no_args).and_return(response)&lt;br /&gt;
        allow(response).to receive(:round).and_return(1)&lt;br /&gt;
        allow(response).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_peer_review_data(1,timeline_list)).to eq([{:id=&amp;gt;1, :label=&amp;gt;&amp;quot;Round 1 peer review&amp;quot;, :updated_at=&amp;gt;timevalue}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies retrieval of feedback from author&lt;br /&gt;
  describe &amp;quot;#get_author_feedback_data&amp;quot; do&lt;br /&gt;
    context 'when no feedback response mapped' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        StudentTask.get_author_feedback_data(user2,timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when mapped to feedback response map' do&lt;br /&gt;
      it 'returns timeline array' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(FeedbackResponseMap).to receive_message_chain(:where, :find_each).with(reviewer_id: 1).with(no_args).and_yield(review_response_map)&lt;br /&gt;
        allow(review_response_map).to receive(:id).and_return(1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:where, :last).with(map_id: 1).with(no_args).and_return(response)&lt;br /&gt;
        allow(response).to receive(:updated_at).and_return(Time.now)&lt;br /&gt;
        timevalue = Time.now.strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_author_feedback_data(1,timeline_list)).to eq([{:id=&amp;gt;1, :label=&amp;gt;&amp;quot;Author feedback&amp;quot;, :updated_at=&amp;gt;timevalue}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verrifies retrieval of submission data from submission&lt;br /&gt;
  describe '#get_submission_data' do&lt;br /&gt;
    context 'when no submission data mapped' do&lt;br /&gt;
      it 'returns nil' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq(nil)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when submission data mapped and not submit hyperlink or Remove hyperlink' do&lt;br /&gt;
      it 'returns timeline_list' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(SubmissionRecord).to receive_message_chain(:where, :find_each).with(team_id: 1, assignment_id: 1).with(no_args).and_yield(submission_record)&lt;br /&gt;
        allow(submission_record).to receive(:operation).and_return('testing_label')&lt;br /&gt;
        allow(submission_record).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq([{:label=&amp;gt;&amp;quot;Testing label&amp;quot;, :updated_at=&amp;gt;timevalue}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when submission data mapped and operation is submit_hyperlink' do&lt;br /&gt;
      it 'returns timeline_list with link' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(SubmissionRecord).to receive_message_chain(:where, :find_each).with(team_id: 1, assignment_id: 1).with(no_args).and_yield(submission_record)&lt;br /&gt;
        allow(submission_record).to receive(:operation).and_return('Submit Hyperlink')&lt;br /&gt;
        allow(submission_record).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq([{:label=&amp;gt;&amp;quot;Submit hyperlink&amp;quot;, :updated_at=&amp;gt;timevalue, :link=&amp;gt;&amp;quot;www.wolfware.edu&amp;quot;}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when submission data mapped and operation is Remove Hyperlink' do&lt;br /&gt;
      it 'returns timeline_list with link' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(SubmissionRecord).to receive_message_chain(:where, :find_each).with(team_id: 1, assignment_id: 1).with(no_args).and_yield(submission_record)&lt;br /&gt;
        allow(submission_record).to receive(:operation).and_return('Remove Hyperlink')&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        allow(submission_record).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq([{:label=&amp;gt;&amp;quot;Remove hyperlink&amp;quot;, :updated_at=&amp;gt;timevalue, :link=&amp;gt;&amp;quot;www.wolfware.edu&amp;quot;}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies retrieval of timeline data&lt;br /&gt;
  describe '#get_timeline_data' do&lt;br /&gt;
    context 'when no timeline data mapped' do&lt;br /&gt;
      it 'returns nil' do&lt;br /&gt;
        allow(participant).to receive(:get_reviewer).and_return(participant)&lt;br /&gt;
        expect(StudentTask.get_timeline_data(assignment, participant, team)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
== Line Coverage achieved ==&lt;br /&gt;
*94 relevant lines&lt;br /&gt;
*86 lines covered&lt;br /&gt;
*8 lines missed&lt;br /&gt;
*Coverage = 91.49%&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
Some of the tests were rather shallow, get_timeline_data specifically needs depth added.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://youtu.be/N6H1HtQ4eds/ YouTube Video Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/johnbumgardner/expertiza/ GitHub Repo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1811/ Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Team Members == &lt;br /&gt;
John Bumgardner, Pedro Benitez, Luke McConnaughey&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2055_write_unit_tests_for_student_task.rb&amp;diff=135763</id>
		<title>CSC/ECE 517 Fall 2020 - E2055 write unit tests for student task.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2055_write_unit_tests_for_student_task.rb&amp;diff=135763"/>
		<updated>2020-10-20T05:21:26Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project based on [https://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;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About RSpec ==&lt;br /&gt;
&lt;br /&gt;
RSpec is a unit test framework for the Ruby programming language. RSpec is different than traditional xUnit frameworks like JUnit because RSpec is a Behavior driven development tool. What this means is that, tests written in RSpec focus on the &amp;quot;behavior&amp;quot; of an application being tested. RSpec does not put emphasis on, how the application works but instead on how it behaves, in other words, what the application actually does.Each RSpec file contains one or more tests. Each test ensures if a particular feature of our website is working properly.The output of an RSpec run will tell you exactly what features aren't working. The benefit is that tested code is unlikely to break unnoticed.The tests are run every time someone makes, or updates, a [https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests Pull Request].&lt;br /&gt;
&lt;br /&gt;
== DB Schema ==&lt;br /&gt;
Below are the tables that are related ti student task functionality&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/images/7/7a/ExpertizaDbSchema.jpg DB Schema]&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The following is an Expertiza based OSS project which deals primarily with the student_task.rb and student_task_spec.rb. It focuses on writing RSpec unit tests for the code affected or added. The goal of this project is to attempt to add sufficient unit tests to this part of the application and increase its path coverage to above 90 percent.&lt;br /&gt;
The following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
* Complete the insufficient unit tests for student_task.rb. &lt;br /&gt;
* Increase path coverage from only 31.91% with 30 lines covered to above 90% coverage&lt;br /&gt;
* Cover edge cases.&lt;br /&gt;
* High branch coverage to be achieved.&lt;br /&gt;
&lt;br /&gt;
There are different tasks that a student can perform. &lt;br /&gt;
* They can see all the assignments that they have been assigned to.&lt;br /&gt;
* They can see details of each assignment like marks, their team, send invitation to student to join a team&lt;br /&gt;
* Review other students' work&lt;br /&gt;
&lt;br /&gt;
== Tests Plan ==&lt;br /&gt;
*Mock Objects to test: Create a series of mock objects that will be used throughout the testing process&lt;br /&gt;
*The following are a list of the functions that were tested:&lt;br /&gt;
*Topic name&lt;br /&gt;
**Retrieves the topic name of an assignment&lt;br /&gt;
*Complete?&lt;br /&gt;
**Checks if a student task is complete&lt;br /&gt;
*Incomplete?&lt;br /&gt;
**If the assignment is not complete return true&lt;br /&gt;
*Not started?&lt;br /&gt;
**Checks if a student task is available to be worked on (i.e in submission/review/metareview stage) and if so has it been started&lt;br /&gt;
*Revision?&lt;br /&gt;
**Checks if a student task is now in the revision stage&lt;br /&gt;
*Met reviews given&lt;br /&gt;
*Teamed students&lt;br /&gt;
**Returns a list of students that an individual has teamed up with&lt;br /&gt;
*Get due date&lt;br /&gt;
**Gets the due date for each assignment assigned to a student&lt;br /&gt;
*Get peer review data&lt;br /&gt;
*Get author feedback&lt;br /&gt;
*Get submission data&lt;br /&gt;
*Get timeline data&lt;br /&gt;
&lt;br /&gt;
== Implementation == &lt;br /&gt;
The following are our written tests in the order listed above:&lt;br /&gt;
&lt;br /&gt;
Details regarding what the test is testing can be seen as comments above each example block&lt;br /&gt;
&lt;br /&gt;
 describe StudentTask do&lt;br /&gt;
  let(:participant) { build(:participant, id: 1, user_id: user.id, parent_id: assignment.id) }&lt;br /&gt;
  let(:participant2) { build(:participant, id: 2, user_id: user2.id, parent_id: assignment.id) }&lt;br /&gt;
  let(:participant3) { build(:participant, id: 3, user_id: user3.id, parent_id: assignment2.id) }&lt;br /&gt;
  let(:user) { create(:student) }&lt;br /&gt;
  let(:user2) { create(:student, name: &amp;quot;qwertyui&amp;quot;, id: 5) }&lt;br /&gt;
  let(:user3) { create(:student, name: &amp;quot;qwertyui1234&amp;quot;, id: 6) }&lt;br /&gt;
  let(:course) { build(:course) }&lt;br /&gt;
  let(:assignment) { build(:assignment, name: 'assignment 1') }&lt;br /&gt;
  let(:assignment2) { create(:assignment, name: 'assignment 2', is_calibrated: true) }&lt;br /&gt;
  let(:team) { create(:assignment_team, id: 1, name: 'team 1', parent_id: assignment.id, users: [user, user2]) }&lt;br /&gt;
  let(:team2) { create(:assignment_team, id: 2, name: 'team 2', parent_id: assignment2.id, users: [user3]) }&lt;br /&gt;
  let(:team_user) { create(:team_user, id: 3, team_id: team.id, user_id: user.id) }&lt;br /&gt;
  let(:team_user2) { create(:team_user, id: 4, team_id: team.id, user_id: user2.id) }&lt;br /&gt;
  let(:team2_user3) { create(:team_user, id: 5, team_id: team2.id, user_id: user3.id) }&lt;br /&gt;
  let(:course_team) { create(:course_team, id: 3, name: 'course team 1', parent_id: course.id) }&lt;br /&gt;
  let(:cource_team_user) { create(:team_user, id: 6, team_id: course_team.id, user_id: user.id) }&lt;br /&gt;
  let(:cource_team_user2) { create(:team_user, id: 7, team_id: course_team.id, user_id: user2.id) }&lt;br /&gt;
  let(:topic) { build(:topic) }&lt;br /&gt;
  let(:topic2) { create(:topic, topic_name: &amp;quot;TestReview&amp;quot;) }&lt;br /&gt;
  let(:topic3) { create(:topic) }&lt;br /&gt;
  let(:due_date) { build(:assignment_due_date, deadline_type_id: 1) }&lt;br /&gt;
  let(:deadline_type) { build(:deadline_type, id: 1) }&lt;br /&gt;
  let(:review_response_map) { build(:review_response_map, assignment: assignment, reviewer: participant, reviewee: team2) }&lt;br /&gt;
  let(:metareview_response_map) { build(:meta_review_response_map, reviewed_object_id: 1) }&lt;br /&gt;
  let(:response) { build(:response, id: 1, map_id: 1, response_map: review_response_map) }&lt;br /&gt;
  let(:response2) { build(:response, id: 2, map_id: 1, response_map: review_response_map) }&lt;br /&gt;
  let(:submission_record) {build(:submission_record, id:1, team_id: 1, assignment_id: 1) }&lt;br /&gt;
  let(:student_task) do&lt;br /&gt;
    StudentTask.new(&lt;br /&gt;
      user: user,&lt;br /&gt;
      participant: participant,&lt;br /&gt;
      assignment: assignment,&lt;br /&gt;
      topic: topic3,&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
  let(:student_task2) do&lt;br /&gt;
    StudentTask.new(&lt;br /&gt;
      user: user,&lt;br /&gt;
      participant: participant2,&lt;br /&gt;
      assignment: assignment,&lt;br /&gt;
      topic: topic2,&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests topic name to ensure it is stored or set as &amp;quot;-&amp;quot;&lt;br /&gt;
  describe &amp;quot;#topic_name&amp;quot; do&lt;br /&gt;
    it 'returns the topic name if given one' do&lt;br /&gt;
      allow(student_task2).to receive(:topic).and_return(topic2)&lt;br /&gt;
      expect(student_task2.topic_name).to eq(&amp;quot;TestReview&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns - for blank name' do&lt;br /&gt;
      expect(student_task.topic_name).to eq(&amp;quot;-&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies completion status of a student task&lt;br /&gt;
  describe &amp;quot;#complete?&amp;quot; do&lt;br /&gt;
    it 'verifies a student task is complete' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return('Complete')&lt;br /&gt;
      expect(student_task.complete?).to be true&lt;br /&gt;
    end&lt;br /&gt;
    it 'verifies a nil stage_deadline to not be complete' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return('')&lt;br /&gt;
      expect(student_task.complete?).to be false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # tests if hyperlinks or other content is submitted during the submission stage&lt;br /&gt;
  # current stage must be submission&lt;br /&gt;
  # participant has to belong to a team&lt;br /&gt;
  # the team has submitted some content&lt;br /&gt;
  describe &amp;quot;content_submitted_in_current_stage?&amp;quot; do&lt;br /&gt;
    it 'checks if hyperlinks is submitted during submission stage'do&lt;br /&gt;
       student_task.current_stage = &amp;quot;submission&amp;quot;&lt;br /&gt;
       allow(student_task).to receive_message_chain(:hyperlinks, :present).and_return(true)&lt;br /&gt;
       expect(student_task.content_submitted_in_current_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests the updating of the @hyperlinks instance variable based on participant's team&lt;br /&gt;
  # Does not verify operation of ||= call, only tests cases of right hand side&lt;br /&gt;
  describe &amp;quot;#hyperlinks&amp;quot; do&lt;br /&gt;
    it 'returns empty array if participant has no team' do&lt;br /&gt;
      allow(student_task).to receive_message_chain(:participant, :team, :nil?).and_return(true)&lt;br /&gt;
      expect(student_task.hyperlinks).to eq([])&lt;br /&gt;
    end&lt;br /&gt;
    it 'assigns returns populated hyperlinks instance if participant has team' do&lt;br /&gt;
      allow(student_task).to receive_message_chain(:participant, :team, :hyperlinks).and_return(['something'])&lt;br /&gt;
      allow(student_task).to receive_message_chain(:participant, :team, :nil?).and_return(false)&lt;br /&gt;
      expect(student_task.hyperlinks).to eq(['something'])&lt;br /&gt;
    end 	&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies incomplete status of student task&lt;br /&gt;
  describe &amp;quot;#incomplete?&amp;quot; do&lt;br /&gt;
    it 'checks a student_task is incomplete' do&lt;br /&gt;
      expect(student_task.incomplete?).to be true&lt;br /&gt;
    end 	&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies that a task has not started&lt;br /&gt;
  describe &amp;quot;#not_started?&amp;quot; do&lt;br /&gt;
    it 'verfies started status' do&lt;br /&gt;
      allow(student_task).to receive(:in_work_stage?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:started?).and_return(true)&lt;br /&gt;
      expect(student_task.not_started?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
    it 'is not started due to work stage' do&lt;br /&gt;
      allow(student_task).to receive(:in_work_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:started?).and_return(true)&lt;br /&gt;
      expect(student_task.not_started?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests relative_deadline for proper assignment when stage_deadline is present&lt;br /&gt;
  describe &amp;quot;#relative_deadline&amp;quot; do&lt;br /&gt;
    it 'returns false without a valid stage deadline' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return(nil)&lt;br /&gt;
      expect(student_task.relative_deadline).to be_falsey&lt;br /&gt;
    end&lt;br /&gt;
    it 'verifies a valid case where stage_deadline is present' do&lt;br /&gt;
      allow(student_task).to receive(:stage_deadline).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:time_ago_in_words).and_return(&amp;quot;astring&amp;quot;)&lt;br /&gt;
      expect(student_task.relative_deadline).to eq(&amp;quot;astring&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Examines a task to determine if the task is a revision&lt;br /&gt;
  describe &amp;quot;#revision?&amp;quot; do&lt;br /&gt;
    it 'returns true if content is submitted' do&lt;br /&gt;
      allow(student_task).to receive(:content_submitted_in_current_stage?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:reviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      expect(student_task.revision?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns true if reviews given is true' do&lt;br /&gt;
      allow(student_task).to receive(:content_submitted_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:reviews_given_in_current_stage?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      expect(student_task.revision?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns true if metareviews given is true' do&lt;br /&gt;
      allow(student_task).to receive(:content_submitted_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:reviews_given_in_current_stage?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given_in_current_stage?).and_return(true)&lt;br /&gt;
      expect(student_task.revision?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Checks if metareview was given in current task stage&lt;br /&gt;
  describe &amp;quot;#metreviews_given_in_current_stage?&amp;quot; do&lt;br /&gt;
    it 'return true' do&lt;br /&gt;
      student_task.current_stage = &amp;quot;metareview&amp;quot;&lt;br /&gt;
      allow(student_task).to receive(:metareviews_given?).and_return(true)&lt;br /&gt;
      expect(student_task.metareviews_given_in_current_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # Checks if review was given in current task stage&lt;br /&gt;
  describe &amp;quot;#reviews_given_in_current_stage?&amp;quot; do&lt;br /&gt;
    it 'return true' do&lt;br /&gt;
      student_task.current_stage = &amp;quot;review&amp;quot;&lt;br /&gt;
      allow(student_task).to receive(:reviews_given?).and_return(true)&lt;br /&gt;
      expect(student_task.reviews_given_in_current_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # tests whether a student task has been started&lt;br /&gt;
  # if the task is not incomplete &amp;amp;&amp;amp; is not in the revision stage&lt;br /&gt;
  # started? returns false&lt;br /&gt;
  # if the task is incomplete &amp;amp;&amp;amp; is in the revision stage&lt;br /&gt;
  # started? returns true&lt;br /&gt;
  describe &amp;quot;#started?&amp;quot; do&lt;br /&gt;
    it 'is not started' do&lt;br /&gt;
      allow(student_task).to receive(:incomplete?).and_return(false)&lt;br /&gt;
      allow(student_task).to receive(:revision?).and_return(false)&lt;br /&gt;
      expect(student_task.started?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
    it 'is started' do&lt;br /&gt;
      allow(student_task).to receive(:incomplete?).and_return(true)&lt;br /&gt;
      allow(student_task).to receive(:revision?).and_return(true)&lt;br /&gt;
      expect(student_task.started?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests works stage to ensure state is represented correctly&lt;br /&gt;
  describe &amp;quot;#in_work_stage?&amp;quot; do&lt;br /&gt;
    it &amp;quot;is true, submission is a work stage&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;submission&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;is true, review is a work stage&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;is true, metareview is a work stage&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;metareview&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(true)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;is false, empty object&amp;quot; do&lt;br /&gt;
      allow(student_task).to receive(:current_stage).and_return(&amp;quot;&amp;quot;)&lt;br /&gt;
      expect(student_task.in_work_stage?).to eq(false)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Tests teamed students method which returns the unique students that are paired with the student at some point&lt;br /&gt;
  # within their course&lt;br /&gt;
  describe &amp;quot;#teamed_students&amp;quot; do&lt;br /&gt;
    context 'when not in any team' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        expect(StudentTask.teamed_students(user3)).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when assigned in a cource_team ' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        allow(user).to receive(:teams).and_return([course_team])&lt;br /&gt;
        expect(StudentTask.teamed_students(user)).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when assigned in a assignment_team ' do&lt;br /&gt;
      it 'returns the students they are teamed with' do&lt;br /&gt;
        allow(user).to receive(:teams).and_return([team])&lt;br /&gt;
        allow(AssignmentParticipant).to receive(:find_by).with(user_id: 1, parent_id: assignment.id).and_return(participant)&lt;br /&gt;
        allow(AssignmentParticipant).to receive(:find_by).with(user_id: 5, parent_id: assignment.id).and_return(participant2)&lt;br /&gt;
        allow(Assignment).to receive(:find_by).with(id: team.parent_id).and_return(assignment)&lt;br /&gt;
        expect(StudentTask.teamed_students(user)).to eq({assignment.course_id =&amp;gt; [user2.fullname]})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the due dates of an assigment&lt;br /&gt;
  describe &amp;quot;#get_due_date_data&amp;quot; do&lt;br /&gt;
    context 'when called with assignment having empty due dates' do&lt;br /&gt;
      it &amp;quot;return empty time_list array&amp;quot; do&lt;br /&gt;
        timeline_list = []&lt;br /&gt;
        StudentTask.get_due_date_data(assignment, timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  context 'when called with assignment having due date' do&lt;br /&gt;
    context 'and due_at value nil' do&lt;br /&gt;
      it &amp;quot;return empty time_list array&amp;quot; do&lt;br /&gt;
        allow(due_date).to receive(:deadline_type).and_return(deadline_type)&lt;br /&gt;
        timeline_list = []&lt;br /&gt;
        due_date.due_at=nil;&lt;br /&gt;
        assignment.due_dates = [due_date]&lt;br /&gt;
        StudentTask.get_due_date_data(assignment, timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'and due_at value not nil' do&lt;br /&gt;
      it &amp;quot;return time_list array&amp;quot; do&lt;br /&gt;
        allow(due_date).to receive(:deadline_type).and_return(deadline_type)&lt;br /&gt;
        timeline_list = []&lt;br /&gt;
        assignment.due_dates = [due_date]&lt;br /&gt;
        StudentTask.get_due_date_data(assignment, timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([{&lt;br /&gt;
                                          :label=&amp;gt;(due_date.deadline_type.name + ' Deadline').humanize,&lt;br /&gt;
                                          :updated_at=&amp;gt;due_date.due_at.strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
                                      }])&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies fetching of peer review data of a user and a timeline&lt;br /&gt;
  describe &amp;quot;#get_peer_review_data&amp;quot; do&lt;br /&gt;
    context 'when no review response mapped' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        StudentTask.get_peer_review_data(user2,timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when mapped to review response map' do&lt;br /&gt;
      it 'returns timeline array' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(ReviewResponseMap).to receive_message_chain(:where, :find_each).with(reviewer_id: 1).with(no_args).and_yield(review_response_map)&lt;br /&gt;
        allow(review_response_map).to receive(:id).and_return(1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:where, :last).with(map_id: 1).with(no_args).and_return(response)&lt;br /&gt;
        allow(response).to receive(:round).and_return(1)&lt;br /&gt;
        allow(response).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_peer_review_data(1,timeline_list)).to eq([{:id=&amp;gt;1, :label=&amp;gt;&amp;quot;Round 1 peer review&amp;quot;, :updated_at=&amp;gt;timevalue}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies retrieval of feedback from author&lt;br /&gt;
  describe &amp;quot;#get_author_feedback_data&amp;quot; do&lt;br /&gt;
    context 'when no feedback response mapped' do&lt;br /&gt;
      it 'returns empty' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        StudentTask.get_author_feedback_data(user2,timeline_list)&lt;br /&gt;
        expect(timeline_list).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when mapped to feedback response map' do&lt;br /&gt;
      it 'returns timeline array' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(FeedbackResponseMap).to receive_message_chain(:where, :find_each).with(reviewer_id: 1).with(no_args).and_yield(review_response_map)&lt;br /&gt;
        allow(review_response_map).to receive(:id).and_return(1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:where, :last).with(map_id: 1).with(no_args).and_return(response)&lt;br /&gt;
        allow(response).to receive(:updated_at).and_return(Time.now)&lt;br /&gt;
        timevalue = Time.now.strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_author_feedback_data(1,timeline_list)).to eq([{:id=&amp;gt;1, :label=&amp;gt;&amp;quot;Author feedback&amp;quot;, :updated_at=&amp;gt;timevalue}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verrifies retrieval of submission data from submission&lt;br /&gt;
  describe '#get_submission_data' do&lt;br /&gt;
    context 'when no submission data mapped' do&lt;br /&gt;
      it 'returns nil' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq(nil)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when submission data mapped and not submit hyperlink or Remove hyperlink' do&lt;br /&gt;
      it 'returns timeline_list' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(SubmissionRecord).to receive_message_chain(:where, :find_each).with(team_id: 1, assignment_id: 1).with(no_args).and_yield(submission_record)&lt;br /&gt;
        allow(submission_record).to receive(:operation).and_return('testing_label')&lt;br /&gt;
        allow(submission_record).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq([{:label=&amp;gt;&amp;quot;Testing label&amp;quot;, :updated_at=&amp;gt;timevalue}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when submission data mapped and operation is submit_hyperlink' do&lt;br /&gt;
      it 'returns timeline_list with link' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(SubmissionRecord).to receive_message_chain(:where, :find_each).with(team_id: 1, assignment_id: 1).with(no_args).and_yield(submission_record)&lt;br /&gt;
        allow(submission_record).to receive(:operation).and_return('Submit Hyperlink')&lt;br /&gt;
        allow(submission_record).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq([{:label=&amp;gt;&amp;quot;Submit hyperlink&amp;quot;, :updated_at=&amp;gt;timevalue, :link=&amp;gt;&amp;quot;www.wolfware.edu&amp;quot;}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when submission data mapped and operation is Remove Hyperlink' do&lt;br /&gt;
      it 'returns timeline_list with link' do&lt;br /&gt;
        timeline_list=[]&lt;br /&gt;
        allow(SubmissionRecord).to receive_message_chain(:where, :find_each).with(team_id: 1, assignment_id: 1).with(no_args).and_yield(submission_record)&lt;br /&gt;
        allow(submission_record).to receive(:operation).and_return('Remove Hyperlink')&lt;br /&gt;
        timevalue = Time.new(2019).strftime('%a, %d %b %Y %H:%M')&lt;br /&gt;
        allow(submission_record).to receive(:updated_at).and_return(Time.new(2019))&lt;br /&gt;
        expect(StudentTask.get_submission_data(1,1,timeline_list)).to eq([{:label=&amp;gt;&amp;quot;Remove hyperlink&amp;quot;, :updated_at=&amp;gt;timevalue, :link=&amp;gt;&amp;quot;www.wolfware.edu&amp;quot;}])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Verifies retrieval of timeline data&lt;br /&gt;
  describe '#get_timeline_data' do&lt;br /&gt;
    context 'when no timeline data mapped' do&lt;br /&gt;
      it 'returns nil' do&lt;br /&gt;
        allow(participant).to receive(:get_reviewer).and_return(participant)&lt;br /&gt;
        expect(StudentTask.get_timeline_data(assignment, participant, team)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
== Line Coverage achieved ==&lt;br /&gt;
*94 relevant lines&lt;br /&gt;
*86 lines covered&lt;br /&gt;
*8 lines missed&lt;br /&gt;
*Coverage = 91.49%&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
Some of the tests were rather shallow, get_timeline_data specifically needs depth added.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://youtu.be/N6H1HtQ4eds/ YouTube Video Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/johnbumgardner/expertiza/ GitHub Repo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1811/ Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Team Members == &lt;br /&gt;
John Bumgardner, Pedro Benitez, Luke McConnaughey&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2055_write_unit_tests_for_student_task.rb&amp;diff=135704</id>
		<title>CSC/ECE 517 Fall 2020 - E2055 write unit tests for student task.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2055_write_unit_tests_for_student_task.rb&amp;diff=135704"/>
		<updated>2020-10-20T03:08:55Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: /* Description of the current project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project based on [https://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;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About RSpec ==&lt;br /&gt;
&lt;br /&gt;
RSpec is a unit test framework for the Ruby programming language. RSpec is different than traditional xUnit frameworks like JUnit because RSpec is a Behavior driven development tool. What this means is that, tests written in RSpec focus on the &amp;quot;behavior&amp;quot; of an application being tested. RSpec does not put emphasis on, how the application works but instead on how it behaves, in other words, what the application actually does.Each RSpec file contains one or more tests. Each test ensures if a particular feature of our website is working properly.The output of an RSpec run will tell you exactly what features aren't working. The benefit is that tested code is unlikely to break unnoticed.The tests are run every time someone makes, or updates, a [https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests Pull Request].&lt;br /&gt;
&lt;br /&gt;
== DB Schema ==&lt;br /&gt;
Below are the tables that are related ti student task functionality&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/images/7/7a/ExpertizaDbSchema.jpg DB Schema]&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The following is an Expertiza based OSS project which deals primarily with the student_task.rb and student_task_spec.rb. It focuses on writing RSpec unit tests for the code affected or added. The goal of this project is to attempt to add sufficient unit tests to this part of the application and increase its path coverage to above 90 percent.&lt;br /&gt;
The following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
* Complete the insufficient unit tests for student_task.rb. &lt;br /&gt;
* Increase path coverage from only 31.91% with 30 lines covered to above 90% coverage&lt;br /&gt;
* Cover edge cases.&lt;br /&gt;
* High branch coverage to be achieved.&lt;br /&gt;
&lt;br /&gt;
There are different tasks that a student can perform. &lt;br /&gt;
* They can see all the assignments that they have been assigned to.&lt;br /&gt;
* They can see details of each assignment like marks, their team, send invitation to student to join a team&lt;br /&gt;
* Review other students' work&lt;br /&gt;
&lt;br /&gt;
== Tests Plan ==&lt;br /&gt;
*Mock Objects to test&lt;br /&gt;
*Topic name&lt;br /&gt;
*Complete?&lt;br /&gt;
*Incomplete?&lt;br /&gt;
*Not started?&lt;br /&gt;
*Revision?&lt;br /&gt;
*Met reviews given&lt;br /&gt;
*Teamed student&lt;br /&gt;
*Get due date&lt;br /&gt;
*Get peer review data&lt;br /&gt;
*Get author feedback&lt;br /&gt;
*Get submission data&lt;br /&gt;
*Get timeline data&lt;br /&gt;
&lt;br /&gt;
== Line Coverage achieved ==&lt;br /&gt;
*94 relevant lines&lt;br /&gt;
*86 lines covered&lt;br /&gt;
*8 lines missed&lt;br /&gt;
*Coverage = 91.49%&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
Some of the tests were rather shallow, get_timeline_data specifically needs depth added.&lt;br /&gt;
&lt;br /&gt;
== Video of Tests running ==&lt;br /&gt;
[https://youtu.be/N6H1HtQ4eds]&lt;br /&gt;
&lt;br /&gt;
== Team Members == &lt;br /&gt;
John Bumgardner, Pedro Benitez, Luke McConnaughey&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2055_write_unit_tests_for_student_task.rb&amp;diff=135702</id>
		<title>CSC/ECE 517 Fall 2020 - E2055 write unit tests for student task.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2055_write_unit_tests_for_student_task.rb&amp;diff=135702"/>
		<updated>2020-10-20T03:07:21Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: /* Issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project based on [https://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;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About RSpec ==&lt;br /&gt;
&lt;br /&gt;
RSpec is a unit test framework for the Ruby programming language. RSpec is different than traditional xUnit frameworks like JUnit because RSpec is a Behavior driven development tool. What this means is that, tests written in RSpec focus on the &amp;quot;behavior&amp;quot; of an application being tested. RSpec does not put emphasis on, how the application works but instead on how it behaves, in other words, what the application actually does.Each RSpec file contains one or more tests. Each test ensures if a particular feature of our website is working properly.The output of an RSpec run will tell you exactly what features aren't working. The benefit is that tested code is unlikely to break unnoticed.The tests are run every time someone makes, or updates, a [https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests Pull Request].&lt;br /&gt;
&lt;br /&gt;
== DB Schema ==&lt;br /&gt;
Below are the tables that are related ti student task functionality&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/images/7/7a/ExpertizaDbSchema.jpg DB Schema]&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The following is an Expertiza based OSS project which deals primarily with the student_task.rb and student_task_spec.rb. It focuses on writing RSpec unit tests for the code affected or added. The goal of this project is to attempt to add sufficient unit tests to this part of the application and increase its path coverage to above 90 percent.&lt;br /&gt;
The following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
* Complete the insufficient unit tests for student_task.rb. &lt;br /&gt;
* Increase path coverage from only 31.91% with 30 lines covered to above 92.55% with 87 lines covered.&lt;br /&gt;
* Cover edge cases.&lt;br /&gt;
* High branch coverage to be achieved.&lt;br /&gt;
&lt;br /&gt;
There are different tasks that a student can perform. &lt;br /&gt;
* He can see all the assignments that he has been assigned to.&lt;br /&gt;
* He can see details of each assignment like marks, his team, send invitation to student to join a team&lt;br /&gt;
* Review other students' work&lt;br /&gt;
&lt;br /&gt;
== Tests Plan ==&lt;br /&gt;
*Mock Objects to test&lt;br /&gt;
*Topic name&lt;br /&gt;
*Complete?&lt;br /&gt;
*Incomplete?&lt;br /&gt;
*Not started?&lt;br /&gt;
*Revision?&lt;br /&gt;
*Met reviews given&lt;br /&gt;
*Teamed student&lt;br /&gt;
*Get due date&lt;br /&gt;
*Get peer review data&lt;br /&gt;
*Get author feedback&lt;br /&gt;
*Get submission data&lt;br /&gt;
*Get timeline data&lt;br /&gt;
&lt;br /&gt;
== Line Coverage achieved ==&lt;br /&gt;
*94 relevant lines&lt;br /&gt;
*86 lines covered&lt;br /&gt;
*8 lines missed&lt;br /&gt;
*Coverage = 91.49%&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
Some of the tests were rather shallow, get_timeline_data specifically needs depth added.&lt;br /&gt;
&lt;br /&gt;
== Video of Tests running ==&lt;br /&gt;
[https://youtu.be/N6H1HtQ4eds]&lt;br /&gt;
&lt;br /&gt;
== Team Members == &lt;br /&gt;
John Bumgardner, Pedro Benitez, Luke McConnaughey&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2055_write_unit_tests_for_student_task.rb&amp;diff=135701</id>
		<title>CSC/ECE 517 Fall 2020 - E2055 write unit tests for student task.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2055_write_unit_tests_for_student_task.rb&amp;diff=135701"/>
		<updated>2020-10-20T03:06:31Z</updated>

		<summary type="html">&lt;p&gt;Lcmcconn: /* Line Coverage achieved */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project based on [https://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;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About RSpec ==&lt;br /&gt;
&lt;br /&gt;
RSpec is a unit test framework for the Ruby programming language. RSpec is different than traditional xUnit frameworks like JUnit because RSpec is a Behavior driven development tool. What this means is that, tests written in RSpec focus on the &amp;quot;behavior&amp;quot; of an application being tested. RSpec does not put emphasis on, how the application works but instead on how it behaves, in other words, what the application actually does.Each RSpec file contains one or more tests. Each test ensures if a particular feature of our website is working properly.The output of an RSpec run will tell you exactly what features aren't working. The benefit is that tested code is unlikely to break unnoticed.The tests are run every time someone makes, or updates, a [https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests Pull Request].&lt;br /&gt;
&lt;br /&gt;
== DB Schema ==&lt;br /&gt;
Below are the tables that are related ti student task functionality&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/images/7/7a/ExpertizaDbSchema.jpg DB Schema]&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The following is an Expertiza based OSS project which deals primarily with the student_task.rb and student_task_spec.rb. It focuses on writing RSpec unit tests for the code affected or added. The goal of this project is to attempt to add sufficient unit tests to this part of the application and increase its path coverage to above 90 percent.&lt;br /&gt;
The following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
* Complete the insufficient unit tests for student_task.rb. &lt;br /&gt;
* Increase path coverage from only 31.91% with 30 lines covered to above 92.55% with 87 lines covered.&lt;br /&gt;
* Cover edge cases.&lt;br /&gt;
* High branch coverage to be achieved.&lt;br /&gt;
&lt;br /&gt;
There are different tasks that a student can perform. &lt;br /&gt;
* He can see all the assignments that he has been assigned to.&lt;br /&gt;
* He can see details of each assignment like marks, his team, send invitation to student to join a team&lt;br /&gt;
* Review other students' work&lt;br /&gt;
&lt;br /&gt;
== Tests Plan ==&lt;br /&gt;
*Mock Objects to test&lt;br /&gt;
*Topic name&lt;br /&gt;
*Complete?&lt;br /&gt;
*Incomplete?&lt;br /&gt;
*Not started?&lt;br /&gt;
*Revision?&lt;br /&gt;
*Met reviews given&lt;br /&gt;
*Teamed student&lt;br /&gt;
*Get due date&lt;br /&gt;
*Get peer review data&lt;br /&gt;
*Get author feedback&lt;br /&gt;
*Get submission data&lt;br /&gt;
*Get timeline data&lt;br /&gt;
&lt;br /&gt;
== Line Coverage achieved ==&lt;br /&gt;
*94 relevant lines&lt;br /&gt;
*86 lines covered&lt;br /&gt;
*8 lines missed&lt;br /&gt;
*Coverage = 91.49%&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
One major issue we encountered was reaching the goal of exceeding 90% test coverage. We seem to have converged around 85%.&lt;br /&gt;
&lt;br /&gt;
== Video of Tests running ==&lt;br /&gt;
[https://youtu.be/N6H1HtQ4eds]&lt;br /&gt;
&lt;br /&gt;
== Team Members == &lt;br /&gt;
John Bumgardner, Pedro Benitez, Luke McConnaughey&lt;/div&gt;</summary>
		<author><name>Lcmcconn</name></author>
	</entry>
</feed>